Sorting categories
native
Sort bars/categories by value or custom order
Matrix status native. Verification types · strong. ChartKit option: ChartKitChartSpecV1.sort.
sort by a field or by value, ascending or descending
Source: chartkit:packages/core/src/sort.ts:1
ChartKit spec
Passed validate() during npm run matrix:refresh. The SVG is the server render.
{
"version": "1",
"type": "bar",
"data": [
{
"lane": "A",
"stops": 12
},
{
"lane": "C",
"stops": 15
}
],
"encoding": {
"x": "lane",
"y": "stops"
},
"a11y": {
"alt": "Lane C has more."
},
"size": {
"width": 640,
"height": 260
},
"sort": {
"by": "value",
"order": "descending"
}
}Other libraries
Option names are the paths recorded in the matrix. A grep-only cell names the identifier that matched, not a render test. Markdown copy: data.sort.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | unknown | — | conflict · unknown | — |
| Recharts | unknown | — | conflict · unknown | — |
| Apache ECharts | native | dataset.transformsort transform | types · strong | echarts/types/dist/shared.d.ts:5304 |
| Highcharts | native | grep: dataSortingdataSorting.enabled | grep · weak | highcharts/options/zigzag.src.d.ts:404 |
| Plotly.js | native | layout.xaxis.categoryorder | types · strong | plot-schema.json#layout.layoutAttributes.xaxis.categoryorder |
| Nivo | unknown | — | conflict · unknown | — |
| Victory | native | VictoryBar.sortKey, VictoryBar.sortOrder | types · strong | victory-core/lib/victory-util/common-props.d.ts:13 |
| visx | unknown | — | conflict · unknown | — |
| ApexCharts | unknown | — | conflict · unknown | — |
| Tremor (npm) | unknown | — | conflict · unknown | — |
| Observable Plot | native | grep: sortmark sort option + scale domain sort | grep · weak | @observablehq/plot/src/mark.d.ts:2 |
| Vega-Lite | native | grep: SortField | grep · weak | 101: "AllSortString" |
| AG Charts | unknown | — | conflict · unknown | — |
| amCharts 5 | unknown | grep: sortBycategoryAxis sorting via data.sort | unverified · unknown | — |
| Google Charts | native | grep: sortColumn | grep · weak | @types/google.visualization/index.d.ts:169 |
| uPlot | unknown | — | conflict · unknown | — |
| TradingView Lightweight Charts | none | — | absence · absence | — |
| MUI X Charts | unknown | — | conflict · unknown | — |
| Mermaid (chart-ish diagrams only) | unknown | — | conflict · unknown | — |
| AntV G2 | native | grep: sortX | grep · weak | @antv/g2/lib/index.d.ts:45 |