将数据从魔术记录追加到数组

时间:2019-04-19 10:48:59

标签: swift magicalrecord swiftcharts

我想从魔术记录中向我的快速图表数组添加数据

if let data = WeightTracker.mr_findAll() as? [WeightTracker] {
    WeightArray = data

    var x = [1.0, 2.0, 3.0, 4.0]
    let y = [0.0, 10.0, 16.0, 45.0]
    let formatter = WTRandomVC(lineChart: lineChartsView, xArray: x , yArray: y)

    self.lineChartsView?.data?.setValueFormatter(formatter)
    x.append(Double("\(String(describing: data.date))")!)
}

0 个答案:

没有答案