Alternating bands / plot bands
native
Shaded alternating stripes or bands on an axis
Matrix status native. Verification types · strong. ChartKit option: ChartKitChartSpecV1.axes.x.bands.
axes.x.bands and axes.y.bands shade ranges. x also accepts "weekends" when x is dates.
Source: chartkit:packages/core/src/annotations.ts:19
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
},
"axes": {
"x": {
"bands": [
{
"from": "Q1",
"to": "Q2",
"label": "Window"
}
]
}
}
}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: axis.bands.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | plugin | — | npm · weak | — |
| Recharts | native | ReferenceArea | types · strong | recharts/types/cartesian/ReferenceArea.d.ts:129 |
| Apache ECharts | native | yAxis.splitArea | types · strong | echarts/types/dist/shared.d.ts:2623 |
| Highcharts | native | yAxis.plotBands, yAxis.alternateGridColor | types · strong | highcharts/highcharts.d.ts:110494 |
| Plotly.js | native | layout.shapes | types · strong | plot-schema.json#layout.layoutAttributes.shapes |
| Nivo | manual | Line.layers | mechanism · weak | @nivo/line/dist/types/types.d.ts:171 |
| Victory | manual | VictoryBarProps.dataComponent | mechanism · weak | victory-core/lib/victory-util/common-props.d.ts:9 |
| visx | manual | Group | mechanism · weak | @visx/group/lib/Group.d.ts:15 |
| ApexCharts | native | grid.row.colors | types · strong | apexcharts/types/apexcharts.d.ts:5286 |
| Tremor (npm) | none | — | absence · absence | — |
| Observable Plot | native | rectYbands as marks | types · strong | @observablehq/plot/src/marks/rect.d.ts:270 |
| Vega-Lite | manual | TopLevelSpec.layer | mechanism · weak | vega-lite/build/spec/layer.d.ts:27 |
| AG Charts | native | grep: crossLines | grep · weak | ag-charts-enterprise/dist/types/src/main.d.ts:9 |
| amCharts 5 | native | grep: axisFillaxis ranges / alternating fills | grep · weak | @amcharts/amcharts5/.internal/plugins/json/ChartSerializer.d.ts:42 |
| Google Charts | none | — | absence · absence | — |
| uPlot | native | Options.bands | types · strong | uplot/dist/uPlot.d.ts:377 |
| TradingView Lightweight Charts | none | — | absence · absence | — |
| MUI X Charts | native | grep: ChartsReferenceLinelines only; bands via custom | grep · weak | @mui/x-charts/index.d.ts:8 |
| Mermaid (chart-ish diagrams only) | none | — | absence · absence | — |
| AntV G2 | native | grep: rangeY | grep · weak | @antv/g2/lib/index.d.ts:82 |