order
Input Stack:
|
⇨ | Output Stack:
|
Specify the sort order to use when :sort is applied to time series results. This controls whether series appear in ascending or descending order based on the sort criteria. The order setting affects the visual arrangement of lines in legends and the stacking order for area charts.
Parameters¶
- expr: The time series expression to apply ordering to
- ordering: Sort direction - either
asc
(ascending, default) ordesc
(descending)
Supported Values¶
asc
- Ascending order (smallest to largest)desc
- Descending order (largest to smallest)
If no order is specified, asc
is used by default.
Examples¶
Default ascending order when sorting by max:
Before | After |
name,sps,:eq, :sum, (,nf.cluster,),:by, max,:sort | name,sps,:eq, :sum, (,nf.cluster,),:by, max,:sort, asc,:order |
Changing to descending order (highest values first):
Before | After |
name,sps,:eq, :sum, (,nf.cluster,),:by, max,:sort | name,sps,:eq, :sum, (,nf.cluster,),:by, max,:sort, desc,:order |
Related Operations¶
- :sort - Sort time series (order specifies direction)
- :by - Group data for sorting
- :limit - Limit results after sorting
Since: 1.5