How I can "detach" a graph from the date selector?

Hi all, anyone know how I can “detach” a graph from the date selector?

Say I have a mysql query which gets data from the last 48 hours, specifies the last 48 hours in the query, and only want to ever display the last 48 hours.

If I select, say, last month, the graph changes to only display last month’s data and the graph flatlines.

How can I tell the graph to ignore the date selector? Other graphs on the page need to respect the date selector, but not this one.

I’ve wondered about this too, but so far haven’t found a way (on elasticsearch data source anyway). Seems like the outer grafana frame handles all the querying with a fixed time range then hands a data frame to each panel before it would have chance to override a time frame

Wonder if it could be a datasource level feature

Have you tried the relative time option? https://grafana.com/docs/grafana/latest/panels/queries/#query-options

I have. If I put in, say, 48h, it displays the data commencing 48 hours after the date selector start date. Not the last 48h.

I’ve tested on play.grafana.org using 48h and it renders as “Last 48 hours”. In this case the data source is Graphite, but inspecting the network tab in chrome developer tools clearly shows that it queries the last 48 hours and not 48 hours after the time range start date as you says. Would recommend opening a bug report on GitHub if you continue having problem with this. Let me know if I misunderstood something

Hi ,
I tried your solution,
selected absolute date: 2021-06-01 to 2021-06-07
and I want to show the last 48hrs graph
note:
*last 48hrs should be date: 2021-06-28 to 2021-06-29

I use query options: Relative time (and also tried Time shift) = 48h
the graph still show selected date (2021-06-01 to 2021-06-07)
not the last 48hrs (2021-06-28 to 2021-06-29)

your solution work, I guess it is because you selected ‘last 1 hour’

Weird. I think you’re right. You should probably open a bug report for this on grafana github repository