Variables in panel options

Are variables still not supported in panel options? I am trying to use a variable to set a min and a max for a graph but the variable appears to not be read.

Hi @kevin43d4,

Maybe if you can share some more information e.g. what datasource you are using and the best will be some screenshots to get more clarity.

Here are some screen shots showing me entering a 0.2 for my mininum scale value and it working, however, if the scale variable is used which is set to 0.2 it ignores it completely.






Thanks for the screenshots as it was helpful to understand it better.

A few questions to go further:

1- What Grafana version are you using?

Because I am using ver. 9 and I cannot put the $scale variable in the Min field on the right side of the options.

2- Can you reproduce this on https://play.grafana.com/ and share the details here so that we can know further?

I am using Grafana 9.1 now, same issue

I have duplicated the issue in play.grafana.com. Basically just added a variable with a text box called scale. The reference the variable in the title of one of the graphs and that works perfectly. If I enter $scale as a min or max, the graph does not change. It is ignored.

Can you share the dashboard link, the one you created at play.grafana.com ?

Hi @kevin43d4,

So, I again tried to reproduce it on a time-series panel but the same thing as I still cannot insert this $scale variable as a min or max.

You wrote to use the text box called as scale which I cannot understand as how exactly you achieved it.

Maybe if you can share like a small video screencast (or like a .gif) which tells the steps of reproduction.

instead of it saying auto I just type $scale. Are you saying it won’t let you type it or it ignores it?

I think I m missing one of your key steps i.e. how you are exactly adding this:

Maybe share a screenshot or as previously said a small screencast so that can understand as maybe I am not exactly following it while you can still reproduce it on play.grafana.com

quick update, so I created this variable inside the dashboard as scale.

But still cannot copy/paste or manually type $scale in the “Standard Options” → Min as it only allows numerical values + or - or default to auto.

Any workaround or something else on that ?
I want to have a min/max based on the result of a query for several panels (i.e: each panel will contain a part of the result of the query so i can’t use “auto”).

You should be able to do what you want via the tranformation “Config from query resut”. You can set thresholds, min, max and others from query that is the same panel where the data has to be visualized. for exmaple, you could set a max = 110% of the max value of a time-series obtained by another query in the same panel. Not the best use-case, but I hope you got my point.

I got the same issue as @kevin43d4 , I tried to use variables values as the Standard Options > Max, and the variables got ignored or not taken.
I’m using them as $variable
Is this supported? I’m using Grafana v.10.1.0
It should be great to allow using the variables for this panel options.

Hi @alvarorey

Then it seems that this feature is not yet supported in Grafana.

We would appreciate it if you can open a feature-request report about this in our official GitHub repository using this link.

Provide all the information (you can simply copy/paste your data + screenshot from here to there).

Lastly, paste the link to your feature request here in this post so that all other community users can also track it. I will also add more additional information to it :+1: