How to Filter Top N results in MongoDB Charts

I’ve created a bar chart but it has more than 50 bars.

I’d like to filter only the top 10 bars, or create an ‘Others’ category.

If I try to add a [{ “$limit”: 10 }] filter, it affects only the raw documents, not the bars.

Does anybody know how to do it?

Hi @Roberto_de_Oliveira!

In most cases you can achieve this by using the “Limit Results” option shown on the field card mapped to the category axis. Does this work for you?

Tom

Jezz!!! How did I miss that?! Thank you very much!

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