-
Notifications
You must be signed in to change notification settings - Fork 669
/
ring.jsx
80 lines (76 loc) · 1.05 KB
/
ring.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import React from "react";
import { Pie } from '@antv/g2plot';
import { createPlot } from '../../src';
const RingChart = createPlot(Pie);
const data = [
{
"x": "大健康",
"y": 20
},
{
"x": "大淘系",
"y": 20
},
{
"x": "大文娱",
"y": 20
},
{
"x": "大物流",
"y": 20
},
{
"x": "海外",
"y": 20
},
{
"x": "基金",
"y": 121
},
{
"x": "生活服务",
"y": 140
},
{
"x": "新零售",
"y": 151
},
{
"x": "新兴业务",
"y": 200
},
{
"x": "云智能",
"y": 79
},
{
"x": "待定",
"y": 30
},
{
"x": "行业未定义",
"y": 60
}
];
const config = {
"title": {
"visible": true,
"text": "环形图"
},
"description": {
"visible": true,
"text": "一个简单的环形图"
},
"label": {
"type": "spider"
},
"width": 580,
"height": 460,
"autoFit": false,
"colorField": "x",
"angleField": "y",
}
function Basic() {
return <RingChart data={data} {...config} />
}
export default Basic;