Features · scale

Nice rounding

native

Round domain to nice values

Matrix status native. Verification runtime · strong. ChartKit option: ChartKitChartSpecV1.encoding.y.scale.nice.

nice:false honoured since PR #16; drawn on createRenderer([line]) since PR #17 (main 116d0af)

Source: chartkit:packages/core/src/generated/schema.ts:697

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": {
      "field": "units",
      "scale": {
        "nice": false
      }
    }
  },
  "a11y": {
    "alt": "Units rose in Q2."
  },
  "size": {
    "width": 640,
    "height": 260
  }
}

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: scale.nice.md.

LibraryStatusOptionVerificationSource
Chart.jsnativegrep: gracebounds:'ticks' / gracegrep · weakchart.js/dist/types/index.d.ts:1356
RechartsnativeYAxis.allowDecimals, YAxis.niceTickstypes · strongrecharts/types/util/types.d.ts:814
Apache EChartspartialyAxis.splitNumbernice by defaulttypes · strongecharts/types/dist/shared.d.ts:2683
HighchartsnativeyAxis.startOnTick, yAxis.endOnTicktypes · stronghighcharts/highcharts.d.ts:110609
Plotly.jspartiallayout.yaxis.autorangetypes · strongplot-schema.json#layout.layoutAttributes.yaxis.autorange
Nivonativegrep: nicegrep · weak@nivo/scales/dist/types/types.d.ts:40
Victorynone—absence · absence—
visxnativegrep: nicegrep · weak@visx/scale/lib/index.d.ts:23
ApexChartsnativeyaxis.forceNiceScaletypes · strongapexcharts/types/apexcharts.d.ts:5042
Tremor (npm)none—absence · absence—
Observable Plotnativegrep: nicegrep · weak@observablehq/plot/src/scales.d.ts:2
Vega-Litenativegrep: nicegrep · weak1645: "description"
AG Chartsnativegrep: nicegrep · weakag-charts-community/dist/types/src/module-support.d.ts:31
amCharts 5partialgrep: strictMinMaxgrep · weak@amcharts/amcharts5/.internal/charts/xy/axes/ValueAxis.d.ts:9
Google Chartspartialgrep: viewWindowMode'pretty'grep · weak@types/google.visualization/index.d.ts:547
uPlotnone—absence · absence—
TradingView Lightweight Chartsnone—absence · absence—
MUI X ChartsnativeLineChart.yAxis.domainLimittypes · strong@mui/x-charts/models/axis.d.mts:532
Mermaid (chart-ish diagrams only)none—absence · absence—
AntV G2nativegrep: nicegrep · weak@antv/g2/lib/composition/d3Projection.d.ts:1