Fix for pie chart, so small values won't appear as "background" (which really is a huge circle)
This commit is contained in:
parent
8134d7f056
commit
afcb72f50f
1 changed files with 2 additions and 4 deletions
|
@ -263,16 +263,14 @@ public class PieChartRenderer extends DataRenderer {
|
|||
|
||||
mPathBuffer.reset();
|
||||
|
||||
float arcStartPointX = 0.f, arcStartPointY = 0.f;
|
||||
float arcStartPointX = center.x + radius * (float) Math.cos(startAngleOuter * Utils.FDEG2RAD);
|
||||
float arcStartPointY = center.y + radius * (float) Math.sin(startAngleOuter * Utils.FDEG2RAD);
|
||||
|
||||
if (sweepAngleOuter % 360f <= Utils.FLOAT_EPSILON) {
|
||||
// Android is doing "mod 360"
|
||||
mPathBuffer.addCircle(center.x, center.y, radius, Path.Direction.CW);
|
||||
} else {
|
||||
|
||||
arcStartPointX = center.x + radius * (float) Math.cos(startAngleOuter * Utils.FDEG2RAD);
|
||||
arcStartPointY = center.y + radius * (float) Math.sin(startAngleOuter * Utils.FDEG2RAD);
|
||||
|
||||
mPathBuffer.moveTo(arcStartPointX, arcStartPointY);
|
||||
|
||||
mPathBuffer.arcTo(
|
||||
|
|
Loading…
Add table
Reference in a new issue