# Hiding legend label when no data

**URL:** https://discuss.elastic.co/t/hiding-legend-label-when-no-data/186541
**Category:** Kibana
**Created:** [June 19, 2019, 8:35pm UTC](https://discuss.elastic.co/t/hiding-legend-label-when-no-data/186541 "2019-06-19T20:35:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![littlexsparkee](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@littlexsparkee](https://discuss.elastic.co/u/littlexsparkee)
#### Post date: [June 19, 2019, 8:35pm UTC](https://discuss.elastic.co/t/hiding-legend-label-when-no-data/186541/1 "2019-06-19T20:35:34Z")

</div>

I tried using {"min\_doc\_count":1} in the JSON input section to hide labels for a bar chart but when I pressed save, I got an Internal Service Error message.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/0/b0ed8c78b4f7b4f235949181ad11a1706d59390d.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/1/0108b74ade8408dc1bb3c0459609f2a8ec1c9f08.png)

Ideally what should happen is the legend labels disappear for categories with no data and the data for the remaining labels is centered on the x-axis instead of space still being allocated for the remaining categories. Thanks in advance.

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [June 19, 2019, 9:22pm UTC](https://discuss.elastic.co/t/hiding-legend-label-when-no-data/186541/2 "2019-06-19T21:22:45Z")

</div>

Hmm, could you share a screenshot of your chart configuration (along with the json input)?

---

<div class="post-metadata">

### Author: ![littlexsparkee](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@littlexsparkee](https://discuss.elastic.co/u/littlexsparkee)
#### Post date: [June 19, 2019, 10:07pm UTC](https://discuss.elastic.co/t/hiding-legend-label-when-no-data/186541/3 "2019-06-19T22:07:48Z")

</div>

Here you go - let me know if there's anything else you need  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5d4d9f328f08fc6eef78f1033a6c213eae759d04.png)

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [June 19, 2019, 10:18pm UTC](https://discuss.elastic.co/t/hiding-legend-label-when-no-data/186541/4 "2019-06-19T22:18:47Z")

</div>

The average aggregation doesn't support `min_doc_count`. Maybe you are meaning to include that in your buckets aggregation instead?

---

<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: [July 17, 2019, 10:18pm UTC](https://discuss.elastic.co/t/hiding-legend-label-when-no-data/186541/5 "2019-07-17T22:18:53Z")

</div>

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