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.
{
"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.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | plugin | —formatter | npm · weak | — |
| Recharts | native | LabelList.formatter | types · strong | recharts/types/component/LabelList.d.ts:106 |
| Apache ECharts | native | series.label.formatter | types · strong | echarts/types/dist/shared.d.ts:7927 |
| Highcharts | native | plotOptions.series.dataLabels.format, plotOptions.series.dataLabels.formatter | types · strong | highcharts/options/series.d.ts:247 |
| Plotly.js | native | trace.texttemplate | types · strong | plot-schema.json#traces.{bar,contour,funnel,funnelarea,heatmap,histogram,…}.attributes.texttemplate |
| Nivo | native | Bar.valueFormat, Bar.label | types · strong | @nivo/bar/dist/types/types.d.ts:164 |
| Victory | native | VictoryBar.labels | types · strong | victory-core/lib/types/prop-types.d.ts:117 |
| visx | manual | Group | mechanism · weak | @visx/group/lib/Group.d.ts:15 |
| ApexCharts | native | dataLabels.formatter | types · strong | apexcharts/types/apexcharts.d.ts:4799 |
| Tremor (npm) | unknown | — | conflict · unknown | — |
| Observable Plot | native | grep: format | grep · weak | @observablehq/plot/src/scales.d.ts:327 |
| Vega-Lite | native | grep: format | grep · weak | 84: "description" |
| AG Charts | native | grep: formatter | grep · weak | ag-charts-enterprise/dist/types/src/license/licenseManager.d.ts:2 |
| amCharts 5 | native | grep: text | grep · weak | @amcharts/amcharts5/index.d.ts:32 |
| Google Charts | native | grep: format | grep · weak | @types/google.visualization/index.d.ts:162 |
| uPlot | unknown | — | conflict · unknown | — |
| TradingView Lightweight Charts | unknown | — | conflict · unknown | — |
| MUI X Charts | native | BarChart.series.barLabelfunction | types · strong | @mui/x-charts/models/seriesType/bar.d.mts:53 |
| Mermaid (chart-ish diagrams only) | none | — | absence · absence | — |
| AntV G2 | native | grep: formatter | grep · weak | @antv/g2/lib/component/legendCategory.d.ts:5 |