implement customPalette prop across all chart components#147
Merged
Conversation
Add support for custom color palettes in all chart components, allowing users to override default theme colors with brand-specific or custom color schemes.
Changes:
- Add customPalette?: string[] prop to all chart component interfaces
- Update color distribution logic to prioritize customPalette over theme
- Add customPalette to argTypes in all story files
- Create CustomPalette stories demonstrating usage
- Update documentation to mention customPalette feature
- Ensure consistent implementation across:
- AreaChart
- BarChart
- LineChart
- PieChart
- RadarChart
- RadialChart
The customPalette prop overrides the theme prop when provided, giving users full control over chart colors while maintaining the existing theme system as fallback.
Usage:
<ChartComponent
data={data}
categoryKey="month"
customPalette={["#FF6B6B", "#4ECDC4", "#45B7D1"]}
// theme prop is ignored when customPalette is provided
/>
i-subham23
requested review from
abhithesys,
ankit-thesys,
rabisg and
thesysHrijul
July 2, 2025 13:15
abhithesys
approved these changes
Jul 3, 2025
| import { Card } from "../../../Card"; | ||
| import { AreaChart, AreaChartProps } from "../AreaChart"; | ||
|
|
||
| const customColorPalette = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for custom color palettes in all chart components, allowing users to override default theme colors with brand-specific or custom color schemes.
Changes:
The customPalette prop overrides the theme prop when provided, giving users full control over chart colors while maintaining the existing theme system as fallback.
Usage:
<ChartComponent
data={data}
categoryKey="month"
customPalette={["#FF6B6B", "#4ECDC4", "#45B7D1"]}
// theme prop is ignored when customPalette is provided
/>