What I'm trying to accomplish with CorePlot on the iPhone is to plot two graphs in two 开发者_开发知识库different PlotSpaces. The y-Axis of the first PlotSpace should appear on the left and the y-Axis of the second one on the right.
The documentation gives a hint that it should be possible but I have no idea how to accomplish it.
I tried the following but failed miserably:
CPXYAxis *leftY = [[[CPXYAxis alloc] init] autorelease];
CPXYAxis *rightY = [[[CPXYAxis alloc] init] autorelease];
CPXYAxis *x = [[[CPXYAxis alloc] init] autorelease];
CPAxisSet *axisSet = [[[CPAxisSet alloc] init] autorelease];
axisSet.axes = [NSArray arrayWithObjects:x,leftY,rightY,nil];
graph.axisSet = axisSet;
leftY.plotSpace = leftAxisPlotSpace;
rightY.plotSpace = rightAxisPlotSpace;
x.plotSpace = rightAxisPlotSpace;
All I get are 3 x-Axis.
Any idea how I could accomplish this?
You need to specify which are the y-axes:
leftY.coordinate = CPCoordinateY;
rightY.coordinate = CPCoordinateY;
精彩评论