Add colors plugin TS options to be configured (#11115)

This commit is contained in:
Jacco van den Berg 2023-02-07 14:19:00 +01:00 committed by GitHub
parent 23e8f7d378
commit d20b59fb03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -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<TType extends ChartType> {
}
export interface PluginOptionsByType<TType extends ChartType> {
colors: ColorsPluginOptions;
decimation: DecimationOptions;
filler: FillerOptions;
legend: LegendOptions<TType>;

View File

@ -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,
}
}
}
});