apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.69k stars 19.62k forks source link

[Bug] StackedLine Display Error #20477

Closed jiao006 closed 2 weeks ago

jiao006 commented 2 weeks ago

Version

5.5.1

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=line-stack

Steps to Reproduce

option = { title: { text: 'Stacked Line' }, tooltip: { trigger: 'axis' }, legend: { data: ['2023', '2024'] }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, toolbox: { feature: { saveAsImage: {} } }, xAxis: { type: 'category', boundaryGap: false, data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [ { name: '2023', type: 'line', stack: 'Total', data: [120, 132, 101, 134, 90, 230, 210] }, { name: '2024', type: 'line', stack: 'Total', data: [0,0,0,0,0,0,0] } ] };

using this option (the second group data is all 0) on examples page, we will see two lines overlapping.

Current Behavior

when unchecked the 2023 series, the line for 2024 will be correct. image image

Expected Behavior

if change the sequence of the data,the chart will be correct. I hope the chart can display normally no matter how the order changes.

attach the correct chart image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

helgasoft commented 2 weeks ago

not-a-bug, that's how zeroes stack to positive values: 120 + 0 = 120 📌 please close issue if problem solved.