I’ve got an array of points for a standard line-graph like so:
Array = [NSArray arrayWithObjects:
[NSArray arrayWithObjects: [NSNumber numberWithInt: 10], [NSNumber numberWithInt: 20], nil],
[NSArray arrayWithObjects: [NSNumber numberWithInt: 30], [NSNumber numberWithInt: 40], nil],
nil];
The points show up on the graph display fine, but I’m having trouble finding out how to connect these two points to form a line. All the examples I can find online deal with plotting the paths of functions, such as f(x)=1/x. I’m simply interested in connecting two points to display a line.
Thank you.
EDIT 1
Here is how I set up the graph:
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;
EDIT 2
To anyone with a similar problem, the solution you are looking for is the dataLineStyle property.
If we’re talking about directly drawing lines in Quartz, something like this…
Without more info, I can’t really help.