You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "sadpandajoe (via GitHub)" <gi...@apache.org> on 2026/09/21 01:32:20 UTC

[I] ECharts stacked Bar Chart value labels collide/duplicate on near-zero segments next to a large-magnitude outlier [superset]

sadpandajoe opened a new issue, #44466:
URL: https://github.com/apache/superset/issues/44466

   ### Bug description
   
   Follow-up to #38037. The chart configuration described there (stacked ECharts Bar chart, "Show Value" enabled, mostly small values plus one very large-magnitude outlier in the same series) produces value labels that collide and overlap on the small-but-non-zero segments, rendering an illegible garbled cluster of text instead of readable per-segment values.
   
   This is **distinct** from two already-fixed, related defects, which I confirmed do not cover this case:
   - #42702 / fixed by #43178 — only suppresses labels when a segment's value is *exactly* `0` (`numericValue === 0`). It does not help here: the small values in this repro (e.g. `-1` to `-5`) are non-zero, so they are not filtered, but their rendered height is still sub-pixel next to the outlier.
   - #43144 — added a fit-aware legibility floor (`MIN_LABEL_SEGMENT_SIZE_PX`), but only for the opt-in **Auto** value-label position (`isAutoBarLabel`). The shipped **default** position (`Outside End`) has no such guard.
   
   ### Reproduction
   
   1. Create a dataset with mostly small values in one range (e.g. `-1` to `-5`) and one large-magnitude outlier in the same series (e.g. `-4,000,000`) — see the CSV attached to #38037 for a working example (50 rows × 3 stacked series).
   2. Create an ECharts Bar Chart, Stacked, with "Show Value" enabled and a currency/number format applied.
   3. Render the chart (horizontal or vertical orientation).
   
   **Observed:** the small-magnitude segments render at sub-pixel height/width next to the outlier's segment. Their value labels are still drawn (they're non-zero, so the zero-value guard from #43178 doesn't apply) but land at nearly-identical coordinates and visually collide/overlap, producing garbled, unreadable text.
   
   **Expected:** either the labels are omitted on segments too small to legibly display them (matching the behavior `Auto` position already gets via `MIN_LABEL_SEGMENT_SIZE_PX`), or they are laid out to avoid collision.
   
   ### Technical detail
   
   Verified via a headless ECharts (6.1.0) render of the reproduction data (50 rows × 3 stacked series), independent of the browser:
   - 145–149 of 150 rendered labels have a colliding neighbor (near-identical bounding box).
   - 24 groups of labels are drawn at byte-identical `(x, y)` coordinates.
   - Reproduces identically on current `master` and on the pre-#38695 code — this is not related to the (separate, already-fixed) horizontal-clipping symptom originally reported in #38037.
   
   Root cause: `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts`. The `MIN_LABEL_SEGMENT_SIZE_PX` legibility-floor guard (lines 86, 163) is only reachable through the `labelLayout` callback, which is gated behind `isAutoBarLabel` / the opt-in `Auto` value-label position (lines 568, 609). The shipped default (`BarValueLabelPosition.OutsideEnd`) resolves with no `labelLayout` callback at all (see `test/Timeseries/transformers.test.ts:424-443`), so nothing suppresses or repositions colliding labels for users who haven't opted into `Auto`.
   
   ### Suggested fix
   
   Extend the existing `MIN_LABEL_SEGMENT_SIZE_PX` legibility-floor guard to every `plotType === 'bar'` label, not only when `isAutoBarLabel` is true — reusing the helper `#43144` already added, scoped to bar charts only, so segments too small to legibly display a label are blanked instead of left to collide.
   
   ### Superset version
   
   master / latest-dev
   
   ### Additional context
   
   Found during automated investigation of #38037 by Agor/Ultraset; PR referencing #38037's originally-reported symptom is already fixed on master via #38695 (unrelated change, side effect). This issue tracks only the residual label-collision defect, which is confirmed still live on current master.
   


-- 
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: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] ECharts stacked Bar Chart value labels collide/duplicate on near-zero segments next to a large-magnitude outlier [superset]

Posted by "kokhlo (via GitHub)" <gi...@apache.org>.
kokhlo commented on issue #44466:
URL: https://github.com/apache/superset/issues/44466#issuecomment-5754609532

   PR with the fix and tests: #44469. Local verification: RED on current main (5 failing assertions for the new contract), 53/53 green with the fix; no new lint/type errors vs main.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] ECharts stacked Bar Chart value labels collide/duplicate on near-zero segments next to a large-magnitude outlier [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #44466: ECharts stacked Bar Chart value labels collide/duplicate on near-zero segments next to a large-magnitude outlier
URL: https://github.com/apache/superset/issues/44466


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] ECharts stacked Bar Chart value labels collide/duplicate on near-zero segments next to a large-magnitude outlier [superset]

Posted by "kokhlo (via GitHub)" <gi...@apache.org>.
kokhlo commented on issue #44466:
URL: https://github.com/apache/superset/issues/44466#issuecomment-5754538730

   Confirmed on master. The legibility floor added for the Auto position (`MIN_LABEL_SEGMENT_SIZE_PX`, `transformers.ts:86`, enforced in `getAutoBarLabelLayout` at `:163`) is only reachable through the `labelLayout` callback, which `transformSeries` spreads solely when `isAutoBarLabel` (`transformers.ts:568`, applied at `:609-613`) — i.e. `valueLabelPosition === Auto`. The shipped default `OutsideEnd` (`getBarLabelPosition`, `:104`) resolves with no `labelLayout` callback at all (pinned by `test/Timeseries/transformers.test.ts:424-443`), so near-zero non-zero segments next to a large-magnitude outlier keep drawing colliding labels — exactly the residual defect after #43178 (zero-only suppression) and #43144 (Auto-only floor).
   
   Plan: extend the floor to every bar value label via a suppression-only `labelLayout` callback for bar series that are not on Auto — hide through the same `HIDDEN_LABEL_LAYOUT` (`fontSize: 0`) mechanism when the segment extent drops below `MIN_LABEL_SEGMENT_SIZE_PX`, return an empty layout otherwise so the configured `OutsideEnd`/inside placement is untouched. This reuses the existing data plumbing of `createAutoBarLabelLayout` and adds unit tests for `OutsideEnd`/`InsideCenter` with sub-16px segments.
   
   I'd like to implement this myself — PR within the hour.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org