PieRenderer extends SeriesRenderer<PieChart, Segment, SegmentFormatter> { protected static float degsToScreenDegs(float degs) { degs = degs % FULL_PIE_DEGS; if (degs > 0) { return FULL_PIE_DEGS - degs; } else { return degs; } } PieRenderer(PieChart plot); float getRadius(RectF rect); @Override void onRender(Canvas canvas, RectF plotArea, Segment series, SegmentFormatter formatter,
            RenderStack stack); void setDonutSize(float size, DonutMode mode); Segment getContainingSegment(PointF point); void setStartDegs(float degs); float getStartDegs(); void setExtentDegs(float degs); float getExtentDegs();  }
@Test public void testDegsToScreenDegs() throws Exception { assertEquals(0f, PieRenderer.degsToScreenDegs(0)); assertEquals(359f, PieRenderer.degsToScreenDegs(1)); assertEquals(271f, PieRenderer.degsToScreenDegs(89)); assertEquals(270f, PieRenderer.degsToScreenDegs(90)); assertEquals(269f, PieRenderer.degsToScreenDegs(91)); assertEquals(181f, PieRenderer.degsToScreenDegs(179)); assertEquals(180f, PieRenderer.degsToScreenDegs(180)); assertEquals(179f, PieRenderer.degsToScreenDegs(181)); assertEquals(91f, PieRenderer.degsToScreenDegs(269)); assertEquals(90f, PieRenderer.degsToScreenDegs(270)); assertEquals(89f, PieRenderer.degsToScreenDegs(271)); assertEquals(1f, PieRenderer.degsToScreenDegs(359)); assertEquals(0f, PieRenderer.degsToScreenDegs(360)); }