Y axis values changes when I zoom out the time range - can anyone explain why?
Here is the Graph pulling from InfluxDB 2 in a 12 hour range:
Here is the Graph pulling from InfluxDB 2 in a 24 hour range:
Is there any reason to change Y axis based on different time range?
I would imagine this is happening because the y axis adjusts dynamically to fit all the data points, unless you set explicits overrides. As you are zooming out you are likely catching a higher value, and so the graph adjusts to draw it
Depending in use case you could add another graph where you do a two step aggregate window. The first does the mean for every , 10s
in my example. Then an max for v.windowPeriod
. Note that this gets rather CPU intensive when you do a longer time span. For me the time out threshold seems to be about a week.
from(bucket:"piprobe/autogen")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "ifcounters" and
r._field == "rx_bytes" and
r.intf == "eth0" and
r.probe == "${probe}"
)
|> derivative(nonNegative: true)
|> aggregateWindow(every: 10s, fn: mean)
|> aggregateWindow(every: v.windowPeriod, fn: max)
|> map(fn:(r) => ({ _time:r._time,max:r._value * 8.0}))
The same logic can be done using sub queries in influxql.