Skip to content

Commit c4b665c

Browse files
committed
migrate RadialChart
1 parent 0bb1a2b commit c4b665c

File tree

3 files changed

+87
-79
lines changed

3 files changed

+87
-79
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { ControlsWithNote, DocsHeader, Footer } from '@sb/components';
2+
import { Canvas, Meta } from '@storybook/addon-docs';
3+
import * as ComponentStories from './RadialChart.stories';
4+
5+
<Meta of={ComponentStories} />
6+
7+
<DocsHeader />
8+
9+
## Example
10+
11+
<Canvas of={ComponentStories.Default} />
12+
13+
## Properties
14+
15+
<ControlsWithNote of={ComponentStories.Default} />
16+
17+
<br />
18+
<br />
19+
20+
## More Examples
21+
22+
### With Custom Color
23+
24+
<Canvas of={ComponentStories.WithCustomColor} />
25+
26+
### Micro RadialCharts
27+
28+
<Canvas of={ComponentStories.MicroRadialCharts} />
29+
30+
<Footer />

packages/charts/src/components/RadialChart/RadialChart.stories.mdx

Lines changed: 0 additions & 79 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
import { FlexBox, FlexBoxAlignItems, FlexBoxJustifyContent, Text } from '@ui5/webcomponents-react';
3+
import { ThemingParameters } from '@ui5/webcomponents-react-base';
4+
import React from 'react';
5+
import { RadialChart } from './RadialChart.js';
6+
7+
const meta = {
8+
title: 'RadialChart',
9+
component: RadialChart,
10+
args: { displayValue: '50%', value: 50, maxValue: 100 }
11+
} satisfies Meta<typeof RadialChart>;
12+
13+
export default meta;
14+
type Story = StoryObj<typeof meta>;
15+
16+
export const Default: Story = {};
17+
18+
export const WithCustomColor: Story = {
19+
args: {
20+
color: '#f0ab00'
21+
}
22+
};
23+
24+
export const MicroRadialCharts: Story = {
25+
render: (args) => {
26+
return (
27+
<FlexBox justifyContent={FlexBoxJustifyContent.SpaceBetween} alignItems={FlexBoxAlignItems.Center}>
28+
<RadialChart
29+
value={50}
30+
style={{ height: '50px', width: '50px' }}
31+
chartConfig={{ innerRadius: '75%', margin: { top: 0, right: 0, bottom: 0, left: 0 } }}
32+
displayValue={'50%'}
33+
displayValueStyle={{
34+
fontSize: ThemingParameters.sapFontSmallSize,
35+
fill: ThemingParameters.sapChart_OrderedColor_1
36+
}}
37+
/>
38+
<FlexBox alignItems={FlexBoxAlignItems.Center}>
39+
<RadialChart
40+
value={50}
41+
style={{ width: '25px', height: '25px' }}
42+
chartConfig={{ innerRadius: '70%', margin: { top: 0, right: 0, bottom: 0, left: 0 } }}
43+
/>
44+
<Text>50%</Text>
45+
</FlexBox>
46+
<FlexBox alignItems={FlexBoxAlignItems.Center}>
47+
<RadialChart
48+
value={50}
49+
style={{ height: '16px', width: '16px' }}
50+
chartConfig={{ innerRadius: '75%', margin: { top: 0, right: 0, bottom: 0, left: 0 } }}
51+
/>
52+
<Text style={{ fontSize: ThemingParameters.sapFontSmallSize }}>50%</Text>
53+
</FlexBox>
54+
</FlexBox>
55+
);
56+
}
57+
};

0 commit comments

Comments
 (0)