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

[feature-request] pie/sunburst label text direction #3590

Closed
destradafilm opened this issue Feb 28, 2019 · 9 comments · Fixed by #4420
Closed

[feature-request] pie/sunburst label text direction #3590

destradafilm opened this issue Feb 28, 2019 · 9 comments · Fixed by #4420
Assignees
Labels
feature something new
Milestone

Comments

@destradafilm
Copy link

feature request for pie chart label options - to control how inside plot label directions are set.
As you see here, some of the labels from the values that are bigger slices face different directions compared to each other (one with the text bottom facing the outside of the donut, the other with the bottom facing the inside of the donut). The smaller slices have text with the bottom of text right aligned to center of donut.

plotly pie chart labels

@alexcjohnson
Copy link
Collaborator

Ha good timing, we were just talking about this today regarding the sunburst charts @etpinard is working on right now, but yes, would be great to implement for pie too.

@alexcjohnson alexcjohnson added the feature something new label Feb 28, 2019
@destradafilm
Copy link
Author

nice! I didn't even know you had a sunburst charts. Where can I find examples/docs on sunburst charts?

@alexcjohnson
Copy link
Collaborator

Sunburst is not yet available, but coming soon!

@etpinard etpinard mentioned this issue Mar 4, 2019
9 tasks
@etpinard
Copy link
Contributor

etpinard commented Mar 5, 2019

I'm thinking of adding textrotation: 'radial' | 'tangent' | 'none' | 'auto' - where 'auto' is the current default.

Any objections?

@alexcjohnson
Copy link
Collaborator

Perhaps change 'none' to 'fixed' or 'constant' so it can at some point be modified with another attribute containing an angle - or an array of angles? Other than that, 👍

@destradafilm
Copy link
Author

@etpinard thanks for taking care of this.

  • I'm wondering if 'tangent' will ensure that the text will always face one direction (in comparison to the preview I posted above: the tangential text with the largest slices in pie chart 1 and 2 face different directions)
  • What will be the behavior if a user chooses 'tangential' but the text is super long? Will the text ellipse? Will it get super small like it currently does when you choose textposition: 'inside' ?

@alexcjohnson
Copy link
Collaborator

That's a good point @destradafilm - I would assume the default would be to always have the text "right-side-up" as referenced to the screen, but that's the behavior you don't want since a biggest slice <50% like your chart 2 would have its text rotated right, but >50% like the other two would have it rotated left. A behavior where you always have the top (for tangential) or right (for radial) edge of the text toward either the inside or outside of the circle would need to be a separate attribute.

@parthhhh

This comment has been minimized.

@etpinard etpinard changed the title [feature-request] pie chart label text direction [feature-request] pie/sunburst label text direction Jul 11, 2019
@parthhhh

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
5 participants