-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
59 lines (54 loc) · 1.85 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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<title>G2Plot-Column</title>
</head>
<body>
<div style="padding:40px;text-align:center">
<a href="https://github.com/yujs/G2Plot-Column" target="_blank">Github</a>
<span>|</span>
<a href="https://github.com/yujs" target="_blank">Author</a>
</div>
<div id="container"></div>
<script src="https://unpkg.com/@antv/g2plot"></script>
<script src="https://unpkg.com/g2plot-column">
</script>
<script>
var data = [
{
name: 'Internet Explorer',
value: 26,
symbol: 'https://gw.alipayobjects.com/zos/rmsportal/eOYRaLPOmkieVvjyjTzM.png',
},
{ name: 'Chrome', value: 40, symbol: 'https://gw.alipayobjects.com/zos/rmsportal/dWJWRLWfpOEbwCyxmZwu.png', color: 'red' },
{ name: 'Firefox', value: 30, symbol: 'https://gw.alipayobjects.com/zos/rmsportal/ZEPeDluKmAoTioCABBTc.png' },
{ name: 'Safari', value: 24, symbol: 'https://gw.alipayobjects.com/zos/rmsportal/eZYhlLzqWLAYwOHQAXmc.png' },
{ name: 'Opera', value: 15, symbol: 'https://gw.alipayobjects.com/zos/rmsportal/vXiGOWCGZNKuVVpVYQAw.png' },
{
name: 'Undetectable',
value: 8,
symbol: 'https://gw.alipayobjects.com/zos/rmsportal/NjApYXminrnhBgOXyuaK.png',
},
];
var chart = new G2Plot.P(
'container',
{
data,
xField: 'name',
yField: 'value',
height: 600,
curvature: 0.8,
autoFit: true,
symbolSize: [40, 40],
padding: [50, 0, 0, 0], //发现顶部图标被挡住的时候 暂时可以设置一个padding解决
color: 'l(0) 0:#ffffff 0.5:#7ec2f3 1:#1890ff',
},
G2PlotColumn.adaptor,
G2PlotColumn.defaultOptions,
);
chart.render();
</script>
</body>
</html>