ywlx.js
1.4 KB
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
var chartDom = document.getElementById('tab');
var myChart = echarts.init(chartDom);
var option;
option = {
height:"300px",
width:"300px",
title: {
},
tooltip: {
// trigger: 'item'
},
grid:{
x:40,
left: 0,
right: 0,
},
legend: {
orient: 'vertical',
left: '62%',
x:'right',
y:'center',
data:['健康水库','运行水库','告警水库','重危水库'],
textStyle:{
color:'#fff',
fontSize:12,
}
},
series: [
{
// name: 'Access From',
type: 'pie',
radius: '60%',
center: ["30%", "53%"],
data: [
{ value: 1048, name: '重危水库' },
{ value: 735, name: '告警水库' },
{ value: 580, name: '运行水库' },
{ value: 484, name: '健康水库' },
],
emphasis: {
itemStyle: {
show:false,
// shadowBlur: 10,
// shadowOffsetX: 0,
// shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
labelLine:{
normal:{
position:'inner',
show:false,
}
},
itemStyle:{
normal:{
label:{
show:false,
// position:'top',
// textStyle:{
// color:'#fff',
// fontSize:14,
// }
},
color:function(params){
var colorList = [
'#FF0000','#DD4103','#CBDD03','#00FDFD',
];
return colorList[params.dataIndex]
},
}
}
}
]
};
option && myChart.setOption(option);