Number formatting options
native
Decimals, prefix/suffix, compact, percent, currency
Matrix status native. Verification types · strong. ChartKit option: ChartKitChartSpecV1.axes.y.format.style=compact.
number|compact|percent|currency|bytes|duration-ms|date|time|datetime
Source: chartkit:packages/core/src/generated/schema.ts:644
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": {
"y": {
"format": {
"style": "compact"
}
}
}
}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: format.number.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | manual | Plugin.afterDatasetsDrawcallback with Intl | mechanism · weak | chart.js/dist/types/index.d.ts:1051 |
| Recharts | manual | CustomizedtickFormatter callback | mechanism · weak | recharts/types/component/Customized.d.ts:26 |
| Apache ECharts | manual | series.type=customformatter callback / template | mechanism · weak | echarts/types/dist/shared.d.ts:11176 |
| Highcharts | native | yAxis.labels.format{value:,.2f} format strings + numericSymbols | types · strong | highcharts/highcharts.d.ts:109837 |
| Plotly.js | native | layout.yaxis.tickformatd3-format strings | types · strong | plot-schema.json#layout.layoutAttributes.yaxis.tickformat |
| Nivo | native | grep: formatd3-format strings | grep · weak | @nivo/legends/dist/types/types.d.ts:3 |
| Victory | manual | VictoryBarProps.dataComponent | mechanism · weak | victory-core/lib/victory-util/common-props.d.ts:9 |
| visx | manual | Group | mechanism · weak | @visx/group/lib/Group.d.ts:15 |
| ApexCharts | unknown | —formatter callbacks | unverified · unknown | — |
| Tremor (npm) | native | LineChart.valueFormatterfunction | types · strong | @tremor/react/dist/index.d.ts:60 |
| Observable Plot | native | grep: tickFormatd3-format strings | grep · weak | @observablehq/plot/src/scales.d.ts:591 |
| Vega-Lite | native | grep: formatd3-format strings in JSON | grep · weak | 84: "description" |
| AG Charts | native | grep: formatd3-style format strings in options | grep · weak | ag-charts-types/dist/types/src/serverSideRenderingOptions.d.ts:3 |
| amCharts 5 | native | grep: numberFormat'#,###.00' patterns | grep · weak | @amcharts/amcharts5/index.d.ts:72 |
| Google Charts | native | NumberFormat | types · strong | @types/google.visualization/index.d.ts:1646 |
| uPlot | manual | Options.hooks | mechanism · weak | uplot/dist/uPlot.d.ts:394 |
| TradingView Lightweight Charts | native | grep: priceFormat | grep · weak | 2211:export interface IPriceFormatter { |
| MUI X Charts | native | grep: valueFormatter | grep · weak | @mui/x-charts/SparkLineChart/SparkLineChart.d.ts:43 |
| Mermaid (chart-ish diagrams only) | unknown | — | conflict · unknown | — |
| AntV G2 | native | grep: labelFormatterd3-format string or function | grep · weak | @antv/g2/lib/component/legendCategory.d.ts:5 |