# How to sort pie chart

**URL:** <https://community.glideapps.com/t/how-to-sort-pie-chart/54647>\
**Category:** Ask for Help\
**Created:** [November 21, 2022, 8:56pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647 "2022-11-21T20:56:18Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [November 21, 2022, 8:56pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/1 "2022-11-21T20:56:18Z")

</div>

Is there a way to sort a pie chart the way to do it with inline lists? So only show the top 10 for example?

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 21, 2022, 9:07pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/2 "2022-11-21T21:07:05Z")

</div>

Is there not a limit feature for charts? If not, you’ll need to rank the items in your list and give them an index. Then filter the list where rank is less than 10.

Similar to my rank leaderboard concept:

> [@1st\_place\_medal2nd\_place\_medal3rd\_place\_medal Convert Number Score to Rankings in Glide!](https://community.glideapps.com/t/convert-number-score-to-rankings-in-glide/34103):
>
> Using a combination of new Glide Plugin Columns, you can now rank items based on a raw value (points, score, scale, etc.) [[Glide: Create a RANKED Leaderboard!] ](https://www.youtube.com/watch?v=QvNTzYx7tvI)

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [November 21, 2022, 9:10pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/3 "2022-11-21T21:10:39Z")

</div>

Yeah the limit is not the problem, it doesnt show highest to lower, but like this.  
 ![CleanShot 2022-11-21 at 22.09.03@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/f/6f692af637056a430ac9fec713a87f27b5d46f73.png)  
It feels logic to me that Glide does that sorting or gives you an option.  
I’ll see what I can do with your way of working, thanks.

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [November 21, 2022, 9:14pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/4 "2022-11-21T21:14:41Z")

</div>

create a sorted column for your chart data

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 21, 2022, 9:26pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/5 "2022-11-21T21:26:02Z")

</div>

Don’t charts allow you to sort?

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [November 21, 2022, 9:27pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/6 "2022-11-21T21:27:37Z")

</div>

I only see visibility and filter under options, not sort data.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 21, 2022, 9:28pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/7 "2022-11-21T21:28:08Z")

</div>

Ah…only Bar chart lets you sort.

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [November 21, 2022, 9:29pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/8 "2022-11-21T21:29:11Z")

</div>

How would you do that?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [November 21, 2022, 9:31pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/9 "2022-11-21T21:31:19Z")

</div>

create an array from your data… then use the sort array function… then break that array… or if you are using Google Sheets… simply use the SORT function

 ![Screen Shot 2022-11-21 at 5.56.04 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/7/a7f0f4921c4ae02154b1a6c52a6c0b4ec9aff7e1.jpeg)

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [November 21, 2022, 9:34pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/10 "2022-11-21T21:34:00Z")

</div>

When you configure you pie/radial chart, right panel, General tab, at the bottom (the section is called Options)": there you can limit the number of items displayed

 ![Screenshot 2022-11-21 at 22.29.29](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/6/06e298582fbcc87d881e213c679a8c5a26c965f5.png)

The items taken are the first n values of your table. You could sort your values as follows:

 ![Screenshot 2022-11-21 at 23.00.44](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/f/8fc3bd07eaf14282c0e8bd09cd0e844f0e06ce3e.png)

If you need a further explanation on which column types to use and how to generate RowIndex via RowIDs, don’t hesitate to ask.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 21, 2022, 9:34pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/11 "2022-11-21T21:34:01Z")

</div>

> [@Uzo](#):
>
> create an array from your data… then use the sort array function… then break that array

This ☝

This is what I showcase in the video above.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 21, 2022, 9:35pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/12 "2022-11-21T21:35:30Z")

</div>

@nathanaelb …you can simply use a single value column after you get the Row Index. Point the single value at the reverse array and then choose the Row Index in the “from start” field.

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [November 21, 2022, 9:35pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/13 "2022-11-21T21:35:49Z")

</div>

Thanks! You video helps, still feels complex for sorting of a list though 😉

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [November 21, 2022, 9:36pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/14 "2022-11-21T21:36:54Z")

</div>

I am going to try! Thanks.

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [November 21, 2022, 9:37pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/15 "2022-11-21T21:37:24Z")

</div>

Thanks! Will give it a go!

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [November 21, 2022, 9:40pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/16 "2022-11-21T21:40:31Z")

</div>

If you have a list of sales numbers (for instance) and display them in a chart, so far so good it’s a no brainer. Having to jump through all of these hoops to display a top n feels a little silly, but that’s how I would do it.

(Follow Bob’s advice: you can probably save yourself a column by using a single value column instead of the slice array column, thereby not needing to the RowNumber column.)

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [November 21, 2022, 9:58pm UTC](https://community.glideapps.com/t/how-to-sort-pie-chart/54647/17 "2022-11-21T21:58:14Z")

</div>

@Robert_Petitto @Uzo @nathanaelb Thanks all, I followed the whole route so learned some more about the Array section 😉 The weird thing is, after doing so and without changing anything Glide only showed the top list. Or Glide looks if there is a ranking column or I was the victim of a temporarily glitch … Thanks again!
