Quantcast
Channel: InfluxDB - Grafana Labs Community Forums
Viewing all articles
Browse latest Browse all 208

Legend change issue with Grafana/Flux

$
0
0

I am having an issue with changing the legend of my graph to something meaningful.

I have this flux query:

from(bucket: “xianenergyd”)
|> range(start: v.timeRangeStart, stop:v.timeRangeStop)
|> filter(fn: (r) => r._measurement == “xianenergy”)
|> filter(fn: (r) => r._field == “AC21_W” or r._field == “AC22_W” or r._field == “AC11_W” or r._field == “AC12_W”)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> pivot(rowKey: [“_time”], columnKey: [“_field”], valueColumn: “_value”)
|> map(fn: (r) => ({ r with _value: r.AC21_W + r.AC22_W - r.AC11_W - r.AC12_W}))
|> set(key: “_field”, value: “BATTERY”)
|> yield(name: “AC”)

But the resulting legend is:

BATTERY {AC11_W=“some value”,AC12_W=“some value”,AC21_W=“some value”,AC22=“some value”} Current: 415 W

How do I get rid of the info between the 2 brackets {} ?

I tried overrides but that does not work as the value changes and it comes back to showing the brackets.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 208

Trending Articles