Skip to content

Commit 2a1209a

Browse files
committed
docs: 添加柱状图示例
1 parent 9c13ced commit 2a1209a

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

docs/demos/config/Bar.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@
77
## 分组柱状图
88

99
<code src="./demo/Bar/group.tsx" />
10+
11+
## Label
12+
13+
<code src="./demo/Bar/label.tsx" />
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import type { BarProps } from '@sensoro-design/chart';
2+
import { Bar } from '@sensoro-design/chart';
3+
4+
const list = [
5+
{
6+
name: '搜狐新闻',
7+
value: 257,
8+
},
9+
{
10+
name: '网易新闻自媒体',
11+
value: 142,
12+
},
13+
{
14+
name: '财经头条',
15+
value: 125,
16+
},
17+
{
18+
name: '新浪财经',
19+
value: 61,
20+
},
21+
{
22+
name: '东方财富网',
23+
value: 60,
24+
},
25+
{
26+
name: '一点资讯',
27+
value: 48,
28+
},
29+
{
30+
name: '新浪网',
31+
value: 41,
32+
},
33+
{
34+
name: '顶端新闻',
35+
value: 41,
36+
},
37+
{
38+
name: '新浪财经头条号',
39+
value: 35,
40+
},
41+
{
42+
name: '哔哩哔哩',
43+
value: 32,
44+
},
45+
];
46+
47+
function Example() {
48+
const spec: BarProps = {
49+
height: 400,
50+
data: [
51+
{
52+
values: list,
53+
},
54+
],
55+
xField: 'name',
56+
yField: 'value',
57+
barWidth: 20,
58+
label: {
59+
visible: true,
60+
style: {
61+
fontSize: 11,
62+
fill: '#F6F9FE',
63+
},
64+
},
65+
};
66+
67+
return (
68+
<Bar {...spec} />
69+
);
70+
};
71+
72+
export default Example;

docs/demos/config/demo/WordCloud/click.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function Example() {
77
height: 225,
88
width: 464,
99
padding: 0,
10+
color: ['#AEC0DE', '#5C8BE6', '#3EB390', '#D96762'],
1011
nameField: 'name',
1112
valueField: 'value',
1213
seriesField: 'name',

0 commit comments

Comments
 (0)