Restore proper formatting on the linechart highlighter

This commit is contained in:
Geert Janssens 2016-04-16 15:57:25 +02:00
parent 96ce4258a4
commit 340b5a3ece

View File

@ -490,6 +490,10 @@
autoscale: true,
},
},
highlighter: {
tooltipContentEditor: formatTooltip,
tooltipLocation: 'ne',
},
cursor: {
show: true,
zoom: true
@ -548,10 +552,8 @@
(push "var plot = $.jqplot('")(push chart-id)(push"', data, options);
function formatTooltip(str, seriesIndex, pointIndex) {
if (options.axes.xaxis.ticks[pointIndex] !== undefined)
x = options.axes.xaxis.ticks[pointIndex][1];
else
x = pointIndex;
x = $.jqplot.DateTickFormatter (options.axes.xaxis.tickOptions.formatString,
data[seriesIndex][pointIndex][0]);
y = data[seriesIndex][pointIndex][1].toFixed(2);
return options.series[seriesIndex].label + ' ' + x + '<br><b>' + y + '</b>';
}\n")