zoukankan      html  css  js  c++  java
  • Echarts柱形图颜色设置

    ECharts图为每个数据项配置颜色

    只需要在series里面给data数组的每个元素设置itemSytle就可以了
    option如下:
    option = {
        title : {
            text: '高架排队情况'
        },
        tooltip : {
            trigger: 'axis'
        },
        xAxis : [
            {
                type : 'value',
              axisLabel : {
                    formatter: '{value} 米'
                }
            }
        ],
        yAxis : [
            {
                type : 'category',
                data : ['未知','畅通','拥挤','堵塞']
            }
        ],
        series : [
            {
                type:'bar',
              data:[
                  {
                    value:200,
                    itemStyle:{
                      normal:{color:'gray'}
                  }
                  }, 
                  {
                    value:300,
                    itemStyle:{
                      normal:{color:'green'}
                  }
                  },
                  {
                    value:1500,
                    itemStyle:{
                      normal:{color:'yellow'}
                  }
                  },
                  {
                    value:300,
                    itemStyle:{
                      normal:{color:'red'}
                  }
                  }
                ]
            }
        ]
    };
  • 相关阅读:
    守卫者的挑战(guard)
    pf
    放砖头
    多人背包
    TC-572-D1L2 未完!待续!
    方程的解数
    单词矩阵/贰五语言
    虫食算
    移动玩具
    UVA 125 统计路径条数 FLOYD
  • 原文地址:https://www.cnblogs.com/zhangym/p/5923365.html
Copyright © 2011-2022 走看看