Echarts设置不同柱子颜色

梦里梦外; 2023-06-29 07:25 87阅读 0赞
  1. {
  2. series: [
  3. {
  4. itemStyle: {
  5. normal: {
  6. //每根柱子颜色设置
  7. color: function(params) {
  8. let colorList = [
  9. "#c23531",
  10. "#2f4554",
  11. "#61a0a8",
  12. "#546570"
  13. ];
  14. return colorList[params.dataIndex];
  15. }
  16. }
  17. },
  18. }
  19. ]
  20. }

发表评论

表情:
评论列表 (有 0 条评论,87人围观)

还没有评论,来说两句吧...

相关阅读