Skip to content

Commit a4f7d96

Browse files
authored
docs(charts): add example for normalized stacked chart (#6762)
1 parent 4d7c8e1 commit a4f7d96

File tree

15 files changed

+82
-19
lines changed

15 files changed

+82
-19
lines changed

packages/charts/src/components/BarChart/BarChart.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ControlsWithNote, DocsHeader, Footer } from '@sb/components';
22
import { Canvas, Meta } from '@storybook/addon-docs';
33
import TooltipStory from '../../resources/TooltipConfig.mdx';
44
import LegendStory from '../../resources/LegendConfig.mdx';
5+
import NormalizedStackedChartStory from '../../resources/NormalizedStackedChart.mdx';
56
import * as ComponentStories from './BarChart.stories';
67

78
<Meta of={ComponentStories} />
@@ -37,6 +38,8 @@ import * as ComponentStories from './BarChart.stories';
3738

3839
<Canvas of={ComponentStories.WithFormatter} />
3940

41+
<NormalizedStackedChartStory of={ComponentStories.WithNormalizedStacks} />
42+
4043
### Loading Placeholder
4144

4245
<Canvas of={ComponentStories.LoadingPlaceholder} />

packages/charts/src/components/BarChart/BarChart.stories.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
legendConfig,
55
secondaryDimensionDataSet,
66
simpleDataSet,
7+
stackedNormalizedConfig,
78
tooltipConfig
89
} from '../../resources/DemoProps.js';
910
import { BarChart } from './BarChart.js';
@@ -159,6 +160,10 @@ export const WithHighlightedMeasure: Story = {
159160
}
160161
};
161162

163+
export const WithNormalizedStacks: Story = {
164+
args: stackedNormalizedConfig
165+
};
166+
162167
export const WithCustomTooltipConfig: Story = {
163168
args: tooltipConfig
164169
};

packages/charts/src/components/BarChart/BarChart.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,6 @@ const BarChart = forwardRef<HTMLDivElement, BarChartProps>((props, ref) => {
236236
resizeDebounce={chartConfig.resizeDebounce}
237237
{...propsWithoutOmitted}
238238
>
239-
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
240-
{/*// @ts-ignore:: todo not yet compatible with React19*/}
241239
<BarChartLib
242240
syncId={syncId}
243241
onClick={onClickInternal}

packages/charts/src/components/BulletChart/BulletChart.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,6 @@ const BulletChart = forwardRef<HTMLDivElement, BulletChartProps>((props, ref) =>
281281
resizeDebounce={chartConfig.resizeDebounce}
282282
{...propsWithoutOmitted}
283283
>
284-
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
285-
{/*// @ts-ignore:: todo not yet compatible with React19*/}
286284
<ComposedChartLib
287285
syncId={syncId}
288286
onClick={onClickInternal}

packages/charts/src/components/ColumnChart/ColumnChart.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ControlsWithNote, DocsHeader, Footer } from '@sb/components';
22
import { Canvas, Meta } from '@storybook/addon-docs';
33
import TooltipStory from '../../resources/TooltipConfig.mdx';
44
import LegendStory from '../../resources/LegendConfig.mdx';
5+
import NormalizedStackedChartStory from '../../resources/NormalizedStackedChart.mdx';
56
import * as ComponentStories from './ColumnChart.stories';
67

78
<Meta of={ComponentStories} />
@@ -32,6 +33,8 @@ import * as ComponentStories from './ColumnChart.stories';
3233

3334
<Canvas of={ComponentStories.WithStacks} />
3435

36+
<NormalizedStackedChartStory of={ComponentStories.WithNormalizedStacks} />
37+
3538
### With Formatter
3639

3740
<Canvas of={ComponentStories.WithFormatter} />

packages/charts/src/components/ColumnChart/ColumnChart.stories.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
legendConfig,
55
secondaryDimensionDataSet,
66
simpleDataSet,
7+
stackedNormalizedConfig,
78
tooltipConfig
89
} from '../../resources/DemoProps.js';
910
import { ColumnChart } from './ColumnChart.js';
@@ -86,6 +87,10 @@ export const WithStacks: Story = {
8687
}
8788
};
8889

90+
export const WithNormalizedStacks: Story = {
91+
args: stackedNormalizedConfig
92+
};
93+
8994
export const WithFormatter: Story = {
9095
args: {
9196
dimensions: [{ accessor: 'name', formatter: (element) => element.slice(0, 3) }],

packages/charts/src/components/ColumnChart/ColumnChart.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@ const ColumnChart = forwardRef<HTMLDivElement, ColumnChartProps>((props, ref) =>
235235
resizeDebounce={chartConfig.resizeDebounce}
236236
{...propsWithoutOmitted}
237237
>
238-
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
239-
{/*// @ts-ignore:: todo not yet compatible with React19*/}
240238
<ColumnChartLib
241239
syncId={syncId}
242240
onClick={onClickInternal}

packages/charts/src/components/ComposedChart/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,6 @@ const ComposedChart = forwardRef<HTMLDivElement, ComposedChartProps>((props, ref
286286
resizeDebounce={chartConfig.resizeDebounce}
287287
{...propsWithoutOmitted}
288288
>
289-
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
290-
{/*// @ts-ignore:: todo not yet compatible with React19*/}
291289
<ComposedChartLib
292290
syncId={syncId}
293291
onClick={onClickInternal}

packages/charts/src/components/LineChart/LineChart.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ const LineChart = forwardRef<HTMLDivElement, LineChartProps>((props, ref) => {
230230
resizeDebounce={chartConfig.resizeDebounce}
231231
{...propsWithoutOmitted}
232232
>
233-
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
234-
{/*// @ts-ignore:: todo not yet compatible with React19*/}
235233
<LineChartLib
236234
syncId={syncId}
237235
margin={marginChart}

packages/charts/src/components/PieChart/PieChart.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,6 @@ const PieChart = forwardRef<HTMLDivElement, PieChartProps>((props, ref) => {
289289
resizeDebounce={chartConfig.resizeDebounce}
290290
{...propsWithoutOmitted}
291291
>
292-
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
293-
{/*// @ts-ignore:: todo not yet compatible with React19*/}
294292
<PieChartLib
295293
onClick={onClickInternal}
296294
margin={chartConfig.margin}

0 commit comments

Comments
 (0)