echarts transverse bar graph, text, vertically aligned lenticular

code show as below:

// About "provincial quality nursery named" vote 
var chartData = [18,28,15,6,17,8,8 ];
 var chartName = [ 'Sun City nursery', 'Tangmu Jing Yuan Kindergarten', 'Zhangzhai, Shandong Nova nursery ',' Zhuzhai, Anhui Preschool ',' Zhuzhai, Anhui Yan arch nursery ',' Long guzhen nursery Chunlong good source ',' Renzhuang nursery ' ];
 // var = Unit' one hundred million yuan '; 
var myColor = [ '# FFA483', '# F97F53', '# F45922' ]; 
Option = {
     //   title: { 
    //      text: 'unit:' + unit, 
    //      right: 0, 
    //      textStyle: { 
    //          Color: '# 000', 
    //          the fontSize: 14, 
    //      } 
    // },
   
        dataset: {
          source: [
            [ 'Product', '2012', '2013', '2014', '2015' ], 
            [ 'Beijing points', 271.1, 30.4, 100, 100 ], 
            [ 'Shanghai points', 156.5, 12.1, 100, 50 ], 
            [ 'Zhejiang points', 117.5, 92.1, 100, 50 ], 
            [ 'Guangzhou points', 110.5, 102.1, 100, 50 ], 
            [ 'Anhui points', 86.5, 132.1, 100, 50 ], 
          ], 
        } , 
    the backgroundColor: '#fff' , 
    Grid: { 
        left: '% 2' , 
        right: '10% ' , 
        bottom:'10%',
        top: '10%',
        containLabel: true
    },
    xAxis: [{
            show: false,
        }
    ],
    yAxis: {
        type: 'category',
        inverse: true,
        show: true,
        axisLine: {
            lineStyle: {
                color: 'rgba(0,0,0,.0)'
            }
        },
        axisLabel: {
            textStyle: {
                color: '#f00',
            },
            height: 70, 
            Margin: -35 , 
            Rich: { 
            } 
        } 
    }, 

    Series: [ 

        // bright bar percentage 
        { 
            Show: to true , 
            type: 'bar' , 
            barGap: '-100%' , 
            barWidth: '20% ' , 
            Z: 2 , 
            ItemStyle: { 
                Normal: { 
                    Color: function (the params) {
                         var NUM = myColor.length;
                        return myColor[params.dataIndex % num]
                    }
                }
            },
            label: {
                normal: {
                    show: true,
                    textStyle: {
                        color: '#000',
                        fontSize: 25,
                        fontWeight: 'bold'
                    },
                    position: 'right'
                }
            }
        },
    ]
};

 

Guess you like

Origin www.cnblogs.com/qtx-/p/11734410.html