Skip to content

Commit 3a515d0

Browse files
authored
fix: correct typing for doughnut, pie, and polarArea charts (#11521)
* fix(#10896): correct typing for doughnut, pie, and polarArea charts * formatting
1 parent 49256c6 commit 3a515d0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export interface DoughnutControllerDatasetOptions
281281
spacing: number;
282282
}
283283

284-
export interface DoughnutAnimationOptions {
284+
export interface DoughnutAnimationOptions extends AnimationSpec<'doughnut'> {
285285
/**
286286
* If true, the chart will animate in with a rotation animation. This property is in the options.animation object.
287287
* @default true

test/types/options.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Chart } from '../../src/types.js';
1+
import { Chart, ChartOptions, ChartType, DoughnutControllerChartOptions } from '../../src/types.js';
22

33
const chart = new Chart('test', {
44
type: 'bar',
@@ -31,3 +31,15 @@ const chart = new Chart('test', {
3131
}
3232
}
3333
});
34+
35+
const doughnutOptions: DoughnutControllerChartOptions = {
36+
circumference: 360,
37+
cutout: '50%',
38+
offset: 0,
39+
radius: 100,
40+
rotation: 0,
41+
spacing: 0,
42+
animation: false,
43+
};
44+
45+
const chartOptions: ChartOptions<ChartType> = doughnutOptions;

0 commit comments

Comments
 (0)