# Kibana single bar spans the entire x-axis

**URL:** <https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148>\
**Category:** Kibana\
**Created:** [November 2, 2017, 9:00am UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148 "2017-11-02T09:00:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mad-max](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mad-max](https://discuss.elastic.co/u/mad-max)\
**Post date:** [November 2, 2017, 9:00am UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148/1 "2017-11-02T09:00:02Z")

</div>

Hi at All,

I would like to know if is it possible to select a bar of a barchartA; applying relative filters, and the size of the chart filtered remains of its original size, and NOT the bar spans the entire x-axis.  
For me is much important.  
Thank you very much for helping.

M.

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [November 3, 2017, 10:12am UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148/2 "2017-11-03T10:12:59Z")

</div>

Hi @mad-max,

this depends on the aggregation you are using on your x-axis. Could you maybe provide further details or a screenshot/drawing to illustrate the situation?

---

<div class="post-metadata">

**Author:** ![mad-max](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mad-max](https://discuss.elastic.co/u/mad-max)\
**Post date:** [November 3, 2017, 11:44am UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148/3 "2017-11-03T11:44:39Z")

</div>

HI a screenshot/drawing to illustrate the situation:

 ![Immagine1](https://us1.discourse-cdn.com/elastic/original/3X/9/d/9d653b1771e883f6c6fe8dc39c034000f3f51d5c.png)  
 ![Immagine2](https://us1.discourse-cdn.com/elastic/original/3X/f/f/ffab1739da503d901e3fbd6708b9082fb3ad84cc.png)

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [November 3, 2017, 4:06pm UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148/4 "2017-11-03T16:06:38Z")

</div>

It looks like you have a `Terms` bucket aggregation on your x-axis. The effect you are seeing comes from the fact that the x-axis is evenly divided among all terms returned by Elasticsearch. After applying the filter for a term, all other buckets are omitted by default because they are empty. You can tell Elasticsearch to still return the empty buckets by setting `{"min_doc_count": 0}` in the advanced "JSON input" of the bucket aggregation:

![image](https://us1.discourse-cdn.com/elastic/original/3X/9/4/94fd20ff17fd45d76903bb8f61fd483f91c5d966.png)

That should lead to Elasticsearch still returning the empty term buckets, which subsequently still take up space on the x-axis.

---

<div class="post-metadata">

**Author:** ![mad-max](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mad-max](https://discuss.elastic.co/u/mad-max)\
**Post date:** [November 3, 2017, 5:05pm UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148/5 "2017-11-03T17:05:34Z")

</div>

Hi thanks for the answer with just the bouquet is perfect but i also use the split series and at this point the result is like the image and it is occupied half of the axis x the worse is if i use the stacked bar as the graph after l 'The filter application is empty.  
M

 ![Immagine1](https://us1.discourse-cdn.com/elastic/original/3X/1/9/1998683abf69aae3dd1121e4ba269a1e3fb76bf8.png)

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [November 3, 2017, 5:40pm UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148/6 "2017-11-03T17:40:25Z")

</div>

Have you added the `min_doc_count` setting to the first bucket aggregation as well?

---

<div class="post-metadata">

**Author:** ![mad-max](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mad-max](https://discuss.elastic.co/u/mad-max)\
**Post date:** [November 4, 2017, 4:03pm UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148/7 "2017-11-04T16:03:27Z")

</div>

Hi yes i do  
now the sceenshot  
 ![Immagine0 4-11](https://us1.discourse-cdn.com/elastic/original/3X/f/a/fa24bb3d1fd009ab4210bc1dcefc07c4144e1a8f.png)

 ![Immagine1 7-11](https://us1.discourse-cdn.com/elastic/original/3X/3/9/3940a5570f640e96fca36dfcf1f2cb2aa12b5f68.png)  
 ![Immagine2 4-11](https://us1.discourse-cdn.com/elastic/original/3X/e/1/e1b7d8fb6aee3f3144e40a306e7508afb871ad55.png)  
what I'm doing wrong?

M

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [November 6, 2017, 11:07am UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148/8 "2017-11-06T11:07:00Z")

</div>

Hm, your screenshot shows that the second aggregation does not have the `min_doc_count` setting applied. Try setting it on both aggregations.

---

<div class="post-metadata">

**Author:** ![mad-max](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mad-max](https://discuss.elastic.co/u/mad-max)\
**Post date:** [November 6, 2017, 2:31pm UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148/9 "2017-11-06T14:31:47Z")

</div>

HI it's ok.  
thank you very much.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 4, 2017, 2:32pm UTC](https://discuss.elastic.co/t/kibana-single-bar-spans-the-entire-x-axis/106148/10 "2017-12-04T14:32:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
