Author: croberts
Date: 2012-05-15 18:29:45 +0000 (Tue, 15 May 2012)
New Revision: 5376
Modified:
trunk/cumin/resources/app.js
Log:
Adding pre/post draw hooks and zoom/resetzoom hooks for cumin charts.
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2012-05-14 23:15:47 UTC (rev 5375)
+++ trunk/cumin/resources/app.js 2012-05-15 18:29:45 UTC (rev 5376)
@@ -719,11 +719,36 @@
}
}
} else {
- allCharts[divName] = $j.jqplot(holder,
dataContainer['y_coordinate_values'],chartOptionsObject);
+ $j.jqplot.preDrawHooks.push(cuminChartPreDraw);
+ $j.jqplot.postDrawHooks.push(cuminChartPostDraw);
+ allCharts[divName] = $j.jqplot(holder,
dataContainer['y_coordinate_values'],chartOptionsObject);
+ allCharts[divName].target.bind('jqplotResetZoom', cuminChartResetZoom);
+ allCharts[divName].target.bind('jqplotZoom', cuminChartZoom);
startChartMonitor(divName);
}
-} // end function drawChart
+
+} // end function drawChart
+// called on the jqplotZoom event
+cuminChartZoom = function(gridpos, datapos, plot, cursor) {
+// console.log("cuminZoom");
+}
+
+//called on the jqplotResetZoom event
+cuminChartResetZoom = function(gridpos, datapos, plot, cursor) {
+// console.log("cuminResetZoom");
+}
+
+// called immediately after the chart is drawn
+cuminChartPostDraw = function() {
+// console.log("customPostDraw");
+}
+
+// called right before a chart is drawn
+cuminChartPreDraw = function() {
+// console.log("customPreDraw");
+}
+
// used to let us tweak the contents of the tooltip according to our whim, gets called
from highlighter plugin showTooltip function
customTooltip = function(str, seriesIndex, pointIndex, plot) {
value = plot.series[seriesIndex]._plotData[pointIndex][1];
@@ -737,7 +762,7 @@
}
// used in axis:tickOptions:formatter to override the default axis label formatting
-x_axis_Formatter = function (format, val) {
+function x_axis_Formatter(format, val) {
if (typeof val == 'number') {
if (!format) {
format = $j.jqplot.config.defaultTickFormatString;
Show replies by date