Skip to content

BarChart

stable

Token-native grouped/stacked bar chart (Recharts) reading DS dataviz tokens at runtime — FX volume by currency, payment counts by status, budget vs. actual, funding source stacks

import { BarChart } from "@danagraph/design-system/finance"
Loading demo…

Props

datarequired
Type Record<string, number | string>[]Default —

Data rows

xKeyrequired
Type stringDefault —

Key for x-axis category labels

seriesrequired
Type string[] | BarSeries[]Default —

Series keys to plot — BarSeries objects allow label/color overrides

variant
Type 'grouped' | 'stacked'Default grouped

Bar layout

title
Type stringDefault —

Chart title

asOf
Type stringDefault —

As-of date shown right of the title

height
Type numberDefault 240

Chart height in px

showGrid
Type booleanDefault true

Show horizontal grid lines

showLegend
Type booleanDefault false

Show series legend

showLabels
Type booleanDefault —

Show values on bars when they fit — declared in the props contract but not yet rendered

ariaLabel
Type stringDefault —

Accessible label override (falls back to title)

style
Type CSSPropertiesDefault —

Style override

Accessibility

  • Wrapper renders role="group" and the chart role="img", both labelled from ariaLabel ?? title.
  • Series colors come from the DS categorical dataviz palette (up to 8 series) and re-resolve on theme change.
  • Pair the chart with a data table or figure caption for non-visual access to exact values.
groupedstackedsemantictypeborderdataviz
MobileStacks / Scroll

Chart requires min 300px for legible axis labels. Wrap in overflow-x-auto.

Design Rationale

This component was designed to express:

Explore Related

Was this helpful?