Sorting and setting a maximum number of results, or pagination within a chart

Hi,

I have a custom transformer setup which provides a big array of objects. On the X axis of my bar chart, I want to display one of the properties (there could be thousands of these). On the Y axis, I want to display the number of occurrences. I want to group by another property on the object (there could be three of four of these).

Please see a screenshot of the chart as it stands below.

What I want to do, is sort the results by their most occurring to the least, and then display only the top 10 results on the graph. What's the best way to do this please?

Thanks in advance :slight_smile:

@HorizonApp

Hey there :wave: Thanks for reaching out! For your use case I would recommend sorting this data in a transformer and only passing in the data you want displayed to the chart. Within the chart you can aggregate data, group data, etc but not omit values. Hope that helps!