Skip to content

Instantly share code, notes, and snippets.

@eads
Created December 9, 2011 20:24
Show Gist options
  • Save eads/1453150 to your computer and use it in GitHub Desktop.
Save eads/1453150 to your computer and use it in GitHub Desktop.
Banded error tooltip
// Option snippet
var opts = {
'highlighter' : {
'tooltipContentEditor' : $.jqplot.Highlighter.errorTooltip
}
};
// Custom tooltip formatter
$.jqplot.Highlighter.errorTooltip = function(str, seriesIndex, pointIndex, plot) {
var series = plot.series[seriesIndex];
if (typeof series.renderer.bandData !== 'undefined' && series.renderer.bandData.length) {
lowValue = series.renderer.bandData[0][pointIndex],
highValue = series.renderer.bandData[1][pointIndex];
str += '<span class="max-err">Err max: '+ highValue[1] +'</span>';
str += '<span class="min-err">Err min: '+ lowValue[1] +'</span>';
}
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment