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.
{
"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.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | native | grep: gracebounds:'ticks' / grace | grep · weak | chart.js/dist/types/index.d.ts:1356 |
| Recharts | native | YAxis.allowDecimals, YAxis.niceTicks | types · strong | recharts/types/util/types.d.ts:814 |
| Apache ECharts | partial | yAxis.splitNumbernice by default | types · strong | echarts/types/dist/shared.d.ts:2683 |
| Highcharts | native | yAxis.startOnTick, yAxis.endOnTick | types · strong | highcharts/highcharts.d.ts:110609 |
| Plotly.js | partial | layout.yaxis.autorange | types · strong | plot-schema.json#layout.layoutAttributes.yaxis.autorange |
| Nivo | native | grep: nice | grep · weak | @nivo/scales/dist/types/types.d.ts:40 |
| Victory | none | — | absence · absence | — |
| visx | native | grep: nice | grep · weak | @visx/scale/lib/index.d.ts:23 |
| ApexCharts | native | yaxis.forceNiceScale | types · strong | apexcharts/types/apexcharts.d.ts:5042 |
| Tremor (npm) | none | — | absence · absence | — |
| Observable Plot | native | grep: nice | grep · weak | @observablehq/plot/src/scales.d.ts:2 |
| Vega-Lite | native | grep: nice | grep · weak | 1645: "description" |
| AG Charts | native | grep: nice | grep · weak | ag-charts-community/dist/types/src/module-support.d.ts:31 |
| amCharts 5 | partial | grep: strictMinMax | grep · weak | @amcharts/amcharts5/.internal/charts/xy/axes/ValueAxis.d.ts:9 |
| Google Charts | partial | grep: viewWindowMode'pretty' | grep · weak | @types/google.visualization/index.d.ts:547 |
| uPlot | none | — | absence · absence | — |
| TradingView Lightweight Charts | none | — | absence · absence | — |
| MUI X Charts | native | LineChart.yAxis.domainLimit | types · strong | @mui/x-charts/models/axis.d.mts:532 |
| Mermaid (chart-ish diagrams only) | none | — | absence · absence | — |
| AntV G2 | native | grep: nice | grep · weak | @antv/g2/lib/composition/d3Projection.d.ts:1 |