From d16369a2cb3ec80cc2778dfdfcc0f434cbf54ae3 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Tue, 19 Nov 2019 13:38:19 -0600 Subject: [PATCH] =?UTF-8?q?[chart.js]=20missing=20Chart.platform=20and=20C?= =?UTF-8?q?hart.global.tooltips=20st=E2=80=A6=20(#40476)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chart.js/chart.js-tests.ts | 10 ++++++++++ types/chart.js/index.d.ts | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index b7fd322bfc..0a462fcb7f 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -295,3 +295,13 @@ const customTooltipsPieChart = new Chart(ctx, { }, }, }); + +// platform global values +Chart.platform.disableCSSInjection = true; + +// default global static values +Chart.defaults.global.defaultFontColor = '#544615'; +Chart.defaults.global.defaultFontFamily = 'Arial'; +Chart.defaults.global.tooltips.backgroundColor = '#0a2c54'; +Chart.defaults.global.tooltips.cornerRadius = 2; +Chart.defaults.global.tooltips.displayColors = false; diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 60ceb9f6ea..ab164dab80 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -55,7 +55,9 @@ declare class Chart { static plugins: PluginServiceStatic; static defaults: { - global: Chart.ChartOptions & Chart.ChartFontOptions; + global: Chart.ChartOptions & Chart.ChartFontOptions & { + tooltips: Chart.ChartTooltipOptions + }; [key: string]: any; }; @@ -67,6 +69,10 @@ declare class Chart { [key: string]: any; }; + static platform: { + disableCSSInjection: boolean + }; + // Tooltip Static Options static Tooltip: Chart.ChartTooltipsStaticConfiguration; }