Conversation
- Added new properties for legend label and container styles in ChartTheme. - Updated BaseLegend component to utilize theme styles for legend labels and container. - Refactored BarChart and LineChart components to remove dependency on providerTheme for legend shape styles. - Cleaned up unused imports and styles in related components.
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 2 files.
|
| color: group.options?.stroke || theme.colors[ index % theme.colors.length ], | ||
| shapeStyle: | ||
| group?.options?.legendShapeStyle ?? providerTheme.legendShapeStyles?.[ index ] ?? {}, | ||
| shapeStyle: group?.options?.legendShapeStyle, |
There was a problem hiding this comment.
Remove providerTheme.legendShapeStyle logic from bar/line chart since BaseLegend now handles all theme-related styling internally.
kangzj
left a comment
There was a problem hiding this comment.
Looks good to me!
I'm thinking of something similar as well - to move these colors, patterns and shapes control to the themes, and to make the themes easier to customize 👍
* Enhance chart legend styling and theme integration - Added new properties for legend label and container styles in ChartTheme. - Updated BaseLegend component to utilize theme styles for legend labels and container. - Refactored BarChart and LineChart components to remove dependency on providerTheme for legend shape styles. - Cleaned up unused imports and styles in related components. * changelog
Proposed changes:
Enable customization of legend labels and container styles via the theme provider.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
pnpm --filter="@automattic/charts" storybook