Bar Gauge doesn't update width when variable is changed and all updated values are 0

  • What Grafana version and what operating system are you using?
    Version 7.5.15 and Windows.

  • What are you trying to achieve?
    Bar Gauge width should update when variable is changed and all values are 0.

  • How are you trying to achieve it?
    I have used query to fetch data for different duration and using Bar gauge visualization to display it.

  • What happened?
    Visualization when default variable is selected :

    Visualization when variable is updated/changed and all updated values are 0:

  • What did you expect to happen?
    Visualization should have changed to the following image when variable was changed.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    N/A

  • Did you follow any online instructions? If so, what is the URL?
    N/A

You can consider this approach to solve your problem; it may prove helpful for you.
Step : 1 Force Panel Refresh
Click on the panel title → select Refresh.
Or change the time range (top-right corner) slightly, e.g. from “Last 7 days” to “Last 8 days”.
See if bar widths reset properly when values are zero.
If it works, then it’s a rendering refresh issue.

Step 2: Set Fixed Min/Max in Bar Gauge
Bar Gauge auto-calculates min/max based on data. When values are all 0, it can’t calculate width correctly.
Bar Gauge panel>Panel settings >Field >Standard options.
Scroll to Min and Max
Set Min = 0
Set Max = fixed value (e.g. 10 or whatever your typical max range is).
This forces the bars to scale consistently, even if all values are 0.


Step 3: Add Transparent Threshold or Placeholder

If you want the bars to still show (even if value is 0), use a threshold color or add a small placeholder value like 0.001:

In Thresholds, add a color range for 0–1 /SQL query, use:

IF(value = 0, 0.001, value) AS adjusted_value

This ensures the bar always renders.


Step 4: Upgrade Grafana if you use older version

Grafana 7.5.15 is very old (released in early 2022). These bugs are fixed in later versions.

Step 5: Debug Panel JSON

panel title → Inspect → Panel JSON
Check if the data source returns correct updated 0 values when the variable changes.
If data is correct, then it’s 100% a visual rendering issue.

final output look like:

Hello @rach1tdani,
Just checking in—did this solution resolve your issue, or are you still experiencing the same problem?