The problem of stacking and non-stacking of ECharts line chart

I encountered a situation today when I cooperated with the background joint debugging data

When the third piece of data is 0, it is not on the y-axis at 0, but coincides with the previous line

 ECharts line charts are stacked. The meaning of stacking line charts is: the value of the second line = its own value + the value of the first line, the value of the third line = the value on the second line + its own value , and so on...

To set the line chart not to be stacked, you only need to set the value of each stack to a different name or delete the stack attribute.

series: [
            {
                name:'2021',
                type:'line',
                //stack: '总量',
                data:[120, 132, 101, 134, 90, 230, 210]
             },
            {
                name:'2022',
                type:'line',
                //stack: '总量',
                data:[220, 182, 191, 234, 290, 330, 310]
            },
            {
                name:'2023',
                type:'line',
                //stack: '总量',
                data:[150, 232, 201, 154, 0,0, 0]
            },
        ]

When deleting or commenting out the stack attribute, the effect diagram is as shown in the following figure:

 

Guess you like

Origin blog.csdn.net/jianshou6442/article/details/130616767