Features · layout

Responsive rules / breakpoints

native

Different options at different container sizes

Matrix status native. Verification runtime · strong. ChartKit option: layout.breakpoints.

layout.breakpoints is a list of rules. The first rule whose maxWidth or minWidth matches size.width, or the container width when width is auto, overrides legend, direction, facet columns, or concat direction. A narrow rule can set columns to 2 so the panels stay readable. A non-positive maxWidth warns CK3046. columns without a facet field warns CK3047.

Source: packages/core/src/layout.ts

ChartKit spec

Passed validate() during npm run matrix:refresh. The SVG is the server render.

The legend hides below 480px.The legend hides below 480px.102030405060Q1Q2
{
  "version": "1",
  "type": "line",
  "data": [
    {
      "quarter": "Q1",
      "units": 40,
      "cost": 12
    },
    {
      "quarter": "Q2",
      "units": 55,
      "cost": 15
    }
  ],
  "encoding": {
    "x": "quarter",
    "y": [
      "units",
      "cost"
    ]
  },
  "a11y": {
    "alt": "The legend hides below 480px."
  },
  "size": {
    "width": 320,
    "height": 220
  },
  "layout": {
    "breakpoints": [
      {
        "maxWidth": 480,
        "legend": false
      }
    ]
  }
}

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: layout.breakpoints.md.

LibraryStatusOptionVerificationSource
Chart.jsnativegrep: onResizeonResize callback onlygrep · weakchart.js/dist/types/index.d.ts:1677
Rechartsnone—absence · absence—
Apache EChartsnativegrep: mediabaseOption + media queriesgrep · weakecharts/types/src/model/OptionManager.d.ts:11
Highchartsnativeresponsive.rulestypes · stronghighcharts/highcharts.d.ts:98595
Plotly.jsnone—absence · absence—
Nivounknown—conflict · unknown—
Victorynone—absence · absence—
visxnone—absence · absence—
ApexChartsnativeresponsivetypes · strongapexcharts/types/apexcharts.d.ts:1487
Tremor (npm)none—absence · absence—
Observable Plotunknown—conflict · unknown—
Vega-Litenone—absence · absence—
AG Chartsunknown—conflict · unknown—
amCharts 5nativegrep: ResponsiveThemegrep · weak@amcharts/amcharts5/.internal/themes/ResponsiveTheme.d.ts:27
Google Chartsnone—absence · absence—
uPlotnone—absence · absence—
TradingView Lightweight Chartsnone—absence · absence—
MUI X Chartsunknown—conflict · unknown—
Mermaid (chart-ish diagrams only)unknown—conflict · unknown—
AntV G2none—absence · absence—