Include zero
native
Force or allow the scale to include zero
Matrix status native. Verification types · strong. ChartKit option: ChartKitChartSpecV1.encoding.y.scale.zero.
Source: chartkit:packages/core/src/generated/schema.ts:693
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": {
"zero": true
}
}
},
"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.zero.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | native | grep: beginAtZero | grep · weak | chart.js/dist/types/index.d.ts:3313 |
| Recharts | partial | YAxis.domain[0, 'auto'] | types · strong | recharts/types/cartesian/YAxis.d.ts:53 |
| Apache ECharts | native | yAxis.scalescale:true means do not force zero | types · strong | echarts/types/dist/shared.d.ts:2736 |
| Highcharts | partial | yAxis.min | types · strong | highcharts/highcharts.d.ts:110317 |
| Plotly.js | native | layout.yaxis.rangemode=tozero | types · strong | plot-schema.json#layout.layoutAttributes.yaxis.rangemode |
| Nivo | partial | grep: min | grep · weak | @nivo/tree/package.json:36 |
| Victory | unknown | — | conflict · unknown | — |
| visx | native | grep: zero | grep · weak | @visx/sankey/node_modules/@types/d3-shape/index.d.ts:133 |
| ApexCharts | native | yaxis.forceNiceScale | types · strong | apexcharts/types/apexcharts.d.ts:5042 |
| Tremor (npm) | partial | LineChart.autoMinValue | types · strong | @tremor/react/dist/index.d.ts:69 |
| Observable Plot | native | grep: zero | grep · weak | @observablehq/plot/src/scales.d.ts:260 |
| Vega-Lite | native | grep: zero | grep · weak | 524: "description" |
| AG Charts | partial | grep: min | grep · weak | ag-charts-types/dist/types/src/presets/sparkline/sparklineOptions.d.ts:49 |
| amCharts 5 | partial | grep: min | grep · weak | @amcharts/amcharts5/.internal/charts/xy/series/XYSeries.d.ts:35 |
| Google Charts | partial | grep: viewWindow | grep · weak | @types/google.visualization/index.d.ts:547 |
| uPlot | partial | grep: range | grep · weak | 131: /** re-ranges a given min/max by a multiple of the range's magnitude (used internally to expand/snap/pad numeric y scales) */ |
| TradingView Lightweight Charts | none | — | absence · absence | — |
| MUI X Charts | partial | LineChart.yAxis.min | types · strong | @mui/x-charts/models/axis.d.mts:467 |
| Mermaid (chart-ish diagrams only) | unknown | — | conflict · unknown | — |
| AntV G2 | native | grep: zero | grep · weak | @antv/g2/lib/api/utils.d.ts:12 |