Primary capabilities we expect from this feature
- Sorting data by metrics when underlying API does not offer a sort (see cases below)
- Legend sorting
User story
Sort order affects the understanding of the data, but not all charts allow custom sorting. This is a frequently-requested feature when users run into one of the aggregation limits of Elasticsearch. Here are some example use cases and limitations:
Sorting data by metrics / methods underlying API does not offer
- Metric sort - Changing the filter order based on the count or other metric
- Metric sort, percentiles - Sorting terms by percentiles
- Metric sort - formula/columnwise math: Sorting based on a calculation, for example sorting by derivative
- Explicit sort Assigning a predefined order to Terms based on a list of known terms
- Offering sort using both axis - Sorting both axes of a heatmap by ascending order, not just one
- Sorting on both categorical groupings independently. Occurs in 1) heatmaps 2) mosaic 3) grouped bars 4) pie/donut
Sorting the legend separately from visualization
- Legend metric sort - sorting the vis on metric but legend alphabetically
- Explicit legend sort - assigning a predefined order to Terms based on a list of known terms
Example before and after
This visualization is using math to calculate the "max - min" value per bar. The natural sort order is not helpful, so we actually want to apply client-side sorting based on the number displayed:

Proposed functionality
Each dimension will offer an advanced setting that does client-side sorting, visible in the flyout editor. This setting would be called "Sort override" and have the options "No override", "Ascending" and "Descending". Numbers and dates would be sorted based on the raw value, and all other types would be sorted based on the formatted value.
Primary capabilities we expect from this feature
User story
Sort order affects the understanding of the data, but not all charts allow custom sorting. This is a frequently-requested feature when users run into one of the aggregation limits of Elasticsearch. Here are some example use cases and limitations:
Sorting data by metrics / methods underlying API does not offer
Sorting the legend separately from visualization
Example before and after
This visualization is using math to calculate the "max - min" value per bar. The natural sort order is not helpful, so we actually want to apply client-side sorting based on the number displayed:
Proposed functionality
Each dimension will offer an advanced setting that does client-side sorting, visible in the flyout editor. This setting would be called "Sort override" and have the options "No override", "Ascending" and "Descending". Numbers and dates would be sorted based on the raw value, and all other types would be sorted based on the formatted value.