1.先看效果图
2.在option下面的series里面添加
{
type: 'bar',
data: [110, 83, 65, 49, 45, 40, 83,65, 49, 45, 40,40],
barWidth : 10,//柱图宽度
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
offset: 0,
color: "#0d5db0" // 0% 处的颜色
}, {
offset: 0.6,
color: "#20b1df"// 60% 处的颜色
}], false)
}
},
}