Per-slice color and label overrides for pie/treemap/funnel - #72
Merged
Conversation
Adds a widget-level slices map ({label: {color, label}}) so label/value
charts can recolor and rename individual slices, mirroring the existing
per-series map. Wired through the schema, Go model/loader/validator, TS
types, and the chart renderer.
Prompt To Fix All With AI### Issue 1
frontend/src/components/widgets/ChartWidget.tsx:1482
**Slice rename overwrites pie value**
When a pie chart uses the same result column for `label` and `value`, constructing `pieData` replaces the numeric value with the slice's display label before Recharts reads it, causing an invalid or zero-sized slice and incorrect percentages.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Add per-slice color and label overrides ..." | Re-trigger Greptile |
Write the display name to a dedicated key so a widget whose label and value point at the same column no longer overwrites its numeric value.
Prompt To Fix All With AI### Issue 1
frontend/src/components/widgets/ChartWidget.tsx:1483
**Synthetic key overwrites pie value**
When a pie chart uses a result column named `__sliceName` as its value field, this object spread replaces the numeric value with the slice's display label before Recharts reads it, causing invalid slice sizes and percentages.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (2): Last reviewed commit: "Keep pie slice rename off the value colu..." | Re-trigger Greptile |
Apply the slice rename in the label/legend/tooltip formatters instead of injecting it into the row data, so no synthetic key can collide with a result column.
|
Reviews (3): Last reviewed commit: "Rename pie slices at the display layer o..." | Re-trigger Greptile |
baharkyc
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a widget-level
slicesmap ({label: {color, label}}) so pie, treemap, and funnel charts can recolor and rename individual slices, mirroring the existing per-seriesseriesmap. Wired through the schema, Go model/loader/validator, TS types, and the chart renderer.