echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] `connectNulls` option is ignored by stacked areas

Open EmmadUsmani opened this issue 1 year ago • 3 comments

Version

5.4.3

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=line-simple&code=PYBwLglsB2AEC8sDeAoWsAmBDMWDOApmAFzJrqYQC2B0eUdpA2gEQAeLANLCwJ5c9eAJhYBdTuXR5gAVwBOAYwLNJFJLDakAjN17bdQ0gFZYAXwkU1G0kN2loMgDaODpACxmLl5NdgBmO39XWC1PVVFyc3I2AEE2CDxSVEswXhBlWAByBRwCAHNgOV5Mryj0XjiEpNVU9NJMgDcsRxkCTMivQjkIAkTYJlVk71qMzMcIaDavSwUYSYUwADknRz6wOVbpiiw5AiwAZVTHDKQy71pZjBPVS00eDi3LPUEuG7DvWDxcBQBrUhYvlhfq9LGd0EMUmlRuNJiU3rNoPMlis1hsCI9YDs9odeMckmCKBdgFdqh90Hd2CCyc8-CIMQSpN8_jxAcCtqZyBFTABuIA

Steps to Reproduce

Is visible in the reproduction

Current Behavior

Screenshot 2024-02-06 at 10 48 26 AM

The green area of the second series (y2) dips below the first series (y) at x=2, where y is null

Expected Behavior

Screenshot 2024-02-06 at 10 49 47 AM

The green area of the second series (y2) should not dip below the first series (y) at x=2, where y is null. Instead, because the connectNulls option is true, it should behave as if an interpolated value of y=2 is there, and render its line and area accordingly.

Environment

- OS: macOS 13.6.2
- Browser: Firefox 123.0b7

Any additional comments?

Seems like this issue was reported twice before, but those threads are old and inactive https://github.com/apache/echarts/issues/12404 https://github.com/apache/echarts/issues/17135

EmmadUsmani avatar Feb 06 '24 18:02 EmmadUsmani

I would be willing to attempt a fix for this if it's not too difficult, just want to confirm first that the expected behavior seems correct to the maintainers.

EmmadUsmani avatar Feb 06 '24 18:02 EmmadUsmani

My colleague @alxnddr has a fix in progress: https://github.com/apache/echarts/pull/19602

It fixes the first test case in area-stack.html

Before After
image image

EmmadUsmani avatar Feb 07 '24 22:02 EmmadUsmani

Here we go again with the fundamental question - How far should a chart library go to accommodate data exceptions? Line chart has connectNulls, yes but it displays only existing points and line series are independent. Stacked line chart now correctly shows the missing data. But you say "it should behave as if an interpolated value of y=2 is there". Doesn't that mean that ECharts should fabricate data ? I think such responsibility should be taken by the developer, not by the chart library.

helgasoft avatar Feb 08 '24 17:02 helgasoft