Label collision avoidance
native
Hide or move overlapping labels
Matrix status native. Verification runtime · strong. ChartKit option: ChartKitChartSpecV1.mark.labels.
A label whose box overlaps one already drawn is skipped. No separate option.
Source: packages/core/src/glyphs.ts:39
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
},
"mark": {
"labels": true
}
}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: label.collision.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | plugin | —display:'auto' | npm · weak | — |
| Recharts | none | — | absence · absence | — |
| Apache ECharts | native | series.labelLayout, series.avoidLabelOverlap | types · strong | echarts/types/dist/shared.d.ts:8361 |
| Highcharts | native | plotOptions.series.dataLabels.allowOverlap | types · strong | highcharts/options/series.d.ts:143 |
| Plotly.js | native | layout.uniformtext | types · strong | plot-schema.json#layout.layoutAttributes.uniformtext |
| Nivo | native | Bar.labelSkipWidth, Bar.labelSkipHeight | types · strong | @nivo/bar/dist/types/types.d.ts:159 |
| Victory | unknown | — | conflict · unknown | — |
| visx | none | — | absence · absence | — |
| ApexCharts | unknown | — | conflict · unknown | — |
| Tremor (npm) | none | — | absence · absence | — |
| Observable Plot | native | grep: dodge | grep · weak | @observablehq/plot/src/index.d.ts:51 |
| Vega-Lite | none | — | absence · absence | — |
| AG Charts | native | grep: avoidCollisions | grep · weak | ag-charts-types/dist/types/src/presets/gauge/linearGaugeOptions.d.ts:70 |
| amCharts 5 | native | grep: oversizedBehavior | grep · weak | @amcharts/amcharts5/.internal/core/render/scene/SceneNode.d.ts:186 |
| Google Charts | unknown | — | conflict · unknown | — |
| uPlot | none | — | absence · absence | — |
| TradingView Lightweight Charts | none | — | absence · absence | — |
| MUI X Charts | none | — | absence · absence | — |
| Mermaid (chart-ish diagrams only) | unknown | — | conflict · unknown | — |
| AntV G2 | native | grep: overlapHide | grep · weak | @antv/g2/lib/index.d.ts:165 |