Skip to main content
Pricing

Horizontal Bar Chart

Pro

A bar chart with horizontal bars, ideal for categories with long labels or when comparing many items. Rendered as SVG with category labels on the y-axis and value labels on the x-axis. Supports sorted ordering and optional value annotations at bar ends. Preferred over vertical bars when there are more than 8 categories.

4 variants

React92%Vue68%Svelte45%Angular38%Next.js85%

Variants

VariantDescriptionWhen to use
DefaultStandard horizontal bars with category labels aligned left and value labels at the end.Use for ranking comparisons with long labels — top pages, survey responses.
With Values

Usage Guidelines

Do

Sort bars by value (largest to smallest) for ranking comparisons.

Don't

Mix sorted and unsorted bars in the same view.

Do

Show value labels at the end of each bar for quick reading.

Don't

Truncate category labels — the horizontal layout exists to avoid that.

Do

Use horizontal layout when category labels are long or there are many items.

Don't

Use horizontal bars for time-series data — use Line or Area Chart instead.

Do

Provide a data table alternative for screen reader users.

Don't

Plot more than 15 categories without scrolling or pagination.

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 listing all categories and values.
  • Ensure bar colour meets 3:1 contrast against the background.
  • Each bar can be focusable with an aria-label stating the category and value.

Keyboard Interactions

TabMoves focus to the chart container.
ArrowUp/ArrowDownNavigates between horizontal bars.
Enter/SpaceOpens a tooltip for the focused bar.
EscapeDismisses the tooltip.