Grouped Bar Chart
A multi-category bar chart with responsive columns and interactive hover tooltips.
// SYSTEM.STAGE
Installation
Install the component and its peer dependencies automatically via the CLI:
// SYS.USAGE
Drop this code into your screen or view:
1import GroupedBarChart from "@/components/grouped-bar-chart";2 3export default function FinancialPerformanceScreen() {4 const financialData = [5 { label: "Jan", fullDate: "January 2026", revenue: 10400, profit: 3600 },6 { label: "Feb", fullDate: "February 2026", revenue: 15500, profit: 5200 },7 { label: "Mar", fullDate: "March 2026", revenue: 12200, profit: 4100 },8 { label: "Apr", fullDate: "April 2026", revenue: 18900, profit: 7800 },9 { label: "May", fullDate: "May 2026", revenue: 14200, profit: 4900 },10 { label: "Jun", fullDate: "June 2026", revenue: 21000, profit: 9200 },11 ];12 13 return (14 <GroupedBarChart15 data={financialData}16 series={[17 { key: "revenue", label: "revenue" },18 { key: "profit", label: "profit" },19 ]}20 theme="dark"21 title="Financial Performance"22 valuePrefix="$"23 height={240}24 onSelectGroup={(point, index) => {25 console.log("Selected group:", point.label, "at index:", index);26 }}27 />28 );29}// SPEC.PROPS_API
Configurable interfaces for <GroupedBarChart />
| PROP_IDENTIFIER | TYPE_SIGNATURE | DEFAULT_VAL | TELEMETRY_NOTES |
|---|---|---|---|
| data | GroupedBarDataPoint[] | DEFAULT_GROUPED_BAR_DATA | Dataset containing multi-series numeric values, category labels, and optional full date descriptions. |
| series | BarSeriesConfig[] | DEFAULT_BAR_SERIES | Array defining each data series with key, display label, and optional custom colors. |
| theme | "dark" | "light" | "dark" | Color theme mode for canvas surface, grid lines, text tokens, bars, and tooltip backdrop. |
| title | string | undefined | Optional header title displayed above the grouped bar chart. |
| subtitle | string | undefined | Optional secondary description displayed below the title. |
| valuePrefix | string | "" | Prefix formatted before numerical metrics in the tooltip (e.g. '$'). |
| valueSuffix | string | "" | Suffix formatted after numerical metrics in the tooltip (e.g. ' pts'). |
| height | number | 240 | Height in pixels of the interactive SVG chart visualization. |
| animated | boolean | true | Whether to animate bar heights with a staggered spring entrance on mount. |
| showBackgroundTrack | boolean | true | Whether to render subtle background vertical tracks behind each group slot. |
| showLegend | boolean | true | Whether to display interactive series legend pills with live rolling numbers in the header. |
| showTooltip | boolean | true | Whether to render the floating glassmorphic tooltip with animated rolling numbers. |
| showGridLines | boolean | true | Whether to render dashed horizontal grid lines across the chart area. |
| initialIndex | number | null | null | Optional initial active group index on mount (defaults to null for clean idle state). |
| onSelectGroup | (point: GroupedBarDataPoint, index: number) => void | undefined | Callback fired when a category group is scrubbed, clicked, or tapped. |
Dataset containing multi-series numeric values, category labels, and optional full date descriptions.
DEFAULT_GROUPED_BAR_DATAArray defining each data series with key, display label, and optional custom colors.
DEFAULT_BAR_SERIESColor theme mode for canvas surface, grid lines, text tokens, bars, and tooltip backdrop.
"dark"Optional header title displayed above the grouped bar chart.
undefinedOptional secondary description displayed below the title.
undefinedPrefix formatted before numerical metrics in the tooltip (e.g. '$').
""Suffix formatted after numerical metrics in the tooltip (e.g. ' pts').
""Height in pixels of the interactive SVG chart visualization.
240Whether to animate bar heights with a staggered spring entrance on mount.
trueWhether to render subtle background vertical tracks behind each group slot.
trueWhether to display interactive series legend pills with live rolling numbers in the header.
trueWhether to render the floating glassmorphic tooltip with animated rolling numbers.
trueWhether to render dashed horizontal grid lines across the chart area.
trueOptional initial active group index on mount (defaults to null for clean idle state).
nullCallback fired when a category group is scrubbed, clicked, or tapped.
undefined// PERFORMANCE_&_A11Y
Native touch gestures, screen reader attributes, and 60–120 FPS frame budgets: