React plugin: how to register to the TimeRangeChange event


So we’ve been experimenting a bit with React plugins for grafana and
I would like to fire some code in my plugin whenever the user changes the dashboard timerange.
In the PanelProps interface interface I found the method onChangeTimeRange which I implemented. (
However the event never seems to fire. Does anyone know of any example where such a behaviour is implemented.
Any help would be appreciated, as the existing examples I could find are rather limited to just show some text.



1 Like

this event where the panel can change the dashboard time range (like graph zoom in)

1 Like

Thank you, so this function is not usable in for this.

Now i’ve been trying to figure out how to get the timerange.
But it would seem that on my panel the render method only gets called upon adding or modifying the options in the panel. I was hoping that this would be triggerd at each refresh of the page (as with angular plugins?)
I was unable to find much info in the documentation, I’ll admit that my knowledge of React is also limited

I’ve followed


But it’s all rather basic, what’s in there i’ve gotten to work but i’d like to do some more complex things.

So i’ve got these questions:
When does the render function get called?
How should we then get the timerange?
Is there some example code somewhere that does something similar?


Hi wouterdt,
Were you able to find the event ? I am also stuck here. Can you please help ?

1 Like