Skip to content

Stacked bar chart

The total per period, and what it is made of.

Definition · Updated Nov 2, 2026

A stacked bar chart builds each bar from its parts, so you read the total and the mix in one shape. Use it for failures by reason, revenue by plan or tickets by type, period after period.

Pay once. Every update included.

Live preview

Failed payments by reasonFailed payments per week by reason, W27 to W40: 552 in W27, 214 in W40 (118 card declined, 64 insufficient funds, 32 fraud block).6004002000W27W30W33W36W40CARD DECLINEDINSUFFICIENT FUNDSFRAUD BLOCK
Failed payments by reason
WeekCard declinedInsufficient fundsFraud blockTotal
W2730416682552
W2829616181538
W2929816281541
W3027915276507
W3126914773489
W3226214371476
W3324913667452
W3423712965431
W3521911960398
W3618810351342
W371719347311
W381528341276
W391367437247
W401186432214

Sample data: failed payments per week by reason (card declined, insufficient funds, fraud block), W27 to W40

Size
Legend
Data shape
Two to four parts per period
Good for
Reasons, plans, types per week or month
Avoid when
Each part must be compared exactly
Sizes
XS, S, M and L, re-laid out from the data

Anatomy

Inspect it like the Figma file.

The same layers, names and tokens as the component. Select one to read its size, fill and style.

Layers

003 / Stacked bars

chart/003-stacked-bars
plot · stacked bars
Layer
bar 01 · insufficient funds
Type
Rectangle
Size
49 × 64
Fill
data/cat-2
Group
Marks · 42

Layers

003 / Stacked bars

chart/003-stacked-bars
plot · stacked bars
Layer
bar 01 · insufficient funds
Type
Rectangle
Size
16 × 28
Fill
data/cat-2
Group
Marks · 42

Sizes

Re-laid out, never scaled.

The same data at XS, S, M and L. Every size is redrawn from the data, so text and line weights never shrink.

M against S

Width360 px480 px

Plot328 px440 px

Labels99

Marks4242

Height212 px246 px

Same tokens at every size: text styles, 1 px lines and mark radius stay put.

When to use

Total and mix.

Three signs it fits, and three signs another type fits better.

Does the total per period matter?

Parts compared with each other.

Yes: Keep the stacked bars

Are there several periods?

One split, one moment.

Yes: Keep the stacked bars

Are there four parts or fewer?

Many parts in a flowing mix.

Yes: Keep the stacked bars

Code and Figma

One name in Figma and in code.

Every Figma property is a prop with the same name and values. One command installs it.

Figma

chart/003-stacked-bars

size
legend
Property = propValuesDefault
size"xs" · "s" · "m" · "l""xs"
legendtrue · falsetrue
color"cat-1" · "cat-2" · "cat-3" · "cat-4""cat-1"
npx shadcn add @chartory/stacked-bars
stacked-bars.tsx
import { StackedBars } from "@/components/chartory/stacked-bars"import { failuresByReason } from "./failures-by-reason"export function FailuresByReason() {  return (    <StackedBars      data={failuresByReason}      size="m"      legend={true}    />  )}

Hearth widget

Stacked bars as a widget.

The chart in a Hearth card with a hero number and two blocks. One token set, light and dark.

Code
Get the code

EmberPreset

ChartoryDefault preset

Pick the blocks, the size and the preset for your own widget.

Read the Hearth widget docs

FAQ

Stacked bar questions.

What people ask before they put stacked bars in a dashboard.

Something else?

hello@usechartory.com
  • The first one in the legend (card declined in the sample). Only the bottom part starts from zero, so put the one people compare most there.

Related types

The same question, a different shape of answer. Every type ships in Figma and in code.

Same family

Part of a whole

16 types in Chartory answer this question.