I have two pie charts in Grafana v8. Both depict statistics of the same series, that means the legend entries are the same in both charts. The amount of series is dynamic based on the used data source.
How can “Field overrides” be used to define colours dynamically (the amount of cake pieces varies) across multiple pie charts?
Defining a color for a particular series in each panel individually should be straight-forward. However, that approach doesn’t answer the actual question.
Each project has its own dashboard. In each dashboard we have 5 pie charts for the 5 error types. These pie charts shall reflect which team has how many errors (in absolute numbers and as a percentage) per error type.
The problem is that new teams might be created along the way and there will be more and more projects (and therefore dashboards) in future. So manually adding the same color overrides to all pie charts for all dashboards would result in a lot of maintenance effort for each new team.
Even though I absolutely see the need to be able to assign fixed colors to certain elements and use these colors across multiple pie charts, I doubt that there’s an easy fix for this in Grafana itself. Someone prove me wrong, please!
One idea would be to keep the mapping of teams and colors in a database and use a script to parse the JSON source code and add all the color overrides, but of course only to those pie charts for which this is required. They would need to be identified by the script somehow so that other pie charts won’t be affected. Whenever a new team is added the script would need to be run manually for all dashboards and the new overrides would get inserted in the JSON code.
I have no idea, however, whether this will be feasible in the end and how much effort this would be …