The two bar charts of echarts are on one side. What is it that is not separated? it feels like two data are combined into an array.

clipboard.png

1717 1818

clipboard.png

  series: [
        {
        name: "...", //
        type: "bar",
        yAxisIndex: 0,
        barWidth: 20, //
        data: [0, 0],
        areStyle: {
            smooth: false,
            // smoothMonotone:"x"
        },
        label: {
            normal: {
                show: true,
                position: "top"
            }
        },
        // data: [ cirone, cirtwo],
        itemStyle: {
            //:
            normal: { //colorListcolorList
                color: "-sharp1a947d"
                    // color: function (params){
                    //     var colorList = ["-sharp1a947d"];
                    //     return colorList[params.dataIndex];
                    // }
            },
            areStyle: {
                smooth: false,
            }
        }
    }, {
        name: "...", //
        type: "bar",
        yAxisIndex: 0,
        barWidth: 20, //
        data: [0, 0],
        areStyle: {
            smooth: false,
            // smoothMonotone:"x"
        },
        label: {
            normal: {
                show: true,
                position: "top"
            }
        },
        // data: [cirthree,cirfour],
        itemStyle: {
            //:
            normal: { //colorListcolorList
                color: "-sharpec9000"

            },
            areStyle: {
                smooth: false,
            }
        }
    }
    ]
    
    
     
    
    
    
Mar.23,2021

is not the same series, specific modification scheme reference case and document


beautify the value of the final option and send it out. I'll adjust it to you


you should put both data in series [0] .data. Series is an array that represents a bar chart with multiple colors. If there is only one color data, assign the array to series [0] .data

.
Menu