Class: Pointer

Highcharts. Pointer

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.

findNearestKDPoints(series, shared, coordinates)

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

Whether it is a shared tooltip or not.

coordinates Highcharts.PointerCoordinatesObject

Chart coordinates of the pointer.

Returns:
Highcharts.Point | undefined .

The point closest to given coordinates.

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 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
element Highcharts.SVGDOMElement | Highcharts.HTMLDOMElement

The element to investigate.

className string

The class name to look for.

Returns:
boolean .

True if either the element or one of its parents has the given class name.

normalize(e)

Takes a browser event object and extends it with custom Highcharts properties chartX and chartY in order to work on the internal coordinate system.

Parameters:
Name Type Description
e global.Event

Event object in standard browsers.

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 Description
allowMove boolean

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

delay number