How do I change a Stacked Bar Chart element color?

  • What Grafana version and what operating system are you using?
    9.1.2 OSS, Under Windows Server

  • What are you trying to achieve?
    I have a Table data from a SQL database that shows queue stats from my ticketing system, for each queue I have the unassigned, assigned and pending ticket states
    I want to be able to select what color will be set to each element/status in a stacked bar chart

  • How are you trying to achieve it?
    I though that with 3 overrides, 1 for each of the 3 states, I could set the color with a value mapping and then setting for all values the same color

  • What happened?
    I don’t have any options to change to color in the bar chart override

  • What did you expect to happen?
    I expected to be able to have an override for the color

  • Can you copy/paste the configuration(s) that you are having problems with?
    A piece of the table:


    The query:
    SELECT * FROM view_queue_status
    WHERE ticket_new>0 or ticket_locked>0 or ticket_pending>0
    order by ticket_queue

  • Did you follow any online instructions? If so, what is the URL?
    Bar chart | Grafana documentation

I searched for hours the community because the Bar Chart page does not reference any color override/selection apart from the color palette

Hi @massimoforni,

Thanks for opening this post.

So you are doing the correct method i.e. to use Overwrite and then define the colour palette based on the data and colourize them as needed.

I am not sure what you might be missing here (watch it from 4:19) as it should work easily. I found a good resource where it shows how to colourize the data fields which are also displayed in tabular form.

Also, as a live example, you can check at this link on play.grafana.org which shows as how to colourize them.

I hope this helps.

Hello @usman.ahmad

thank you for your reply but what you linked is about bar gauge or tables, that override is not present on a stacked Bar Chart

Ok, I suspect this is a bug or something is not implemented yet

If I click on the color of a series in the legend I can override its color. If after that I open the Overrides panel I see options that I cannot set manually: