1.更改全部颜色
series: [
{
type: "bar",
barWidth: 36,
data: [13, 23, 62, 83, 85, 108],
itemStyle: {
normal: {
color: function (params) {
let colorList = [
// 每根颜色顺序
"rgba(225, 133, 255, 0.39)",
"rgba(45, 211, 193, 0.39)",
"rgba(121, 173, 245, 0.39)",
"rgba(252, 223, 86, 0.39)",
"rgba(255, 156, 71, 0.39)",
"rgba(255, 91, 71, 0.39)",
];
return colorList[params.dataIndex];
},
},
},
},
],
2.更改其中一个的颜色
series:[ {
data: [
{
value:13,
itemStyle: {
color: 'rgba(225, 133, 255, 0.39)'
}
},
]