# Pie chart least used

**URL:** <https://discuss.elastic.co/t/pie-chart-least-used/328686>\
**Category:** Kibana\
**Created:** [March 28, 2023, 8:06am UTC](https://discuss.elastic.co/t/pie-chart-least-used/328686 "2023-03-28T08:06:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alice\_Ionescu](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@Alice\_Ionescu](https://discuss.elastic.co/u/Alice_Ionescu)\
**Post date:** [March 28, 2023, 8:06am UTC](https://discuss.elastic.co/t/pie-chart-least-used/328686/1 "2023-03-28T08:06:28Z")

</div>

Hello,  
I am trying to create a pie chart with the least 10 used permissions.  
I am trying this  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/c/9c80d959e7328f1c36008cd2841907fc516c37ab.png)

But it does not give me the correct number of users for each permission. I am getting only 1.

How can I create a visualization to display the least used permissions?

Thanks!

---

<div class="post-metadata">

**Author:** ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)\
**Post date:** [March 28, 2023, 8:20am UTC](https://discuss.elastic.co/t/pie-chart-least-used/328686/2 "2023-03-28T08:20:05Z")

</div>

Hey @Alice_Ionescu, your configuration seems ok to me. Which are the available terms (permissions) for this specific timerange? (You can check in Discover)

---

<div class="post-metadata">

**Author:** ![Alice\_Ionescu](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@Alice\_Ionescu](https://discuss.elastic.co/u/Alice_Ionescu)\
**Post date:** [March 28, 2023, 10:08am UTC](https://discuss.elastic.co/t/pie-chart-least-used/328686/3 "2023-03-28T10:08:11Z")

</div>

There are a lot.

But when I give a year as timeframe I am getting 1 user for each permission (10 permissions in total).

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

But if I filter on one permission I can see I have 2 users assigned on that specific permission (the timeframe is the same)

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

So I would have expected that for an year as a timeframe, and no permission selected I would see also 2 users for that permission

---

<div class="post-metadata">

**Author:** ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)\
**Post date:** [March 28, 2023, 10:48am UTC](https://discuss.elastic.co/t/pie-chart-least-used/328686/4 "2023-03-28T10:48:48Z")

</div>

I see, as mentioned on the ES documentation the terms aggregation can return wrong results if the non-default order is used [Terms aggregation | Elasticsearch Guide [8.6] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/f/ff815b2d7e5e4bf6fc98f179d42ca18c97432a76.png)

If you create this chart in Lens, you can turn on the accuracy setting that will render more accurate results.

---

<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:** [April 25, 2023, 10:49am UTC](https://discuss.elastic.co/t/pie-chart-least-used/328686/5 "2023-04-25T10:49:13Z")

</div>

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