update left and right padding
This commit is contained in:
parent
a318b19410
commit
9329f0ca15
@ -173,10 +173,15 @@ open class DoughnutChart: View, MVMCoreUIViewConstrainingProtocol {
|
|||||||
return doughnutChartModel?.spaceRequired ?? true
|
return doughnutChartModel?.spaceRequired ?? true
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateLabelContainer() {
|
func updateLabelContainer() {
|
||||||
labelContainer.leftPin?.constant = lineWidth()
|
labelContainer.layoutIfNeeded()
|
||||||
labelContainer.topPin?.constant = lineWidth()
|
let radius = sizeObject.getValueBasedOnApplicationWidth()/2 - lineWidth()
|
||||||
labelContainer.setNeedsDisplay()
|
let labelheight = labelContainer.frame.height/2
|
||||||
}
|
let padding = sizeObject.getValueBasedOnApplicationWidth()/2 - sqrt(pow(radius, 2) - pow(labelheight, 2))
|
||||||
|
|
||||||
|
labelContainer.leftPin?.constant = padding
|
||||||
|
labelContainer.topPin?.constant = padding
|
||||||
|
labelContainer.setNeedsDisplay()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user