function renderNation(_data){
var option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: "{b}:{c}"
},
grid: {
top: '9%',
left: '3%',
right: '10%',
bottom: '0%',
containLabel: true
},
xAxis: {
type: 'value',
boundaryGap: [0, 0.01],
"axisLabel": {
"interval": 0,
formatter: '{value}',
},
axisTick: {
show: false,
},
axisLine: {
show: false,
},
axisLabel: {
show: false
},
splitLine: {
show: false
}
},
yAxis: {
type: 'category',
axisTick: {
show: false,
},
axisLine: {
show: false,
},
axisLabel: {
textStyle: {
color: '#73c4fc'
},
interval: 0
},
axisTick: {
show: false
},
axisLine: {
show: false
},
data: _data.eventCauselist
},
series: [{
name: '',
type: 'bar',
barWidth: 9,
itemStyle: {
//通常情况下每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
normal:{
color: function (params){
var colorList = ["#17c699","#f4c533","#cf145f","#92f5dc","#02b4d3"];
return colorList[params.dataIndex];
},
label: {
show: true,
// position: 'inside'
position: 'right'
}
},
//鼠标悬停时:
emphasis: {
shadowBlur: 8,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
data: _data.Numlist
}]
};
myChart.setOption(option);
}