How to use dashboard variable in timeseries panel type Min/Max fields

Hi all,

I’m trying to make the Y-axis Min/Max of a Time series panel controllable via a dashboard variable, so an external embedding context (an iframe with a query-string-driven var-y_min/var-y_max) can set the axis bounds dynamically without editing the panel each time.

Setup:

  • Grafana v13.0.2 (3fcdbc5a)
  • Dashboard uses the newer schema (kind/spec based dashboard JSON, not the legacy panels[] array)
  • Two dashboard variables defined: y_min and y_max, both type “Textbox”
  • Panel: Time series, under Field → Standard options → Min / Max

What I tried:

  1. Editing the panel JSON directly to set "min": "${y_min}" and "max": "${y_max}" inside fieldConfig.defaults. After reloading the dashboard, the Standard options → Min/Max fields in the panel editor show empty (“auto”) — the variable string was not retained.
  2. Trying to type ${y_min} directly into the Min field in the panel editor UI: the field does not accept the input at all (appears to be a strict numeric-only input, rejects $, {, }).
  3. Setting the variables to plain numbers (e.g. y_min=20, y_max=30) via the dashboard’s variable dropdowns at the top, then checking the panel — axis remains on “auto” (0–3000ish, calculated from data), confirming the variable substitution never reaches the Min/Max fields.

Question: Is there a supported way to bind a Time series panel’s Y-axis Min/Max to a dashboard variable in current Grafana (v13), or is this field intentionally restricted to static numeric values only? If it’s not supported on Min/Max directly, is there a recommended alternative (e.g. a transform, a hidden series that forces the axis range, or a different field/override mechanism) to achieve a variable-driven Y-axis range?

Happy to share the full panel JSON if helpful.

Thanks!

Create additional query in the panel (that one can use dashboard variable eventually), which will return min/max value and then use it the transformation Config from query result to set panel’s min/max:

It is not straightforward as your idea, but it should work.

I tested the suggested workaround on Grafana v13.0.2 and can confirm it works in my environment.

Direct variable interpolation in the Time series panel’s Standard options → Min/Max fields does not appear to be supported. Attempts to use ${variable} in those fields were not retained by the panel and the axis continued to use auto-scaling.

However, I was able to achieve variable-driven Y-axis limits using Config from query results.

Created two dashboard Textbox variables: y_min and y_max
Added a secondary query returning:

SELECT ${y_min} AS min_value, ${y_max} AS max_value

Added the Config from query results transformation
Selected the secondary query as the config source

Mapped:

  • min_value → Min
  • max_value → Max

After applying the transformation, changing the dashboard variables dynamically updated the Time series Y-axis range without editing the panel.

  • y_min=20, y_max=30 → Y-axis range became approximately 20–30
  • y_min=100, y_max=200 → Y-axis range became approximately 100–200


So while direct variable binding in Standard options → Min/Max does not appear to be supported, the Config from query results transformation provides a working workaround for dynamic Y-axis bounds.