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

Configuration for Labels inside PolarCoord/PieChart #275

Open
ToniHeiss opened this issue Nov 28, 2023 · 4 comments
Open

Configuration for Labels inside PolarCoord/PieChart #275

ToniHeiss opened this issue Nov 28, 2023 · 4 comments

Comments

@ToniHeiss
Copy link

The labels are inside the piechart and, when you have fairly long labels, they overlap other areas in the chart. Is there any way to add a way to say "outside the pie chart"? Alternatively, use the offset of the label but apply it radially from the center out. If I configure a (20,20) offset for my pie chart labels, ALL labels will move 20 right, 20 down. There should be a way to say "20px" away or to the circle center for pie charts.

@ToniHeiss
Copy link
Author

Example:
271519572-6bb5d60c-ebd6-4223-875b-4c075b84c298

@j-robin-hunter
Copy link

I have the exact same issue. It ought to be possible to push the label out by a radius offset or similar

@rjahn
Copy link

rjahn commented Oct 10, 2024

A short info would be nice for us ;-)

@entronad
Copy link
Owner

@ToniHeiss @j-robin-hunter @rjahn

There should be a way to say "20px" away or to the circle center for pie charts.

The right way to set this is by coord.dimFill, I have updated the pie chart example to show:

coord: PolarCoord(transposed: true, dimCount: 1, dimFill: 1.05),

You've discovered an interesting issue; in fact, I hadn't realized why labelPosition wasn't working in the pie chart either. It was only after carefully examining the source code that I realized a pie chart exists in a one-dimensional polar coordinate system that only has angular direction. Therefore, positioning along the diameter is ineffective, and the correct approach is to set the default value along the diameter of the coordinate system: dimFill.

I admit this goes against intuition, but it's a logically consistent approach, which is precisely where the charm of the graphical grammar lies.

Of course, I will add more detailed explanations in the examples and comments.

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

No branches or pull requests

4 participants