private native void showChart(VDCharts c, String id, String dataSeries, String options, String decimalSeparator, String thousandsSeparator) /*-{ $wnd.jQuery(document).ready(function($){ var _options = eval("("+options+")"); var _dataSeries = eval("("+dataSeries+")"); $wnd.jQuery('#'.concat(id)).empty(); $.jqplot.sprintf.decimalMark=decimalSeparator; $.jqplot.sprintf.thousandsSeparator=thousandsSeparator; //plots need to be destroyed because of memory leaks //$('#'+id).html(''); //console.log('drawing chart'); if(window.plots) { //console.log('plots exists. size: ' + window.plots); if (window.plots[id]){ //console.log('plot EXIST: id=' + id); //console.log('plot value: ' + window.plots[id]) ; window.plots[id].destroy(); delete window.plots[id]; //console.log('plot destroyed. new value: ' + window.plots[id]) ; } } else { //console.log('creating plots map'); window.plots = {}; } window.plots[id] = $.jqplot(id, _dataSeries, _options); // send first chart image c.@org.dussan.vaadin.dcharts.client.ui.VDCharts::sendChartImageToServer()(); // and then watch for changes $wnd.jQuery('#'.concat(id)).find('.jqplot-series-canvas').attrchange(function(attrName) { if($wnd.jQuery('#'.concat(id).concat('-button')).size() == 1 && $wnd.jQuery('#'.concat(id).concat('-button-clone')).size() == 0) { var button = $wnd.jQuery('#'.concat(id).concat('-button')); button.clone().attr('id',button.attr('id').concat('-clone')) .css('top',button.position().top).css('left',button.position().left) .css('position','absolute').appendTo(button.parent()); $wnd.jQuery('#'.concat(id).concat('-button-clone')).find('.v-button-caption').css('color','red'); } c.@org.dussan.vaadin.dcharts.client.ui.VDCharts::sendChartImageToServer()(); }); }); }-*/;