Open kianj2 opened 1 month ago
I agree. Sure I can do the pre-processing, but this is just confusing. No one reasonably expects this data to output this graph. Some may say it's not a bug, but it will look like a bug to any fresh eyes. And be reported as such, and lower trust in the lib. Plus it makes the lib less convenient, for very basic use-cases.
This is the natural output for the given data:
Commenting to increase visibility on this issue. This is an important use case to my team and it also seems like a likely use case for others.
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
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
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.