Extend last value in Graph

I have hourly forecast data that I visualize using a Graph.
The data are valid for the entire 60min interval.
My problem is that Grafana “stops” graphing them with the last value avalailable at e.g. 23:00 instead of drawing the line for an extra hour.
i.e. the last hour of the day is not shown.

Is there a way to circumvent this?

I’m using Grafana version 4.2.0 with InfluxDB

maybe try to time range that extends into the future? like from: now-6h to: now+1th

InfluxDB automatically sets an upper bound to now unless you specify otherwise in the query:


The upper time range bound is not the problem.
The thing is that my last observation really is at 23:00, however this value is valid for the one hour time range from 23:00 until 00:00, as I have hourly data.
I think what I would need is a function that tells Grafana to extend the line for an extra time interval. In my case that would be 1 hour. For, say, quarter-hourly data, the the extra time interval would need to be 15min etc.

By the way, if I changed the timestamp from 23:00 to 00:00, it would work. However, the same problem would appear at the beginning of the time series instead of at the end.

It appears that, currently, I have no option to plot a line from the beginning to the end of my set time range.

1 Like

Does fill(previous) work for you?

This screenshot is from 14:30 and shows one hour into the future:

that looks promising!
With a GROUP BY time () time interval less than 1 hour, the line is drawn into the future:

however, when I set GROUP BY time(1h) it is not:

Since I have hourly data, though, I want to set it to 1h.
Any ideas?

Use the first group by with $__interval and set the Group by time interval field (under the query, in the query editor) to >1h.

I tried it, but this doesnt change anything.
The line still stops at the last data point.

You need to look a bit further into the future if you are grouping per hour. The next datapoint is further into the future than your timerange. Set timerange to to now+62m or more.

Perfect, that works!
Thanks a lot for your help!

1 Like