                 continue
             }
             
+            let entryCount = set.entryCount
+            var visibleAngleCount = 0
+            for (var j = 0; j < entryCount; j++)
+            {
+                guard let e = set.entryForIndex(j) else { continue }
+                if ((abs(e.value) > 0.000001))
+                {
+                    visibleAngleCount++;
+                }
+            }
+            
             if (xIndex == 0)
             {
                 angle = 0.0

        
        let entryCount = dataSet.entryCount
        var drawAngles = chart.drawAngles
        let center = chart.centerCircleBox
        let radius = chart.radius
        let innerRadius = drawHoleEnabled && holeTransparent ? radius * holeRadiusPercent : 0.0
        
        CGContextSaveGState(context)
        
        for (var j = 0; j < entryCount; j++)
        {
            let sliceAngle = drawAngles[j]
            let sliceSpace = dataSet.sliceSpace
            let sliceSpaceOuterAngle = sliceSpace / (ChartUtils.Math.FDEG2RAD * radius)
            let sliceSpaceInnerAngle = innerRadius == 0.0 ? 0.0 : sliceSpace / (ChartUtils.Math.FDEG2RAD * innerRadius)
            
            guard let e = dataSet.entryForIndex(j) else { continue }
            

            
            if (innerRadius > 0.0)
            {
                let sliceSpaceInnerAngle = visibleAngleCount == 1 ?
                    0.0 :
                    sliceSpace / (ChartUtils.Math.FDEG2RAD * innerRadius)
                let startAngleInner = rotationAngle + (angle + sliceSpaceInnerAngle / 2.0) * phaseY
                var sweepAngleInner = (sliceAngle - sliceSpaceInnerAngle) * phaseY
                if (sweepAngleInner < 0.0)
