[PROTOTYPE] DRAFT apply configured data element/indicator color #3469
Draft
karolinelien wants to merge 1 commit into
Draft
[PROTOTYPE] DRAFT apply configured data element/indicator color #3469karolinelien wants to merge 1 commit into
karolinelien wants to merge 1 commit into
Conversation
Prototype toggle in Style -> Color set: "Use configured item color when available". When on (and legend is off), each data element / indicator with a configured style.color uses it instead of the color set; items without one fall back to the palette. Precedence: legend > configured item color > color set. Includes a patch-package patch to @dhis2/analytics so the chart series adapter honors a per-series color instead of always overwriting it from the color set (the one-line change belongs upstream for a real feature). Scope: column charts validated. Not for merge. AI Assisted
|
Contributor
|
🚀 Deployed on https://pr-3469.data-visualizer.netlify.dhis2.org |
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.



Draft prototype — not for merge.
Spike of letting a visualization use each data element's / indicator's configured
style.color(set in Maintenance)instead of the color-set palette, via a single toggle in Style → Color set: "Use configured item color when available."
Behaviour
Colour-source precedence: Legend > configured item color > color set.
style.coloruses it; items without one fall back to the color set.Try it (Netlify preview)
What's here
useItemColoroption, savable, added to the column-chart option setstyle[color]added to the item field setColorSet.jsxapplyConfiguredItemColors()injectsseries[i].colorfromstyle.color(skips when legend active)@dhis2/analyticsso the chart adapter honours a per-series colourCaveats (prototype scope)
@dhis2/analyticsfor a real feature.AI Assisted