Set absolute time range on multiple graphs in a dashboard

  • What Grafana version and what operating system are you using?
    v 9.3.6 - Linux

  • What are you trying to achieve?
    I have a list of times stored in a database.
    The time ranges represent the start a test.
    I have retrieved these times and store them in a dashboard variable called ${test_start}.
    I would like to have the dashboard create one graph for every value of ${test_start} that the user selects, and the graph would contain data from ${test_start} to (${test_start}+30m).
    So, basically, if ${test_start} has values [2023-03-01 01:00, 2023-02-01 02:00, 2023-01-01 03:00], and all have been selected, the dashboard would contain 3 graphs, which contain data as follows:

graph1 - 2023-03-01 01:00 to 2023-03-01 01:30
graph2 - 2023-02-01 02:00 to 2023-02-01 02:30
graph3 - 2023-01-01 03:00 to 2023-01-01 03:30

I would like the x-axis/time axis to be only the 30 minute time range that contains data.

  • How are you trying to achieve it?
    I have created a panel with the “Repeat by variable” option set to test_start.
    I use the ${test_start} variable in the influx query.

  • What happened?
    I get one graph for every test_start value that is selected.
    The query is accurate. It displays data from test_start test_start+30m.
    However, the x-axis / time range is not correct.
    It seems to be set by the time picker. If I set the time picker to 1 year, all of the graphs will contain data - but, it is barely readable.
    If I zoom in one one graph, the other graphs display “Data outside time range”.

  • What did you expect to happen?
    I want each graph to have an x-axis with only 30 minutes of time in it.

  • Can you copy/paste the configuration(s) that you are having problems with?
    FYI - Here is my query:
    from(bucket: “FluxData”)
    |> range(start: ${test_start}, stop: ${test_start}+1800)
    |> filter(fn: (r) =>
    r._measurement == “MY Statistics”

I tried setting the query option “Relative Time” to 30m. However, that did not help.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?