diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index d4cb0b189e..c4fa224b41 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -302,6 +302,11 @@ const customTooltipsPieChart = new Chart(ctx, { // platform global values Chart.platform.disableCSSInjection = true; +// Chart instances in the global namespace +for (const id in Chart.instances) { + Chart.instances[id].resize(); +} + // default global static values Chart.defaults.global.defaultFontColor = '#544615'; Chart.defaults.global.defaultFontFamily = 'Arial'; diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 5793bfbf1e..7b35d9afa0 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -77,6 +77,10 @@ declare class Chart { // Tooltip Static Options static Tooltip: Chart.ChartTooltipsStaticConfiguration; + + static readonly instances: { + [key: string]: Chart; + }; } declare class PluginServiceStatic { register(plugin: Chart.PluginServiceGlobalRegistration & Chart.PluginServiceRegistrationOptions): void;