From: Jacco van den Berg Date: Tue, 7 Feb 2023 13:19:00 +0000 (+0100) Subject: Add colors plugin TS options to be configured (#11115) X-Git-Tag: v4.2.1~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d20b59fb0364b68838997c1d015e58b021442168;p=thirdparty%2FChart.js.git Add colors plugin TS options to be configured (#11115) --- diff --git a/src/types/index.d.ts b/src/types/index.d.ts index da4ab6a13..9dbf5b1de 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -12,6 +12,7 @@ import {ChartArea, Padding, Point} from './geometric.js'; import {LayoutItem, LayoutPosition} from './layout.js'; import {RenderTextOpts} from './helpers/helpers.canvas.js'; import {CanvasFontSpec} from '../helpers/helpers.options.js'; +import type {ColorsPluginOptions} from '../plugins/plugin.colors.js'; export {EasingFunction} from '../helpers/helpers.easing.js'; export {default as ArcElement, ArcProps} from '../elements/element.arc.js'; @@ -2791,6 +2792,7 @@ export interface TooltipItem { } export interface PluginOptionsByType { + colors: ColorsPluginOptions; decimation: DecimationOptions; filler: FillerOptions; legend: LegendOptions; diff --git a/test/types/plugins/plugin.colors/colors.ts b/test/types/plugins/plugin.colors/colors.ts new file mode 100644 index 000000000..180709bdb --- /dev/null +++ b/test/types/plugins/plugin.colors/colors.ts @@ -0,0 +1,19 @@ +import { Chart } from '../../../../src/types.js'; + +const chart = new Chart('id', { + type: 'bubble', + data: { + labels: [], + datasets: [{ + data: [] + }] + }, + options: { + plugins: { + colors: { + enabled: true, + forceOverride: false, + } + } + } +});