1
SciChart折れ線グラフに日付を追加できません。実行時にこのエラーが発生します。SciChart iOS日時チャート
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Axis does not support type.'
私は提供された例に沿って次のように私のコードを軸に追加します。
var sciChartSurface: SCIChartSurface?
var lineDataSeries: SCIXyDataSeries!
var lineRenderableSeries: SCIFastLineRenderableSeries!
func createDataSeries(){
lineDataSeries = SCIXyDataSeries(xType: .dateTime, yType: .double)
lineDataSeries.acceptUnsortedData = true
let items = self.dataFeed.priceHistory
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
for i in 0..<(items.count) - 1 {
let date:Date = dateFormatter.date(from: items[i].date!)!
print("\(date) \(items[i].close!)")
lineDataSeries.appendX(SCIGeneric(date), y: SCIGeneric(Double(items[i].close!)))
}
}
これはprint文からどのような私の出力
2017-08-09 07:00:00 +0000 2474.02
2017-08-08 07:00:00 +0000 2474.92
2017-08-07 07:00:00 +0000 2480.91
2017-08-04 07:00:00 +0000 2476.83
2017-08-03 07:00:00 +0000 2472.16
2017-08-02 07:00:00 +0000 2477.57
私が間違ってやっている任意のアイデアですか?必要に応じてViewController全体を含めることを喜んでください。
方法にありました。私たちのエラーメッセージはより明確になります! [私はScichartチームにいる] –