Color from one column, label from another

I’m sure this is a very basic function but I cant for the life of me find the answer.

I want to display the results of a health check on a couple of different sub systems.
I wish to display this info dynamically as a number of squares with the names of the sub systems as the displayed text in each square, and with a colored background based on if the health check was successful or not. I am using a stat panel.
I have the information needed in my query. I however fail to combine the two so that one provides the text and one the color. I have succesfully gotten it to dynamically display my data and provide colors based on the result, I simply fail to then change the title of the stat square to another field. There is just one query.

Anyone able to help?

I’m running on Grafana v11.2.2 if that matters.

Here is what it looks like today

And here is my (dummy) data:

I want to for example display check if level > 5 and change the color accordingly, while always displaying for example the value in “value”.

Edit:
Thank you @sowdenraymond for the solution!
In short, this is what needed to be added:


Together with appropriate Thresholds/Value Mappings

can try converting your value and self columns to strings with a transformation:

and then setting your color scheme to thresholds by value and then set your thresholds

1 Like

This sorta worked! Thank you!

I tried it with ‘value’ and ‘level’ for clarity, got ‘Yes value’ on all squares, added this override:

And now it looks like this:

Any way I can get it to say just the numbers instead of ‘x value’?

1 Like

you should check out the treemap panel as well:

it can also weight the size of the boxes

I did utilize the Stat styles, but putting “Value” gives me the value in the column I use for the colouring, while “Name” gives me the value in another column (but with the “value” added), which is what I’m after.

try converting the label you want to a string?

I did, this is what made the numbers show up in the title in the first place:


(I’m looking to use ‘level’ here)

I solved it! Filter out the “self”, that was the value that was being added, not the field named ‘value’. Confusing with default names, but a huge thank you for your help!

1 Like