Stacking groups within the bar chart

  • What Grafana version and what operating system are you using?

  • What are you trying to achieve?
    In a Bar Graph I am displaying data from a PV system grouped by days ofver the course of a month.
    Some Bars represent incoming energy from different sources (PV and public network), others show consumption (Washing machine, Dryer, Lights, whatever).

I would like to have the bars stack in two groups so there is one bar that includes all sources stacked and one bar that show consumption by the individual devices for each day of the month.

  • How are you trying to achieve it?
    I was hoping there would be a similar mechanism to the Time Series Panel where stacking groups A.B,C can be applied in override properties, but that is not the case (yet?)

If this feature is not possible at the moment I think it would make a great addition to the bar graph panel


What is your datasource and could you please provide sample data?

My datasource is influxDB.
I’m not sure how I can provide sample data so at first here are some screenshots of the panel I am working on at the moment:

There is a lot going on here, so I will try to narrow it down a bit:
Some data is based on simple counters (energy meters) that always increase so I used the queries shown in the picture to extract the difference of the value from one day to the next to get the amount that was generated/consumed for each day.

As you can see in the graph having many values to show for each day of the month results in narrow individual bars which looks a little confusing.

since some of these bars represent incoming energy while others represent outgoing energy it would be nice to group and stack them. So for example I might want to stack “Netzbezug” (Energy received from the network) on top of “PV production” (Energy produced by the solar panels) to form a bar that shows all incoming energy.
Another stack could be “Verbrauch” (Energy consumed) and “Einspeisung” (Energy overhead that was returned to the public network).
In this special case the stack of incoming energy would be the same height as the stack of consumed/exported energy.

Heres a little drawing of what I would hope the result to look like.
I think a good solution from a usability perspective would be to not only allow stacking to be turned on or off (or 100%) but allow to assign stacking groups to queries.
So in this example I would assign Netzbezug and PV Produktion to Stacking Group A and Verbrauch and Einspeisung to Stacking Group B and the result would look like this:


1 Like