Changing the Time Interval for Data Fetching in Panel Plugin?

Hello everyone! I need to implement a feature for changing the time interval for data fetching. Currently, the data is displayed for the last 5 minutes. The task is to add two buttons — “next” and “back”. When pressing the “back” button, the interval should increase by 5 minutes (i.e., the data will be shown for the last 10 minutes, then 15, and so on). The “next” button should similarly decrease the interval by 5 minutes.

In my case, there is a modal window with a chart, and the data needs to update on the chart when these buttons are pressed. Is it possible to implement this?

Thanks in advance for your help!

@maxymzakharkiv have you tried modifying the url parameters that contain the time values?

e.g.: http://localhost:3000/d/ce10yfh23b01sd/new-dashboard?from=now-15m&to=now&timezone=browser

notice the from and to parameters.

Keep in mind grafana dashboards could use relative and absolute times

Thanks for the reply! Implemented through these parameters and the onChangeTimeRange function, Everything seems to have worked