diff --git a/types/index.esm.d.ts b/types/index.esm.d.ts index fdb23250bbc..41095e03d9d 100644 --- a/types/index.esm.d.ts +++ b/types/index.esm.d.ts @@ -480,6 +480,8 @@ export declare class Chart< readonly scales: { [key: string]: Scale }; readonly attached: boolean; + readonly tooltip?: TooltipModel; // Only available if tooltip plugin is registered and enabled + data: ChartData; options: ChartOptions; diff --git a/types/tests/plugins/plugin.tooltip/chart.tooltip.ts b/types/tests/plugins/plugin.tooltip/chart.tooltip.ts new file mode 100644 index 00000000000..7aacb72dc49 --- /dev/null +++ b/types/tests/plugins/plugin.tooltip/chart.tooltip.ts @@ -0,0 +1,13 @@ +import { Chart } from '../../../index.esm'; + +const chart = new Chart('id', { + type: 'line', + data: { + labels: [], + datasets: [{ + data: [] + }] + }, +}); + +const tooltip = chart.tooltip;