Show value of a field and set threshold color based on another field

Using grafana 9.2.4 on a debian 10 machine

I want to display the monitoring of a gauge valve using as a data source InfluxDB. On the gauge measurement, I have several fields (flow, status,…). I want to setup a widget (gauge would be perfect) that can show the value of one of the fields on the measurement (flow). I can do this easily, but I would like to change the color based on the value of another measurement field (status). Is this possible?

Thanks!

Please provide some sample data?

I am not sure how to provide some sample data.
In pseudocode:

my_meas = {
  "flow" = 0.02,
  "active" = 0
}

I want to show in a widget the value of the flow and color the widget based on the value of active

What I have:

I would like to have the gauge from the left, but show it in red if the active field of the measurement is ‘0’, green otherwise. The gauge widget lets you change the color, but only on the value it is representing, not another one, that I know of:
image

Thanks

1 Like

Not sure about grafana’s gauge but apache eChart grafan plugin can

Thank you very much! I didn’t know about this plugin. It seems to have a lot of options as well as a stepping learning curve! I will give it a look, as I think it will be of use for other necessities I have (show a map of gauges).

If you could paste here the code that generates that gauge, it would be very helpful, in case you still have it around.

Thanks!

1 Like

try this one

https://raw.githubusercontent.com/yosiasz/grafanadashboards/main/src/dashboards/dynamic_value_color.json