Time range control - time unit for 'today'

Hi,

I’m running Grafana 6.4.4 on Ubuntu 18.04 with InfluxDB 1.7 as the datasource (all installed on the same box)

I’ve been searching the community and the docs to try to work out the time range control ‘code’ I should use to override a specific panel so that it shows ‘today’ including time up to midnight that has not yet passed. This would be equivalent to selecting the quick range ‘Today’ in the ‘Current time range’ picker in the top right of a dashboard. I want to achieve this for one panel so that it always shows the equivalent of ‘Today’ but can’t work out what the code should be. Things I’ve tried in the ‘Relative time’ box include:

1d - shows the last 24 hours up to current time
1d/d - this shows from midnight last night/this morning to the current time
1d/h - this shows from the current hour yesterday to the current time (e.g. 9pm yesterday to 9:16pm today)
Today - invalid input
today - invalid input

Furthermore I’d like to be able to show the whole of yesterday in one chart, the whole of the day before that in another and so on for the past week (i.e. 1 chart for each day of the week) but again can’t figure out the codes, including the time shift input.

Can anyone shed any light on this?!

Many thanks,

Ben

Have you tried setting both From and To to now/d? And the time shifts of the charts to 1d for yesterday, 2d for the day before yesterday and so forth.

Hi,

There is no From and To, only ‘Relative Time’ and ‘Time Shift’ (see image below):

Also, now/d gives me the day so far, not the whole day, including the portion from now until midnight, so unfortunately that wouldn’t work…

I have exactly this question too! Has anyone figured out a solution?

@johndowell Would doing something like this work for you?

That’s almost it! The end result I want is a graph which shows “today” and is locked to that range and independent from the main interval which all the rest of the windows use. Relative time let’s you put in now/d but not from now/d to now/d

1 Like