bito-code-review[bot] commented on PR #42854:
URL: https://github.com/apache/superset/pull/42854#issuecomment-5208301255
<!-- Bito Reply -->
The flagged issue is correct. The current implementation unconditionally
suppresses zero-value labels for all series, which incorrectly affects
non-stacked charts where zero values should remain visible. To resolve this,
the zero-value check should be conditional on whether the chart is stacked.
### Proposed Fix
Update the condition in
`superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts`
to only suppress zero values when `stack` is enabled:
```typescript
if (
(stack && numericValue !== 0 || !stack) &&
numericValue >=
(thresholdValues[dataIndex] || Number.MIN_SAFE_INTEGER)
) {
return formatter(numericValue);
}
```
This change ensures that zero-value suppression only applies to stacked
series, preserving existing behavior for non-stacked charts. Please let me know
if you would like me to check the remaining comments on this PR.
**superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts**
```
if (
(stack && numericValue !== 0 || !stack) &&
numericValue >=
(thresholdValues[dataIndex] || Number.MIN_SAFE_INTEGER)
) {
return formatter(numericValue);
}
```
--
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]