Author: croberts
Date: 2012-05-08 18:50:00 +0000 (Tue, 08 May 2012)
New Revision: 5364
Modified:
trunk/cumin/resources/app.js
Log:
Charts will now show multiple series on the tooltips when a data point is shared.
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2012-05-08 18:16:22 UTC (rev 5363)
+++ trunk/cumin/resources/app.js 2012-05-08 18:50:00 UTC (rev 5364)
@@ -716,7 +716,14 @@
// 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) {
- str = str.replace(/#serieLabel#/,plot.series[seriesIndex].label);
+ value = plot.series[seriesIndex]._plotData[pointIndex][1];
+ labels = new Array();
+ for(i=0; i<plot.series.length; i++) {
+ if (plot.series[i]._plotData[pointIndex][1] == value) {
+ labels.push(plot.series[i].label);
+ }
+ }
+ str = str.replace(/#serieLabel#/,labels.join(", "));
return str;
}
Show replies by date