How to change the labels and color of the gauge panel?

Hi,

I use this query:

SELECT time, sensor_id AS metric, "measure_value::double"
FROM "sensordb"."temp" 
WHERE "measure_value::varchar" IS NULL and 
sensor_id IN (
  '28-02149245a540',
  '28-02159245c2cf',
  '28-3ce1045708a9',
  '28-3ce104572746'
)
ORDER BY time DESC LIMIT 20

With the “Prepare Time Series → Multi-Frame Time Series” transform.

I want to set for each “sensor_id” my custom label and change the color for each Gauge to my personal custom value? (For example red, blue, …)

  1. How can I do this?
  2. Is it correct that I have to structure the order of my gauge in the sql query? How would you do this?

Thank you

1 Like

What do you mean by custom label? Do you have a very limited set of sensors? Can you post a sample of the sensor ids?

Only the 4 ids which you can see in the upper query.

1 Like

I created a screenshot to make my question more “clear”


I want to “label” the red marked text for each gauge and I want to set different colors for each gauge.

Thank you :slight_smile:

1 Like

Make the above to be

"measure_value::double" as value

No I have there something like “value 28-3ce1045708a9” for each gauge. But I would like to write a custom label. For example “Watersensor”, “Heatersensor” …

Is this possible?

Yes use value mapping


It is not working. What I am doing wrong?
(I tried it with “value 28-3ce104572746” and “28-3ce104572746”)

Thank you so much

Is the value in the database

value 484847384u3

What is your datasource? Mysql?

I use aws timestream.

Is the value in the database

value 484847384u3

No, this value is not in the database. Where is it from?

It was just an example :eyes:
Is the value in the database
Actually has the string value in it?

value 28-3ce104572746”

This is the value in the database: “28-02149245a540”
This is also the value which I use in my “WHERE” part of the SQL query.

Then dont use

value 28-3ce104572746

In the value mapping field entry

But also 28-02149245a540 is not working.

I use the “Multi-Frame time series” Transform. Might this be a problem?

Show us what you mean by is not working?
Also time and time series related stuff does not apply as you are using a gauge and not a time series visualization.

But if I don’t enable this feature I only see one gauge.

Should I have for each gauge only one query?

remove the time column, then look what I did here, I made it so that it shows All Values.

I don’t want to color the gauge on a specific value. I want to make for example the first gauge with a specific id always red. (independent from the value)

that is not possible. there are a few things not making sense with your visualization

you have time series readings for different devices but you want to show them in gauge visualization. In this case your time column is really not useful as you will not see that value but now it creates way too many gauges since there many time series of data for each sensor. You will need to figure what visualization you want to use if time is involved. but if you insist you want to use gauge then time column is throwing things off. hence you might maybe need to get the latest reading for each sensor.

thank you. You are right. I have to modify the query.

How would you write this? => “You might maybe need to get the latest reading for each sensor.”