echarts 每个柱子都显示不同的颜色
color: function (params) { var colorList = [ ['rgb(14,102,179)', 'rgb(51,36,169)'], ['#F5cF0D', '#fa9203'], ['#61dbe8', '#0785de'], ['#ff9717', '#ff4518'], ]; var index = params.dataIndex; if (params.dataIndex >= colorList.length) { index = params.dataIndex - colorList.length; } return new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: colorList[index][0] }, { offset: 1, color: colorList[index][1] } ]); }