Skip to main content
Module

x/fresh_charts/deps.ts>ChartJs.TooltipOptions

A server-side-rendered charting library for Fresh
Go to Latest
interface ChartJs.TooltipOptions
import { type ChartJs } from "https://deno.land/x/fresh_charts@0.2.0/deps.ts";
const { TooltipOptions } = ChartJs;

Type Parameters

optional
TType extends ChartType = ChartType

Properties

Are on-canvas tooltips enabled?

The mode for positioning the tooltip

Override the tooltip alignment calculations

itemSort: () => number

Sort tooltip items.

filter: (
index: number,
array: TooltipItem<TType>[],
data: ChartData,
) => boolean

Background color of the tooltip.

boxPadding: number

Padding between the color box and the text.

Color of title

See Fonts

titleSpacing: Scriptable<number, ScriptableTooltipContext<TType>>

Spacing to add to top and bottom of each title line.

titleMarginBottom: Scriptable<number, ScriptableTooltipContext<TType>>

Margin to add on bottom of title section.

Horizontal alignment of the title text lines.

Spacing to add to top and bottom of each tooltip item.

Color of body

Horizontal alignment of the body text lines.

footerSpacing: Scriptable<number, ScriptableTooltipContext<TType>>

Spacing to add to top and bottom of each footer line.

footerMarginTop: Scriptable<number, ScriptableTooltipContext<TType>>

Margin to add before drawing the footer.

Color of footer

See Fonts

Horizontal alignment of the footer text lines.

Padding to add to the tooltip

caretPadding: Scriptable<number, ScriptableTooltipContext<TType>>

Extra distance to move the end of the tooltip arrow away from the tooltip point.

Size, in px, of the tooltip arrow.

Radius of tooltip corner curves.

Color to draw behind the colored boxes when multiple items are in the tooltip.

displayColors: Scriptable<boolean, ScriptableTooltipContext<TType>>

If true, color boxes are shown in the tooltip.

Width of the color box if displayColors is true.

Height of the color box if displayColors is true.

usePointStyle: Scriptable<boolean, ScriptableTooltipContext<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)

Color of the border.

Size of the border.

true for rendering the legends from right to left.

textDirection: Scriptable<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

animation: AnimationSpec<TType> | false
animations: AnimationsSpec<TType> | false

Methods

external(this: TooltipModel<TType>, args: { chart: Chart$4; tooltip: TooltipModel<TType>; }): void

See external tooltip section.