forked from core-plot/core-plot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCPTFunctionDataSource.h
More file actions
38 lines (28 loc) · 1.28 KB
/
CPTFunctionDataSource.h
File metadata and controls
38 lines (28 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#import "CPTPlot.h"
@class CPTPlotRange;
/// @file
/**
* @brief A function called to generate plot data in a CPTFunctionDataSource datasource.
**/
typedef double (*CPTDataSourceFunction)(double);
/**
* @brief An Objective-C block called to generate plot data in a CPTFunctionDataSource datasource.
**/
typedef double (^CPTDataSourceBlock)(double);
@interface CPTFunctionDataSource : NSObject<CPTPlotDataSource>
@property (nonatomic, readonly, nullable) CPTDataSourceFunction dataSourceFunction;
@property (nonatomic, readonly, nullable) CPTDataSourceBlock dataSourceBlock;
@property (nonatomic, readonly, nonnull) CPTPlot *dataPlot;
@property (nonatomic, readwrite) CGFloat resolution;
@property (nonatomic, readwrite, strong, nullable) CPTPlotRange *dataRange;
/// @name Factory Methods
/// @{
+(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction)function;
+(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock)block;
/// @}
/// @name Initialization
/// @{
-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction)function;
-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock)block;
/// @}
@end