Tuesday, November 29, 2022
HomeIOS Developmentios - Chart with UIBezierPath at one under one

ios – Chart with UIBezierPath at one under one


I’m attempting to make pie chart as under which is working high quality however I’ve difficulty with finish path (which is orange in under picture).

enter image description here

What I need to do is make finish of orange form to under the inexperienced one in order that I can obtain as under.

enter image description here

Any suggestion how this may be finished?

Code could be discovered at under hyperlink.

https://drive.google.com/file/d/1ST0zNooLgRaI8s2pDK3NMjBQYjBSRoXB/view?usp=sharing

Beneath is what I’ve.

func drawBeizer(start_angle : CGFloat, end_angle : CGFloat, final_color : UIColor) {
    let path1 : UIBezierPath = UIBezierPath()
    
    path1.addArc(withCenter: CGPoint(x: self.body.measurement.width/2, y: self.body.measurement.peak/2), radius: ((self.body.measurement.width-main_view_width)/2), startAngle: start_angle, endAngle: end_angle, clockwise: true)
    path1.lineWidth = main_view_width
    path1.lineCapStyle = .spherical
    final_color.setStroke()
    path1.stroke()
    
}

This operate I’m passing begin angle and finish angle & colour for the trail.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments