StackedBarChart #

Renders horizontal stacked bars for category composition comparisons.

Props #

PropTypeRequiredDescription
data{ label: string, values: Record<string, number> }[]YesGrouped rows and keyed values.
series{ key: string, label?: string, colorClass?: string }[]YesSegment definitions and ordering.
showLegendbooleanNoShows the legend. Default: true.
classNamestringNoWrapper classes.

Live example #

Docs22
Blog24
API21
New
Updated
Archived

Code #

mdx
<StackedBarChart
series={[
{ key: 'new', label: 'New' },
{ key: 'updated', label: 'Updated' },
{ key: 'archived', label: 'Archived' },
]}
data={[
{ label: 'Docs', values: { new: 14, updated: 6, archived: 2 } },
{ label: 'Blog', values: { new: 9, updated: 11, archived: 4 } },
{ label: 'API', values: { new: 5, updated: 13, archived: 3 } },
]}
/>