我有一个点的数组的标准线图如下所示:睿情节:捣乱线
Array = [NSArray arrayWithObjects:
[NSArray arrayWithObjects: [NSNumber numberWithInt: 10], [NSNumber numberWithInt: 20], nil],
[NSArray arrayWithObjects: [NSNumber numberWithInt: 30], [NSNumber numberWithInt: 40], nil],
nil];
的点显示在图形显示效果细腻,但我有麻烦找出如何连接这两点形成一条线。我可以在网上找到的所有示例处理绘制函数的路径,例如f(x)= 1/x。我只是想连接两点来显示一条线。
谢谢。
EDIT 1
这里是我设置的图形:
graph = [[CPTXYGraph alloc] init];
CPTTheme *theme = [CPTTheme themeNamed:kCPTStocksTheme];
[graph applyTheme:theme];
graph.frame = self.view.bounds;
graph.paddingRight = 4.0f;
graph.paddingLeft = 4.0f;
graph.plotAreaFrame.masksToBorder = NO;
graph.plotAreaFrame.cornerRadius = 0.0f;
CPTMutableLineStyle *borderLineStyle = [CPTMutableLineStyle lineStyle];
borderLineStyle.lineColor = [CPTColor whiteColor];
borderLineStyle.lineWidth = 0.01f;
graph.plotAreaFrame.borderLineStyle = borderLineStyle;
self.graphHost.hostedGraph = graph;
编辑2
要任何具有类似的问题,该您正在寻找的解决方案是dataLineStyle属性。
您确实没有发布足够的代码以提供帮助。但是,您可能需要遵循以下教程:http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application – Perception
您应该在初始化图形视图并设置它的位置包含代码属性。 Core Plot自己绘制线条,它不是你应该明确必须做的事情。 – Perception