Plugin which will highlight data points when they are moused over.
To use this plugin, include the js file in your source:
<script type="text/javascript" src="plugins/jqplot.highlighter.js"></script>
A tooltip providing information about the data point is enabled by default. To disable the tooltip, set “showTooltip” to false.
You can control what data is displayed in the tooltip with various options. The “tooltipAxes” option controls whether the x, y or both data values are displayed.
Some chart types (e.g. hi-low-close) have more than one y value per data point. To display the additional values in the tooltip, set the “yvalues” option to the desired number of y values present (3 for a hlc chart).
By default, data values will be formatted with the same formatting specifiers as used to format the axis ticks. A custom format code can be supplied with the tooltipFormatString option. This will apply to all values in the tooltip.
For more complete control, the “formatString” option can be set. This Allows conplete control over tooltip formatting. Values are passed to the format string in an order determined by the “tooltipAxes” and “yvalues” options. So, if you have a hi-low-close chart and you just want to display the hi-low-close values in the tooltip, you could set a formatString like:
highlighter: {
tooltipAxes: 'y',
yvalues: 3,
formatString:'<table class="jqplot-highlighter">
<tr><td>hi:</td><td>%s</td></tr>
<tr><td>low:</td><td>%s</td></tr>
<tr><td>close:</td><td>%s</td></tr></table>'
}
Summary
$.jqplot.Highlighter | Plugin which will highlight data points when they are moused over. |
Properties | |
show | true to show the highlight. |
markerRenderer | Renderer used to draw the marker of the highlighted point. |
showMarker | true to show the marker |
lineWidthAdjust | Pixels to add to the lineWidth of the highlight. |
sizeAdjust | Pixels to add to the overall size of the highlight. |
showTooltip | Show a tooltip with data point values. |
tooltipLocation | Where to position tooltip, ‘n’, ‘ne’, ‘e’, ‘se’, ‘s’, ‘sw’, ‘w’, ‘nw’ |
fadeTooltip | true = fade in/out tooltip, flase = show/hide tooltip |
tooltipFadeSpeed | ‘slow’, ‘def’, ‘fast’, or number of milliseconds. |
tooltipOffset | Pixel offset of tooltip from the highlight. |
tooltipAxes | Which axes to display in tooltip, ‘x’, ‘y’ or ‘both’, ‘xy’ or ‘yx’ ‘both’ and ‘xy’ are equivalent, ‘yx’ reverses order of labels. |
useAxesFormatters | Use the x and y axes formatters to format the text in the tooltip. |
tooltipFormatString | sprintf format string for the tooltip. |
formatString | alternative to tooltipFormatString will format the whole tooltip text, populating with x, y values as indicated by tooltipAxes option. |
yvalues | Number of y values to expect in the data point array. |
bringSeriesToFront | This option requires jQuery 1.4+ True to bring the series of the highlighted point to the front of other series. |