[charts] Apply axis colorMap to radial bar fill#22800
Merged
Merged
Conversation
The radialBar color processor was defined but never invoked, so a colorMap on the rotation or radius axis was ignored and every bar used the series color. Call the processor in useRadialBarPlotData, mirroring BarChart, so the band axis colorMap colors each bar. Add a 'Coloring each bar' docs section with a health dashboard demo.
Deploy previewBundle size
PerformanceTotal duration: 2,282.97 ms 🔺+439.52 ms(+23.8%) | Renders: 63 (+0)
…and 5 more (+16 within noise) — details Metric alarms
Check out the code infra dashboard for more information about this PR. |
bb10c9a to
ad3b494
Compare
Comment on lines
+39
to
+46
| ## Coloring each bar | ||
|
|
||
| Set a `colorMap` on the band axis to give each category its own color. | ||
| With `layout='horizontal'` the band categories sit on the `radiusAxis`, so an `'ordinal'` color map there paints each concentric ring independently. | ||
|
|
||
| The demo below uses this to build a health dashboard where every metric ring tracks progress toward its goal. | ||
|
|
||
| {{"demo": "HealthRadialBarChart.js", "bg": "outline"}} |
Member
There was a problem hiding this comment.
This section of the docs let me think only the band axis can have a color map
Might be better to link to the bar charts docs section about colorMap saying that x/y axes are replaced by rotation/radius
alexfauquette
approved these changes
Jun 19, 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.
Motivation
The
radialBarseries already defined a color processor (getColor), butuseRadialBarPlotDatanever invoked it — it assignedseriesItem.colordirectly. As a result acolorMapset on the rotation or radius axis was silently ignored and every bar fell back to the series color.Changes
useRadialBarPlotData, mirroringuseBarPlotDatain the cartesianBarChart. The band axiscolorMapnow colors each bar.HealthRadialBarChart) where each metric ring uses an ordinalcolorMapon theradiusAxis.In
layout='horizontal'the band categories live on theradiusAxis, so an'ordinal'color map there paints each concentric ring independently.