What Grafana version and what operating system are you using?
Grafana v11.3.0 on MacOS 15.1
What are you trying to achieve?
I’m trying to create a stacked bar chart where unique values on the bucket field are displayed along the x-axis, and different channel values for each bucket are stacked on top of each other.
How are you trying to achieve it?
I’m running a query against a Prometheus data source that returns metric points with three fields:
sum by(bucket, channel) (cdh_nba_optionality_requests_total{instance=~"$instance", direction="Inbound", subject_type="all_subject_types", strategy=~"$strategy"})
bucket, channel, and metric count. I want to configure the panel to display unique bucket values on the x-axis, with each channel stacked within its corresponding bucket.
What happened?
Currently, the graph is duplicating the bucket values along the x-axis instead of stacking them. Each channel is represented as a separate bar next to other bars of the same bucket value, rather than stacking within the same bucket.
What did you expect to happen?
I expected the graph to show each bucket value only once on the x-axis, with the channel values stacked on top of each other within that bucket.
Images:
Current graph showing duplicated bucket values on the x-axis.
The table view of the same data.
Other transformations applied on the chart: