-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plot is not refreshed on variable change #359
Comments
@denglerchr Thank you for your question. A possible solution could be adding a new simple query that will track the variable's value. Every time the value of a variable changes - this will trigger a data change and a panel change But in that case, you can use the value directly from the data. const title = context.panel.data.series.find(s => s.name === 'Variable').fields[0].values[0]
const options = {
title: { text: title }, Let me know if this is a workable solution for you |
@denglerchr As Vitali replied, because of the multiple optimizations in the Grafana v11 dashboards, variable updates don't trigger panel rerenders. One of the solutions is to use variable in the data source which will cause panel to rerender. |
Hello together, yes your solution worked fine, thanks! I used the testdata datasource and entered my variables there, now the refresh works. |
this will change soon :) we're going to add universal variable interpolation to all panel options and fieldConfig the same way we just did transforms: grafana/grafana#100225 |
@denglerchr Thank you for confirming. |
Im using your great panel, but am having an inconvenience. Basically I use several variables in the code to change the look of the graph.
However, on changing the variable, the graph is not refreshing, unless I also refresh the dashboard. Attached an example based on the default code in the panel, I just added a "MyTitle" variable.
Upon changing the MyTitle variable, the title isnt updated. Only upon refreshing the dashboard, the title is finally updating. It would be nice, if it updates immediately.
The text was updated successfully, but these errors were encountered: