#import "CPTAnnotationHostLayer.h"
#import "CPTDefinitions.h"
#import "CPTNumericDataType.h"
/// @file
@class CPTLegend;
@class CPTMutableNumericData;
@class CPTNumericData;
@class CPTPlot;
@class CPTPlotArea;
@class CPTPlotSpace;
@class CPTPlotSpaceAnnotation;
@class CPTPlotRange;
@class CPTTextStyle;
/// @ingroup plotBindingsAllPlots
/// @{
extern NSString *const CPTPlotBindingDataLabels;
/// @}
/**
* @brief Enumeration of cache precisions.
**/
typedef enum _CPTPlotCachePrecision {
CPTPlotCachePrecisionAuto, ///< Cache precision is determined automatically from the data. All cached data will be converted to match the last data loaded.
CPTPlotCachePrecisionDouble, ///< All cached data will be converted to double precision.
CPTPlotCachePrecisionDecimal ///< All cached data will be converted to @ref NSDecimal.
}
CPTPlotCachePrecision;
#pragma mark -
/**
* @brief A plot data source.
**/
@protocol CPTPlotDataSource<NSObject>
/// @name Data Values
/// @{
/** @brief @required The number of data points for the plot.
* @param plot The plot.
* @return The number of data points for the plot.
**/
-(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot;
@optional
/** @brief @optional Gets a range of plot data for the given plot and field.
* Implement one and only one of the optional methods in this section.
* @param plot The plot.
* @param fieldEnum The field index.
* @param indexRange The range of the data indexes of interest.
* @return An array of data points.
**/
-(NSArray *)numbersForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange;
/** @brief @optional Gets a plot data value for the given plot and field.
* Implement one and only one of the optional methods in this section.
* @param plot The plot.
* @param fieldEnum The field index.
* @param idx The data index of interest.
* @return A data point.
**/
-(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx;
/** @brief @optional Gets a range of plot data for the given plot and field.
* Implement one and only one of the optional methods in this section.
* @param plot The plot.
* @param fieldEnum The field index.
* @param indexRange The range of the data indexes of interest.
* @return A retained C array of data points.
**/
-(double *)doublesForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange;
/** @brief @optional Gets a plot data value for the given plot and field.
* Implement one and only one of the optional methods in this section.
* @param plot The plot.
* @param fieldEnum The field index.
* @param idx The data index of interest.
* @return A data point.
**/
-(double)doubleForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx;
/** @brief @optional Gets a range of plot data for the given plot and field.
* Implement one and only one of the optional methods in this section.
* @param plot The plot.
* @param fieldEnum The field index.
* @param indexRange The range of the data indexes of interest.
* @return A one-dimensional array of data points.
**/
-(CPTNumericData *)dataForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange;
/** @brief @optional Gets a range of plot data for all fields of the given plot simultaneously.
* Implement one and only one of the optional methods in this section.
*
* The data returned from this method should be a two-dimensional array. It can be arranged
* in row- or column-major order although column-major will load faster, especially for large arrays.
* The array should have the same number of rows as the length of @par{indexRange}.
* The number of columns should be equal to the number of plot fields required by the plot.
* The column index (zero-based) corresponds with the field index.
* The data type will be converted to match the @link CPTPlot::cachePrecision cachePrecision @endlink if needed.
*
* @param plot The plot.
* @param indexRange The range of the data indexes of interest.
* @return A two-dimensional array of data points.
**/
-(CPTNumericData *)dataForPlot:(CPTPlot *)plot recordIndexRange:(NSRange)indexRange;
/// @}
/// @name Data Labels
/// @{
/** @brief @optional Gets a range of data labels for the given plot.
* @param plot The plot.
* @param indexRange The range of the data indexes of interest.
* @return An array of data labels.
**/
-(NSArray *)dataLabelsForPlot:(CPTPlot *)plot recordIndexRange:(NSRange)indexRange;
/** @brief @optional Gets a data label for the given plot.
* This method will not be called if
* @link CPTPlotDataSource::dataLabelsForPlot:recordIndexRange: -dataLabelsForPlot:recordIndexRange: @endlink
* is also implemented in the datasource.
* @param plot The plot.
* @param idx The data index of interest.
* @return The data label for the point with the given index.
* If you return @nil, the default data label will be used. If you return an instance of NSNull,
* no label will be shown for the index in question.
**/
-(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)idx;
/// @}
@end
#pragma mark -
/**
* @brief Plot delegate.
**/
@protocol CPTPlotDelegate<NSObject>
@optional
/// @name Point Selection
/// @{
/** @brief @optional Informs the delegate that a data label was
* @if MacOnly clicked. @endif
* @if iOSOnly touched. @endif
* @param plot The plot.
* @param idx The index of the
* @if MacOnly clicked data label. @endif
* @if iOSOnly touched data label. @endif
**/
-(void)plot:(CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)idx;
/** @brief @optional Informs the delegate that a data label was
* @if MacOnly clicked. @endif
* @if iOSOnly touched. @endif
* @param plot The plot.
* @param idx The index of the
* @if MacOnly clicked data label. @endif
* @if iOSOnly touched data label. @endif
* @param event The event that triggered the selection.
**/
-(void)plot:(CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event;
/// @}
/// @name Drawing
/// @{
/**
* @brief @optional Informs the delegate that plot drawing is finished.
* @param plot The plot.
**/
-(void)didFinishDrawing:(CPTPlot *)plot;
/// @}
@end
#pragma mark -
@interface CPTPlot : CPTAnnotationHostLayer {
@private
__cpt_weak id<CPTPlotDataSource> dataSource;
NSString *title;
CPTPlotSpace *plotSpace;
BOOL dataNeedsReloading;
NSMutableDictionary *cachedData;
NSUInteger cachedDataCount;
CPTPlotCachePrecision cachePrecision;
BOOL needsRelabel;
CGFloat labelOffset;
CGFloat labelRotation;
NSUInteger labelField;
CPTTextStyle *labelTextStyle;
NSFormatter *labelFormatter;
NSRange labelIndexRange;
NSMutableArray *labelAnnotations;
CPTShadow *labelShadow;
BOOL alignsPointsToPixels;
}
/// @name Data Source
/// @{
@property (nonatomic, readwrite, cpt_weak_property) __cpt_weak id<CPTPlotDataSource> dataSource;
/// @}
/// @name Identification
/// @{
@property (nonatomic, readwrite, copy) NSString *title;
/// @}
/// @name Plot Space
/// @{
@property (nonatomic, readwrite, retain) CPTPlotSpace *plotSpace;
/// @}
/// @name Plot Area
/// @{
@property (nonatomic, readonly, retain) CPTPlotArea *plotArea;
/// @}
/// @name Data Loading
/// @{
@property (nonatomic, readonly, assign) BOOL dataNeedsReloading;
/// @}
/// @name Data Cache
/// @{
@property (nonatomic, readonly, assign) NSUInteger cachedDataCount;
@property (nonatomic, readonly, assign) BOOL doublePrecisionCache;
@property (nonatomic, readwrite, assign) CPTPlotCachePrecision cachePrecision;
@property (nonatomic, readonly, assign) CPTNumericDataType doubleDataType;
@property (nonatomic, readonly, assign) CPTNumericDataType decimalDataType;
/// @}
/// @name Data Labels
/// @{
@property (nonatomic, readonly, assign) BOOL needsRelabel;
@property (nonatomic, read
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
IOS_使用core plot实现曲线图(可点击) (179个子文件)
libCorePlot-CocoaTouch.a 4.2MB
.DS_Store 6KB
.DS_Store 6KB
entries 12KB
CPTPlot.h 11KB
CPTTradingRangePlot.h 9KB
CPTAxis.h 9KB
CPTAnimationPeriod.h 7KB
CPTPlotSpace.h 6KB
CPTBarPlot.h 6KB
CPTDefinitions.h 6KB
CPTPieChart.h 5KB
CPTAnimation.h 5KB
CPTScatterPlot.h 4KB
CPTLegend.h 4KB
CPTUtilities.h 4KB
CPTGraph.h 4KB
CPTRangePlot.h 3KB
CPTGradient.h 3KB
CPTNumericData.h 3KB
CPTLayer.h 3KB
CPTPlotSymbol.h 2KB
CPTLineCap.h 2KB
mainpage.h 2KB
CPTPlotRange.h 2KB
CorePlot-CocoaTouch.h 2KB
CPTResponder.h 2KB
CPTNumericDataType.h 2KB
CPTPlotArea.h 2KB
CPTTheme.h 1KB
CPTLineStyle.h 1KB
CPTTextStyle.h 1KB
NSCoderExtensions.h 1KB
CPTColor.h 1KB
CPTAxisLabel.h 1KB
CPTAnnotation.h 933B
CPTPlatformSpecificCategories.h 920B
CPTImage.h 917B
CPTConstraints.h 880B
CPTLegendEntry.h 864B
CPTAnimationOperation.h 798B
CPTNumericData+TypeConversion.h 780B
CPTFill.h 773B
CPTXYPlotSpace.h 750B
CPTMutableNumericData+TypeConversion.h 668B
CPTMutablePlotRange.h 631B
CPTDataSourceTestCase.h 609B
CPTTextLayer.h 608B
CPTCalendarFormatter.h 602B
CPTMutableLineStyle.h 592B
CPTBorderedLayer.h 560B
CPTAxisSet.h 522B
CPTShadow.h 521B
CPTLimitBand.h 516B
CPTLayerAnnotation.h 487B
CPTGraphHostingView.h 425B
CPTPlotSpaceAnnotation.h 396B
BaseTouchesView.h 396B
CPTAnnotationHostLayer.h 385B
CPTTimeFormatter.h 383B
CPTPlotAreaFrame.h 380B
CPTXYAxis.h 362B
TouchPlotViewController.h 351B
CPTMutableTextStyle.h 348B
CPTColorSpace.h 345B
CPTXYGraph.h 318B
CPTGridLineGroup.h 291B
CPTMutableShadow.h 285B
CPTPlatformSpecificFunctions.h 284B
AppDelegate.h 278B
CPTMutableNumericData.h 277B
NSNumberExtensions.h 277B
CPTGridLines.h 267B
CPTPlotGroup.h 261B
CPTPathExtensions.h 224B
CPTXYAxisSet.h 207B
CPTExceptions.h 190B
NSDecimalNumberExtensions.h 150B
CPTPlatformSpecificDefines.h 130B
CPTTestCase.h 88B
CPTDerivedXYGraph.h 76B
CPTAxisTitle.h 75B
CPTAxisLabelGroup.h 72B
CPTTextStylePlatformSpecific.h 0B
TouchPlotViewController.m 25KB
AppDelegate.m 2KB
BaseTouchesView.m 843B
main.m 334B
project.pbxproj 34KB
CoreplotSimple-Prefix.pch 456B
CoreplotSimple-Info.plist 1KB
xcschememanagement.plist 486B
Default-568h@2x.png 18KB
Default@2x.png 16KB
Default.png 6KB
button_bj.png 218B
zsbj.png 140B
InfoPlist.strings 45B
CPTPlot.h.svn-base 11KB
CPTTradingRangePlot.h.svn-base 9KB
共 179 条
- 1
- 2
mark_ios
- 粉丝: 43
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页