Features · label

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.

Units rose in Q2.Units rose in Q2.405540455055Q1Q2
{
  "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.

LibraryStatusOptionVerificationSource
Chart.jsplugin—display:'auto'npm · weak—
Rechartsnone—absence · absence—
Apache EChartsnativeseries.labelLayout, series.avoidLabelOverlaptypes · strongecharts/types/dist/shared.d.ts:8361
HighchartsnativeplotOptions.series.dataLabels.allowOverlaptypes · stronghighcharts/options/series.d.ts:143
Plotly.jsnativelayout.uniformtexttypes · strongplot-schema.json#layout.layoutAttributes.uniformtext
NivonativeBar.labelSkipWidth, Bar.labelSkipHeighttypes · strong@nivo/bar/dist/types/types.d.ts:159
Victoryunknown—conflict · unknown—
visxnone—absence · absence—
ApexChartsunknown—conflict · unknown—
Tremor (npm)none—absence · absence—
Observable Plotnativegrep: dodgegrep · weak@observablehq/plot/src/index.d.ts:51
Vega-Litenone—absence · absence—
AG Chartsnativegrep: avoidCollisionsgrep · weakag-charts-types/dist/types/src/presets/gauge/linearGaugeOptions.d.ts:70
amCharts 5nativegrep: oversizedBehaviorgrep · weak@amcharts/amcharts5/.internal/core/render/scene/SceneNode.d.ts:186
Google Chartsunknown—conflict · unknown—
uPlotnone—absence · absence—
TradingView Lightweight Chartsnone—absence · absence—
MUI X Chartsnone—absence · absence—
Mermaid (chart-ish diagrams only)unknown—conflict · unknown—
AntV G2nativegrep: overlapHidegrep · weak@antv/g2/lib/index.d.ts:165