new Pointer(chart, options)
The mouse and touch tracker object. Each Highcharts.Chart item has one assosiated Pointer item that can be accessed from the Highcharts.Chart.pointer property.
Parameters:
| Name | Type | Description |
|---|---|---|
chart |
Highcharts.Chart | The chart instance. |
options |
Highcharts.Options | The root options object. The pointer uses options from the chart and tooltip structures. |
Methods
-
destroy()
-
Destroys the Pointer object and disconnects DOM events.
-
findNearestKDPoint(series, shared, e)
-
Finds the closest point to a set of coordinates, using the k-d-tree algorithm.
Parameters:
Name Type Description seriesArray.<Highcharts.Series> All the series to search in.
sharedboolean | undefined Whether it is a shared tooltip or not.
eHighcharts.PointerEventObject The pointer event object, containing chart coordinates of the pointer.
Returns:
-
getChartPosition()
-
Return the cached chartPosition if it is available on the Pointer, otherwise find it. Running offset is quite expensive, so it should be avoided when we know the chart hasn't moved.
Returns:
Highcharts.ChartPositionObject .The offset of the chart container within the page
-
getCoordinates(e)
-
Get the click position in terms of axis values.
Parameters:
Name Type Description eHighcharts.PointerEventObject Pointer event, extended with
chartXandchartYproperties.Returns:
-
inClass(element, className)
-
Utility to detect whether an element has, or has a parent with, a specificclass name. Used on detection of tracker objects and on deciding whether hovering the tooltip should cause the active series to mouse out.
Parameters:
Name Type Description elementHighcharts.SVGDOMElement | Highcharts.HTMLDOMElement The element to investigate.
classNamestring The class name to look for.
Returns:
boolean | undefined .True if either the element or one of its parents has the given class name.
-
normalize(e [, chartPosition])
-
Takes a browser event object and extends it with custom Highcharts properties
chartXandchartYin order to work on the internal coordinate system.Parameters:
Name Type Argument Description eglobal.MouseEvent | global.PointerEvent | global.TouchEvent Event object in standard browsers.
chartPositionHighcharts.OffsetObject <optional>
Additional chart offset.
Returns:
Highcharts.PointerEventObject .A browser event with extended properties
chartXandchartY. -
reset( [allowMove] [, delay])
-
Reset the tracking by hiding the tooltip, the hover series state and the hover point
Parameters:
Name Type Argument Description allowMoveboolean <optional>
Instead of destroying the tooltip altogether, allow moving it if possible.
delaynumber <optional>
Returns: