Add a background color bar chart

Test () {
       the this .carTotalEc = the this $ echarts.init (. the this $ refs.boxEc.)
       var Option = { 
        title: { 
            text: 'total population of the world' , 
            subtext: 'data from the network' 
        }, 
        ToolTip: { 
            Trigger: 'Axis' , 
            axisPointer: { 
                type: ' Shadow ' 
            } 
        }, 
        Legend: { 
            Data: [ ' in 2011, '' in 2012 ' ] 
        }, 
        Grid: { 
            left: '3%', 
            Right: '. 4%' , 
            bottom: '. 3%' , 
            containLabel: to true 
        }, 
        XAXIS: { 
            type: 'value' , 
            boundaryGap: [ 0, 0.01 ] 
        }, 
        YAXIS: { 
            type: 'category' , 
            Data: [ 'Brazil', 'Indonesia', 'America', 'India', 'China', 'the world's population (ten thousand)' ] 
        }, 
        Series: [ 
            { 
                name: '2011 Nian' , 
                of the 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);

    }

 

Version 4.7.0

 effect

 

Guess you like

Origin www.cnblogs.com/xhrr/p/12600137.html