Change background color depending on displayed value

I’m using a simple mysql-query and like to change the background color depending on the query result
The query looks like

select mydb.status
from mydb
where 1=1
AND agentid = 11
AND key = 123

Hi wucis,

The result from your query would be helpful. Assuming that only a single value returns, this should be a number.
Then you can select SingleStat as visualization, check Background in the coloring section, enter the thresholds and choose the colors you want.

mgrimm, thanks for your fast replie(s). I do not have the layout/options which are displayed in your answer. I installed version 7.0.1. (opensource edition) from today and the visualization ‘Stat’ has no such options as ‘Prefix’ , ‘Postfix’ . I miss also the font size tuning options.
The ‘Stat’ visualization has the option Field | Thresholds where I could implement the changing background color depending on the displayed value.

For the records only: Yes the query returns only a single value in this case.

Sorry, didnt know you’re using the newest version. But it’almost the same only in a different layout.

No problem, I’m a grafana-newbie, so I went with the current version :wink:
Can you confirm, that version 7.0 has no options for font size and pre/postfix in the single stat visualization ?