Hello everyone,
I’m working on a Grafana dashboard and need to dynamically adjust the line width of a time series based on a user-controlled filter. Here’s what I’m aiming to achieve:
Filter: Add a dropdown or toggle that allows users to select true
or false
.
Dynamic Line Width:
When the filter is set to true
, set the line width to 1
.
When the filter is set to false
, set the line width to 0
What I’ve Tried:
- Created a Variable:
Name:lineWidthFilter
Type: Custom
Values:true, false
- Configured Field Overrides:
Override 1:
Fields with name: (removed for privacy)*
*Line Width:1
Override 2:
Fields with name: (removed for privacy)
Line Width:0
Issue: Both overrides are applied simultaneously, causing conflicting line widths. I want the line width to toggle between 1
and 0
based on the lineWidthFilter
variable within the same panel.
Constraints:
Single Panel: Prefer to manage this within one panel without creating duplicates.
No Query Changes: Solution should utilize Grafana’s UI features like variables and overrides without modifying the data query.
Questions:
- Is it possible to conditionally apply field overrides based on a dashboard variable within a single Grafana panel?
- If so, how can I set up the overrides or use other Grafana features (like transformations or expressions) to achieve dynamic line width based on the
lineWidthFilter
variable? - Are there any recommended workarounds or best practices for this scenario with Grafana’s current capabilities?