I’m using Grafana version 10.0.2 on Windows 10 operating system.
I’m using the Bar gauge in my dashboard and for single row it’s not showing the labels. As you can see in the below screenshot for multiple rows it’s showing the left side labels but for single row it’s not showing that. I have attached the screenshots for multiple rows and single row.
Multiple rows
Single row
I want to show the label even for the single row as it’s showing only bar and from that it’s hard to say what it is all about.
I tried by adding the blank row to the SQL return statement so that it’ll at least show two row for single row return.
But, that is not working as expected. It’s showing black Bar Gauge at the end which is not the expected outcome
I want to show the labels even if there is single row in the Bar gauge.
4 Likes
This solution worked for me:
opened 06:27PM - 14 May 22 UTC
closed 09:21AM - 16 May 22 UTC
**What happened**:
In a bar gauge with a prom query like `sum(aobiz_cust_node_g… auge2{custtag=~"cnp"}) by (ostype)` the bar chart displays all 'ostype's in the proper format (ostype name, bar and value) when there is more than one 'ostype' to display. However, when there is only a single 'ostype' returned, the display name for the 'ostype' does not appear. For example, if all nodes for the dashboard are of ostype 'linux-rh7.9' that ostype name is not displayed in the chart.
**What you expected to happen**:
The ostype name should display in the bar chart. I believe it's the legend value that is not being displayed.
**How to reproduce it (as minimally and precisely as possible)**:
This is what the bar chart looks like when multiple 'ostypes' are returned from the query:
<img width="259" alt="image" src="https://user-images.githubusercontent.com/15000796/168443787-b9bad129-6d70-4300-8ff4-24b7a03433af.png">
This is what bar chart looks like when only one 'ostype' is returned from the query. Notice the name 'linux-rh7.9' is not displayed and the bar itself is not filled in):
<img width="259" alt="image" src="https://user-images.githubusercontent.com/15000796/168443816-d403a14c-9ed3-48c1-80de-acae42c0937f.png">
Return query:
<img width="496" alt="image" src="https://user-images.githubusercontent.com/15000796/168443913-5f4e3bc9-3582-4862-acf2-8eeeb47a8f2e.png">
**Anything else we need to know?**:
**Environment**:
- Grafana version: Version 8.5.2 (commit: 90701be19c, branch: HEAD)
- Data source type & version: prometheus, version 2.35.0
- OS Grafana is installed on: CentOS Linux release 7.9.2009 (Core)
- User OS & Browser: macOS Monterey 12.3.1 with FF or Chrome
- Grafana plugins: None