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

Pie charts don't always seem to fit labels to a constrained space #75

Closed
tlrdstd opened this issue Dec 4, 2015 · 7 comments
Closed

Comments

@tlrdstd
Copy link
Contributor

tlrdstd commented Dec 4, 2015

Maybe it's just me, but I keep ending up with pie chart labels that look like this: http://codepen.io/tlrdstd/pen/QyWybK

image

It happens when I assign a fixed size to the pie chart, either by passing it in the layout hash, or in style attributes on the div. The pie chart always grows to fit the space, regardless of whether there is room to fit the labels. With a 300x300 square in this example, both the title and the text are cut off. If I increase to a 500x500 square, the title fits, but the text is still cut off because the pie chart grows to match.

Converting the square to a rectangle solves the problem, but that doesn't fit my design space.

I haven't dug into this in the code yet...after trying to solve variations on the same problem in other libraries (flot, d3pie, and uvcharts come to mind), I'm just assuming it ain't easy. d3pie does the best job of plotting labels of anything I've seen, though it too forgets to check the edges of the box.

@alexcjohnson
Copy link
Collaborator

We certainly could check for labels going off the edge of the plot, and shrink them to fit, that probably wouldn't be very hard.

The problem gets worse if you have several pies, their respective labels do nothing to avoid each other. That seems like a harder one to fix...

@mosteele
Copy link

mosteele commented Feb 8, 2017

This is not just you! Mine are getting cut off when embedded.
image

@mosteele

This comment has been minimized.

@lucky6qi

This comment has been minimized.

@phanigokaraj

This comment has been minimized.

@nicolaskruchten
Copy link
Contributor

Related #3607

@etpinard
Copy link
Contributor

Merging into (updated) #4223

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

7 participants