Skip to content
Demographic breakdowns

Grouped Bar

Multi-series bars grouped side-by-side or stacked within category bands, with a legend and tooltips. The workhorse categorical comparison when small multiples would be overkill.

Theme
Installshow
viz add d3/stats/grouped-bar-v1

Props

PropTypeDescription
dataGroupedBarData{ rows: {label, values: Record<series, number>}[], series, groups?, yLabel?, yDomain?, unit?, mode?, title?, subtitle?, source? }.

See full TypeScript interface on GitHub for all props.

Usageshow
TypeScript
import GroupedBar from '@/viz/components/d3/stats/grouped-bar-v1';

Metadata

  • FrameworkD3 / SVG
  • CategoryDemographic breakdowns
  • Sourced3/stats/grouped-bar-v1
bar grouped stacked comparison d3

Dependencies

d3-scale