Setting time range from JavaScript

  • What Grafana version and what operating system are you using?
    V11.2.0

How can I set the time range from JavaScript? For instance, from an echarts panel or in the JavaScript console in Google Chrome. I want to be able to run a snippet of code to set the start or end of the time picker to a specific value.

Previous posts on this forum have suggested using angular selectors to get the time picker and set it, but angular has been removed in this version.

I can find the time picker singleton in the typescript library but can’t access it from the browser!

Thanks in advance for your help.

@linerider We have an example in documentation for Business Charts (ECharts)

1 Like

Thank you, that’s perfect!

1 Like