Overlapping labels in aster plot

383 Views Asked by At

We have a strange issue of overlapping labels in the aster plot d3 chart. We have used the d3 chart library & reference of http://bl.ocks.org/bbest/2de0e25d4840c68f2db1 In below image, 0.02% overlaps 2.91% pie.

To plot the polyline and label, I have referred http://bl.ocks.org/dbuezas/9306799

enter image description here

1

There are 1 best solutions below

1
Gerardo Furtado On

Warning: this is an ad hoc solution.

Using the index of the problematic label (in the CodePen you shared, it's 6) you can move everything, texts and polylines, a little bit up or down. In this case, down:

pos[1] = index === 6 ? pos[1] + 12 : pos[1];
outerArcCen[1] = index === 6 ? outerArcCen[1] + 10 : outerArcCen[1];

Here is the result: http://codepen.io/anon/pen/YZgXxa?editors=0010