archiewood opened a new pull request, #21493: URL: https://github.com/apache/echarts/pull/21493
## Brief Information This pull request is in the type of: - [x] bug fixing - [x] new feature - [ ] others Currently I believe time axes are "not supported" with stack, which would make this a new feature. But also this has been reported as a bug several times. ### What does this PR do? Supports using "stack" for time-based charts ### Fixed issues - #20254 - #7937 - #20096 ## Details ### Before: What was the problem? [Reproduction](https://echarts.apache.org/examples/en/editor.html?code=yy8oyczPs63mUlBQqnCsyCxWslIAcYDcksqCVCBPqSQzN1UJKFSrA1JUnFqUmQpSFQ1WBVGLpDopsUgJpBAsmJJYkghXCgLRSkYGRqa6BoZApKRjEgtTiZAxAstYxEIl4CqUiksSk7NBNoAZhiAXQd1EtisgdhljcQXEfZZwGdzOgEjUAkmwGqVKaCDiCJ6yxJxScGhC9XDVAgA&enc=deflate) If you attempted to use stack with time axes, and the series are not in the same order, then the stacks will render incorrectly. The stacked series will use the index to determine the start position, not the time. ### After: How does it behave after the fixing? The stacks will look up the stack using the time value instead of the index ## Document Info One of the following should be checked. - [ ] This PR doesn't relate to document changes - [x] The document should be updated later - [ ] The document changes have been made in apache/echarts-doc#xxx ## Misc ### Security Checking - [ ] This PR uses security-sensitive Web APIs. <!-- PLEASE CHECK IT AGAINST: <https://github.com/apache/echarts/wiki/Security-Checklist-for-Code-Contributors> --> ### ZRender Changes - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx). ### Related test cases or examples to use the new APIs ```js let option={ "xAxis": { "type": "time" }, "series": [ { "name": "A", "type": "bar", "data": [ ["2025-01-01",4], ["2025-02-01",8] ], "stack": "stack1" }, { "name": "B", "type": "bar", "data": [ ["2025-02-01",3], ["2025-01-01",9,] ], "stack": "stack1", } ], "yAxis": [ { "type": "value" } ] } ``` ### Merging options - [ ] Please squash the commits into a single one when merging. ### Other information -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
