echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] Stacked bars do not work on time x axis when data is not fully synchronized

Open kianj2 opened this issue 1 year ago • 0 comments

Version

5.5.1

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=bar-stack&lang=ts&code=PYBwLglsB2AEC8sDeAoWszGAG0iAXMmuhgE4QDmFApqYQOQCGAHhAM73EC-ANMcwEFWbQqhIYAniGoNIAW2qd0vYhKHtRxdGCkzY9AG6NsAV0Xc-6NrQjURsANpai47boYAjRqXqXXbMEYAYwBrBgAzLF9ndAATRkDCBwdoagB3WAARBOoACnoAJgAGAoAWAFoigEZKqoAVavwioqaigC16AEoeWAKAXT7nFXExVx1pT29o11gA4LD9SOBp13jExxiSFPSsnPzistrahpbm1o7u2Cq-vxntjOywPMKSiurjxrPmi57r29d7rsnvtXkdqg0Cq1zl1foMZnCSFxiIMuABuIA

Steps to Reproduce

  1. View chart

Current Behavior

Rendering of series breaks (see first bar in the linked example) and bars are not stacked but instead overlapping.

Expected Behavior

Series should stack where timestamps overlap. When timestamps do not overlap the stack should only consider data that exists at the given timestamp.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

I have seen this comment in a similar issue. That comment advises to preprocess the data so that null values are written where timestamps do not overlap. However, if there is a lot of data it would be nice to avoid this preprocessing. In addition, it feels reasonable to assume that stacking will only occur where timestamps are the same even without preprocessing the data.

The documentation mentions that time and category axis are not supported, but I am assuming this applies to the y axis since the apache echarts stacked bar examples use category axis and it works fine. This would imply to me that time x axis is supported for stacking.

Am I missing something here? Is the preprocessing the intended way to use bar stacking? I feel that the functionality I described where preprocessing isn't needed sounds reasonable.

I opened a new issue because this seems slightly different than the linked one. To me, the linked one is saying stacking bars on a time axis does not work at all. Here, it seems that stacking bars on a time axis can sometimes work but sometimes breaks. And according to the documentation, it does not say that it is unsupported.

kianj2 avatar Aug 13 '24 21:08 kianj2