uniapp Ucharts 横向bar图 每个设置颜色不同
代码-------》》》
arr = [80,80,80]
let valueList = arr.map((item, index) => { let color = '' let newNumber = Number(item) if (index == 0) color = '#5593FE' if (index == 1) color = '#93b6f8' if (index == 2) color = '#d5e4ff' return { value: newNumber, color } }) this.barData = { categories: ["高意向转低意向客户", "低意向转高意向客户", "死单客户"], series: [{ name: "目标值", data: valueList, format: 'yAxisDemo1' }, ], }