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
Pie charts that are 100% a single value have a line that shouldn't be there #4385
Comments
This is doable with I've also found that You must choose to always eliminate spaces between different slices if your chart potentially has a single value, which seems like an unnecessary limitation. |
Makes sense to me, the default should probably be no line there.
It does? Can you give an example?
Same, can you give an example?
Right now we're at an in-between where the storybook has more accurate documentation than the website due to the website being hard to maintain. This does need added there and feel free to make a PR here https://github.com/recharts/recharts.org if you'd like to see it there.
For sure! This is a legacy thing, I have no idea why it is like that and I agree with you. We can just default stroke to none when there are no slices, but this is a breaking change and we'll have to do it in 3.x which we're working on |
Yes.
You can observe the added white border around the pie chart, however there is probably a way to make this stroke color the same color as my background, making this a non-issue, but perhaps it should default transparent? You can also see the slight offset of the pink slice in the first picture at the center of the pie chart.
Here you can see the pink slice has no offset and and its most central point is flush with the rest of the other slice's most central point. |
Got it. I can see the case for making the stroke transparent or none by default for sure. I'm not really sure what the logic of Changing the stroke default can come in 3.x. Fixing |
All https://github.com/recharts/recharts/blob/3.x/src/polar/Pie.tsx#L517. This could easily be replaced with |
What problem does this feature solve?
Pie charts that are filled with only a single value will be whole circles and not have an unnecessary split in them. A whole pie chart should not have any split in it.
What does the proposed API look like?
I don't believe there should be any new API exposed to the user; by default pie charts that are 100% a single value should show a single solid circle. If this feature was to be optional there could be an attribute passed to
<Pie />
likesplitOnSingleValue
orwholeCircleOnSingleValue
, etc.The text was updated successfully, but these errors were encountered: