From: Evert Timberg Date: Fri, 2 Apr 2021 14:53:00 +0000 (-0400) Subject: Fix tooltip align & external types (#8782) X-Git-Tag: v3.0.0~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=877f4c6b2d5cdd732d79f2ed088095f5768c6bb2;p=thirdparty%2FChart.js.git Fix tooltip align & external types (#8782) --- diff --git a/types/index.esm.d.ts b/types/index.esm.d.ts index 39cedbc4a..64e9936b6 100644 --- a/types/index.esm.d.ts +++ b/types/index.esm.d.ts @@ -2208,15 +2208,16 @@ export interface TitleOptions { text: string | string[]; } -export type TooltipAlignment = 'start' | 'center' | 'end'; +export type TooltipXAlignment = 'left' | 'center' | 'right'; +export type TooltipYAlignment = 'top' | 'center' | 'bottom'; export interface TooltipModel { // The items that we are rendering in the tooltip. See Tooltip Item Interface section dataPoints: TooltipItem[]; // Positioning - xAlign: TooltipAlignment; - yAlign: TooltipAlignment; + xAlign: TooltipXAlignment; + yAlign: TooltipYAlignment; // X and Y properties are the top left of the tooltip x: number; @@ -2331,9 +2332,9 @@ export interface TooltipOptions extends CoreInteraction */ enabled: Scriptable>; /** - * See custom tooltip section. + * See external tooltip section. */ - custom(this: TooltipModel, args: { chart: Chart; tooltip: TooltipModel }): void; + external(this: TooltipModel, args: { chart: Chart; tooltip: TooltipModel }): void; /** * The mode for positioning the tooltip */ @@ -2342,8 +2343,8 @@ export interface TooltipOptions extends CoreInteraction /** * Override the tooltip alignment calculations */ - xAlign: Scriptable>; - yAlign: Scriptable>; + xAlign: Scriptable>; + yAlign: Scriptable>; /** * Sort tooltip items.