Color whole row based on cell threshold value

  • What Grafana version and what operating system are you using?

Grafana v10.2.3 Ubuntu Server 22.04

  • What are you trying to achieve?
    I would like to change the color of a whole row based on one cell meeting a threshold, like this:

image

However, it seems I can only change the color of the individual cell, not the entire row. Does anyone know if this is possible currently?

Check this out using Dynamic Text plugin

https://play.grafana.org/d/f34fdadc-ad8c-409e-b225-70077de75f5b/table-with-dynamic-coloring?orgId=1

Interesting, I hadn’t seen that plugin before! I realize this might be outside of the scope of this post, but do you know how I could get this example to work with a table from a MySQL data source? I looked through the documentation and while there are examples of tables, I didn’t see any using SQL as the data source. I know next to nothing about JavaScript/CSS, so having a hard time figuring it out on my own. Regardless, thank you for pointing me in the right direction!

1 Like

data is data, does not matter whether it is csv or mysql

just run your query

Ah I see. It only seems to work for the first row though. In your example, if you change line 4 in the JavaScript After Content Ready from 129 to 1, Aruba changes to green, but all the other countries remain white and Afghanistan doesn’t change to blue.

Look at it again, had to change something

Still only seems to color the first row for me, but I think I can tinker with it and get it to do what I want. Thanks again for your help!

1 Like