Author: croberts
Date: 2011-11-28 16:13:22 +0000 (Mon, 28 Nov 2011)
New Revision: 5149
Modified:
branches/noflash/cumin/resources/app.js
Log:
Updating data on a zoomed chart is now working. Also, changing from a complete
regeneration of the chart on a data update to just swap-in the data and do a replot().
This should save memory and cpu cycles on the client machines.
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-11-23 18:59:23 UTC (rev 5148)
+++ branches/noflash/cumin/resources/app.js 2011-11-28 16:13:22 UTC (rev 5149)
@@ -446,7 +446,7 @@
}
startChartMonitor = function(id) {
- setInterval(function() {drawSingleChart(id)}, 30000);
+ setInterval(function() {drawSingleChart(id)}, 10000);
}
stathandler = function(response) {
@@ -604,29 +604,17 @@
cursor:{show:true,
zoom:true,
looseZoom:true,
- showCursorLegend:false
+ showCursorLegend:false,
+ constrainZoomTo: 'x'
},
}
var divName = $(holder).get('id');
if(allCharts[divName]) {
- if(!allCharts[divName].plugins.cursor._zoom.isZoomed) {
- var parent = $(divName).getParent();
- var newDiv = $(divName);
- allCharts[divName].canvasManager.freeAllCanvases();
- if (allCharts[divName].eventCanvas) {
- allCharts[divName].eventCanvas._elem.unbind();
- }
- // Couple of posts on Stack Overflow indicate that empty() doesn't
- // always cear up the dom and release memory. Sometimes setting
- // innerHTML property to null is needed. Particularly on IE, may
- // have to directly set it to null, bypassing jQuery.
- allCharts[divName].target.empty();
- allCharts[divName].target[0].innerHTML = '';
- allCharts[divName].destroy();
- newDiv.inject(parent);
- allCharts[divName] = $j.jqplot(holder,
dataContainer['y_coordinate_values'],chartOptionsObject);
- }
+ for(i=0; i < allCharts[divName].series.length; i++) {
+ allCharts[divName].series[i].data =
dataContainer['y_coordinate_values'][i];
+ }
+ allCharts[divName].replot({axes:{y2axis:{min:0}}})
} else {
allCharts[divName] = $j.jqplot(holder,
dataContainer['y_coordinate_values'],chartOptionsObject);
startChartMonitor(divName);
Show replies by date