zoukankan      html  css  js  c++  java
  • 柱形图添加背景色

    test(){
          this.carTotalEc = this.$echarts.init(this.$refs.boxEc)
          var option = {
            title: {
                text: '世界人口总量',
                subtext: '数据来自网络'
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            legend: {
                data: ['2011年', '2012年']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: {
                type: 'value',
                boundaryGap: [0, 0.01]
            },
            yAxis: {
                type: 'category',
                data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(万)']
            },
            series: [
                {
                    name: '2011年',
                    type: 'bar',
                    data: [18203, 23489, 29034, 104970, 131744, 630230],
                    showBackground: true,
                    backgroundStyle: {
                        color: '#ff0'
                    }
                },
                {
                    name: '2012年',
                    type: 'bar',
                    barWidth: '20%',
                    data: [19325, 23438, 31000, 121594, 134141, 681807],
                    showBackground: true,
                    backgroundStyle: {
                        color: '#ff0'
                    }
                }
            ]
          };
          
          this.carTotalEc.setOption(option);
    
        }

    版本4.7.0

     效果

  • 相关阅读:
    第九周PSP
    c++的继承方式
    matlab的应用
    beta发布的评论
    本周psp
    历年作品点评
    JSON解析数据
    每周工作量及代码统计(第七周)
    词频统计(WEB)版
    评论alpha发布
  • 原文地址:https://www.cnblogs.com/xhrr/p/12600137.html
Copyright © 2011-2022 走看看