Features · scale

Scale padding / clamp / grace

native

Extra space beyond data extent or clamp out-of-range

Matrix status native. Verification types · strong. ChartKit option: encoding.y.scale.padding, encoding.y.scale.clamp.

scale.padding is a fraction of the span (a number, or {min, max}). scale.clamp draws a value outside an explicit domain at the domain edge. A set domain end is not padded.

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

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": {
        "padding": 0.08
      }
    }
  },
  "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.padding.md.

LibraryStatusOptionVerificationSource
Chart.jsnativegrep: gracegrep · weakchart.js/dist/types/index.d.ts:3325
RechartsnativeYAxis.paddingtypes · strongrecharts/types/cartesian/YAxis.d.ts:123
Apache EChartsnativeyAxis.boundaryGaptypes · strongecharts/types/dist/shared.d.ts:2679
HighchartsnativeyAxis.maxPadding, yAxis.minPaddingtypes · stronghighcharts/highcharts.d.ts:110291
Plotly.jsunknown—conflict · unknown—
Nivonativegrep: clampgrep · weak@nivo/generators/dist/types/helpers.d.ts:1
VictorynativeVictoryChart.domainPaddingtypes · strongvictory-core/lib/victory-util/common-props.d.ts:24
visxnativegrep: clampgrep · weak@visx/drag/lib/util/clampNumber.d.ts:1
ApexChartsunknown—conflict · unknown—
Tremor (npm)unknown—conflict · unknown—
Observable Plotnativegrep: clampgrep · weak@observablehq/plot/src/scales.d.ts:1
Vega-Litenativegrep: clampgrep · weak609: "description"
AG Chartsnativegrep: paddinggrep · weakag-charts-types/dist/types/src/presets/sparkline/sparklineAxisOptions.d.ts:15
amCharts 5nativegrep: extraMaxgrep · weak@amcharts/amcharts5/.internal/charts/xy/axes/ValueAxis.d.ts:28
Google Chartsunknown—conflict · unknown—
uPlotunknown—conflict · unknown—
TradingView Lightweight Chartsnativegrep: scaleMarginsgrep · weak536:export interface AutoScaleMargins {
MUI X Chartsunknown—conflict · unknown—
Mermaid (chart-ish diagrams only)unknown—conflict · unknown—
AntV G2nativegrep: clampgrep · weak@antv/g2/lib/utils/number.d.ts:2