Core Plot (iOS and tvOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTScatterPlot.h
Go to the documentation of this file.
1 #import "CPTDefinitions.h"
2 #import "CPTLimitBand.h"
3 #import "CPTPlot.h"
4 #import "CPTPlotSymbol.h"
5 
7 
8 @class CPTLineStyle;
9 @class CPTScatterPlot;
10 @class CPTFill;
11 
16 
23 
27 typedef NS_ENUM (NSInteger, CPTScatterPlotField) {
30 };
31 
35 typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) {
40 };
41 
45 typedef NS_ENUM (NSInteger, CPTScatterPlotCurvedInterpolationOption) {
52 };
53 
57 typedef NS_ENUM (NSInteger, CPTScatterPlotHistogramOption) {
62 };
63 
64 #pragma mark -
65 
70 
71 @optional
72 
75 
81 -(nullable CPTPlotSymbolArray *)symbolsForScatterPlot:(nonnull CPTScatterPlot *)plot recordIndexRange:(NSRange)indexRange;
82 
91 -(nullable CPTPlotSymbol *)symbolForScatterPlot:(nonnull CPTScatterPlot *)plot recordIndex:(NSUInteger)idx;
92 
94 
95 @end
96 
97 #pragma mark -
98 
103 
104 @optional
105 
108 
117 -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)idx;
118 
128 -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event;
129 
138 -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolTouchDownAtRecordIndex:(NSUInteger)idx;
139 
149 -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event;
150 
159 -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolTouchUpAtRecordIndex:(NSUInteger)idx;
160 
170 -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event;
171 
173 
176 
182 -(void)scatterPlotDataLineWasSelected:(nonnull CPTScatterPlot *)plot;
183 
190 -(void)scatterPlot:(nonnull CPTScatterPlot *)plot dataLineWasSelectedWithEvent:(nonnull CPTNativeEvent *)event;
191 
198 -(void)scatterPlotDataLineTouchDown:(nonnull CPTScatterPlot *)plot;
199 
207 -(void)scatterPlot:(nonnull CPTScatterPlot *)plot dataLineTouchDownWithEvent:(nonnull CPTNativeEvent *)event;
208 
215 -(void)scatterPlotDataLineTouchUp:(nonnull CPTScatterPlot *)plot;
216 
224 -(void)scatterPlot:(nonnull CPTScatterPlot *)plot dataLineTouchUpWithEvent:(nonnull CPTNativeEvent *)event;
225 
227 
230 
238 -(void)scatterPlot:(nonnull CPTScatterPlot *)plot prepareForDrawingPlotLine:(nonnull CGPathRef)dataLinePath inContext:(nonnull CGContextRef)context;
239 
241 
242 @end
243 
244 #pragma mark -
245 
247 
250 @property (nonatomic, readwrite, strong, nullable) NSNumber *areaBaseValue;
251 @property (nonatomic, readwrite, strong, nullable) NSNumber *areaBaseValue2;
252 @property (nonatomic, readwrite, assign) CPTScatterPlotInterpolation interpolation;
253 @property (nonatomic, readwrite, assign) CPTScatterPlotHistogramOption histogramOption;
255 @property (nonatomic, readwrite, assign) CGFloat curvedInterpolationCustomAlpha;
257 
260 @property (nonatomic, readonly, nullable) CPTLimitBandArray *areaFillBands;
262 
265 @property (nonatomic, readwrite, copy, nullable) CPTLineStyle *dataLineStyle;
266 @property (nonatomic, readwrite, copy, nullable) CPTPlotSymbol *plotSymbol;
267 @property (nonatomic, readwrite, copy, nullable) CPTFill *areaFill;
268 @property (nonatomic, readwrite, copy, nullable) CPTFill *areaFill2;
270 
273 @property (nonatomic, readonly, nonnull) CGPathRef newDataLinePath;
275 
278 @property (nonatomic, readwrite, assign) CGFloat plotSymbolMarginForHitDetection;
279 @property (nonatomic, readwrite, assign) CGFloat plotLineMarginForHitDetection;
280 @property (nonatomic, readwrite, assign) BOOL allowSimultaneousSymbolAndPlotSelection;
282 
285 -(NSUInteger)indexOfVisiblePointClosestToPlotAreaPoint:(CGPoint)viewPoint;
286 -(CGPoint)plotAreaPointOfVisiblePointAtIndex:(NSUInteger)idx;
288 
291 -(nullable CPTPlotSymbol *)plotSymbolForRecordIndex:(NSUInteger)idx;
292 -(void)reloadPlotSymbols;
293 -(void)reloadPlotSymbolsInIndexRange:(NSRange)indexRange;
295 
298 -(void)addAreaFillBand:(nullable CPTLimitBand *)limitBand;
299 -(void)removeAreaFillBand:(nullable CPTLimitBand *)limitBand;
301 
302 @end
CPTScatterPlotInterpolationStepped
@ CPTScatterPlotInterpolationStepped
Steps beginning at data point.
Definition: CPTScatterPlot.h:37
CPTLineStyle
Immutable wrapper for various line drawing properties. Create a CPTMutableLineStyle if you want to cu...
Definition: CPTLineStyle.h:20
CPTScatterPlot::areaFill
CPTFill * areaFill
The fill style for the area underneath the data line. If nil, the area is not filled.
Definition: CPTScatterPlot.h:267
CPTScatterPlot::areaFillBands
CPTLimitBandArray * areaFillBands
An array of CPTLimitBand objects.
Definition: CPTScatterPlot.h:260
CPTScatterPlotBindingPlotSymbols
CPTScatterPlotBinding __nonnull const CPTScatterPlotBindingPlotSymbols
Plot symbols.
Definition: CPTScatterPlot.m:32
CPTScatterPlotInterpolationCurved
@ CPTScatterPlotInterpolationCurved
Curved interpolation.
Definition: CPTScatterPlot.h:39
CPTScatterPlot::curvedInterpolationOption
CPTScatterPlotCurvedInterpolationOption curvedInterpolationOption
The interpolation method used to generate the curved plot line (interpolation = CPTScatterPlotInterpo...
Definition: CPTScatterPlot.h:254
UIEvent
CPTPlotDataSource-p
A plot data source.
Definition: CPTPlot.h:51
CPTLimitBand
Defines a range and fill used to highlight a band of data.
Definition: CPTLimitBand.h:17
CPTScatterPlot::plotSymbol
CPTPlotSymbol * plotSymbol
The plot symbol drawn at each point if the data source does not provide symbols. If nil,...
Definition: CPTScatterPlot.h:266
CPTScatterPlotFieldX
@ CPTScatterPlotFieldX
X values.
Definition: CPTScatterPlot.h:28
NSRange
typedef NSRange
CGPoint
typedef CGPoint
NSUInteger
typedef NSUInteger
CPTScatterPlotCurvedInterpolationCatmullRomUniform
@ CPTScatterPlotCurvedInterpolationCatmullRomUniform
Catmull-Rom Spline Interpolation with alpha = 0.0.
Definition: CPTScatterPlot.h:47
CPTScatterPlotBindingXValues
CPTScatterPlotBinding __nonnull const CPTScatterPlotBindingXValues
X values.
Definition: CPTScatterPlot.m:30
CPTScatterPlot::allowSimultaneousSymbolAndPlotSelection
BOOL allowSimultaneousSymbolAndPlotSelection
YES if both symbol selection and line selection can happen on the same upEvent. If NO then when an up...
Definition: CPTScatterPlot.h:280
CPTScatterPlotHistogramNormal
@ CPTScatterPlotHistogramNormal
Standard histogram.
Definition: CPTScatterPlot.h:58
CPTScatterPlotCurvedInterpolationCatmullCustomAlpha
@ CPTScatterPlotCurvedInterpolationCatmullCustomAlpha
Catmull-Rom Spline Interpolation with a custom alpha value.
Definition: CPTScatterPlot.h:50
CPTScatterPlot::plotLineMarginForHitDetection
CGFloat plotLineMarginForHitDetection
A margin added to each side of a plot line when determining whether it has been hit.
Definition: CPTScatterPlot.h:279
CPTScatterPlotCurvedInterpolationOption
CPTScatterPlotCurvedInterpolationOption
Enumration of scatter plot curved interpolation style options.
Definition: CPTScatterPlot.h:45
CPTScatterPlotInterpolationHistogram
@ CPTScatterPlotInterpolationHistogram
Steps centered at data point.
Definition: CPTScatterPlot.h:38
CPTScatterPlotField
CPTScatterPlotField
Enumeration of scatter plot data source field types.
Definition: CPTScatterPlot.h:27
CPTScatterPlotFieldY
@ CPTScatterPlotFieldY
Y values.
Definition: CPTScatterPlot.h:29
CPTFill
Draws area fills.
Definition: CPTFill.h:18
CPTScatterPlotCurvedInterpolationHermiteCubic
@ CPTScatterPlotCurvedInterpolationHermiteCubic
Hermite Cubic Spline Interpolation.
Definition: CPTScatterPlot.h:51
CPTScatterPlotDataSource-p
A scatter plot data source.
Definition: CPTScatterPlot.h:69
-[NSObject copy]
id copy
CPTScatterPlotHistogramOptionCount
@ CPTScatterPlotHistogramOptionCount
The number of histogram options available.
Definition: CPTScatterPlot.h:61
CPTScatterPlotCurvedInterpolationCatmullRomChordal
@ CPTScatterPlotCurvedInterpolationCatmullRomChordal
Catmull-Rom Spline Interpolation with alpha = 1.0.
Definition: CPTScatterPlot.h:49
CPTScatterPlotCurvedInterpolationNormal
@ CPTScatterPlotCurvedInterpolationNormal
Standard Curved Interpolation (Bezier Curve)
Definition: CPTScatterPlot.h:46
CPTScatterPlotBindingYValues
CPTScatterPlotBinding __nonnull const CPTScatterPlotBindingYValues
Y values.
Definition: CPTScatterPlot.m:31
CPTPlotSymbol
Plot symbols for CPTScatterPlot.
Definition: CPTPlotSymbol.h:37
CPTScatterPlotInterpolationLinear
@ CPTScatterPlotInterpolationLinear
Linear interpolation.
Definition: CPTScatterPlot.h:36
CPTScatterPlot::curvedInterpolationCustomAlpha
CGFloat curvedInterpolationCustomAlpha
The custom alpha value used when the CPTScatterPlotCurvedInterpolationCatmullCustomAlpha interpolatio...
Definition: CPTScatterPlot.h:255
CGPathRef
typedef CGPathRef
CGContextRef
typedef CGContextRef
CPTScatterPlot
A two-dimensional scatter plot.
Definition: CPTScatterPlot.h:247
CPTScatterPlot::newDataLinePath
CGPathRef newDataLinePath
The path used to draw the data line. The caller must release the returned path.
Definition: CPTScatterPlot.h:273
CPTPlotSymbol.h
CPTDefinitions.h
CPTScatterPlot::histogramOption
CPTScatterPlotHistogramOption histogramOption
The drawing style for a histogram plot line (interpolation = CPTScatterPlotInterpolationHistogram)....
Definition: CPTScatterPlot.h:253
CPTScatterPlot::plotSymbolMarginForHitDetection
CGFloat plotSymbolMarginForHitDetection
A margin added to each side of a symbol when determining whether it has been hit.
Definition: CPTScatterPlot.h:278
CPTLimitBand.h
CPTPlot.h
-[CPTScatterPlot reloadPlotSymbols]
void reloadPlotSymbols()
Reload all plot symbols from the data source immediately.
Definition: CPTScatterPlot.m:399
CPTScatterPlotHistogramSkipFirst
@ CPTScatterPlotHistogramSkipFirst
Skip the first step of the histogram.
Definition: CPTScatterPlot.h:59
CPTPlot
An abstract plot class.
Definition: CPTPlot.h:258
CPTScatterPlotCurvedInterpolationCatmullRomCentripetal
@ CPTScatterPlotCurvedInterpolationCatmullRomCentripetal
Catmull-Rom Spline Interpolation with alpha = 0.5.
Definition: CPTScatterPlot.h:48
NSArray
CPTScatterPlot::areaBaseValue
NSNumber * areaBaseValue
The Y coordinate of the straight boundary of the area fill. If not a number, the area is not filled.
Definition: CPTScatterPlot.h:250
cpt_swift_struct
#define cpt_swift_struct
Marks a type definition to be imported into Swift as a structure.
Definition: CPTDefinitions.h:73
CPTScatterPlotInterpolation
CPTScatterPlotInterpolation
Enumeration of scatter plot interpolation algorithms.
Definition: CPTScatterPlot.h:35
CPTScatterPlot::interpolation
CPTScatterPlotInterpolation interpolation
The interpolation algorithm used for lines between data points. Default is CPTScatterPlotInterpolatio...
Definition: CPTScatterPlot.h:252
NSString
CPTScatterPlotHistogramSkipSecond
@ CPTScatterPlotHistogramSkipSecond
Skip the second step of the histogram.
Definition: CPTScatterPlot.h:60
CPTScatterPlot::dataLineStyle
CPTLineStyle * dataLineStyle
The line style for the data line. If nil, the line is not drawn.
Definition: CPTScatterPlot.h:265
CPTScatterPlotDelegate-p
Scatter plot delegate.
Definition: CPTScatterPlot.h:102
CPTPlotDelegate-p
Plot delegate.
Definition: CPTPlot.h:170
CPTScatterPlot::areaBaseValue2
NSNumber * areaBaseValue2
The Y coordinate of the straight boundary of the secondary area fill. If not a number,...
Definition: CPTScatterPlot.h:251
CPTScatterPlot::areaFill2
CPTFill * areaFill2
The fill style for the area above the data line. If nil, the area is not filled.
Definition: CPTScatterPlot.h:268
CPTScatterPlotHistogramOption
CPTScatterPlotHistogramOption
Enumeration of scatter plot histogram style options.
Definition: CPTScatterPlot.h:57