$.jqplot.Highlighter

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 wether 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.

### Properties

### show

> this.show = $.jqplot.config.enablePlugins

true to show the highlight.

### markerRenderer

> 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.

### showMarker

> this.showMarker = true

true to show the marker

### lineWidthAdjust

> this.lineWidthAdjust = 2.5

Pixels to add to the lineWidth of the highlight.

### sizeAdjust

> this.sizeAdjust = 5

Pixels to add to the overall size of the highlight.

### showTooltip

> this.showTooltip = true

Show a tooltip with data point values.

### tooltipLocation

> this.tooltipLocation = 'nw'

Where to position tooltip, ‘n’, ‘ne’, ‘e’, ‘se’, ‘s’, ‘sw’, ‘w’, ‘nw’

### fadeTooltip

> this.fadeTooltip = true

true = fade in/out tooltip, flase = show/hide tooltip

### tooltipFadeSpeed

> this.tooltipFadeSpeed = "fast"

’slow’, ‘def’, ‘fast’, or number of milliseconds.

### tooltipOffset

> this.tooltipOffset = 2

Pixel offset of tooltip from the highlight.

### tooltipAxes

> this.tooltipAxes = 'both'

Which axes to display in tooltip, ‘x’, ‘y’ or ‘both’, ‘xy’ or ‘yx’ ‘both’ and ‘xy’ are equivalent, ‘yx’ reverses order of labels.

### useAxesFormatters

> this.useAxesFormatters = true

Use the x and y axes formatters to format the text in the tooltip.

### tooltipFormatString

> 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.

### formatString

> 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.

### yvalues

> this.yvalues = 1

Number of y values to expect in the data point array. Typically this is 1. Certain plots, like OHLC, will have more y values in each data point array.

### bringSeriesToFront

> this.bringSeriesToFront = false

This option requires jQuery 1.4+ True to bring the series of the highlighted point to the front of other series.

> this.show = $.jqplot.config.enablePlugins

true to show the highlight.

> this.markerRenderer = new $.jqplot.MarkerRenderer( | {shadow:false} | )

Renderer used to draw the marker of the highlighted point.

> this.showMarker = true

true to show the marker

> this.lineWidthAdjust = 2.5

Pixels to add to the lineWidth of the highlight.

> this.sizeAdjust = 5

Pixels to add to the overall size of the highlight.

> this.showTooltip = true

Show a tooltip with data point values.

> this.tooltipLocation = 'nw'

Where to position tooltip, ‘n’, ‘ne’, ‘e’, ‘se’, ‘s’, ‘sw’, ‘w’, ‘nw’

> this.fadeTooltip = true

true = fade in/out tooltip, flase = show/hide tooltip

> this.tooltipFadeSpeed = "fast"

‘slow’, ‘def’, ‘fast’, or number of milliseconds.

> this.tooltipOffset = 2

Pixel offset of tooltip from the highlight.

> this.tooltipAxes = 'both'

Which axes to display in tooltip, ‘x’, ‘y’ or ‘both’, ‘xy’ or ‘yx’ ‘both’ and ‘xy’ are equivalent, ‘yx’ reverses order of labels.

> this.useAxesFormatters = true

Use the x and y axes formatters to format the text in the tooltip.

> this.tooltipFormatString = '%.5P'

sprintf format string for the tooltip.

> this.formatString = null

alternative to tooltipFormatString will format the whole tooltip text, populating with x, y values as indicated by tooltipAxes option.

> this.yvalues = 1

Number of y values to expect in the data point array.

> this.bringSeriesToFront = false

This option requires jQuery 1.4+ True to bring the series of the highlighted point to the front of other series.
Close