Grafana with different colours on single graph?


I am using HomeAssistant with Grafana and it’s really nice and smooth.

One question did come up recently:
I have a Grafana panel with a single data source. It is an index which indicates quality. So good quality is <25 and poor quality is >250.

Is there a way to tell Grafana to change the colour display above or below these values?
If it is below 25 the graph should be green, above 250 red and below yellow.

Any hints?


Not the line, no. You can change the graph background colour to mark the levels though:



this will relate to the current value only, right?

Not what I want, yes. But I’ll have a look. Thanks so far.
Might it be an option to define a max/min value and add the same datasource triple times?


I don’t know what you mean by that.

They are background graph colours you set the levels for. Like this (these are the thresholds set in my last image):

Ahhhh… got it now! Thought it will change background based on current value.

Ok, thanks- that is a really good alternative for my wishes. I will do this.

Thanks again!


Actually you can do what you want now, see: Ability to color lines by threshold values - #7 by grant2 - Singlestat Panel - Grafana Labs Community Forums

Thanks a lot!

This is indeed what I was looking for.

Unfortunately it does not work as I expected it to do:

However, if I configure it to show the thresholds, it is acceptable.

In any case better than before.
If you have an idea why it is showing this strange ways, let me know.


Under Standard Options, set the color scheme to “From thresholds(by value)”:


Thanks again for pointing me to the configuration item. Got it now finally!

Working like a charm: