yujing.js
1.5 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
80
81
82
83
84
85
86
var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;
option = {
// width:'90%',
// heigt:'90%',
grid:{
// left:'10%',
},
xAxis: [{
axisTick: {
show: false
},
axisLabel:{
textStyle:{
color:'#fff',
// fontSize:14,
}
},
axisLine:{
lineStyle:{
color:'#5456CB',
}
},
type: 'category',
data: ['紧急', '主要', '次要', '已处理', '提示', '其它', '其它']
}],
yAxis:{
name:'单位/条',
nameTextStyle:{
color:'#fff',
},
nameLocation:'end',
color:['#fff'],
splitLine:{
show:true,
lineStyle:{
color:['#5456CB'],
width:1,
type:'solid',
},
},
axisLine:{
lineStyle:{
color:'#5456CB',
}
},
axisLabel:{
textStyle:{
color:'#fff',
fontSize:12,
}
},
axisTick: {
show: false
},
},
series: [
{
data: [2000, 4000, 8000, 10000, 8000, 4000, 2000],
type: 'bar',
barWidth: '50%',
itemStyle:{
normal:{
label:{
show:true,
position:'top',
textStyle:{
color:'#fff',
fontSize:12,
}
},
color:function(params){
var colorList = [
'#FF0000','#DD4103','#CBDD03','#006699','#00FDFD','#008CCC','#999933',
];
return colorList[params.dataIndex]
},
}
}
}
]
};
option && myChart.setOption(option);