|
| 1 | +import { BarChart, type BarChartProps } from "../../dist/Chart/BarChart"; |
| 2 | +import { getStoryFactory } from "../getStory"; |
| 3 | +import { sectionName } from "./sectionName"; |
| 4 | + |
| 5 | +const { meta, getStory } = getStoryFactory<BarChartProps>({ |
| 6 | + sectionName: sectionName, |
| 7 | + "wrappedComponent": { BarChart }, |
| 8 | + "description": ` |
| 9 | +- [See DSFR documentation](https://www.systeme-de-design.gouv.fr/composants-et-modeles/composants-beta/graphiques-charts/) |
| 10 | +- [See source code](https://github.com/codegouvfr/react-dsfr/blob/main/src/Chart/BarChart.tsx)`, |
| 11 | + "argTypes": { |
| 12 | + "x": { |
| 13 | + "description": "Array of value for the x axis" |
| 14 | + }, |
| 15 | + "y": { |
| 16 | + "description": "Array of value for the y axis" |
| 17 | + }, |
| 18 | + "name": { "description": "Array of name", control: "object" }, |
| 19 | + "color": { "description": "Array of color", control: "object" }, |
| 20 | + "horizontal": { |
| 21 | + "control": { "type": "boolean" } |
| 22 | + }, |
| 23 | + "stacked": { |
| 24 | + "control": { "type": "boolean" } |
| 25 | + }, |
| 26 | + "hline": { "description": "Array of horizontal lines to add", control: "object" }, |
| 27 | + "hlinename": { "description": "Name of the horizontal lines", control: "object" }, |
| 28 | + "vline": { "description": "Array of vertical lines to add", control: "object" }, |
| 29 | + "vlinename": { "description": "Name of the vertical lines", control: "object" }, |
| 30 | + "vlinecolor": { "description": "Color of the horizontal lines", control: "object" }, |
| 31 | + "hlinecolor": { "description": "Color of the vertical lines", control: "object" } |
| 32 | + }, |
| 33 | + "disabledProps": ["lang"] |
| 34 | +}); |
| 35 | + |
| 36 | +export default meta; |
| 37 | + |
| 38 | +export const Default = getStory({ |
| 39 | + "x": [ |
| 40 | + ["A", "B"], |
| 41 | + ["A", "B"] |
| 42 | + ], |
| 43 | + "y": [ |
| 44 | + [100, 50], |
| 45 | + [20, 10] |
| 46 | + ] |
| 47 | +}); |
0 commit comments