CPT ScatterPlot 连接点与跳过一些数据点

CPTScatterPlot connect point with skip some data point

例如,从09:00am到09:05:am
理想情况下,我的情节从服务器获得 6 分。

- (NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot {
   return 6;
}

数据源

Index Time  Price    

0     09:00 84.2
1     09:01 84.5
2     09:02 84.1
3     09:03 84.0
4     09:04 84.1
5     09:05 84.0

但是,实际上Server会这样响应数据源

Index Time  Price    
0     09:00 84.2
1     09:01 84.5
2     09:02 nil
3     09:03 nil
4     09:04 84.1
5     09:05 84.0

I return 6 for numberOfRecordsForPlot
numberForPlot 索引 2 和 3 为 nil
我会得到这样的情节 我的问题是 如果索引 2 和索引 3 没有数据
如何用直线连接索引 1 和索引 4
即使用直线连接 (1, 84.5) 到 (4, 84.1)

由于您只有四个数据点要绘制,-numberOfRecordsForPlot: 应该 return 4。数据源还应跳过 nil 值:

Index Time  Price    
0     09:00 84.2
1     09:01 84.5
2     09:04 84.1
3     09:05 84.0