Features · label

Data label formatting

native

Format/template for label text

Matrix status native. Verification runtime · strong. ChartKit option: ChartKitChartSpecV1.mark.labelFormat.

Format preset on the label text. Falls back to the series format. Setting it turns labels on.

Source: packages/core/src/generated/schema.ts:895

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": {
    "labelFormat": "integer"
  }
}

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.format.md.

LibraryStatusOptionVerificationSource
Chart.jsplugin—formatternpm · weak—
RechartsnativeLabelList.formattertypes · strongrecharts/types/component/LabelList.d.ts:106
Apache EChartsnativeseries.label.formattertypes · strongecharts/types/dist/shared.d.ts:7927
HighchartsnativeplotOptions.series.dataLabels.format, plotOptions.series.dataLabels.formattertypes · stronghighcharts/options/series.d.ts:247
Plotly.jsnativetrace.texttemplatetypes · strongplot-schema.json#traces.{bar,contour,funnel,funnelarea,heatmap,histogram,…}.attributes.texttemplate
NivonativeBar.valueFormat, Bar.labeltypes · strong@nivo/bar/dist/types/types.d.ts:164
VictorynativeVictoryBar.labelstypes · strongvictory-core/lib/types/prop-types.d.ts:117
visxmanualGroupmechanism · weak@visx/group/lib/Group.d.ts:15
ApexChartsnativedataLabels.formattertypes · strongapexcharts/types/apexcharts.d.ts:4799
Tremor (npm)unknown—conflict · unknown—
Observable Plotnativegrep: formatgrep · weak@observablehq/plot/src/scales.d.ts:327
Vega-Litenativegrep: formatgrep · weak84: "description"
AG Chartsnativegrep: formattergrep · weakag-charts-enterprise/dist/types/src/license/licenseManager.d.ts:2
amCharts 5nativegrep: textgrep · weak@amcharts/amcharts5/index.d.ts:32
Google Chartsnativegrep: formatgrep · weak@types/google.visualization/index.d.ts:162
uPlotunknown—conflict · unknown—
TradingView Lightweight Chartsunknown—conflict · unknown—
MUI X ChartsnativeBarChart.series.barLabelfunctiontypes · strong@mui/x-charts/models/seriesType/bar.d.mts:53
Mermaid (chart-ish diagrams only)none—absence · absence—
AntV G2nativegrep: formattergrep · weak@antv/g2/lib/component/legendCategory.d.ts:5