codeant-ai-for-open-source[bot] commented on code in PR #42854:
URL: https://github.com/apache/superset/pull/42854#discussion_r3731202873
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts:
##########
@@ -467,9 +467,13 @@ export function transformSeries(
return formatter(numericValue);
}
if (!onlyTotal) {
+ // A zero value occupies no space in a stacked series, so its label
+ // would render on top of the adjacent segment's label. Skip it
+ // regardless of the threshold.
if (
+ numericValue !== 0 &&
numericValue >=
- (thresholdValues[dataIndex] || Number.MIN_SAFE_INTEGER)
+ (thresholdValues[dataIndex] || Number.MIN_SAFE_INTEGER)
) {
Review Comment:
**Suggestion:** The zero-value guard is reached for non-stacked series when
`legendState` marks the series as unselected, because those series bypass the
earlier `!stack && isSelectedLegend` branch. This changes the existing behavior
and suppresses zero labels even though the overlap problem only applies to
stacked segments. Restrict the zero suppression to stacked series or preserve
the non-stacked label path. [incorrect condition logic]
<details>
<summary><b>Severity Level:</b> Minor ๐งน</summary>
```mdx
- โ ๏ธ Isolated unstacked series can lose zero-value labels.
- โ ๏ธ Legend double-click filtering affects label rendering.
- โ ๏ธ Stacked-chart overlap fix changes unstacked chart behavior.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=eb0bf0d4ce71400c8ca11decfb35f03c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=eb0bf0d4ce71400c8ca11decfb35f03c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts
**Line:** 473:477
**Comment:**
*Incorrect Condition Logic: The zero-value guard is reached for
non-stacked series when `legendState` marks the series as unselected, because
those series bypass the earlier `!stack && isSelectedLegend` branch. This
changes the existing behavior and suppresses zero labels even though the
overlap problem only applies to stacked segments. Restrict the zero suppression
to stacked series or preserve the non-stacked label path.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42854&comment_hash=b91e8e43d31cd6ed16bb488e34162fa372ab50e81d5f29ab115a22506b0a2fb0&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42854&comment_hash=b91e8e43d31cd6ed16bb488e34162fa372ab50e81d5f29ab115a22506b0a2fb0&reaction=dislike'>๐</a>
--
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]