-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
added simple path to external labels functionality on pie charts #986
Conversation
…into pie_with_path_labels
centroid = d3.svg.arc() | ||
.outerRadius(_radius + _externalLabelRadius) | ||
.innerRadius(_radius + _externalLabelRadius) | ||
.centroid(d); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
centroid
is never used.
Thanks @alan-unravel, I am merging this and making a few improvements:
As you can see on this test page, there are many problems with pie transitions: I think the position of the line could still be improved. Right now it's drawing from the center of the wedge to the center of a ring segment with the label on the outer radius. IMO it would be nicer to draw it directly to the label, but clip it at the label or a slight margin away from the label. I have code for that elsewhere but this is good enough for now. |
Merged in 2.0.0 beta 20 |
Thanks @gordonwoodhull let me know if I can be of any help, the original lines from the example I put in gitter were nice but I didn't have the time to generalize the concept. |
Requires externalLabels to have a value. Should probably also require radius otherwise the labels will get cut off very frequently. Not as fancy as the initial example, will have to work on that
