-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
73 lines (69 loc) · 1.63 KB
/
index.html
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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<title>G2Plot-Lollipop</title>
</head>
<style>
#container {
width: 600px;
height: 600px;
}
</style>
<body>
<h1 style="padding:40px;">
<a href="https://github.com/MrSmallLiu/G2Plot-Lollipop" target="_blank">G2Plot-Lollipop</a>
<span>|</span>
<a href="https://github.com/MrSmallLiu" target="_blank">Author: MrSmallLiu</a>
</h1>
<div style="width: 100%; height: 100%; display: flex;align-items: center; justify-content: center;">
<div id="container"></div>
</div>
<script src="https://unpkg.com/@antv/g2plot"></script>
<script src="https://unpkg.com/g2plot-lollipop"></script>
</body>
<script>
const data = [
{
type: '家具家电',
sales: 38,
},
{
type: '粮油副食',
sales: 52,
},
{
type: '生鲜水果',
sales: 61,
},
{
type: '美容洗护',
sales: 145,
},
{
type: '母婴用品',
sales: 48,
},
{
type: '进口食品',
sales: 38,
},
{
type: '食品饮料',
sales: 38,
},
{
type: '家庭清洁',
sales: 38,
},
];
const lollipop = new Lollipop.Lollipop('container', {
data,
xField: 'type',
yField: 'sales',
diameterRatio: 0.4
})
lollipop.render()
</script>
</html>