Skip to content

Commit

Permalink
Add colors plugin TS options to be configured (#11115)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeLenaleee authored Feb 7, 2023
1 parent 23e8f7d commit d20b59f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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>;
Expand Down
19 changes: 19 additions & 0 deletions test/types/plugins/plugin.colors/colors.ts
Original file line number Diff line number Diff line change
@@ -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,
}
}
}
});

0 comments on commit d20b59f

Please sign in to comment.