CorePlot 中的多个 y 轴
我试图在 iPhone 上使用 CorePlot 完成的任务是在两个不同的 PlotSpace 中绘制两个图表。第一个 PlotSpace 的 y 轴应出现在左侧,第二个 PlotSpace 的 y 轴应出现在右侧。
该文档暗示这应该是可能的,但我不知道如何实现它。
我尝试了以下方法,但惨败:
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;
我得到的只是 3 个 x 轴。
知道我怎样才能做到这一点吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要指定 y 轴:
You need to specify which are the y-axes: