Skip to content

GIT-450: feat(BarChart): expose bar size and gap props#454

Open
osk02 wants to merge 1 commit into
stagingfrom
git-450-bar-size-props-clean
Open

GIT-450: feat(BarChart): expose bar size and gap props#454
osk02 wants to merge 1 commit into
stagingfrom
git-450-bar-size-props-clean

Conversation

@osk02
Copy link
Copy Markdown

@osk02 osk02 commented May 14, 2026

Summary

Re-raises PR #450 with a clean history.

Recharts' BarChart and Bar components accept four standard props for controlling bar width and spacing — maxBarSize, barSize, barCategoryGap, and barGap. The Force UI wrapper currently swallows all of them, so consumers cannot cap or shrink bar widths without forking the wrapper.

This forwards them through:

  • barCategoryGap and barGap go onto the inner <BarChart>
  • maxBarSize and barSize go onto each <Bar>

All four props are optional. When unset, Recharts' default sizing applies, so existing behavior is preserved for current consumers.

Test plan

  • Render an existing BarChart consumer without passing any of the new props → output unchanged
  • Pass barSize={20} → bars render at 20px width
  • Pass maxBarSize={40} on a category with few bars → bars cap at 40px
  • Pass barCategoryGap="20%" and barGap={4} → spacing reflects values

Recharts' BarChart and Bar components accept four standard props for
controlling bar width and spacing — maxBarSize, barSize, barCategoryGap,
and barGap. The Force UI wrapper currently swallows all of them, so
consumers cannot cap or shrink bar widths without forking the wrapper.

This forwards them through:
- barCategoryGap and barGap go onto the inner <BarChart>
- maxBarSize and barSize go onto each <Bar>

All four props are optional. When unset, Recharts' default sizing
applies, so existing behavior is preserved for current consumers.
@osk02 osk02 self-assigned this May 14, 2026
Comment thread src/components/bar-chart/bar-chart.tsx
Comment thread src/components/bar-chart/bar-chart.tsx
@sarangshahane sarangshahane force-pushed the git-450-bar-size-props-clean branch from ee4321b to 4a51ab3 Compare May 18, 2026 03:02
@osk02 osk02 force-pushed the git-450-bar-size-props-clean branch from 4a51ab3 to ee4321b Compare May 18, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant