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

   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   ### What does this PR do?
   
   Stops a `null`/`'-'` value in a lower series from corrupting the whole stack 
(bars disappearing) when `stackStrategy: 'all'` is used.
   
   ### Fixed issues
   
   - close #21685
   
   ## Details
   
   ### Before: What was the problem?
   
   In `calculateStack` (`src/processor/dataStack.ts`), the `stackStrategy === 
'all'` branch matched unconditionally. When a lower series' value was 
`null`/`'-'` (stored internally as `NaN`), `sum = addSafe(sum, NaN)` produced 
`NaN` and the loop `break`ed, so the upper series' stacked bar vanished. The 
`positive`/`negative`/`samesign` strategies aren't affected because their `val 
> 0` / `val < 0` checks already reject `NaN`.
   
   ### After: How does it behave after the fixing?
   
   The `all` branch is guarded with `!isNaN(val)`, so `null` values are 
excluded from the stack (consistent with the other strategies) and the 
remaining values stack correctly. Added a regression unit test 
(`test/ut/spec/data/dataStack.test.ts`) covering a stack that contains a `null`.
   
   ## Document Info
   
   - [x] This PR doesn't relate to document changes
   
   ## Misc
   
   ### Security Checking
   
   - [ ] This PR uses security-sensitive Web APIs.
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes.
   
   ### Merging options
   
   - [x] Please squash the commits into a single one when merging.


-- 
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