Multiple Time range?

Hi all,

Happy new year to everybody ! :slight_smile:

I created a new dashboard to get thoses differents graph :

I want to display the evolution of user connection for the day (by hour and by minute) but how i can define a different time range for the week :

Check my MySQL Query (for the week ) :slight_smile:

****** //////
SELECT COUNT(DISTINCT login) as value, UNIX_TIMESTAMP(when) as time_sec
FROM logs

WHERE when BETWEEN $__timeFrom(now/w) AND $__timeTo(now/w)
AND
type=‘login’

GROUP BY
DATE(when), HOUR( when )
//////// ********

Thanks in advance !

In panel options there’s is a time range tab where you can specify panel time ranges overrides

Hi Torkel

Yes but i can’t configured two time range in same time to display differents times series, you see ?

Thanks !

Why?

One panel can show last 5min, another last 1d, another last 7d

Because i want to display in same time the evolution of user connection Today and of the week, i can understand if it’s not possible but maybe i think i could use this function :
$__timeFrom(now/w)

So why not use panel time range override ???

Hi Torkel,

Sorry for the delay, just to confirm we talk to the same thing :

With this tool i can’t see on the two graph in the top of the screen stats of the day, and the third stats of the week.

but why not set time range on each panel?

1 Like

oooooooh My gooood yes indeed i forget this function !

Thanks torkel

Hello, How do you get two time ranges into 1 panel? also, I’m getting errors that the say the macros
__unixEpochTo and __unixEpochFrom are unknown!

is it has solution with Grafana 6+?

the setting board looks different from upper image.

Same question as jason80d. Changing the time range within the panels on Grafana 6+ changes the time range for the whole dashboard. I’m not seeing a discrete time range option within each panel like Grafana 5.

Hello zncaudata! :wave:Please check out these threads for more information on how to set time range on each panel for Grafana 6+:

Hi,
Where is panel options in Grafana 8?
I don’t see timeoveride option

1 Like

Panel’s Time range setting.

Edit → Query options → Relative time to set the Time rage.
Interval can also be set here.

1 Like

I run Grafana * v9.0.5 on Docker on Synology NAS. I don’t see the Time Range Options. I can’t find override relative time…

I want to add an additional query, to compare the previous year.
How can I do this? Thanks, torkel.

Thats right. Is it also possible to set different time shifts for two different queries? I want to compare the values with the previous year

1 Like

This is the correct way to do it, thanks

Issue is still there: impossible to show on one dashboard two time series graphs with different time ranges of the panels, e.g. one panel for last 30min and another for 24h.

Using v9.3.2. Data source mysql.
Query (same for both panels): select FROM_UNIXTIME(ts/1000) as adate, round(val) as aval from ts_number where id=186 order by adate desc LIMIT 1440;
One measurement per minute record.

Dashboard time range setting: last 30min.