Tick label wrapping / truncation
native
Wrap or ellipsize long labels
Matrix status native. Verification runtime · strong. ChartKit option: ChartKitChartSpecV1.axes.x.labelWidth.
labelWidth and labelLines wrap tick labels on x, y, and y2, then ellipsize. Drawn on createRenderer([line]).
Source: packages/core/src/generated/schema.ts:1044
ChartKit spec
Passed validate() during npm run matrix:refresh. The SVG is the server render.
{
"version": "1",
"type": "line",
"data": [
{
"quarter": "Q1",
"units": 40
},
{
"quarter": "Q2",
"units": 55
}
],
"encoding": {
"x": "quarter",
"y": "units"
},
"a11y": {
"alt": "Units rose in Q2."
},
"size": {
"width": 640,
"height": 260
},
"axes": {
"x": {
"labelWidth": 48
}
}
}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: axis.ticks.wrap.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | partial | grep: callbackreturn arrays for multi-line | grep · weak | chart.js/dist/types/index.d.ts:1216 |
| Recharts | partial | XAxis.tickcustom tick component | types · strong | recharts/types/cartesian/XAxis.d.ts:101 |
| Apache ECharts | native | xAxis.axisLabel.overflow, xAxis.axisLabel.width | types · strong | echarts/types/dist/shared.d.ts:7917 |
| Highcharts | native | xAxis.labels.styletextOverflow ellipsis | types · strong | highcharts/highcharts.d.ts:108063 |
| Plotly.js | none | — | absence · absence | — |
| Nivo | partial | grep: renderTick | grep · weak | @nivo/axes/dist/types/types.d.ts:21 |
| Victory | partial | VictoryAxis.tickLabelComponent | types · strong | victory-core/lib/victory-theme/types.d.ts:56 |
| visx | partial | grep: Text@visx/text width wrapping | grep · weak | @visx/sankey/node_modules/@types/d3-shape/index.d.ts:6 |
| ApexCharts | native | xaxis.labels.trim, xaxis.labels.maxHeight | types · strong | apexcharts/types/apexcharts.d.ts:4913 |
| Tremor (npm) | unknown | — | conflict · unknown | — |
| Observable Plot | native | grep: lineWidth | grep · weak | @observablehq/plot/src/marks/text.d.ts:29 |
| Vega-Lite | native | grep: labelLimit | grep · weak | 1424: "labelLimit" |
| AG Charts | native | grep: wrapping | grep · weak | ag-charts-types/dist/types/src/chart/types.d.ts:52 |
| amCharts 5 | native | grep: oversizedBehavior | grep · weak | @amcharts/amcharts5/.internal/plugins/exporting/Exporting.d.ts:283 |
| Google Charts | native | grep: maxTextLines | grep · weak | @types/google.visualization/index.d.ts:542 |
| uPlot | none | — | absence · absence | — |
| TradingView Lightweight Charts | unknown | — | conflict · unknown | — |
| MUI X Charts | native | grep: tickLabelStyle | grep · weak | @mui/x-charts/constants/index.d.ts:14 |
| Mermaid (chart-ish diagrams only) | unknown | — | conflict · unknown | — |
| AntV G2 | unknown | grep: labelAutoEllipsis | unverified · unknown | — |