Stack totals
native
Label the total on stacked bars
Matrix status native. Verification runtime · strong. ChartKit option: ChartKitChartSpecV1.mark.stackTotal.
Labels the total on a stacked bar or stacked area. On a bar this also stacks the series.
Source: packages/core/src/totals.ts:6
ChartKit spec
Passed validate() during npm run matrix:refresh. The SVG is the server render.
{
"version": "1",
"type": "stacked-area",
"data": [
{
"x": "A",
"a": 2,
"b": 3
},
{
"x": "B",
"a": 4,
"b": 2
}
],
"encoding": {
"x": "x",
"y": [
"a",
"b"
]
},
"a11y": {
"alt": "B is higher."
},
"size": {
"width": 640,
"height": 260
},
"mark": {
"stackTotal": true
}
}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: label.total.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | plugin | — | npm · weak | — |
| Recharts | manual | Customized | mechanism · weak | recharts/types/component/Customized.d.ts:26 |
| Apache ECharts | manual | series.type=custom | mechanism · weak | echarts/types/dist/shared.d.ts:11176 |
| Highcharts | native | yAxis.stackLabels | types · strong | highcharts/highcharts.d.ts:110590 |
| Plotly.js | manual | layout.shapes | mechanism · weak | plot-schema.json#layout.layoutAttributes.shapes |
| Nivo | native | Bar.enableTotals | types · strong | @nivo/bar/dist/types/types.d.ts:176 |
| 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 | plotOptions.bar.dataLabels.total | types · strong | apexcharts/types/apexcharts.d.ts:3140 |
| Tremor (npm) | none | — | absence · absence | — |
| Observable Plot | manual | grep: rendertext on groupX sum | mechanism · weak | @observablehq/plot/src/scales.d.ts:166 |
| Vega-Lite | manual | TopLevelSpec.layer | mechanism · weak | vega-lite/build/spec/layer.d.ts:27 |
| AG Charts | unknown | — | unverified · unknown | — |
| amCharts 5 | manual | Graphics | mechanism · weak | @amcharts/amcharts5/.internal/core/render/Graphics.d.ts:162 |
| Google Charts | none | — | absence · absence | — |
| uPlot | none | — | absence · absence | — |
| TradingView Lightweight Charts | none | — | absence · absence | — |
| MUI X Charts | manual | ChartsContainer | mechanism · weak | @mui/x-charts/ChartsContainer/ChartsContainer.d.mts:34 |
| Mermaid (chart-ish diagrams only) | none | — | absence · absence | — |
| AntV G2 | manual | grep: register | mechanism · weak | @antv/g2/lib/exports.d.ts:2 |