Responsive width (fill container)
native
Auto-resize to the container
Matrix status native. Verification types · strong. ChartKit option: ChartKitChartSpecV1.size.width.
'auto' fills container and follows resizes
Source: chartkit:packages/core/src/generated/schema.ts:1097
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": "units"
},
"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: layout.responsive.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | native | grep: responsive | grep · weak | chart.js/dist/types/index.d.ts:1650 |
| Recharts | native | ResponsiveContainer | types · strong | recharts/types/component/ResponsiveContainer.d.ts:76 |
| Apache ECharts | native | grep: resizechart.resize() on window resize (manual hook) | grep · weak | echarts/types/src/util/types.d.ts:348 |
| Highcharts | native | chart.reflow | types · strong | highcharts/highcharts.d.ts:6538 |
| Plotly.js | native | config.responsive | types · strong | plot-schema.json#config.responsive |
| Nivo | native | ResponsiveLine | types · strong | @nivo/line/dist/types/ResponsiveLine.d.ts:4 |
| Victory | native | VictoryChart.widthresponsive via viewBox by default | types · strong | victory-core/lib/victory-util/common-props.d.ts:55 |
| visx | native | ParentSize, ScaleSVG | types · strong | @visx/responsive/lib/components/ParentSize.d.ts:20 |
| ApexCharts | native | chart.width'100%' | types · strong | apexcharts/types/apexcharts.d.ts:1765 |
| Tremor (npm) | native | LineChartfills parent by default | types · strong | @tremor/react/dist/index.d.ts:130 |
| Observable Plot | manual | grep: renderfixed width; re-render on resize | mechanism · weak | @observablehq/plot/src/scales.d.ts:166 |
| Vega-Lite | native | grep: containerwidth: 'container' | grep · weak | 4264: "description" |
| AG Charts | native | grep: widthfills container by default | grep · weak | ag-charts-types/dist/types/src/serverSideRenderingOptions.d.ts:6 |
| amCharts 5 | native | grep: autoResizeroot autoResize | grep · weak | @amcharts/amcharts5/.internal/core/Root.d.ts:373 |
| Google Charts | unknown | —redraw on resize | unverified · unknown | — |
| uPlot | manual | Options.hookssetSize() on resize | mechanism · weak | uplot/dist/uPlot.d.ts:394 |
| TradingView Lightweight Charts | native | grep: autoSize | grep · weak | 938: * Please pay attention that `autoSize` option and explicit sizes options `width` and `height` don't conflict with one another. |
| MUI X Charts | native | LineChart.widthfills parent when omitted | types · strong | @mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.mts:25 |
| Mermaid (chart-ish diagrams only) | native | grep: useMaxWidth | grep · weak | mermaid/dist/setupGraphViewbox.d.ts:1 |
| AntV G2 | native | grep: autoFit | grep · weak | @antv/g2/lib/component/slider.d.ts:7 |