如何使用图表和核心数据生成图形?
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))