class PieRenderer extends SeriesRenderer<PieChart, Segment, SegmentFormatter> {

    @Override
    public void onRender(Canvas canvas, RectF plotArea, Segment series, SegmentFormatter formatter,
            RenderStack stack) {

        // This renderer renders all series in one shot, so exclude any remaining series
        // from causing subsequent invocations of onRender:
        stack.disable(getClass());

        float radius = getRadius(plotArea);
        PointF origin = new PointF(plotArea.centerX(), plotArea.centerY());

        double[] values = getValues();
        double scale = calculateScale(values);
        float offset = degsToScreenDegs(startDegs);

        RectF rec = new RectF(origin.x - radius, origin.y - radius, origin.x + radius,
                origin.y + radius);

        int i = 0;
        for (SeriesBundle<Segment, ? extends SegmentFormatter> sfPair : getSeriesAndFormatterList()) {
            float lastOffset = offset;
            float sweep = (float) (scale * (values[i]) * extentDegs);
            offset += sweep;
            drawSegment(canvas, rec, sfPair.getSeries(), sfPair.getFormatter(), radius, lastOffset,
                    sweep);
            i++;
        }
    }

    public  PieRenderer(PieChart plot);

}