Interface: TooltipOptions<TType>
• animation: AnimationSpec<TType>
Defined in:
animations
• animations: <TType>
Defined in: index.esm.d.ts:2568 (opens new window)
axis
• axis: "x"
| "y"
| "xy"
Can be set to ‘x’, ‘y’, or ‘xy’ to define which directions are used in calculating distances. Defaults to ‘x’ for ‘index’ mode and ‘xy’ in dataset and ‘nearest’ modes.
Inherited from: CoreInteractionOptions.
Defined in: index.esm.d.ts:1349 (opens new window)
backgroundColor
• backgroundColor: Scriptable<, ScriptableTooltipContext<TType>>
Background color of the tooltip.
default
‘rgba(0, 0, 0, 0.8)’
Defined in:
bodyAlign
• bodyAlign: <TextAlign, <TType>>
Horizontal alignment of the body text lines.
default
‘left’
Defined in: index.esm.d.ts:2475 (opens new window)
bodyColor
• bodyColor: Scriptable<, ScriptableTooltipContext<TType>>
Color of body
default
‘#fff’
Defined in:
bodyFont
• bodyFont: <FontSpec, <TType>>
See Fonts.
default
{}
Defined in: index.esm.d.ts:2470 (opens new window)
bodySpacing
• bodySpacing: Scriptable<number, <TType>>
Spacing to add to top and bottom of each tooltip item.
default
2
Defined in: index.esm.d.ts:2460 (opens new window)
borderColor
• borderColor: Scriptable<, ScriptableTooltipContext<TType>>
Color of the border.
default
‘rgba(0, 0, 0, 0)’
Defined in:
borderWidth
• borderWidth: <number, ScriptableTooltipContext<TType>>
Size of the border.
default
0
Defined in:
boxHeight
• boxHeight: <number, ScriptableTooltipContext<TType>>
Height of the color box if displayColors is true.
default
bodyFont.size
Defined in:
boxWidth
• boxWidth: <number, ScriptableTooltipContext<TType>>
Width of the color box if displayColors is true.
default
bodyFont.size
Defined in:
callbacks
• callbacks: <TType, TooltipModel<TType>, <TType>>
Defined in: index.esm.d.ts:2569 (opens new window)
• caretPadding: <number, ScriptableTooltipContext<TType>>
Extra distance to move the end of the tooltip arrow away from the tooltip point.
default
2
Defined in:
caretSize
Size, in px, of the tooltip arrow.
default
5
Defined in:
cornerRadius
• cornerRadius: <number, ScriptableTooltipContext<TType>>
Radius of tooltip corner curves.
default
6
Defined in:
displayColors
• displayColors: <boolean, ScriptableTooltipContext<TType>>
If true, color boxes are shown in the tooltip.
default
true
Defined in:
enabled
• enabled: <boolean, ScriptableTooltipContext<TType>>
Are on-canvas tooltips enabled?
default
true
Defined in:
filter
• filter: (e
: <"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
>, index
: number, array
: TooltipItem<"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
>[], data
: <"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
, (number | ScatterDataPoint | )[], unknown>) => boolean
Type declaration
▸ (e
: <"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
>, index
: number, array
: TooltipItem<"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
>[], data
: <"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
, (number | ScatterDataPoint | )[], unknown>): boolean
Parameters
Returns: boolean
Defined in:
footerAlign
• footerAlign: <TextAlign, <TType>>
Horizontal alignment of the footer text lines.
default
‘left’
Defined in: index.esm.d.ts:2500 (opens new window)
footerColor
• footerColor: Scriptable<, ScriptableTooltipContext<TType>>
Color of footer
default
‘#fff’
Defined in:
footerFont
• footerFont: <FontSpec, <TType>>
See Fonts
default
{weight: ‘bold’}
Defined in: index.esm.d.ts:2495 (opens new window)
footerMarginTop
• footerMarginTop: Scriptable<number, <TType>>
Margin to add before drawing the footer.
default
6
Defined in: index.esm.d.ts:2485 (opens new window)
footerSpacing
• footerSpacing: Scriptable<number, <TType>>
Spacing to add to top and bottom of each footer line.
default
2
Defined in: index.esm.d.ts:2480 (opens new window)
intersect
• intersect: boolean
if true, the hover mode only applies when the mouse position intersects an item on the chart.
default
true
Inherited from: CoreInteractionOptions.
Defined in: index.esm.d.ts:1344 (opens new window)
itemSort
• itemSort: (a
: TooltipItem<"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
>, b
: <"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
>, data
: ChartData<"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
, (number | | BubbleDataPoint)[], unknown>) => number
Sort tooltip items.
Type declaration
▸ (a
: TooltipItem<"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
>, b
: <"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| >, data
: ChartData<"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
, (number | | BubbleDataPoint)[], unknown>): number
Parameters
Returns: number
Defined in: index.esm.d.ts:2422 (opens new window)
• mode: "x"
| "y"
| "dataset"
| "index"
| "point"
| "nearest"
Sets which elements appear in the tooltip. See Interaction Modes for details.
Inherited from: .mode
Defined in:
multiKeyBackground
• multiKeyBackground: <Color, <TType>>
Color to draw behind the colored boxes when multiple items are in the tooltip.
default
‘#fff’
Defined in: index.esm.d.ts:2525 (opens new window)
padding
• padding: Scriptable<number | , ScriptableTooltipContext<TType>>
Padding to add to the tooltip
default
6
Defined in:
position
• position: <"nearest"
| "average"
, ScriptableTooltipContext<TType>>
The mode for positioning the tooltip
Defined in:
rtl
• rtl: <boolean, ScriptableTooltipContext<TType>>
true for rendering the legends from right to left.
Defined in:
textDirection
• textDirection: <string, ScriptableTooltipContext<TType>>
This will force the text direction ‘rtl’ or ‘ltr on the canvas for rendering the tooltips, regardless of the css specified on the canvas
default
canvas’s default
Defined in:
titleAlign
• titleAlign: <TextAlign, <TType>>
Horizontal alignment of the title text lines.
default
‘left’
Defined in: index.esm.d.ts:2455 (opens new window)
titleColor
• titleColor: Scriptable<, ScriptableTooltipContext<TType>>
Color of title
default
‘#fff’
Defined in:
titleFont
• titleFont: <FontSpec, <TType>>
See Fonts
default
{weight: ‘bold’}
Defined in: index.esm.d.ts:2440 (opens new window)
titleMarginBottom
• titleMarginBottom: Scriptable<number, <TType>>
Margin to add on bottom of title section.
default
6
Defined in: index.esm.d.ts:2450 (opens new window)
titleSpacing
• titleSpacing: Scriptable<number, <TType>>
Spacing to add to top and bottom of each title line.
default
2
Defined in: index.esm.d.ts:2445 (opens new window)
usePointStyle
• usePointStyle: Scriptable<boolean, <TType>>
Use the corresponding point style (from dataset options) instead of color boxes, ex: star, triangle etc. (size is based on the minimum value between boxWidth and boxHeight)
default
false
Defined in: index.esm.d.ts:2545 (opens new window)
xAlign
• xAlign: Scriptable<, ScriptableTooltipContext<TType>>
Override the tooltip alignment calculations
Defined in:
• yAlign: Scriptable<, ScriptableTooltipContext<TType>>
Defined in:
external
▸ external(args
: { chart
: <"bar"
| "line"
| "scatter"
| "bubble"
| "pie"
| "doughnut"
| "polarArea"
| "radar"
, (number | ScatterDataPoint | )[], unknown> ; tooltip
: TooltipModel<TType> }): void
See external tooltip section.
Parameters
Defined in: index.esm.d.ts:2407 (opens new window)