Skip to content
Alea0.1

Charts

BarChart

Compare categories: grouped or stacked, vertical or horizontal, with values on the bars.

Ant Design: Column, Bar (Ant Charts)

import { BarChart } from '@alea/ui';

Examples

Grouped bars

Compare two years per quarter.

Revenue (k$)

2026 beat 2025 in every quarter.

  • 2025
  • 2026
$0k$20k$40k$60k$80kQ1Q2Q3Q4

Horizontal and stacked

Long category names read better horizontally; values on the bars.

Users by plugin
  • Free
  • Pro
01,0002,0003,0004,000Contrast CheckerPalette GeneratorType ScaleSpec Sheet2,9005101,1001407601009030

Props

BarChart props

Compare amounts across categories: grouped, stacked or horizontal (MUI BarChart, Mantine BarChart).

PropTypeDefaultDescription
datarequiredChartRow[]-Rows of data, one per x value or category.
seriesrequiredSeries[]-The series to draw: key in each row, label for the legend, optional color.
xrequiredstring-The key for the x axis (dates, months, categories).
classNamestring-Extra class names for the root element.
descriptionReactNode-One sentence on what the data shows; read before the chart.
heightnumber260Plot height in px. Default 260.
horizontalboolean-Bars go sideways (good for long category names).
showTablebooleantrueShows the table toggle. Default true.
showValuesboolean-Show the value on each bar.
stackedboolean-Stack the series in one bar.
titleReactNode-The title shown above it and read by screen readers.
valueFormat((v: number) => string)-Formats values (axis, tooltip, table).
xFormat((x: string | number) => string)-Formats x labels.

Accessibility

  • Same as LineChart: summary, keyboard reading and the table view.

Keyboard

KeyDoes
Arrow keysRead each category

Do and don't

Do

  • Start bars at zero.
  • Use horizontal bars for long category names.

Don't

  • Don't use more than four series in a grouped chart.
  • Don't use 3D or gradients on bars.
Tested with axe, keyboard and screen reader roles