echart柱状图设置宽度颜色网格线
2019-12-05 本文已影响0人
lesdom
代码
let option = {
xAxis: {
type: 'category',
name: '维度名称',
nameTextStyle: {
padding: [25, 0, 0, 0]
},
data: picxData
},
yAxis: {
splitLine:{
show:false //去掉网格线
},
name: '资产总数量',
type: 'value'
},
series: [{
type: 'bar',
itemStyle : {
normal : {
color: function(params) {
// build a color map as your need.
let colorList = [
'#5B9BD5','#ED7D31','#FFC000'
];
return colorList[params.dataIndex]
},
label: {
show: true,
position: 'top',
// padding: [0,0,10,0],
}
},
},
barWidth : 30,//柱图宽度
data: picyData,
}]
}