Grafana iframe set time range automatic

I use a variable in my grafana dashboard to set the range from the data dynamic.
For e.g.
i load the database data which are created since 4 days.
The time range is set with a variable and can be change, to load data since 7 days.
It works create! when the user on my website change the time intervall, it would be change the variable in the iframe and load the data in the graphic.

The problem is only, that the time range from the showing option (from=1645666732065&to=1645677532065) doesn’t fit automatically to the time range, which i set with my variable.
For example:
i create a variable for the sql code, which contains a day count. 3 days, 4days, 5 days, 6 days, 7 days.
i add the embed in my websit and create a dropdown field with html. with jquery i check the dropdown changing and set it in the iframe url. So i get the correct data range. But i can’t see it correct, because the time range isn’t correct.
Now i need to fix it in the url by from…to…
i can do it with jquery…, but its a little bit more work.
Can grafana pass the time range automatically to the data range and refresh it automatically, if the data range is changing?

thank you

1 Like

Hi, have you found any workaround yourself?

Do you have a idea?

Does anyone have a solution?

Does anybody know how I can set the time range from to iframe url in association with the choose dashboard varibale time range?