Bar gauge based on influx tag value leads to wrong visualisation

Hey there,

I am a beginner in data visualisation with grafana. I read some tutorials and wanted to create a bar gauge based on tag data in influx (state=[green | yellow | red]).

I execute the following query:

from(bucket: "myBucket")
  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)
  |> filter(fn: (r) => r._measurement == "myMeasurement")
  |> group(columns: ["state", "_measurement"], mode:"by")
  |> count(column: "_value")  

And I get the correct data in the tableview:

_start               green
xxx                   15

_start               yellow
xxx                   10

_start               red
xxx                   5

But when I switch to bar gauge representation, the height of the bars is not correct (e.g. “red” is too low for value 5)

Do you have any idea?

Best
Stefan

It looks like it’s treating the min value (red: 5) as the lower bounds for the graph, and the max value (green: 15) as the max value. Have you tried setting the Min value for the graph to be 0?

1 Like

I changed to the bar chart and it worked out. Maybe I have not understood the “bar gauge” chart right :wink: