# Histograms for multiple series in one graph panel

**URL:** <https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249>\
**Category:** Time Series Panel\
**Tags:** postgres\
**Created:** [March 19, 2018, 6:32pm UTC](https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249 "2018-03-19T18:32:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vedrana](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@vedrana](https://community.grafana.com/u/vedrana)\
**Post date:** [March 19, 2018, 6:32pm UTC](https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249/1 "2018-03-19T18:32:52Z")

</div>

Hi! I would like to create a graph that shows histograms of more then one series on the same plot, but not grouped together, I want to see histograms overlay. Right now data from both series is grouped together in one histogram.  
Also, I would like to be able to hide/unhide a particular series with a simple click.  
Is that possible?  
I’m using Postgresql data.

Thanks!

---

<div class="post-metadata">

**Author:** ![anon34853223](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@anon34853223](https://community.grafana.com/u/anon34853223)\
**Post date:** [April 23, 2018, 1:01pm UTC](https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249/2 "2018-04-23T13:01:48Z")

</div>

Hi,

When you say histogram you want to have non-time values on X-Axis? You can use X-Axis mode histogram and then under Display tab enable Stack. This works for me using the nightly build / latest master commit at least.

Marcus

---

<div class="post-metadata">

**Author:** ![michalk](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@michalk](https://community.grafana.com/u/michalk)\
**Post date:** [January 24, 2019, 12:41pm UTC](https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249/3 "2019-01-24T12:41:02Z")

</div>

Hi, I am not able to get this to wokr.

I have my test data in MySQL table:

![image](https://us1.discourse-cdn.com/grafana/original/2X/f/fb1871e14e01abcf01b606c5cca20c6fc39b2e38.png)

X-axis should have BINs on and histogram should show stacked VALUE for each CLASS.  
Could you please advise me how should the query for my table look like and what should be the settings?

Thank you in advance,  
Michal

---

<div class="post-metadata">

**Author:** ![anon34853223](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@anon34853223](https://community.grafana.com/u/anon34853223)\
**Post date:** [January 24, 2019, 2:10pm UTC](https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249/4 "2019-01-24T14:10:24Z")

</div>

It must be a [time series query](http://docs.grafana.org/features/datasources/mysql/#time-series-queries). If you don’t have a timestamp in your data you may be successful selecting now/current date or similar in epoch format.

---

<div class="post-metadata">

**Author:** ![michalk](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@michalk](https://community.grafana.com/u/michalk)\
**Post date:** [January 25, 2019, 7:12am UTC](https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249/5 "2019-01-25T07:12:37Z")

</div>

thanks for your replay, I have time\_sec derived from now() in the query:

SELECT  
UNIX\_TIMESTAMP(NOW()) as time\_sec,  
MAX(VALUE) as value  
,CONCAT(BIN) as metric  
FROM test GROUP BY BIN, CLASS;

However I am not able to get class stacked on each other:

 ![Capture2](https://us1.discourse-cdn.com/grafana/original/2X/0/09dc3da68fe477bc43333fbfec319f23458d3b94.png)

---

<div class="post-metadata">

**Author:** ![anon34853223](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@anon34853223](https://community.grafana.com/u/anon34853223)\
**Post date:** [January 25, 2019, 2:33pm UTC](https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249/6 "2019-01-25T14:33:44Z")

</div>

Sorry stacked is not supported in Series X-Axis Mode, only Time and Histogram X-Axis Mode supports stacked.

---

<div class="post-metadata">

**Author:** ![michalk](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@michalk](https://community.grafana.com/u/michalk)\
**Post date:** [January 28, 2019, 7:05am UTC](https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249/7 "2019-01-28T07:05:17Z")

</div>

Could you please show me example of data and query that actualy produces stacked serries histogram. Either for Time or Histogram X-Axis mode? Thank you in advance.

---

<div class="post-metadata">

**Author:** ![anon34853223](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@anon34853223](https://community.grafana.com/u/anon34853223)\
**Post date:** [January 28, 2019, 1:18pm UTC](https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249/8 "2019-01-28T13:18:50Z")

</div>

The only X-Axis Mode supporting showing something else (bins in your example) than time on X axis is Series mode which don’t support stacking.

---

<div class="post-metadata">

**Author:** ![hofo](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@hofo](https://community.grafana.com/u/hofo)\
**Post date:** [October 31, 2019, 10:14am UTC](https://community.grafana.com/t/histograms-for-multiple-series-in-one-graph-panel/6249/9 "2019-10-31T10:14:59Z")

</div>

Hello I have the same problem. Is this bug still not resolved? Why is time important for histograms? My data has also no timestamp. It has only different classes and a sample with values for each class.
