series: [{
name: '',
type: 'bar',
barWidth : 20,//柱体宽度
itemStyle: {
normal: {
label: {
show: true, //开启显示
position: 'top', //在上方显示
textStyle: { //数值样式
color: '#00d7e8',
fontSize: 16
}
},
color:function(params) {//可遍历生成以数组的形式赋值
let colorList = [
new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#072fe0'
}, {
offset: 1,
color: '#00b0fb'
}]),
new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#fa6164'
}, {
offset: 1,
color: '#fd8989'
}])
];
return colorList[params.dataIndex];
}
}
},
data:["2000","2500"]
// data: revenue
},