Stacked Bar Chart from Table Values

I have some MS SQL data that looks like this (after aggregations):

time       metric Revenue    Cost       Profit
1569909600 Sub1   177.345600 159.611040 17.734560
1569909600 Sub2   187.166900 168.450210 18.716690
1569909600 Sub3   209.718500 188.746650 20.971850

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.

Looks like this plugin might work for me:

1 Like

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.

1 Like