gmmoraesbr / flot

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

Pie chart with 1 slice (100%) is drawn differently, breaks explorercanvas, for certain values #365

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When rendering pie charts with a single non-zero data value (i.e. the pie will 
show 100%), certain values cause the chart to be rendered differently.  The 
difference appears (in Firefox 3.6.3) as a thin white or light line along the 
starting radius (at 12 o'clock in the attached screenshot) of the pie for these 
values, while all other values render as a solid filled circle.

The values that cause this aberration can be described by the expression (x * 
2^n) where n is any non-negative integer and x is an element of a seemingly 
random set of integers that includes the following (exhaustive up to 360): (11, 
13, 15, 41, 47, 83, 93, 99, 109, 165, 167, 175, 177, 187, 197 , 207, 219, 229, 
339, 341, 343).  Thus, for example, charting a value of 11, 22, 44, or 88 will 
cause the bug, but not 33, 55, 66, or 77.  The size of the data set being 
charted doesn't seem to matter; if one value is one of these, and the rest (if 
any) are 0, the bug will occur.

The bug is much more severe when using explorercanvas to render the charts in 
IE (IE6 in the case I tested).  Whatever rendering quirk this bug causes in 
flot seems to prevent explorercanvas from rendering the pie at all in IE6 (the 
label shows but the circle does not).  Note that the table also seems to cause 
problems in IE6, so in order to test this with the attached code you'll need to 
remove the table tags.

Original issue reported on code.google.com by super.aardvark@gmail.com on 22 Jun 2010 at 8:59

Attachments:

GoogleCodeExporter commented 8 years ago
I just found this open issue in explorercanvas which may explain the IE 
behavior (and shed some light on the flot bug): 
http://code.google.com/p/explorercanvas/issues/detail?id=49

Original comment by super.aardvark@gmail.com on 22 Jun 2010 at 9:08

GoogleCodeExporter commented 8 years ago
Thanks for this solution but for me, it was not sufficient for IE6. But you 
have to find the code:

if (xStart == xEnd && !aClockwise) {
   xStart += 0.125;

and replace it by: 

   xStart += 0.125;

We dont see the difference visualy but the pie is now dsplayed with IE6 ;-)

Original comment by gcruxi...@gmail.com on 1 Apr 2011 at 7:16

GoogleCodeExporter commented 8 years ago
thanks gcruxi. Your solution fixed it for me.

Original comment by JSu...@gmail.com on 24 Jan 2012 at 3:56

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by dnsch...@gmail.com on 8 May 2012 at 12:23

GoogleCodeExporter commented 8 years ago
Issue 602 has been merged into this issue.

Original comment by dnsch...@gmail.com on 8 May 2012 at 12:23

GoogleCodeExporter commented 8 years ago
Need to review the fix proposed by gcruxifix and make sure that it really makes 
senes to remove that check.

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

GoogleCodeExporter commented 8 years ago

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