@Override
  public void drawData(Canvas c) {

    int width = (int) mViewPortHandler.getChartWidth();
    int height = (int) mViewPortHandler.getChartHeight();

    if (mDrawBitmap == null
        || (mDrawBitmap.getWidth() != width)
        || (mDrawBitmap.getHeight() != height)) {

      if (width > 0 && height > 0) {

        mDrawBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_4444);
        mBitmapCanvas = new Canvas(mDrawBitmap);
      } else return;
    }

    mDrawBitmap.eraseColor(Color.TRANSPARENT);

    PieData pieData = mChart.getData();

    for (PieDataSet set : pieData.getDataSets()) {

      if (set.isVisible() && set.getEntryCount() > 0) drawDataSet(c, set);
    }
  }
  /**
   * This gives all pie-slices a rounded edge.
   *
   * @param c
   */
  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();
    }
  }