Features · format

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.

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

LibraryStatusOptionVerificationSource
Chart.jsmanualPlugin.afterDatasetsDrawcallback with Intlmechanism · weakchart.js/dist/types/index.d.ts:1051
RechartsmanualCustomizedtickFormatter callbackmechanism · weakrecharts/types/component/Customized.d.ts:26
Apache EChartsmanualseries.type=customformatter callback / templatemechanism · weakecharts/types/dist/shared.d.ts:11176
HighchartsnativeyAxis.labels.format{value:,.2f} format strings + numericSymbolstypes · stronghighcharts/highcharts.d.ts:109837
Plotly.jsnativelayout.yaxis.tickformatd3-format stringstypes · strongplot-schema.json#layout.layoutAttributes.yaxis.tickformat
Nivonativegrep: formatd3-format stringsgrep · weak@nivo/legends/dist/types/types.d.ts:3
VictorymanualVictoryBarProps.dataComponentmechanism · weakvictory-core/lib/victory-util/common-props.d.ts:9
visxmanualGroupmechanism · weak@visx/group/lib/Group.d.ts:15
ApexChartsunknown—formatter callbacksunverified · unknown—
Tremor (npm)nativeLineChart.valueFormatterfunctiontypes · strong@tremor/react/dist/index.d.ts:60
Observable Plotnativegrep: tickFormatd3-format stringsgrep · weak@observablehq/plot/src/scales.d.ts:591
Vega-Litenativegrep: formatd3-format strings in JSONgrep · weak84: "description"
AG Chartsnativegrep: formatd3-style format strings in optionsgrep · weakag-charts-types/dist/types/src/serverSideRenderingOptions.d.ts:3
amCharts 5nativegrep: numberFormat'#,###.00' patternsgrep · weak@amcharts/amcharts5/index.d.ts:72
Google ChartsnativeNumberFormattypes · strong@types/google.visualization/index.d.ts:1646
uPlotmanualOptions.hooksmechanism · weakuplot/dist/uPlot.d.ts:394
TradingView Lightweight Chartsnativegrep: priceFormatgrep · weak2211:export interface IPriceFormatter {
MUI X Chartsnativegrep: valueFormattergrep · weak@mui/x-charts/SparkLineChart/SparkLineChart.d.ts:43
Mermaid (chart-ish diagrams only)unknown—conflict · unknown—
AntV G2nativegrep: labelFormatterd3-format string or functiongrep · weak@antv/g2/lib/component/legendCategory.d.ts:5