iPhone CorePlot: Chart with user Touch Event

2019-05-08 19:28发布

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!!

3条回答
Evening l夕情丶
2楼-- · 2019-05-08 19:58

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;
查看更多
Emotional °昔
3楼-- · 2019-05-08 20:12

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.

查看更多
等我变得足够好
4楼-- · 2019-05-08 20:17

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

查看更多
登录 后发表回答