jqplot. | |
$.jqplot. | 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. |
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>' }
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. |
this.markerRenderer = new $.jqplot.MarkerRenderer( {shadow:false} )
Renderer used to draw the marker of the highlighted point. Renderer will assimilate attributes from the data point being highlighted, so no attributes need set on the renderer directly. Default is to turn off shadow drawing on the highlighted point.
this.tooltipFormatString = '%.5P'
sprintf format string for the tooltip. Uses Ash Searle’s javascript sprintf implementation found here: http://hexmen.com/blog/2007/03/printf-sprintf/ See http://perldoc.perl.org/functions/sprintf.html for reference. Additional “p” and “P” format specifiers added by Chris Leonello.
this.formatString = null
alternative to tooltipFormatString will format the whole tooltip text, populating with x, y values as indicated by tooltipAxes option. So, you could have a tooltip like: ‘Date: %s, number of cats: %d’ to format the whole tooltip at one go. If useAxesFormatters is true, values will be formatted according to Axes formatters and you can populate your tooltip string with %s placeholders.
true to show the highlight.
this.show = $.jqplot.config.enablePlugins
Renderer used to draw the marker of the highlighted point.
this.markerRenderer = new $.jqplot.MarkerRenderer( {shadow:false} )
true to show the marker
this.showMarker = true
Pixels to add to the lineWidth of the highlight.
this.lineWidthAdjust = 2.5
Pixels to add to the overall size of the highlight.
this.sizeAdjust = 5
Show a tooltip with data point values.
this.showTooltip = true
Where to position tooltip, ‘n’, ‘ne’, ‘e’, ‘se’, ‘s’, ‘sw’, ‘w’, ‘nw’
this.tooltipLocation = 'nw'
true = fade in/out tooltip, flase = show/hide tooltip
this.fadeTooltip = true
‘slow’, ‘def’, ‘fast’, or number of milliseconds.
this.tooltipFadeSpeed = "fast"
Pixel offset of tooltip from the highlight.
this.tooltipOffset = 2
Which axes to display in tooltip, ‘x’, ‘y’ or ‘both’, ‘xy’ or ‘yx’ ‘both’ and ‘xy’ are equivalent, ‘yx’ reverses order of labels.
this.tooltipAxes = 'both'
Use the x and y axes formatters to format the text in the tooltip.
this.useAxesFormatters = true
sprintf format string for the tooltip.
this.tooltipFormatString = '%.5P'
alternative to tooltipFormatString will format the whole tooltip text, populating with x, y values as indicated by tooltipAxes option.
this.formatString = null
Number of y values to expect in the data point array.
this.yvalues = 1
This option requires jQuery 1.4+ True to bring the series of the highlighted point to the front of other series.
this.bringSeriesToFront = false