I have created a table panel in Grafana as below:
My requirement is to make the status column to have corresponding color shown instead of having the value "Yellow", "Green"... i.e. the word "Orange" should represent the color as below:
I just found the solution/workaround to this, since I was also looking for a solution. The solution is pretty similar to the first answer, but doesn't rely on an extra column (1,2,3).
Limitation: this only works for 3 rows, since we are going to use the threshold function which allows only 3 color values. (maybe by adding another rule you could use more colors..?)
Here goes:
In the "Queries" section of your table instead of text/strings give each row a numeric Alias eg. 1, 100 or 500 (choose values that are a bit apart, since these are the values the threshold is going to differentiate from).
Then switch to the "Visualisation" panel of the same table and create/change the rule for the column "Status" to "Type: Type=String" and in "Value mappings"--> "Type: Value to text".
Under "Value to text" you 'give back the text' to the values you defined earlier, e.g 1 = Yellow, 100 = Red, 500 = Green [..]
Now you can add the color to each row containing aString, by using the Threshold function: "Thresholds=100,110" (if you chose 1, 100 and 1000 before) "Color mode=row" "Colors:" (from lowest to highest) | Yellow | Red | Green.
And that should do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With