Redo the highlighter in barcharts.

The formatting code was removed with the introduction
of the zoom cursor. It continued to display
poorly formatted information though which is now fixed again
This commit is contained in:
Geert Janssens 2014-10-13 20:44:42 +02:00
parent 6d0a3707e1
commit 00b827dbf2

View File

@ -456,8 +456,12 @@
autoscale: true,
},
},
highlighter: {
tooltipContentEditor: formatTooltip,
},
cursor:{
show: true,
showTooltip: false,
zoom: true
}
};\n")
@ -495,12 +499,9 @@
(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];
else
x = pointIndex;
x = data[seriesIndex][pointIndex][0];
y = data[seriesIndex][pointIndex][1].toFixed(2);
return options.series[seriesIndex].label + ' ' + x + '<br><b>' + y + '</b>';
return options.series[seriesIndex].label + '<br/>' + x + '<br/><b>' + y + '</b>';
}\n")
(push "});\n</script>")