Skip to content

Commit 799c23a

Browse files
committed
correct type and stories
1 parent cbbe92f commit 799c23a

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/Chart/PieChart.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import "@gouvfr/dsfr-chart/PieChart/pie-chart.common";
55
import "@gouvfr/dsfr-chart/PieChart/pie-chart.css";
66
import {
77
chartWrapper,
8-
ChartProps,
9-
IntrinsicGraphType,
10-
BaseChartProps,
11-
stringifyObjectValue
8+
type ChartProps,
9+
type IntrinsicGraphType,
10+
type BaseChartProps,
11+
stringifyObjectValue,
12+
type ChartColor
1213
} from "./chartWrapper";
1314

1415
declare global {
@@ -25,7 +26,8 @@ declare global {
2526
export type PieChartBaseProps = {
2627
fill?: boolean;
2728
name?: string[];
28-
} & ChartProps;
29+
color: ChartColor[];
30+
} & Omit<ChartProps, "name" | "color">;
2931

3032
export type PieChartProps = PieChartBaseProps & BaseChartProps;
3133

stories/charts/PieChart.stories.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ You can find an example [here](https://github.com/codegouvfr/react-dsfr/blob/bc2
2222
"y": {
2323
"description": "Array of value for the y axis"
2424
},
25-
"name": { "description": "Array of name", control: "object" },
26-
"color": { "description": "Array of color", control: "object" },
25+
"name": { "description": "Array of name" },
26+
"color": { "description": "Array of color" },
2727
"fill": { control: "boolean" }
2828
},
2929
"disabledProps": ["lang"]
@@ -33,5 +33,7 @@ export default meta;
3333

3434
export const Default = getStory({
3535
x: [1, 2, 3],
36-
y: [10, 20, 30]
36+
y: [10, 20, 30],
37+
name: ["Serie 1", "Serie 2", "Serie 3"],
38+
color: ["blue-france", "green-bourgeon", "blue-ecume"]
3739
});

0 commit comments

Comments
 (0)