Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation on PieChartView #2880

Closed
manan19 opened this issue Oct 15, 2017 · 1 comment
Closed

Animation on PieChartView #2880

manan19 opened this issue Oct 15, 2017 · 1 comment

Comments

@manan19
Copy link

manan19 commented Oct 15, 2017

How do I animate the transparentCircleRadiusPercent and holeRadiusPercent properties on a PieChartView?

I tried this but it doesn't work

UIView.animate(withDuration: 0.6, animations: {
            self.pieChartView.holeRadiusPercent = 1
            self.pieChartView.transparentCircleRadiusPercent = 1
        }) { (finished) in
            self.pieChartView.data = PieChartData(dataSet: dataSet)
            UIView.animate(withDuration: 0.5, animations: {
                self.pieChartView.holeRadiusPercent = 0.9
                self.pieChartView.transparentCircleRadiusPercent = 0.9
            }, completion: { (finished) in

            })
        }
@liuxuan30
Copy link
Member

liuxuan30 commented Oct 25, 2017

It's not the same as UIView animation, as this library is based on CoreGraphics. Seems you have to write yourself (a display link maybe). Take a look at Animator.swift.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants