How to set the color of drawings (line or bar)

Now the bar colors are random set by Grafana. Is there a way to set the drawing color manually?

Thanks

1 Like

yes, click on the colored line icon to the right of the legend
http://docs.grafana.org/features/panels/graph/

3 Likes

Thank you so much! The solution is not very obvious. But it is very easy to use when you figure it out.

This works but I have a dashboard that has a variable to select a servername from an automatically updated drop down list. When I try to save a new color for a graph element, it only saves it for the specific server I had selected. In this example we have several single series graphs showing different details for a server with varied ranges (like CPU percent, and disk used MB). So they make sense in different panels. However since green is the default color I wanted to break up the monotony of a bunch of green graphs. But when I select one and change it to another color and save the graph, it changes back to green for any other server. Only when I return the the server that was in view when I changed it does the new color appear. It seems this is saving the color choice by the ā€˜nameā€™ of the series instead of it just being saved as the color for the ā€˜first series in this panelā€™.

1 Like

Just a suggestion off of this topic:
I havenā€™t seen anything about this, but it would be neat to be able to set default colors for the dashboard in dashboard settings. You could go in order of how many lines would be in your dashboards.
1 = (red)
2 = (blue)
3 = (yellow)
So then if thereā€™s 1 line in a graph itā€™s going to be red.
If there are 2 lines, the first one will be red, and the second one will be blue and so forth.
Hopefully that makes sense!

OK, I couldnā€™t figure out what the answer is. Where do I click? Grafana v7 here and I donā€™t see anything obvious to change the colors.

It would be nice to point to a specific paragraph when referencing documentation.

click on the color in the legend. It will bring up a color selection diagram

Hi there - this is a pretty old thread that seems to be getting a lot of views and some new options are available for more recent versions of Grafana for changing colors than just via the legend. Here are a few newer docs resources. If you have additional questions, please create a new post.

Thresholds - if youā€™re familiar with ā€œconditional formattingā€ in other visualization/graphing tools like Excel or Google sheets this feature in Grafana pretty similar. You can set different rules for colors in graphs this way based on values

Color scheme (for v7.3+) - this makes it easier to set specific single colors with overrides, from thresholds, and makes it easier to create color palettes:

1 Like