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

PNBarChart crash if all yValues are 0. #55

Closed
gbmksquare opened this issue Jan 29, 2016 · 1 comment
Closed

PNBarChart crash if all yValues are 0. #55

gbmksquare opened this issue Jan 29, 2016 · 1 comment

Comments

@gbmksquare
Copy link

In the code below, if all values are 0, yValueMax tries to ge yMinValue. But since yMinValue is not initialized, the app crashes.

func getYValueMax(yLabels:NSArray) {
    let max:CGFloat = CGFloat(yLabels.valueForKeyPath("@max.floatValue") as! Float)
    if max == 0 {
        yValueMax = yMinValue
    } else{
        yValueMax = max
    }
}

Can be temporarily fixed by manually setting barChart.yMinValue when initializing.

@gbmksquare
Copy link
Author

#26

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