图表CoreData-Swift 4

时间:2018-08-07 02:50:34

标签: ios swift charts swift4

如何使用图表和核心数据生成图形?

https://mateusfsilvablog.wordpress.com/2017/03/27/graficos-no-ios-utilizando-charts/

将库与coredata一起使用的最佳方法是什么?

import UIKit
import Charts

public class Occupation: NSObject {
  public struct OccupationValues {
    public var label: String
    public var value: Double
    public var percentage: Double
  }

  fileprivate var data: [OccupationValues]
  fileprivate var cutOff: Double
  public let total = 849.0

  public init(cutOff: Double = 1.7) {
    self.data = [OccupationValues]()
    self.data.append(OccupationValues(label: NSLocalizedString("Occupation.Mayor", value: "Mayor", comment: ""), value: 139))

0 个答案:

没有答案