For fields with a string
data type, you can specify a field to sort on and the sort order.
To encode sorting data:
Use the Sort By dropdown in the Chart Builder to sort chart data by:
Category
Value
Series field (for multi-series charts)
If you sort a multi-series chart generically by Value without sorting by a specific series, MongoDB Charts sorts your data based on the sum of all values in your series.
To toggle between ascending or descending sort order, click the
a-z
button to the right of the Sort By dropdown.By default, Charts sorts data based on Value in descending order.
To learn more, see Sort Data.