OGeek|极客世界-中国程序员成长平台

标题: ios - SwiftChart 库不适用于 Swift 3.0 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 17:28
标题: ios - SwiftChart 库不适用于 Swift 3.0

我用过SwiftChart实现如下图所示的折线图和面积图 Line and chart area .

它适用于 Xcode 7.3。现在正在将我的代码移植到 iOS 10,以便将代码转换为 Swift 3.0。我收到以下错误:

U

CGPathMoveToPoint(area, nil, CGFloat(xValues[0]), zero)

for i in 0..<xValues.count {
    CGPathAddLineToPoint(area, nil, CGFloat(xValues[i]), CGFloat(yValues[i]))
}

CGPathAddLineToPoint(area, nil, CGFloat(xValues.last!), zero)

if labels[i] != 0 {
    // Horizontal grid for 0 is not dashed\
    CGContextSetLineDash(context,phase:0,lengths:[5],count:1)
   // CGContextSetLineDash(context, 0, [5], 1)
} else {
    CGContextSetLineDash(context, 0, nil, 0)
}

请帮我解决这个问题



Best Answer-推荐答案


SwiftChart 的最新更新修复了上面提到的问题。请将您的 swift 图表库代码更新为最新的

关于ios - SwiftChart 库不适用于 Swift 3.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39423971/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4