Grafana Stacked bar chart

I am trying to create a stacked bar chart in Grafana, but it turns out that the values of the different queries are overlapping each other rather than being stacked on top of each other.

Is there somewhere a visualization that supports stacked bar charts or do I somehow need to create a series of queries where the different values are added up? if so what is the best way to do so?

Thanks Tom, just what I needed to know

SELECT mean(“brightness”) FROM “autogen”.“state” WHERE (“entity_id” = ‘shellydimmer2_40f520014e14’) AND $timeFilter GROUP BY time($__interval) fill(null)

This is my query that works for most charts #except bar chart so how did you make it …?