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

Is there any way to position=insideMiddle? #4469

Open
jacquesuhlemann opened this issue Apr 30, 2024 · 5 comments
Open

Is there any way to position=insideMiddle? #4469

jacquesuhlemann opened this issue Apr 30, 2024 · 5 comments
Labels
enhancement Enhancement to a current API

Comments

@jacquesuhlemann
Copy link

Hey,

i want to build a pie chart with labels outside of the pie curved around them..
there i have two problems..

  1. position is only for InsideStart and InsideEnd available and there is no chance to give a spacing/width outwards (https://recharts.org/en-US/api/Label)
    Is there any chance to center this? And/or give a spacing?

  2. Alternatively, I could use a customized solution and use textPath, but I don't have the scope for this.
    Or am i on the wrong track here?

Thank you for your support!

@ckifer
Copy link
Member

ckifer commented Apr 30, 2024

labels outside of the pie curved around them

Can you explain this a bit more or show an image of what you want? You want curved labels around the inside edge of the circle?

Or you just want labels in the inside center like this (using highcharts as an example)?
image

@jacquesuhlemann
Copy link
Author

Hey @ckifer !

I mean something like this..

Bildschirmfoto 2024-04-30 um 22 01 07

I know that there is position=insideStart/insideEnd but there are no more settings for the viewpoint or for a better positioning.. I also try it with a custom label but there i missing a circumference from the cell to add a textPath.

Perhaps you have an idea how I can implement this?

@ckifer
Copy link
Member

ckifer commented Apr 30, 2024

You're correct that this isn't currently supported without custom work and even with custom work, you might not have the attributes available that you need to do it.

I'll try to get a sandbox going to see if I can make anything work

@ckifer ckifer added the enhancement Enhancement to a current API label Apr 30, 2024
@ckifer
Copy link
Member

ckifer commented Apr 30, 2024

Sandbox here, but I don't really know what I'm doing 😅
https://codesandbox.io/p/sandbox/pie-chart-of-straight-angle-forked-ws5ts7

@jacquesuhlemann
Copy link
Author

hmm then I'll keep trying..

Thanks anyway, @ckifer 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to a current API
Projects
None yet
Development

No branches or pull requests

2 participants