Interface: Tooltip

Hierarchy

Properties

id

id: string

Inherited from

Plugin.id

Defined in

index.esm.d.ts:808Tooltip - 图1 (opens new window)


positioners

Readonly positioners: TooltipPositionerMap

Defined in

index.esm.d.ts:2543Tooltip - 图2 (opens new window)

Methods

afterBuildTicks

Optional afterBuildTicks(chart, args, options): void

desc Called after scale has build its ticks. This hook is called separately for each scale in the chart.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.scaleScale<CoreScaleOptions>The scale.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterBuildTicks

Defined in

index.esm.d.ts:967Tooltip - 图3 (opens new window)


afterDataLimits

Optional afterDataLimits(chart, args, options): void

desc Called after scale data limits are calculated. This hook is called separately for each scale in the chart.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.scaleScale<CoreScaleOptions>The scale.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterDataLimits

Defined in

index.esm.d.ts:951Tooltip - 图4 (opens new window)


afterDatasetDraw

Optional afterDatasetDraw(chart, args, options): void

desc Called after the chart datasets at the given args.index have been drawn (datasets are drawn in the reverse order). Note that this hook will not be called if the datasets drawing has been previously cancelled.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.indexnumberThe dataset index.
args.metaChartMeta<Element<AnyObject, AnyObject>, Element<AnyObject, AnyObject>, keyof ChartTypeRegistry>The dataset metadata.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterDatasetDraw

Defined in

index.esm.d.ts:1049Tooltip - 图5 (opens new window)


afterDatasetUpdate

Optional afterDatasetUpdate(chart, args, options): void

desc Called after the chart datasets at the given args.index has been updated. Note that this hook will not be called if the datasets update has been previously cancelled.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.cancelablefalse-
args.indexnumberThe dataset index.
args.metaChartMeta<Element<AnyObject, AnyObject>, Element<AnyObject, AnyObject>, keyof ChartTypeRegistry>The dataset metadata.
args.mode“resize” | “reset” | “none” | “hide” | “show” | “normal” | “active”The update mode.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterDatasetUpdate

Defined in

index.esm.d.ts:926Tooltip - 图6 (opens new window)


afterDatasetsDraw

Optional afterDatasetsDraw(chart, args, options, cancelable): void

desc Called after the chart datasets have been drawn. Note that this hook will not be called if the datasets drawing has been previously cancelled.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.
cancelablefalse-

Returns

void

Inherited from

Plugin.afterDatasetsDraw

Defined in

index.esm.d.ts:1026Tooltip - 图7 (opens new window)


afterDatasetsUpdate

Optional afterDatasetsUpdate(chart, args, options): void

desc Called after the chart datasets have been updated. Note that this hook will not be called if the datasets update has been previously cancelled.

since version 2.1.5

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.cancelabletrue-
args.mode“resize” | “reset” | “none” | “hide” | “show” | “normal” | “active”The update mode.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterDatasetsUpdate

Defined in

index.esm.d.ts:903Tooltip - 图8 (opens new window)


afterDestroy

Optional afterDestroy(chart, args, options): void

Called after the chart has been destroyed.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterDestroy

Defined in

index.esm.d.ts:1102Tooltip - 图9 (opens new window)


afterDraw

Optional afterDraw(chart, args, options): void

desc Called after the chart has been drawn. Note that this hook will not be called if the drawing has been previously cancelled.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterDraw

Defined in

index.esm.d.ts:1009Tooltip - 图10 (opens new window)


afterEvent

Optional afterEvent(chart, args, options): void

desc Called after the event has been consumed. Note that this hook will not be called if the event has been previously discarded.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.cancelablefalse-
args.changed?boolean-
args.eventChartEventThe event object.
args.inChartAreabooleanThe event position is inside chartArea
args.replaybooleanTrue if this event is replayed from Chart.update
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterEvent

Defined in

index.esm.d.ts:1072Tooltip - 图11 (opens new window)


afterInit

Optional afterInit(chart, args, options): void

desc Called after chart has been initialized and before the first update.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterInit

Defined in

index.esm.d.ts:847Tooltip - 图12 (opens new window)


afterLayout

Optional afterLayout(chart, args, options): void

desc Called after the chart has been laid out. Note that this hook will not be called if the layout update has been previously cancelled.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterLayout

Defined in

index.esm.d.ts:975Tooltip - 图13 (opens new window)


afterRender

Optional afterRender(chart, args, options): void

desc Called after the chart has been fully rendered (and animation completed). Note that this hook will not be called if the rendering has been previously cancelled.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterRender

Defined in

index.esm.d.ts:992Tooltip - 图14 (opens new window)


afterTooltipDraw

Optional afterTooltipDraw(chart, args, options): void

desc Called after drawing the tooltip. Note that this hook will not be called if the tooltip drawing has been previously cancelled.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.tooltipTooltipModel<keyof ChartTypeRegistry>The tooltip.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterTooltipDraw

Defined in

index.esm.d.ts:2595Tooltip - 图15 (opens new window)


afterUpdate

Optional afterUpdate(chart, args, options): void

desc Called after chart has been updated and before rendering. Note that this hook will not be called if the chart update has been previously cancelled.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.mode“resize” | “reset” | “none” | “hide” | “show” | “normal” | “active”The update mode
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.afterUpdate

Defined in

index.esm.d.ts:866Tooltip - 图16 (opens new window)


beforeBuildTicks

Optional beforeBuildTicks(chart, args, options): void

desc Called before scale builds its ticks. This hook is called separately for each scale in the chart.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.scaleScale<CoreScaleOptions>The scale.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.beforeBuildTicks

Defined in

index.esm.d.ts:959Tooltip - 图17 (opens new window)


beforeDataLimits

Optional beforeDataLimits(chart, args, options): void

desc Called before scale data limits are calculated. This hook is called separately for each scale in the chart.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.scaleScale<CoreScaleOptions>The scale.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.beforeDataLimits

Defined in

index.esm.d.ts:943Tooltip - 图18 (opens new window)


beforeDatasetDraw

Optional beforeDatasetDraw(chart, args, options): boolean | void

desc Called before drawing the chart dataset at the given args.index (datasets are drawn in the reverse order). If any plugin returns false, the datasets drawing is cancelled until another render is triggered.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.indexnumberThe dataset index.
args.metaChartMeta<Element<AnyObject, AnyObject>, Element<AnyObject, AnyObject>, keyof ChartTypeRegistry>The dataset metadata.
optionsAnyObjectThe plugin options.

Returns

boolean | void

false to cancel the chart datasets drawing.

Inherited from

Plugin.beforeDatasetDraw

Defined in

index.esm.d.ts:1038Tooltip - 图19 (opens new window)


beforeDatasetUpdate

Optional beforeDatasetUpdate(chart, args, options): boolean | void

desc Called before updating the chart dataset at the given args.index. If any plugin returns false, the datasets update is cancelled until another update is triggered.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.cancelabletrue-
args.indexnumberThe dataset index.
args.metaChartMeta<Element<AnyObject, AnyObject>, Element<AnyObject, AnyObject>, keyof ChartTypeRegistry>The dataset metadata.
args.mode“resize” | “reset” | “none” | “hide” | “show” | “normal” | “active”The update mode.
optionsAnyObjectThe plugin options.

Returns

boolean | void

false to cancel the chart datasets drawing.

Inherited from

Plugin.beforeDatasetUpdate

Defined in

index.esm.d.ts:915Tooltip - 图20 (opens new window)


beforeDatasetsDraw

Optional beforeDatasetsDraw(chart, args, options): boolean | void

desc Called before drawing the chart datasets. If any plugin returns false, the datasets drawing is cancelled until another render is triggered.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.cancelabletrue-
optionsAnyObjectThe plugin options.

Returns

boolean | void

false to cancel the chart datasets drawing.

Inherited from

Plugin.beforeDatasetsDraw

Defined in

index.esm.d.ts:1018Tooltip - 图21 (opens new window)


beforeDatasetsUpdate

Optional beforeDatasetsUpdate(chart, args, options): boolean | void

desc Called before updating the chart datasets. If any plugin returns false, the datasets update is cancelled until another update is triggered.

since version 2.1.5

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.mode“resize” | “reset” | “none” | “hide” | “show” | “normal” | “active”The update mode.
optionsAnyObjectThe plugin options.

Returns

boolean | void

false to cancel the datasets update.

Inherited from

Plugin.beforeDatasetsUpdate

Defined in

index.esm.d.ts:893Tooltip - 图22 (opens new window)


beforeDestroy

Optional beforeDestroy(chart, args, options): void

Called before the chart is being destroyed.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.beforeDestroy

Defined in

index.esm.d.ts:1087Tooltip - 图23 (opens new window)


beforeDraw

Optional beforeDraw(chart, args, options): boolean | void

desc Called before drawing chart at every animation frame. If any plugin returns false, the frame drawing is cancelled untilanother render is triggered.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.cancelabletrue-
optionsAnyObjectThe plugin options.

Returns

boolean | void

false to cancel the chart drawing.

Inherited from

Plugin.beforeDraw

Defined in

index.esm.d.ts:1001Tooltip - 图24 (opens new window)


beforeElementsUpdate

Optional beforeElementsUpdate(chart, args, options): void

desc Called during the update process, before any chart elements have been created. This can be used for data decimation by changing the data array inside a dataset.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.beforeElementsUpdate

Defined in

index.esm.d.ts:874Tooltip - 图25 (opens new window)


beforeEvent

Optional beforeEvent(chart, args, options): boolean | void

desc Called before processing the specified event. If any plugin returns false, the event will be discarded.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.cancelabletrue-
args.eventChartEventThe event object.
args.inChartAreabooleanThe event position is inside chartArea
args.replaybooleanTrue if this event is replayed from Chart.update
optionsAnyObjectThe plugin options.

Returns

boolean | void

Inherited from

Plugin.beforeEvent

Defined in

index.esm.d.ts:1060Tooltip - 图26 (opens new window)


beforeInit

Optional beforeInit(chart, args, options): void

desc Called before initializing chart.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.beforeInit

Defined in

index.esm.d.ts:840Tooltip - 图27 (opens new window)


beforeLayout

Optional beforeLayout(chart, args, options): boolean | void

desc Called before laying out chart. If any plugin returns false, the layout update is cancelled until another update is triggered.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.cancelabletrue-
optionsAnyObjectThe plugin options.

Returns

boolean | void

false to cancel the chart layout.

Inherited from

Plugin.beforeLayout

Defined in

index.esm.d.ts:935Tooltip - 图28 (opens new window)


beforeRender

Optional beforeRender(chart, args, options): boolean | void

desc Called before rendering chart. If any plugin returns false, the rendering is cancelled until another render is triggered.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.cancelabletrue-
optionsAnyObjectThe plugin options.

Returns

boolean | void

false to cancel the chart rendering.

Inherited from

Plugin.beforeRender

Defined in

index.esm.d.ts:984Tooltip - 图29 (opens new window)


beforeTooltipDraw

Optional beforeTooltipDraw(chart, args, options): boolean | void

desc Called before drawing the tooltip. If any plugin returns false, the tooltip drawing is cancelled until another render is triggered.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.tooltipTooltipModel<keyof ChartTypeRegistry>The tooltip.
optionsAnyObjectThe plugin options.

Returns

boolean | void

false to cancel the chart tooltip drawing.

Inherited from

Plugin.beforeTooltipDraw

Defined in

index.esm.d.ts:2586Tooltip - 图30 (opens new window)


beforeUpdate

Optional beforeUpdate(chart, args, options): boolean | void

desc Called before updating chart. If any plugin returns false, the update is cancelled (and thus subsequent render(s)) until another update is triggered.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.cancelabletrue-
args.mode“resize” | “reset” | “none” | “hide” | “show” | “normal” | “active”The update mode
optionsAnyObjectThe plugin options.

Returns

boolean | void

false to cancel the chart update.

Inherited from

Plugin.beforeUpdate

Defined in

index.esm.d.ts:857Tooltip - 图31 (opens new window)


destroy

Optional destroy(chart, args, options): void

Called after the chart has been destroyed.

deprecated since version 3.7.0 in favour of afterDestroy

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.destroy

Defined in

index.esm.d.ts:1095Tooltip - 图32 (opens new window)


install

Optional install(chart, args, options): void

desc Called when plugin is installed for this chart instance. This hook is also invoked for disabled plugins (options === false).

since 3.0.0

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.install

Defined in

index.esm.d.ts:817Tooltip - 图33 (opens new window)


reset

Optional reset(chart, args, options): void

desc Called during chart reset

since version 3.0.0

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.reset

Defined in

index.esm.d.ts:882Tooltip - 图34 (opens new window)


resize

Optional resize(chart, args, options): void

desc Called after the chart as been resized.

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsObjectThe call arguments.
args.sizeObjectThe new canvas display size (eq. canvas.style width & height).
args.size.heightnumber-
args.size.widthnumber-
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.resize

Defined in

index.esm.d.ts:1080Tooltip - 图35 (opens new window)


start

Optional start(chart, args, options): void

desc Called when a plugin is starting. This happens when chart is created or plugin is enabled.

since 3.0.0

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.start

Defined in

index.esm.d.ts:825Tooltip - 图36 (opens new window)


stop

Optional stop(chart, args, options): void

desc Called when a plugin stopping. This happens when chart is destroyed or plugin is disabled.

since 3.0.0

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.stop

Defined in

index.esm.d.ts:833Tooltip - 图37 (opens new window)


uninstall

Optional uninstall(chart, args, options): void

Called after chart is destroyed on all plugins that were installed for that chart. This hook is also invoked for disabled plugins (options === false).

since 3.0.0

Parameters

NameTypeDescription
chartChart<keyof ChartTypeRegistry, (number | ScatterDataPoint | BubbleDataPoint)[], unknown>The chart instance.
argsEmptyObjectThe call arguments.
optionsAnyObjectThe plugin options.

Returns

void

Inherited from

Plugin.uninstall

Defined in

index.esm.d.ts:1110Tooltip - 图38 (opens new window)