Author: croberts
Date: 2011-11-28 20:21:11 +0000 (Mon, 28 Nov 2011)
New Revision: 5152
Modified:
branches/noflash/cumin/resources/app.js
Log:
Fixes for axis re-rendering when replot is called, including the fix for calling "replot" on a fresh full page chart, which was failing.
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-11-28 20:18:54 UTC (rev 5151)
+++ branches/noflash/cumin/resources/app.js 2011-11-28 20:21:11 UTC (rev 5152)
@@ -573,8 +573,7 @@
min:dataopts['xmin'] / dataContainer['x_axis_normalizer'],
max:dataopts['xmax'] / dataContainer['x_axis_normalizer'],
//ticks:[[-3600, "60 min"], [-2700, "45 min"], [-1800, "30 min"], [-900, "15 min"], [0, "0"]]
- tickOptions:{formatString:'%.0f ' + dataContainer['x_axis_unit_label'],
- formatter: x_axis_Formatter,},
+ tickOptions:{formatString:'%.0f ' + dataContainer['x_axis_unit_label'], formatter: x_axis_Formatter,},
}
},
series: getSeries(dataContainer),
@@ -613,8 +612,13 @@
if(allCharts[divName]) {
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}}})
+ }
+ try{
+ allCharts[divName].replot({resetAxes:(!allCharts[divName].plugins.cursor._zoom.isZoomed), axes:{y2axis:{autoscale:true,min:0}, xaxis:{min:dataopts['xmin'] / dataContainer['x_axis_normalizer'], max:dataopts['xmax'] / dataContainer['x_axis_normalizer'],tickOptions:{formatString:'%.0f ' + dataContainer['x_axis_unit_label'], formatter: x_axis_Formatter,}}}})
+ } catch (err) {
+ // this is needed in the event of the first draw for a fullpage chart
+ allCharts[divName] = $j.jqplot(holder, dataContainer['y_coordinate_values'],chartOptionsObject);
+ }
} else {
allCharts[divName] = $j.jqplot(holder, dataContainer['y_coordinate_values'],chartOptionsObject);
startChartMonitor(divName);
@@ -641,7 +645,7 @@
}
if (val > 1000000) {
val = val / 1000000
- format = "%.2fM";
+ format = "%.1fM";
}
if (val > 100000) {
val = val / 1000