Class: Pointer

Highcharts. Pointer

new Pointer(chart, options)

The mouse and touch tracker object. Each Highcharts.Chart item has one associated 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
series Array.<Highcharts.Series>

All the series to search in.

shared boolean | undefined

Whether it is a shared tooltip or not.

e Highcharts.PointerEventObject

The pointer event object, containing chart coordinates of the pointer.

Returns:
Highcharts.Point | undefined .

The point closest to given coordinates.

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
e Highcharts.PointerEventObject

Pointer event, extended with chartX and chartY properties.

Returns:

inClass(element, className)

Utility to detect whether an element has, or has a parent with, a specific class 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
element Highcharts.SVGDOMElement | Highcharts.HTMLDOMElement

The element to investigate.

className string

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 chartX and chartY in order to work on the internal coordinate system.

On map charts, the properties lon and lat are added to the event object given that the chart has projection information.

Parameters:
Name Type Argument Description
e global.MouseEvent | global.PointerEvent | global.TouchEvent

Event object in standard browsers.

chartPosition Highcharts.OffsetObject <optional>

Additional chart offset.

Returns:
Highcharts.PointerEventObject .

A browser event with extended properties chartX and chartY.

reset( [allowMove] [, delay])

Reset the tracking by hiding the tooltip, the hover series state and the hover point

Parameters:
Name Type Argument Description
allowMove boolean <optional>

Instead of destroying the tooltip altogether, allow moving it if possible.

delay number <optional>