-
What Grafana version and what operating system are you using?
Grafana 9.3.1 on Linux Debian GNU/Linux 10 (buster) using InfluxDB2 data -
What are you trying to achieve?
I want two curves in one diagram. One with absolute data (growing water usage values) and the second with the difference values of 5 minutes iterations -
How are you trying to achieve it?
Flux language - script -
What did you expect to happen?
two curves with two y-axes and different scales -
Can you copy/paste the configuration(s) that you are having problems with?
two diagrams a) and b) I want to have in one.
a)
from(bucket: “SmartHome”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “watermeter.verbrauch”)
|> filter(fn: (r) => r[“_field”] == “value”)
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> yield(name: “last”)
b)
from(bucket: “SmartHome”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == “watermeter.verbrauch”)
|> filter(fn: (r) => r._field == “value”)
|> difference()
|> aggregateWindow(every: 5m, fn: sum)
Thank you