forked from edwardlikaiyuan/QiPy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpie-nest.html
96 lines (95 loc) · 2.94 KB
/
pie-nest.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html style="height: 100%">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10"/>
<head>
<meta charset="utf-8">
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 100%"></div>
<script type="text/javascript" src="js/echarts.min.js"></script>
<script type="text/javascript" src="js/echarts-gl.min.js"></script>
<script type="text/javascript" src="js/ecStat.min.js"></script>
<script type="text/javascript" src="js/dataTool.min.js"></script>
<script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;
option = {
tooltip: {
trigger: 'item',
formatter: '{a} {b}: {c} ({d}%)'
},
legend: {
x:'right',
y:'bottom',
orient: 'horizontal',
left: 10,
data: [ '带头人', '骨干成员', '一般人员', '专家顾问', '购置费', '材料费', '差旅费', '其它']
},
series: [
{
name: '主项',
type: 'pie',
selectedMode: 'single',
radius: [0, '30%'],
label: {
position: 'inner',
formatter: '{b|{b}} ',
borderWidth: 11,
rich: {
b: {
fontSize: 20,
color:'#eee'
}
}
},
labelLine: {
show: true
},
data: [
{value: 4.5, name: '人员费'},
{value: 5, name: '设备费'},
{value: 2.3, name: '相关\n业务费'},
{value: 1.2, name: '其它\n费\n用'}
]
},
{
name: '单位:万元',
fontSize: 26,
type: 'pie',
radius: ['35%', '55%'],
label: {
formatter: '{b|{b}_}{c|{c}} ',
backgroundColor: '#eee',
borderWidth: 1,
borderRadius: 4,
rich: {
b: {
fontSize: 26,
lineHeight: 33
},
c: {
fontSize: 26
}
}
},
data: [
{value: 0.5, name: '带头人'},
{value: 2, name: '骨干成员'},
{value: 1, name: '一般人员'},
{value: 1, name: '专家顾问'},
{value: 5, name: '购置费'},
{value: 1, name: '材料费'},
{value: 1.3, name: '差旅费'},
{value: 1.2, name: '其它'}
]
}
]
};;
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
</script>
</body>
</html>