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

Error when running strokeChart #43

Closed
beamercola opened this issue Jun 20, 2015 · 0 comments
Closed

Error when running strokeChart #43

beamercola opened this issue Jun 20, 2015 · 0 comments

Comments

@beamercola
Copy link

Assertion failed: (CGFloatIsValid(x) && CGFloatIsValid(y)), function void CGPathMoveToPoint(CGMutablePathRef, const CGAffineTransform *, CGFloat, CGFloat), file Paths/CGPath.cc, line 254.

It's happening on progressline.moveToPoint(CGPointMake(x, y))

My code is pretty simplistic:

            var weekData:NSDictionary = JSON["week"] as! NSDictionary
            // Example: { "02/15": 7 }

            self.chartView?.xLabels = weekData.allKeys
            var data = PNLineChartData()
            data.color = UIColor(red: 77.0 / 255.0, green: 186.0 / 255.0, blue: 122.0 / 255.0, alpha: 1.0)
            data.itemCount = weekData.allKeys.count
            data.getData = ({(index: Int) -> PNLineChartDataItem in
                var yValue:CGFloat = weekData.allValues[index] as! CGFloat
                var item = PNLineChartDataItem(y: yValue)
                return item
            })
            self.chartView?.chartData = [data]
            self.chartView?.strokeChart()
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