Skip to content
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

[charts] Support for patterns in coloring PieChart #15706

Closed
ZaidLinkEZ opened this issue Dec 3, 2024 · 4 comments · Fixed by #15720
Closed

[charts] Support for patterns in coloring PieChart #15706

ZaidLinkEZ opened this issue Dec 3, 2024 · 4 comments · Fixed by #15720
Labels
component: charts This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@ZaidLinkEZ
Copy link

ZaidLinkEZ commented Dec 3, 2024

The problem in depth

I wanted to know if the color palettes and colors that are supported in charts support patterns, for example the usage of lines that work as a pattern inside a pie chart.

chart

Your environment

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: PieChart, Charts, Colors
Order ID: 95670

@ZaidLinkEZ ZaidLinkEZ added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Dec 3, 2024
@github-actions github-actions bot added component: charts This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Dec 3, 2024
@michelengelen
Copy link
Member

Hey @ZaidLinkEZ ... I don't think that this is possible at the moment, but it would be a great addition to the feature set. @JCQuintas how hard would it be to allow the fill to accept a predefined <pattern>...</pattern> element?

@michelengelen michelengelen changed the title [question] Regarding charts, I wanted to know if the color palettes or colors support a pattern inside it? [charts] Support for patterns in coloring Dec 3, 2024
@michelengelen michelengelen added the enhancement This is not a bug, nor a new feature label Dec 3, 2024
@JCQuintas
Copy link
Member

Patterns currently don't work on the PieChart only, because we use style={{fill: "${color}"}} which overrides any changes.

For the other chart types you can simply follow the gradient example and use a pattern instead of gradient.

As seen here:
https://stackblitz.com/edit/react-4k6xke?file=Demo.tsx

@JCQuintas JCQuintas changed the title [charts] Support for patterns in coloring [charts] Support for patterns in coloring PieChart Dec 3, 2024
@JCQuintas JCQuintas removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 3, 2024
@ZaidLinkEZ
Copy link
Author

Patterns currently don't work on the PieChart only, because we use style={{fill: "${color}"}} which overrides any changes.

For the other chart types you can simply follow the gradient example and use a pattern instead of gradient.

As seen here: https://stackblitz.com/edit/react-4k6xke?file=Demo.tsx

Okay, thanks! I'll look it up.

Copy link

github-actions bot commented Dec 4, 2024

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@ZaidLinkEZ How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants