Plugin class representing the cursor as displayed on the plot.

Summary
$.jqplot.CursorPlugin class representing the cursor as displayed on the plot.
Properties
styleCSS spec for cursor style
showwhether to show the cursor or not.
showTooltipshow a cursor position tooltip.
followMouseTooltip follows the mouse, it is not at a fixed location.
tooltipLocationWhere to position tooltip.
tooltipOffsetPixel offset of tooltip from the grid boudaries or cursor center.
showTooltipGridPositionshow the grid pixel coordinates of the mouse.
showTooltipUnitPositionshow the unit (data) coordinates of the mouse.
showTooltipDataPositionUsed with showVerticalLine to show intersecting data points in the tooltip.
tooltipFormatStringsprintf format string for the tooltip.
useAxesFormattersUse the x and y axes formatters to format the text in the tooltip.
tooltipAxisGroupsShow position for the specified axes.
zoomEnable plot zooming.
looseZoomWill expand zoom range to provide more rounded tick values.
clickResetWill reset plot zoom if single click on plot without drag.
dblClickResetWill reset plot zoom if double click on plot without drag.
showVerticalLinedraw a vertical line across the plot which follows the cursor.
showHorizontalLinedraw a horizontal line across the plot which follows the cursor.
constrainZoomTo‘none’, ‘x’ or ‘y’
intersectionThresholdpixel distance from data point or marker to consider cursor lines intersecting with point.
showCursorLegendReplace the plot legend with an enhanced legend displaying intersection information.
cursorLegendFormatStringFormat string used in the cursor legend.
constrainOutsideZoomTrue to limit actual zoom area to edges of grid, even when zooming outside of plot area.
showTooltipOutsideZoomTrue will keep updating the tooltip when zooming of the grid.
methods
$.jqplot.Cursor.zoomProxylinks targetPlot to controllerPlot so that plot zooming of targetPlot will be controlled by zooming on the controllerPlot.

Properties

style

this.style = 'crosshair'

CSS spec for cursor style

show

this.show = $.jqplot.config.enablePlugins

whether to show the cursor or not.

showTooltip

this.showTooltip = true

show a cursor position tooltip.  Location of the tooltip will be controlled by followMouse and tooltipLocation.

followMouse

this.followMouse = false

Tooltip follows the mouse, it is not at a fixed location.  Tooltip will show on the grid at the location given by tooltipLocation, offset from the grid edge by tooltipOffset.

tooltipLocation

this.tooltipLocation = 'se'

Where to position tooltip.  If followMouse is true, this is relative to the cursor, otherwise, it is relative to the grid.  One of ‘n’, ‘ne’, ‘e’, ‘se’, ‘s’, ‘sw’, ‘w’, ‘nw’

tooltipOffset

this.tooltipOffset = 6

Pixel offset of tooltip from the grid boudaries or cursor center.

showTooltipGridPosition

this.showTooltipGridPosition = false

show the grid pixel coordinates of the mouse.

showTooltipUnitPosition

this.showTooltipUnitPosition = true

show the unit (data) coordinates of the mouse.

showTooltipDataPosition

this.showTooltipDataPosition = false

Used with showVerticalLine to show intersecting data points in the tooltip.

tooltipFormatString

this.tooltipFormatString = '%.4P, %.4P'

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 Note, if showTooltipDataPosition is true, the default tooltipFormatString will be set to the cursorLegendFormatString, not the default given here.

useAxesFormatters

this.useAxesFormatters = true

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

tooltipAxisGroups

this.tooltipAxisGroups = []

Show position for the specified axes.  This is an array like [[‘xaxis’, ‘yaxis’], [‘xaxis’, ‘y2axis’]] Default is to compute automatically for all visible axes.

zoom

this.zoom = false

Enable plot zooming.

looseZoom

this.looseZoom = true

Will expand zoom range to provide more rounded tick values.  Works only with linear, log and date axes.

clickReset

this.clickReset = false

Will reset plot zoom if single click on plot without drag.

