Hello,
i have problem with you libraries. When have many value big and low it don't good display on the graph:

Same issue for me
Hello could we help me ? Black background in pie chart #151 not working Me :(
@PhilJay The problem seems to be related to drawing values that are very small when compared to the total (i.e. an angle of the pie that measures to less than one degree). An in particular, it seems to be caused by this condition in PieRenderer.drawDataSet():
if (sweepAngleOuter % 360f <= Utils.FLOAT_EPSILON) {
// Android is doing "mod 360"
mPathBuffer.addCircle(center.x, center.y, radius, Path.Direction.CW);
By changing this code so that it never goes inside this branch (i.e. if (false) { ...) then the pie is drawn correctly. Problem is, I didn't really understand the purpose of that check, so I'm not sure about the consequences of changing it. :(
How to reproduce
In the sample's PieChartActivity, alter the setData() method by commenting out the part that generates the entry values and replacing it by this code:
/*
for (int i = 0; i < count ; i++) {
entries.add(new PieEntry((float) ((Math.random() * mult) + mult / 5), mParties[i % mParties.length]));
}
*/
entries.add(new PieEntry(197, "A"));
entries.add(new PieEntry(1344, "B"));
entries.add(new PieEntry(314, "C"));
entries.add(new PieEntry(3, "D"));
You will see that the whole pie is covered by the color of the last entry (the smallest one). Some other artifacts may be present too, depending on the order of the entries.
Tested on 3.0.0 release.
@matiash I faced the following issues-
The issue for problem 1 is this part in the PieRenderer-
// draw only if the value is greater than zero
if ((Math.abs(e.getY()) > Utils.FLOAT_EPSILON)) {
....
}
The value of Utils.FLOAT_EPSILON is 1.0000001 so the condition is always true. Values less than 1 thus arent drawn.
The issue for problem 2 is as @matiash suggested, since the condition :
sweepAngleOuter % 360f <= Utils.FLOAT_EPSILON
is true
@bharatnadkarni Indeed. I just wanted to point out that this happens for small angles even when the values themselves are greater than 1.
Same problem here, when the fix for this will come? @PhilJay
Same problem.
Happening here too on first attempt to integrate the lib.
Basically happens when the value is somewhere around 1.
If this value of 1 is third in the ArrayList
It's 2018 and I'm getting this. Still no Updates?
Most helpful comment
@PhilJay The problem seems to be related to drawing values that are very small when compared to the total (i.e. an angle of the pie that measures to less than one degree). An in particular, it seems to be caused by this condition in
PieRenderer.drawDataSet():By changing this code so that it never goes inside this branch (i.e.
if (false) { ...) then the pie is drawn correctly. Problem is, I didn't really understand the purpose of that check, so I'm not sure about the consequences of changing it. :(How to reproduce
In the sample's
PieChartActivity, alter thesetData()method by commenting out the part that generates the entry values and replacing it by this code:You will see that the whole pie is covered by the color of the last entry (the smallest one). Some other artifacts may be present too, depending on the order of the entries.
Tested on 3.0.0 release.