Stacked bars

Series stacked on a shared baseline.

JanFebMarAprMayJun020406080
Chart of Projects published, Proposals accepted over 6 points
monthProjects publishedProposals accepted
January2418
February3122
March2825
April3530
May4236
June3833
y={{ keys: ["projects", "bookings"], stacked: true }}

API

Stacked bars are Chart.Bars with stacked set on both the mark and the value axis; there is no separate component, so the props are the same ones.

PropTypeDefault
fill((datum: Record<string, unknown>, index: number) => string)Per-datum fill, for charts coloured by row rather than by series.
gapnumberPixels between two bars of the same category.
keysreadonly string[]Series to draw. Defaults to the root's value keys.
projected((datum: Record<string, unknown>, index: number, key: string) => boolean)Which bars are a projection rather than a record — the weeks ahead, a forecast, or the series still in flight while one is done. Those bars are drawn hatched inside a dashed outline in their series colour, so the eye reads them as pencilled-in, not done. Decided per bar: the datum and the series it belongs to.
radiusnumber4Corner radius of each bar, in pixels.
stackedbooleanStacks the series into one bar per category instead of grouping them side by side.

Plus every <g> prop. Source: chart/components/chart-bars.tsx.