protected void drawRoundedSlices(Canvas c) { if (!mChart.isDrawRoundedSlicesEnabled()) return; PieDataSet dataSet = mChart.getData().getDataSet(); if (!dataSet.isVisible()) return; PointF center = mChart.getCenterCircleBox(); float r = mChart.getRadius(); // calculate the radius of the "slice-circle" float circleRadius = (r - (r * mChart.getHoleRadius() / 100f)) / 2f; List<Entry> entries = dataSet.getYVals(); float[] drawAngles = mChart.getDrawAngles(); float angle = mChart.getRotationAngle(); for (int j = 0; j < entries.size(); j++) { float newangle = drawAngles[j]; Entry e = entries.get(j); // draw only if the value is greater than zero if ((Math.abs(e.getVal()) > 0.000001)) { float x = (float) ((r - circleRadius) * Math.cos(Math.toRadians((angle + newangle) * mAnimator.getPhaseY())) + center.x); float y = (float) ((r - circleRadius) * Math.sin(Math.toRadians((angle + newangle) * mAnimator.getPhaseY())) + center.y); mRenderPaint.setColor(dataSet.getColor(j)); mBitmapCanvas.drawCircle(x, y, circleRadius, mRenderPaint); } angle += newangle * mAnimator.getPhaseX(); } }