rusackas opened a new pull request, #21702: URL: https://github.com/apache/echarts/pull/21702
## Brief Information This pull request is in the type of: - [x] bug fixing - [ ] new feature - [ ] others ### What does this PR do? Draws a bar that is stacked over an out-of-log-domain value (e.g. stacked over a null value) from the value axis start, instead of silently not rendering it. ### Fixed issues - #19517 ## Details ### Before: What was the problem? When bars are stacked on a log axis and a lower series has a null (`'-'`) value, the upper bar's stack base is `0`. Since `log(0)` is `-Infinity`, that bar's base coordinate is non-finite and the rect is never drawn, even though the value still shows up in the tooltip. Minimal repro is in #19517 ([live example](https://echarts.apache.org/examples/en/editor.html?code=PYBwLglsB2AEC8sDeAoWsCG0IFsORgC5YAzDAGwGcBTAGjVjGGHMhGKQF970BPAQQAeEShwbowvENWIBycsADmshtwaChIseglSZsWQGN81RcABOvWTx0ATfBmIBtWQDEI5ymGsGAytUMYW1kAXVUbGnMIalFYJ3FkBN1pOQAjDHNrJNgAehzYVIBXRWIwAAtqc2pYSkKQEGAaW0ZgAuryquqqwzAsRXIY2BhGCprDTuhsvNgAeWhyXkYAd1aM6ttzDCXoADps-17nWQBaHwAmAAYrkJsdGt7DAGs5PAhoFTu1O9Q75P1ZdKZW52BzOM4AViutFgAGYrhcbtkvBgni8MG8PjpOAwwpwANxAA)). Per the analysis in #19517 this seems to have regressed in 5.3.0 with the bar layout changes; earlier versions rendered this case fine. ### After: How does it behave after the fixing? In the progressive bar layout, a non-finite stacked base coordinate is clamped back to the value axis start, in both orientations. A bar stacked over a null value is drawn from the axis start, using the same baseline as the first bar in a stack. Bars in fully-populated stacks are unaffected. Added unit tests in `test/ut/spec/series/barStackLog.test.ts` (vertical, horizontal, and a guard asserting fully-populated stacked layouts are unchanged). The first two fail without the fix. Also added a manual case to `test/bar-log.html`. ## Document Info One of the following should be checked. - [x] This PR doesn't relate to document changes - [ ] 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. ### ZRender Changes - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx). ### Related test cases or examples to use the new APIs `test/bar-log.html`, second chart. ### Merging options - [x] Please squash the commits into a single one when merging. ### Other information I'm aware of the conclusion in #19234 that stacked bars on a log axis can be misleading, and this PR doesn't take a position on that. The proportions concern is about how visible bars are read. This is a different problem: a value that exists in the data and the tooltip silently doesn't render at all, which reads as data loss rather than distortion. The drawn bar's top edge is still truthful against the axis. #19518 attempted a fix for the same issue but hardcoded the stack base to `1`, which would be wrong whenever the axis min isn't 1. This version clamps the computed pixel coordinate instead, so no data values are changed. For what it's worth, we hit this downstream in Apache Superset (apache/superset#25829), where stacked bar charts on a log axis drop bars whenever a series has gaps in it. -- 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]
