Grafana shows incorrect legends


I set query for FLUX.
Then, Grafana shows incorrect legends and chart.

Grafana : 8.1.1
influxDB: 2.0.7

Below chart is dashboard on influxDB.

Below chart is Grafana.

You can see 2 legends _value and weekday on Grafana’s chart.
And, legend label is too long.

Grafana may not be able to process map function.

Query is as below.

import “date”

from(bucket: “my_bucket”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == “test”)
|> filter(fn: (r) => r["_field"] == “val”)
|> filter(fn: (r) => r[“Location”] == “test1”)
|> aggregateWindow(every: 1m, fn: last, createEmpty: false)
|> timeShift(duration: 9h)
|> map(fn: (r) => ({r with weekday: date.weekDay(t: r._time)}))
|> filter(fn: (r) => r.weekday == date.Friday)
|> aggregateWindow(every: 1d, fn: last, createEmpty: false)
|> yield(name: “last”)

1 Like