Make Grafana text panel react to changes in time range

I found a way to do this in issue #1909 (Please look at the message from “maxreb”.) In his code he ‘hacks’ into the Grafana code to make the panel react to changes in the time-range.

As he mentions in hist post the method is quite “hacky”. Meanwhile we are 4 years later. Is there a better way to do this or should I resort to this “hacky” way of doing it?

P.S.
Not sure if “plugins” is the correct tag for this message, but couldn’t select a better one in the drop-down.

Could you please provide us some sample data you are working with and what is it you are attempting to visualize?

An old thread from a closed gitlab issue might shoe horn us into a specific approach when there could be a newer/fresher approach that will solve your issue

That is exactly my point: Is his idea still the best solution to having the text panel react to changes in the selected time-period?

why look at his idea when we might be able to do better.
so we have 2 possible options: hack or not hack :wink:

So: Is there a non-hacky way to get the same results?

The text/html panel contains an iframe that contains an html file that’s made with wick-editor. This html file contains a slider control that slides between the start and end of the time-period. It selects a point in time between start and end.

We shall see if you tell us what you are attempting to do. What are you trying to display in the Text Panel? give us some more details.

The text/html panel contains an iframe that contains an html file that’s made with wick-editor. This html file contains a slider control that slides between the start and end of the time-period. It selects a point in time between start and end.

As a result the html page will show the status of the system as it was at that point in time. Like a YouTube movie.

1 Like

ok, let’s start with a fresh approach using apache echarts, I am not saying you should use this but look into it. It provides you access to from and to as show in bottom console.log

0 hacks

So, the idea is to stop using Grafana and start using apache e-charts? That may be a bit drastic. It probably comes with it’s own challenges, just like Grafana does. Although the console log looks very nice!

:eyes: was not clear in my post but the image should have given you a hint. use the apache echart plugin in grafana.

Aha, now we’re talking… But what about the iFrame with my html page in it that needs to receive the time period? Can I put an iFrame in the Apache echart?

do you want to hack or do you want to thrive? look at the console I posted earlier. it has from to.

Start watching the youtube tutorials for this amazing plugin

Sorry, I’m not very proficient with this kind of stuff. Maybe you can give me some pointers? Oh, wait. Just read your additional text and video. Will watch it now!

The looks very good indeed. Will try tomorrow (it’s 20:00 local time now). Thanks for the idea!

1 Like

I finally got around to installing Apache Echarts and trying it.
Indeed I can log the start and stop times to the console and they change when I select a different time range!!
But the code is in a function body, so where can I find room to put my HTML into (like I can with a Text panel).
I guess I’m looking for a better text panel that can provide start and end times every time the user changes them…
I saw many examples on how to do this, but all of them only show the correct interval when OPENING the panel, not when the time range is adjusted by the user. So weird that it doesn’t provide this out-of-the-box. Doesn’t anybody use the time range in a text panel?

Turns out that I was betting on the wrong horse. It seems like the JSON panel (plugin) is a better choice for displaying external content. I’m trying it now…