-
Notifications
You must be signed in to change notification settings - Fork 71
LG-5588 Add Bar series for charts #3206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 61d1d95 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +143 B (+0.01%) Total Size: 1.6 MB
ℹ️ View Unchanged
|
2ddff74
to
3cdc590
Compare
c144079
to
ecedb1c
Compare
3cdc590
to
194a8b2
Compare
ecedb1c
to
c79aad4
Compare
194a8b2
to
008d760
Compare
c79aad4
to
b8868e3
Compare
08135ba
to
fcb6a07
Compare
b9fcf92
to
029d9c8
Compare
90910cf
to
13fb4c5
Compare
13fb4c5
to
cd3fb3d
Compare
cd3fb3d
to
4ecfd5e
Compare
4ecfd5e
to
61d1d95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Bar series support to the LeafyGreen charts library. It introduces a new Bar component that can render bar charts alongside existing line charts, with support for stacking bars.
Key changes:
- Added Bar component with stacking functionality
- Refactored test utilities to support multiple series types
- Updated exports and imports throughout the codebase
- Added new Storybook stories for bar chart examples
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
charts/core/src/Series/Bar/Bar.tsx | New Bar component implementation with stacking support |
charts/core/src/Series/Bar/index.ts | Exports for Bar component |
charts/core/src/testUtils/makeSeriesData.testUtils.ts | Renamed and refactored utility from line-specific to generic series data |
charts/core/src/testUtils/index.ts | Updated export to use new function name |
charts/core/src/index.ts | Added Bar exports to main index |
charts/core/src/Series/index.ts | Added Bar exports to Series index |
charts/core/src/Echart/initializeEcharts.ts | Registered BarChart component with ECharts |
charts/core/src/Echart/Echart.types.ts | Removed TODO comment for bar chart support |
charts/core/src/Chart.stories.tsx | Updated stories to use generic series data and added Bar examples |
charts/legend/src/Legend.stories.tsx | Updated to use renamed test utility function |
.changeset/funny-eagles-think.md | Added changeset documenting the new feature |
export const Bar = (props: BarProps) => { | ||
const options = useCallback< | ||
(stylingContext: StylingContext) => EChartSeriesOptions['bar']['options'] | ||
>( | ||
stylingContext => ({ | ||
clip: false, | ||
stack: props.stack, | ||
emphasis: { | ||
focus: 'self', | ||
}, | ||
itemStyle: { | ||
color: stylingContext.seriesColor, | ||
}, | ||
}), | ||
[props.stack], | ||
); |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The clip: false
option is set without documentation explaining why clipping is disabled for bar charts. This could impact rendering behavior and should be documented or made configurable.
Copilot uses AI. Check for mistakes.
✍️ Proposed changes
🎫 Ticket
LG-5588
✅ Checklist
new feature
pnpm changeset
and documented my changes🧪 How to test changes
Added storybook pages:
Recording.at.2025-10-15.13.58.44.mp4