diff --git a/MVMCoreUI/Molecules/Doughnut/DoughnutChart.swift b/MVMCoreUI/Molecules/Doughnut/DoughnutChart.swift index acb2e9ea..130536e4 100644 --- a/MVMCoreUI/Molecules/Doughnut/DoughnutChart.swift +++ b/MVMCoreUI/Molecules/Doughnut/DoughnutChart.swift @@ -132,17 +132,16 @@ open class DoughnutChart: View { let arcCenter = shapeLayer.position let radius = shapeLayer.bounds.size.width / 2.0 - lineWidth()/2.0 - let clockwise = true - + let value: CGFloat = chartModel.percent - let gap: CGFloat = spaceReuired() ? lineGap() : 0.0 + let gap: CGFloat = spaceRequired() ? lineGap() : 0.0 let startAngle = ((prevPercent / 100.0) * 2 * .pi) - (0.5 * .pi) let endAngle = ((value / 100.0) * 2 * .pi) + startAngle - gap let circlePath = UIBezierPath(arcCenter: arcCenter, radius: radius, startAngle: startAngle, endAngle: endAngle, - clockwise: clockwise) + clockwise: true) shapeLayer.path = circlePath.cgPath doughnutLayer.addSublayer(shapeLayer) @@ -168,7 +167,7 @@ open class DoughnutChart: View { return doughnutChartModel?.sections.count == 1 ? 0.0 : 0.05 } - func spaceReuired() -> Bool { + func spaceRequired() -> Bool { return doughnutChartModel?.spaceRequired ?? true } diff --git a/MVMCoreUI/Molecules/Doughnut/DoughnutChartView.swift b/MVMCoreUI/Molecules/Doughnut/DoughnutChartView.swift index 4893edbc..31091796 100644 --- a/MVMCoreUI/Molecules/Doughnut/DoughnutChartView.swift +++ b/MVMCoreUI/Molecules/Doughnut/DoughnutChartView.swift @@ -50,7 +50,7 @@ import Foundation centerY.isActive = true colorLablesStack.leadingAnchor.constraint(equalTo: doughnutChart.trailingAnchor, constant: PaddingThree).isActive = true - colorLablesStack.backgroundColor = UIColor.clear + colorLablesStack.backgroundColor = .clear } open override func updateView(_ size: CGFloat) {