Skip to main content
Pricing

Stacked Bar Chart

Pro

Vertical bar chart where each bar is divided into colour-coded segments representing sub-categories. Shows both the total value per category and the composition within it. Rendered as SVG with distinct pattern fills for accessibility. Includes a legend, axis labels, and optional value annotations.

4 variants

Q1Q2Q3Q4
Product A
Product B
Product C

Variants

VariantDescriptionWhen to use
DefaultStacked bars with absolute values, showing total height per category.Use when both totals and composition matter — revenue by product line per quarter.
PercentageAll bars normalised to 100%, showing proportional composition only.Use when comparing the mix rather than absolute totals — market share by region.

Usage Guidelines

Do

Include a legend and direct labels for each segment.

Don't

Display more than 5 segments — group smaller values into "Other".

Do

Use pattern fills alongside colours for segment differentiation.

Don't

Use stacked bars when precise comparison of inner segments is needed — use grouped bars.

Do

Limit to 5 segments per bar for readability.

Don't

Rely on colour alone to identify segments.

Do

Provide a data table alternative for screen reader users.

Don't

Use similar colours for adjacent segments within the same bar.

Code

This component is included in Lexicon Pro

From €149 — one-time purchase, lifetime access

View pricing

Design Tokens

This component is included in Lexicon Pro

From €149 — one-time purchase, lifetime access

View pricing

Accessibility

  • Use role="img" with aria-label and aria-describedby for a text summary.
  • Include a hidden data table breaking down each bar's segments.
  • Pattern fills are required alongside colour for segment identification.
  • Tooltips should list the segment name, value, and percentage of the total bar.

Keyboard Interactions

TabMoves focus to the chart container.
ArrowLeft/ArrowRightNavigates between bars.
ArrowUp/ArrowDownNavigates between segments within a bar.
Enter/SpaceOpens a tooltip with the segment value.
EscapeDismisses the tooltip.