Author: croberts
Date: 2012-05-09 13:39:39 +0000 (Wed, 09 May 2012)
New Revision: 5366
Modified:
trunk/cumin/resources/app.js
Log:
Tooltips on line charts will now show values for all series for the given time when moused
over a point.
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2012-05-08 19:11:36 UTC (rev 5365)
+++ trunk/cumin/resources/app.js 2012-05-09 13:39:39 UTC (rev 5366)
@@ -674,7 +674,7 @@
tooltipaxes:'xy',
useAxesFormatters:true,
show: true,
- formatString:'<table
class="jqplot-highlighter"><tr><td>Time:
%s</td></tr><tr><td>#serieLabel#:
%s</td></tr></table>',
+ formatString:'<table
class="jqplot-highlighter"><tr><td>Time:
%s</td></tr>#allSeries#</table>',
tooltipContentEditor:customTooltip,
},
cursor:{
@@ -717,13 +717,12 @@
// 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];
- labels = new Array();
+ seriesValues = new Array();
for(i=0; i<plot.series.length; i++) {
- if (plot.series[i]._plotData[pointIndex][1] == value) {
- labels.push(plot.series[i].label);
- }
+ series = "<tr><td>" + plot.series[i].label + ": " +
plot.series[i]._plotData[pointIndex][1] + "</td></tr>";
+ seriesValues.push(series);
}
- str = str.replace(/#serieLabel#/,labels.join(", "));
+ str = str.replace(/#allSeries#/,seriesValues.join(""));
return str;
}
Show replies by date