From 28a6c94c10ae203b2dbe14228423f0f94223cce4 Mon Sep 17 00:00:00 2001 From: Leszek Wach Date: Mon, 9 Mar 2015 20:22:22 +0100 Subject: [PATCH] Fixed pie slices separation when there is only one slice Fixed #91 --- .../src/lecho/lib/hellocharts/renderer/PieChartRenderer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hellocharts-library/src/lecho/lib/hellocharts/renderer/PieChartRenderer.java b/hellocharts-library/src/lecho/lib/hellocharts/renderer/PieChartRenderer.java index 36ac1925..ea0c57fd 100644 --- a/hellocharts-library/src/lecho/lib/hellocharts/renderer/PieChartRenderer.java +++ b/hellocharts-library/src/lecho/lib/hellocharts/renderer/PieChartRenderer.java @@ -258,6 +258,10 @@ private void drawSlices(Canvas canvas) { private void drawSeparationLines(Canvas canvas) { final PieChartData data = dataProvider.getPieChartData(); + if(data.getValues().size() < 2){ + //No need for separation lines for 0 or 1 slices. + return; + } final float sliceScale = 360f / maxSum; float lastAngle = rotation; final float circleRadius = originCircleOval.width() / 2f;