Created
December 9, 2011 20:24
-
-
Save eads/1453150 to your computer and use it in GitHub Desktop.
Banded error tooltip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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