Core Plot中DataSource和Delegate

 

最近探究在IOS中,折线图,饼图,柱形图等数据统计方面的显示和操作。

选择了开源的Core Plot框架

最近探究在IOS中,折线图,饼图,柱形图等数据统计方面的显示和操作。

选择了开源的Core Plot框架

现在将框架中的delegate和data source做一个简单的陈列,作为自己的备忘之用。

首先是delegate

1.<CPTAxisDelegate> 关于坐标系(轴线Axis)的delegate

  (a) -(BOOL)axis:(CPTAxis *)axis shouldUpdateAxisLabelAtLocations:(NSSet *)locations

  (b) -(BOOL)axis:(CPTAxis *)axis shouldUpdateMinorAxisLabelAtLocations:(NSSet *)locations

  (c) -(void)axisDidRelabel:(CPTAxis *)axis

  (d) -(BOOL)axisShouldRelabel:(CPTAxis *)axis

2.<CPTPlotSpaceDelegate> 关于点空间的delegate

  (a) -(void)plotSpace:(CPTPlotSpace *)space didChangePlotRangeForCoordinate:(CPTCoordinate)coordinate

  (b) -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceCancelledEvent:(id)event

  (c) -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandelPointingDeviceDownEvent:(id) event atPoint:(CGPoint) point

  (d) -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id) event atPoint:(CGPoint) point

  (e) -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandelPointingDeviceUpEvent:(id) event atPoint:(CGPoint) point

  (f) -(BOOL)plotSpace:(CPTPlotSpace *)space shouldScaleBy:(CGPoint) interactionScale aboutPoint:(CGPoint) interactionPoint

  (g) -(CPTPlotRange *) plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate

  (h) -(CGpoint)plotSpace:(CPTPlotSpace *)space willDisplaceBy:(CGPoint) proposedDisplacementVector

3.<CPTLegendDelegate> 关于图例Legend的delegate

  (a) -(BOOL)legend:(CPTLegend *)legend shouldDrawSwatchAtIndex:(NSUInteger)index forPlot:(CPTPlot *) plot inRect:(CGRect) rect inContext:(CGContextRef)context

4.<CPTBarPlotDelegate> 关于柱形图 Plot的delegate

  (a) -(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger) index

5.<CPTPieChartDelegate> 关于饼图的delegate

  (a) -(void)pieChart:(CPTPieChart *) plot sliceWasSelectedAtRecordIndex:(NSUInteger )index

6.<CPTScatterPlotDelegate>  关于散列点的Scatter的delegate

  (a) -(void)scatterPlot:(CPTScatterPlot *) plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger )index

下面是几个data source

1.<CPTPlotDataSource>

  (a) -(CPTNumericData *)dataForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange) indexRange

  (b) -(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index

  (c) -(double)doubleForPlot:(CPTPlot *)plot field:(NSUInteger) fieldEnum recordIndex:(NSUInteger) index

  (d) -(double *)doublesForPlot:(CPTPlot *) plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange

  (e) -(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index

  (f) -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot

  (g) -(NSArray *)numbersForPlot:(CPTPlot *) plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange

  1.1<CPTBarPlotDataSource> 柱形图

  1.2<CPTPieChartDataSource> 饼图

  1.3<CPTScatterPlotDataSource> 散列点

posted @ 2012-02-26 17:43  Grumoon  阅读(1123)  评论(0编辑  收藏  举报