echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] Stacked line with areaStyle is displayed despite data having 0 values

Open marcomaisel opened this issue 2 years ago • 4 comments

Version

5.3.1

Link to Minimal Reproduction

https://jsfiddle.net/bh6rayzs/1/

Steps to Reproduce

  • Create a chart with two stacked series of type 'line' with an xAxis of type 'time'
  • One of the series has data with some '0' values so that the stacked line is on the same yAxis level as the other serie's line.
  • The series have areaStyles and transparent lines

Current Behavior

At a wide zoom level, you can see the serie's line, which is stacked on top of the other serie's line and has data with some '0' values, sticking out behind the other line. If you zoom in further, it disappears and everything is displayed correctly.

Current behaviour on wider zoom levels. There is a lot of red although most of its series data value is '0': area-simple (1)

If you scroll in a bit you can see how it actually should look like: area-simple

Expected Behavior

The stacked serie's line should only be displayed on top of the other serie's line if it has data with values other than '0'. The data should be displayed correctly on all zoom levels.

Environment

- OS: macOS Monterey
- Browser: Chrome 99, Firefox 97

Any additional comments?

The app shows data for every minute for a whole day with the possibility to zoom via a datazoom.

marcomaisel avatar Mar 24 '22 08:03 marcomaisel

Also faced a similar issue, but I solved it by replacing all 0 by null or '-'

stas-sl avatar Apr 13 '22 15:04 stas-sl

Thanks for your suggestion! Replacing 0 with null makes it significantly better for now and it doesn't look as wrong as before. However, this does not make the rendering correct yet. On wider zoom levels there is still the problem that the representation of each day is not a straight stacked stepped line (with step: start).

Current behaviour on wider zoom levels with 0 replaced with null: Screenshot 2022-04-26 at 08 23 36

Correct rendering when scrolled in a bit more: Screenshot 2022-04-26 at 08 23 25

marcomaisel avatar Apr 26 '22 06:04 marcomaisel

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar Apr 25 '24 21:04 github-actions[bot]

The issue still exists

gehringf avatar Apr 26 '24 10:04 gehringf