Merge branch 'feature/doughnutchart_from_coding' of gitlab.verizon.com:BPHV_MIPS/mvm_core_ui into feature/doughnutchart_from_coding
This commit is contained in:
commit
e326ba9a47
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user