benkeen / d3pie

A configurable pie chart lib and generator built on d3.js
MIT License
370 stars 203 forks source link

Label lines overlap when there are lots of small segments clustered at the bottom. #160

Open mnori opened 6 years ago

mnori commented 6 years ago

d3pie is pretty sweet, but I had some trouble with the label layout. I created a new issue for this, since after doing some tests, it looks like a different bug from #157 (that one affects the top of the pie).

The bug: If you have a pie chart with lots of small segments clustered at the bottom, the layout algorithm becomes confused, causing the label lines to overlap:

borked

I ended up adding a new layout mode called "aside" that renders the labels in a vertical stack, rather than positioned around the circle, this solved my issue:

worky

Demo of bug and my workaround: https://codepen.io/wildtype/pen/ajjrmr