Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone CorePlot: Chart with user Touch Event

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

enter image description here

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

enter image description here

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

Thank you very much!!

like image 537
nullmicgo Avatar asked Dec 09 '22 05:12

nullmicgo


1 Answers

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;
like image 99
beryllium Avatar answered Dec 11 '22 17:12

beryllium