and I’m trying to get a stacked bar chart that looks similar to this:
I’m having a hell of a time figuring out any way to do it. Any chance someone could help me out? So far the best I can get is all of the bars lined up next to each other:
Ah, it looks like I just can’t stack series data. Found the popular 3-year-old github issue:
I agree with the commentators there that this seems like a no-brainer feature to implement (stacking series data by metric) and am quite surprised no support has been added for it in the 3 years since that issue was opened.
Hi jceddy, I am trying to run a query for this visualization(grouped bar chart) but some how it is now processing all the values. Eg My query o/p on work bench is fine but I am getting lesser data on grafana. I am attaching my code and o/p screenshots. Please guide me.
Thanks in advance.
I’m using Grafana 8.2.5, have installed this plugin in my Grafana’s plugin directory after that I have restarted the Grafana Server but still plugin is not visible on console.
this is the example: Grafana
just edit it and change Stacking to Normal
according document about bar chart https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/bar-chart/, stacking bar chart is a grouped bars.
Only one data frame is supported and it must have at least one string field that will be used as the category for an X or Y axis and one or more numerical fields.
If you have more than one numerical field the panel will show grouped bars.
I am using AWS Athena data source. Just group by a, b won’t create a stacked bar chart. You need 1 column as string and 2 or more columns for numbers. You can use count_if or CASE WHEN to count the number for second dimension. I don’t know whether there is a better solution. If there are a lot of unique values for the dimension, you have to create many columns,e.g.
select os,
count_if(platform='amd64') as amd,
count_if(platform='arm64') as arm
from cte group by os