echarts x-axis charts and histograms text display incomplete color adjustment problems

var myChart = echarts.init (document.getElementById ( 'myChart' )); 
    Option = { 
        title: { 
            // text: 'fictitious', 
        }, 
        ToolTip: { 
            Trigger: 'Axis' 
        }, 
        Grid: { 
            left: '5%', // left margin 
            right: '5%', // go margins 
            Top: 10, // the margin 
            bottom: 50, // bottom margins 
            containLabel: to true 
        }, 
        XAXIS: [ 
            { 
                type:'category' , 
                Data: Xarray, 
                AxisLabel: { // the text on end 
                    Formatter: function (value) {
                         return value.split ( "") the Join. ( "\ n-" ) 
                    } 
                } 
            } 
        ], 
        YAXIS: [ 
            { 
                type: 'value' 
            } 
        ], 
        Series: [ 
            { 
                name: 'ha' , 
                type: 'bar' ,
                 // barWidth: 15,
                // barGap: '-10%',
                data: yArray,
                markPoint: {
                    data: [
                        {name: '最高'},
                        {name: '最低'}
                    ]
                },
                itemStyle: {
                    color: function(params) {//柱状体颜色
                        // build a color map as your need.
                        var colorList = [
                            '#FF80AA','#F8568C','#C71848','#F61B63','#7ED321',
                            '#00C47B','#FF894A','#8782F7','#24A8BF','#1CCCB5',
                            '#158EFE','#68B671','#FEDB65','#2CD1C0','#AE54B5'

                        ];
                        return colorList[params.dataIndex]
                    },
                }
            }
        ]
    };
    myChart.setOption(option);

 

Guess you like

Origin www.cnblogs.com/caoxen/p/11227244.html
Recommended