dblClickReset

this.dblClickReset = true

Will reset plot zoom if double click on plot without drag.

showVerticalLine

this.showVerticalLine = false

draw a vertical line across the plot which follows the cursor.  When the line is near a data point, a special legend and/or tooltip can be updated with the data values.

showHorizontalLine

this.showHorizontalLine = false

draw a horizontal line across the plot which follows the cursor.

constrainZoomTo

this.constrainZoomTo = 'none'

’none’, ‘x’ or ‘y’

intersectionThreshold

this.intersectionThreshold = 2

pixel distance from data point or marker to consider cursor lines intersecting with point.  If data point markers are not shown, this should be >= 1 or will often miss point intersections.

showCursorLegend

this.showCursorLegend = false

Replace the plot legend with an enhanced legend displaying intersection information.

cursorLegendFormatString

this.cursorLegendFormatString = $.jqplot.Cursor.cursorLegendFormatString

Format string used in the cursor legend.  If showTooltipDataPosition is true, this will also be the default format string used by tooltipFormatString.

constrainOutsideZoom

this.constrainOutsideZoom = true

True to limit actual zoom area to edges of grid, even when zooming outside of plot area.  That is, can’t zoom out by mousing outside plot.

showTooltipOutsideZoom

this.showTooltipOutsideZoom = false

True will keep updating the tooltip when zooming of the grid.

methods

$.jqplot.Cursor.zoomProxy

$.jqplot.Cursor.zoomProxy = function(targetPlot,
controllerPlot)

links targetPlot to controllerPlot so that plot zooming of targetPlot will be controlled by zooming on the controllerPlot. controllerPlot will not actually zoom, but acts as an overview plot.  Note, the zoom options must be set to true for zoomProxy to work.

this.style = 'crosshair'
CSS spec for cursor style
this.show = $.jqplot.config.enablePlugins
whether to show the cursor or not.
this.showTooltip = true
show a cursor position tooltip.
this.followMouse = false
Tooltip follows the mouse, it is not at a fixed location.
this.tooltipLocation = 'se'
Where to position tooltip.
this.tooltipOffset = 6
Pixel offset of tooltip from the grid boudaries or cursor center.
this.showTooltipGridPosition = false
show the grid pixel coordinates of the mouse.
this.showTooltipUnitPosition = true
show the unit (data) coordinates of the mouse.
this.showTooltipDataPosition = false
Used with showVerticalLine to show intersecting data points in the tooltip.
this.tooltipFormatString = '%.4P, %.4P'
sprintf format string for the tooltip.
this.useAxesFormatters = true
Use the x and y axes formatters to format the text in the tooltip.
this.tooltipAxisGroups = []
Show position for the specified axes.
this.zoom = false
Enable plot zooming.
this.looseZoom = true
Will expand zoom range to provide more rounded tick values.
this.clickReset = false
Will reset plot zoom if single click on plot without drag.
this.dblClickReset = true
Will reset plot zoom if double click on plot without drag.
this.showVerticalLine = false
draw a vertical line across the plot which follows the cursor.
this.showHorizontalLine = false
draw a horizontal line across the plot which follows the cursor.
this.constrainZoomTo = 'none'
‘none’, ‘x’ or ‘y’
this.intersectionThreshold = 2
pixel distance from data point or marker to consider cursor lines intersecting with point.
this.showCursorLegend = false
Replace the plot legend with an enhanced legend displaying intersection information.
this.cursorLegendFormatString = $.jqplot.Cursor.cursorLegendFormatString
Format string used in the cursor legend.
this.constrainOutsideZoom = true
True to limit actual zoom area to edges of grid, even when zooming outside of plot area.
this.showTooltipOutsideZoom = false
True will keep updating the tooltip when zooming of the grid.
$.jqplot.Cursor.zoomProxy = function(targetPlot,
controllerPlot)
links targetPlot to controllerPlot so that plot zooming of targetPlot will be controlled by zooming on the controllerPlot.
Close