bmampaey opened a new issue, #21685:
URL: https://github.com/apache/echarts/issues/21685

   ### Version
   
   6.1.0
   
   ### Link to Minimal Reproduction
   
   https://codepen.io/Benjamin-Mampaey/pen/GgrQPGO
   
   ### Steps to Reproduce
   
   On the [waterfall 
example](https://echarts.apache.org/examples/en/editor.html?c=bar-waterfall2), 
change the stackStrategy to 'all' on the Expenses series (and eventually on the 
others too) instead of the default stackStrategy: 'samesign'
   
   ### Current Behavior
   
   Bars from the Expenses series disappear when the value of the Incomes series 
is null (i.e. '-') 
   
   ### Expected Behavior
   
   The stacking should exclude null values from the series Incomes, so that the 
sum does not become null, and the following series can be stacked.
   
   ### Environment
   
   ```markdown
   - OS:
   - Browser:
   - Framework:
   ```
   
   ### Any additional comments?
   
   In file src/processor/dataStack.ts :
   // Considering positive stack, negative stack and empty data
                       if (
                           stackStrategy === 'all' // single stack group
                           || (stackStrategy === 'positive' && val > 0)
                           || (stackStrategy === 'negative' && val < 0)
                           || (stackStrategy === 'samesign' && sum >= 0 && val 
> 0) // All positive stack
                           || (stackStrategy === 'samesign' && sum <= 0 && val 
< 0) // All negative stack
                       ) {
                           // The sum has to be very small to be affected by the
                           // floating arithmetic problem. An incorrect result 
will probably
                           // cause axis min/max to be filtered incorrectly.
                           sum = addSafe(sum, val);
                           stackedOver = val;
                           break;
                       }
   if val is null, and stackStrategy === 'all' , when `sum = addSafe(sum, 
val);` is executed, sum becomes null
   if val is null, and stackStrategy === 'samesign', because `&& val > 0` 
evaluates to False,   `sum = addSafe(sum, val);` is not executed
   
   There should be a safegard that val is not null


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