iPhone CorePlot: Chart with user Touch Event

梦想的初衷 提交于 2019-12-10 09:36:32

问题


I am now using Core-plot to develop application. I am looking for some touch event for user touch one point of the chart, then it show up the price.

When i take a look of the CorePlot website, It has a application show what i need http://code.google.com/p/core-plot/wiki/AppsUsingCorePlot

I really want to do this function by Core-plot, i am now using CorePlot 0.4 i want to do the following function

I really want to have a touch event which can show the specify price of the point user touch.

Thank you very much!!


回答1:


CorePlot provides a lot of ways to detect user touches:

For plots:

-(void)barPlot:(CPBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index;
-(void)scatterPlot:(CPScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index;
-(void)pieChart:(CPPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)index;

For plot space:

@protocol CPPlotSpaceDelegate <NSObject>
-(BOOL)plotSpace:(CPPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point;
-(BOOL)plotSpace:(CPPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)point;
-(BOOL)plotSpace:(CPPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)event atPoint:(CGPoint)point;



回答2:


The Mac CPTTestApp example program included with Core Plot shows how to do exactly what you describe. Look at the Point Selection Demo under the View menu.




回答3:


use gesture recolonization for this it work fine.in first tap u show price and second hide.



来源:https://stackoverflow.com/questions/7833108/iphone-coreplot-chart-with-user-touch-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!