Features · scale

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.

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

LibraryStatusOptionVerificationSource
Chart.jsnativegrep: beginAtZerogrep · weakchart.js/dist/types/index.d.ts:3313
RechartspartialYAxis.domain[0, 'auto']types · strongrecharts/types/cartesian/YAxis.d.ts:53
Apache EChartsnativeyAxis.scalescale:true means do not force zerotypes · strongecharts/types/dist/shared.d.ts:2736
HighchartspartialyAxis.mintypes · stronghighcharts/highcharts.d.ts:110317
Plotly.jsnativelayout.yaxis.rangemode=tozerotypes · strongplot-schema.json#layout.layoutAttributes.yaxis.rangemode
Nivopartialgrep: mingrep · weak@nivo/tree/package.json:36
Victoryunknown—conflict · unknown—
visxnativegrep: zerogrep · weak@visx/sankey/node_modules/@types/d3-shape/index.d.ts:133
ApexChartsnativeyaxis.forceNiceScaletypes · strongapexcharts/types/apexcharts.d.ts:5042
Tremor (npm)partialLineChart.autoMinValuetypes · strong@tremor/react/dist/index.d.ts:69
Observable Plotnativegrep: zerogrep · weak@observablehq/plot/src/scales.d.ts:260
Vega-Litenativegrep: zerogrep · weak524: "description"
AG Chartspartialgrep: mingrep · weakag-charts-types/dist/types/src/presets/sparkline/sparklineOptions.d.ts:49
amCharts 5partialgrep: mingrep · weak@amcharts/amcharts5/.internal/charts/xy/series/XYSeries.d.ts:35
Google Chartspartialgrep: viewWindowgrep · weak@types/google.visualization/index.d.ts:547
uPlotpartialgrep: rangegrep · weak131: /** 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 Chartsnone—absence · absence—
MUI X ChartspartialLineChart.yAxis.mintypes · strong@mui/x-charts/models/axis.d.mts:467
Mermaid (chart-ish diagrams only)unknown—conflict · unknown—
AntV G2nativegrep: zerogrep · weak@antv/g2/lib/api/utils.d.ts:12