seekskyworld opened a new pull request, #21468:
URL: https://github.com/apache/echarts/pull/21468

   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   ### What does this PR do?
   
   This PR fixes a bug where stacked area charts with `stackStrategy: 
'samesign'` incorrectly draw an area for data points with a value of 0 by 
strictly excluding 0 from the stacking logic.
   
   ### Fixed issues
   
   - Fixes #21467
   
   ## Details
   
   ### Before: What was the problem?
   
   When `stackStrategy` is set to `'samesign'`, the previous implementation 
treated `0` as a positive value (using a `>= 0` check). This caused zero-value 
points to be stacked on top of the previous series instead of being treated 
independently. As a result, the chart would render a visual area for the zero 
value, which is incorrect behavior for a stacked area chart.
   
   ### After: How does it behave after the fixing?
   
   The stacking logic in `src/processor/dataStack.ts` has been updated to 
strictly check for positive (`> 0`) or negative (`< 0`) values when using 
`samesign`. Zero values are no longer considered part of the stack group. This 
ensures that no area is drawn for 0 values, providing the correct visual 
representation.
   
   **Validation:**
   - A new unit test has been added to 
`test/ut/spec/processor/dataStack.test.ts` to verify that 0 values result in 
`NaN` for `stackedOverDimension`.
   - A manual test case `test/issue-21467.html` has been added for visual 
verification.
   
   ## 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
   
   N.A.
   
   ### Merging options
   
   - [x] 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]

Reply via email to