101901.png
let option = {
series:[{
type:'bar',
barGap:'-74%', //两个柱形重叠
showBackground: true, //添加背景色
backgroundStyle: {
color: '#FFF8F0'
},
itemStyle: {
normal: {
color: '#FFEBB8',
barBorderRadius:3,//圆角
show: false,
}
},
barMaxWidth:22,
data:data2
},
{
type:'bar',
itemStyle: {
normal: {
color: (param)=>{ //渐变色
return new this.$echarts.graphic.LinearGradient(0, 0, 0, 1,
[
{offset: 0, color: cols[1]},
{offset: 1, color: cols[2]}
])
} ,
barBorderRadius:3,
show: false,
}
},
barMaxWidth:9,
data:data
},
],
addDataAnimation: true,
animationEasing: 'linear',
}
}