dileep502 / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

Pie chart labels can overlap #530

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've found that it seems common for pie labels to overlap in smaller pie charts 
making them unreadable, particularly if several slices have small percentage 
values.  This is with the jquery.flot.pie plugin.  

Please see attached images.  I've worked around this with the addition of an 
anti-collision routine in the label rendering code.  I'm attaching a copy of 
the revised plugin as well.  See lines 472-501, particularly the new functions 
getPositions() and comparePositions().  This is based in part on Šime Vidas' 
DOM-element collision detection code.  Something like this might be a nice 
addition to the pie library.

Original issue reported on code.google.com by marsh...@hightempo.com on 5 May 2011 at 11:27

Attachments:

GoogleCodeExporter commented 8 years ago
thanks, really needed it.

Original comment by kduvar...@gmail.com on 2 Apr 2012 at 3:00

GoogleCodeExporter commented 8 years ago

Original comment by dnsch...@gmail.com on 8 May 2012 at 9:02

GoogleCodeExporter commented 8 years ago
Thanks, A LOT, the solution works great

Original comment by noo...@gmail.com on 1 Jul 2012 at 11:56

GoogleCodeExporter commented 8 years ago
How similar code to stop the label overlaying on the chart?

Original comment by rich.s.w...@gmail.com on 4 Jul 2012 at 11:13

GoogleCodeExporter commented 8 years ago
Looks great, but needs thorough testing, especially for edge-cases (single 
series, overcrowded pies, situations in which it's impossible to draw all 
labels, etc.)

Original comment by dnsch...@gmail.com on 11 Jul 2012 at 1:17

GoogleCodeExporter commented 8 years ago
First of all thanks a lot. It almost works fine but I observed some times It 
shows an message
"There is no available data" if data is zero.I think It should hide labels 
instead of showing this message.
And second most critical issue is sometimes it gives an error message saying
"Could not draw pie with labels contained inside canvas"
Please suggest any edit

Original comment by dipak.a....@gmail.com on 6 Jun 2013 at 8:27