You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pie charts don't always seem to fit labels to a constrained space #75
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.
Activity
alexcjohnson commentedon Dec 4, 2015
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 commentedon Feb 8, 2017
This is not just you! Mine are getting cut off when embedded.

mosteele commentedon Feb 8, 2017
lucky6qi commentedon Mar 15, 2018
phanigokaraj commentedon Apr 5, 2018
nicolaskruchten commentedon Sep 26, 2019
Related #3607
etpinard commentedon Sep 26, 2019
Merging into (updated) #4223