如何让核心图中的坐标用户交互
我有点想了解核心情节的流程。我已经实现了该图表,其中 x 轴时间(小时)和 y 轴为一些值。现在,我想让每个坐标都与用户交互,这样,如果用户触摸每个坐标,我应该能够获取它的 X 和 Y 值。我在寻找一些提示时也遇到了这个问题。 如何使图形的坐标具有交互性?但不幸的是,我找不到答案中提到的任何存根,例如 mouseOrFingerDownAtPoint。
如果有人能帮助我找出应该在核心绘图框架中的何处实现这些功能,那就太好了。
I am kind of trying to get the flow of core plot. I have implemented the graph with my x-axis time(hours) and y axis to be some values. Now, i wanted to make each coordinate user interactive, such that, if the user touches each coordinate, I should be able to get the X and Y value of it. I also came across this question while searching for some tips.How to make the coordinate of a graph user interactive? But unfortunately, I couldn't find any stubs as mentioned in the answers like mouseOrFingerDownAtPoint.
It would be really great if some one helps me find out, where I should implement these functions in the core plot framework.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
交互方法已重命名为
pointingDevice...Event
。有关信息,请参阅CPResponder
文档。所有绘图都可以配置为响应触摸。您在控制器中实现相应的委托协议并设置绘图的委托属性。委托方法将告诉您所触摸的点的数据索引。您可以使用该索引来查找数据集中的坐标。查看示例程序——其中几个演示了绘图委托。
The interaction methods have been renamed to
pointingDevice...Event
. See theCPResponder
docs for info.All of the plots can be configured to respond to touches. You implement the corresponding delegate protocol in your controller and set the delegate property of the plot. The delegate method will tell you the data index of the point that was touched. You can use that index to find the coordinates in your data set. Look at the example programs--several of them demonstrate the plot delegate.