Defining colors in a stacked bar chart

Hi, I am struggling to specify individual colors for a stacked bar chart.

I am using Grafana v13.1.0

What: I am using the “Bar Chart” element with two series that I want to display in to colors of my own chosing. I can select the “Classic Palette” for individual colors but have no choice over the colors. I have a dashboard that aggregates various KPIs. For each KPI, I compute two numbers “Rest” and “Period”

The logic I am using looks something like this:

WITH data AS (
  SELECT
    'Category A' AS category,
    1200 AS rest_value,
    300 AS period_value
  UNION ALL
  SELECT
    'Category B',
    900,
    150
  UNION ALL
  SELECT
    'Category C',
    450,
    80
)

SELECT *
FROM data;

The only options I found in Grafana 13.1.0 with the Bar Chart panel:

  • Color by field

  • Color by value

  • Color by thresholds

  • Color by special values

There is no “Color by series” option.

What I have tried so far:

  • value mappings and assigning keys in the query → only every worked for one
  • Field overrides with regex → Tooltip correct, bar remains in a single color
  • Disabling “Color by field” → not possible, Grafana automatically selects a field
  • “Color by value” → Colors based on numeric values, not series
  • “Time series panel” → time field required

Any assistance is much appreciated, thank you so much.

The fix is the legend color picker, not a manually built override →

With your query returning rest_value and period_value, both appear as separate entries in the panel’s legend below the chart.
Click the colored swatch next to rest_value in the legend.
Pick your color — all rest_value bars across every category update immediately.
Repeat for period_value with a different color.

This auto-creates the correct field override for you (visible under the panel’s Overrides list as rest_value → Color scheme), which is the property that actually controls bar rendering. A manually-added plain “Color” override only affects the tooltip/legend swatch, not the bars themselves → that’s likely what caused your “tooltip correct, bar unchanged” symptom.

If you’d rather build it manually instead of clicking the legend:
Add field override → matcher “Fields with name” → rest_value → Add override property → Standard options → Color scheme → Single color → pick your swatch. Repeat for period_value.

Hi @jonomaris2 just wanted to check if you got the solution . Happy to help further if you are facing any issues .