Color points in Geomap by (string) id

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

Grafana v8.5.3 on Ubuntu

  • What are you trying to achieve?

I want to visualize points on a map color coded by an id. The id is a string

  • How are you trying to achieve it?

I can put the coords on the Geomap with this query

from(bucket: "test_bucket")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "coords")
  |> filter(fn: (r) => r["_field"] == "lat" or r["_field"] == "lng" or r["_field"] == "id")
  |> drop(columns: ["_start","_stop"])
  |> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")
  |> rename(columns: {id: "_value"})
  |> group()

But I can’t manage to color them by id.

  • What happened?

When I set the color to _value and the color scheme to Classic palette all points are blue

  • What did you expect to happen?

I expected all points with one id to be colored in one color

  • Did you follow any online instructions? If so, what is the URL?

I used some ideas from InfluxDB and GeoData - Emergency Generators | InfluxData

I think you need to do threshhold