Class: Tooltip

Highcharts. Tooltip

new Tooltip(chart, options)

Tooltip of a chart.

参数:
名字 类型 详情
chart Highcharts.Chart

The chart instance.

options Highcharts.TooltipOptions

Tooltip options.

成员

<readonly> chart :Highcharts.Chart

Chart of the tooltip.

Type:

container :Highcharts.HTMLDOMElement|undefined

Reference to the tooltip's container, when [Highcharts.Tooltip#outside] is set to true, otherwise it's undefined.

Type:

<readonly> options :Highcharts.TooltipOptions

Used tooltip options.

Type:
  • Highcharts.TooltipOptions

<readonly> outside :boolean

Whether to allow the tooltip to render outside the chart's SVG element box. By default (false), the tooltip is rendered within the chart's SVG element, which results in the tooltip being aligned inside the chart area.

Type:
  • boolean
To Do:
  • Split tooltip does not support outside in the first iteration. Should not be too complicated to implement.

renderer :Highcharts.SVGRenderer|undefined

Reference to the tooltip's renderer, when [Highcharts.Tooltip#outside] is set to true, otherwise it's undefined.

Type:

<readonly> shared :boolean|undefined

When the tooltip is shared, the entire plot area will capture mouse movement or touch events.

Type:
  • boolean | undefined

<readonly> split :boolean|undefined

True, if the tooltip is split into one label per series, with the header close to the axis.

Type:
  • boolean | undefined

方法

defaultFormatter(tooltip)

In case no user defined formatter is given, this will be used. Note that the context here is an object holding point, series, x, y etc.

参数:
名字 类型 详情
tooltip Highcharts.Tooltip
返回值:

destroy()

Removes and destroys the tooltip and its elements.

getLabel()

Creates the Tooltip label element if it does not exist, then returns it.

返回值:

hide( [delay])

Hides the tooltip with a fade out animation.

参数:
名字 类型 特质 详情
delay number <可选>

The fade out in milliseconds. If no value is provided the value of the tooltip.hideDelay option is used. A value of 0 disables the fade out animation.

refresh(pointOrPoints [, mouseEvent])

Refresh the tooltip's text and position.

参数:
名字 类型 特质 详情
pointOrPoints Highcharts.Point | Array.<Highcharts.Point>

Either a point or an array of points.

mouseEvent Highcharts.PointerEventObject <可选>

Mouse event, that is responsible for the refresh and should be used for the tooltip update.

update(options)

Updates the tooltip with the provided tooltip options.

参数:
名字 类型 详情
options Highcharts.TooltipOptions

The tooltip options to update.