- echarts动态绑定渐变色color
// 代码代码
let color = [['red','blue'],['red','blue'],['red','blue']]
itemStyle: {
color: (params) => {
let cc = color[params.dataIndex]
return new echarts.graphic.LinearGradient(1, 0, 0, 0, [{ offset: 0, color: cc[0] }, { offset: 1, color: cc[1] }])
}
}