最近探究在IOS中,折线图,饼图,柱形图等数据统计方面的显示和操作。
选择了开源的Core Plot框架
最近探究在IOS中,折线图,饼图,柱形图等数据统计方面的显示和操作。
选择了开源的Core Plot框架
现在将框架中的delegate和data source做一个简单的陈列,作为自己的备忘之用。
首先是delegate
1.
(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.
(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.
(a) -(BOOL)legend:(CPTLegend *)legend shouldDrawSwatchAtIndex:(NSUInteger)index forPlot:(CPTPlot *) plot inRect:(CGRect) rect inContext:(CGContextRef)context
4.
(a) -(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger) index
5.
(a) -(void)pieChart:(CPTPieChart *) plot sliceWasSelectedAtRecordIndex:(NSUInteger )index
6.
(a) -(void)scatterPlot:(CPTScatterPlot *) plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger )index
下面是几个data source
1.
(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
1.2