Core Plot (iOS and tvOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTPlotSpace.h
Go to the documentation of this file.
1 #import "CPTDefinitions.h"
2 #import "CPTPlot.h"
3 #import "CPTResponder.h"
4 
5 @class CPTLayer;
6 @class CPTPlotRange;
7 @class CPTGraph;
8 @class CPTPlotSpace;
9 
14 
19 
22 
30 
37 extern CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceCoordinateKey;
38 
46 extern CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceScrollingKey;
47 
55 
57 
62 
63 @optional
64 
67 
75 -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint;
76 
78 
81 
87 -(CGPoint)plotSpace:(nonnull CPTPlotSpace *)space willDisplaceBy:(CGPoint)proposedDisplacementVector;
88 
90 
93 
100 -(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *)space willChangePlotRangeTo:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate;
101 
106 -(void)plotSpace:(nonnull CPTPlotSpace *)space didChangePlotRangeForCoordinate:(CPTCoordinate)coordinate;
107 
109 
112 
120 -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)point;
121 
129 -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)point;
130 
137 -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event;
138 
146 -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)point;
147 
148 #if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE
149 #else
150 
159 -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandleScrollWheelEvent:(nonnull CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint;
160 #endif
161 
163 
164 @end
165 
170 
175 
176 #pragma mark -
177 
179 
180 @property (nonatomic, readwrite, copy, nullable) id<NSCopying, NSCoding, NSObject> identifier;
181 @property (nonatomic, readwrite) BOOL allowsUserInteraction;
182 @property (nonatomic, readonly) BOOL isDragging;
183 @property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGraph *graph;
184 @property (nonatomic, readwrite, cpt_weak_property, nullable) id<CPTPlotSpaceDelegate> delegate;
185 
186 @property (nonatomic, readonly) NSUInteger numberOfCoordinates;
187 
190 -(void)addCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate;
191 -(void)removeCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate;
192 -(void)insertCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx;
193 -(void)setCategories:(nullable CPTStringArray *)newCategories forCoordinate:(CPTCoordinate)coordinate;
194 -(void)removeAllCategories;
195 
196 -(nonnull CPTStringArray *)categoriesForCoordinate:(CPTCoordinate)coordinate;
197 -(nullable NSString *)categoryForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx;
198 -(NSUInteger)indexOfCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate;
200 
203 -(nonnull instancetype)init NS_DESIGNATED_INITIALIZER;
204 -(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER;
206 
207 @end
208 
209 #pragma mark -
210 
215 
218 -(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray *)plotPoint;
219 -(CGPoint)plotAreaViewPointForPlotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count;
220 -(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count;
221 
222 -(nullable CPTNumberArray *)plotPointForPlotAreaViewPoint:(CGPoint)point;
223 -(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point;
224 -(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point;
225 
226 -(CGPoint)plotAreaViewPointForEvent:(nonnull CPTNativeEvent *)event;
227 
228 -(nullable CPTNumberArray *)plotPointForEvent:(nonnull CPTNativeEvent *)event;
229 -(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(nonnull CPTNativeEvent *)event;
230 -(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(nonnull CPTNativeEvent *)event;
232 
235 -(void)setPlotRange:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate;
236 -(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coordinate;
238 
241 -(void)setScaleType:(CPTScaleType)newType forCoordinate:(CPTCoordinate)coordinate;
242 -(CPTScaleType)scaleTypeForCoordinate:(CPTCoordinate)coordinate;
244 
247 -(void)scaleToFitPlots:(nullable CPTPlotArray *)plots;
248 -(void)scaleToFitPlots:(nullable CPTPlotArray *)plots forCoordinate:(CPTCoordinate)coordinate;
249 -(void)scaleToFitEntirePlots:(nullable CPTPlotArray *)plots;
250 -(void)scaleToFitEntirePlots:(nullable CPTPlotArray *)plots forCoordinate:(CPTCoordinate)coordinate;
251 -(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint;
253 
254 @end
CPTPlotSpace::delegate
id< CPTPlotSpaceDelegate > delegate
The plot space delegate.
Definition: CPTPlotSpace.h:184
CPTPlotSpaceCoordinateMappingDidChangeNotification
CPTPlotSpaceCoordinateMapping __nonnull const CPTPlotSpaceCoordinateMappingDidChangeNotification
Plot space coordinate change notification.
Definition: CPTPlotSpace.m:7
CPTPlotSpace::allowsUserInteraction
BOOL allowsUserInteraction
Determines whether user can interactively change plot range and/or zoom.
Definition: CPTPlotSpace.h:181
CPTPlotSpaceScrollingKey
CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceScrollingKey
The userInfo dictionary key used by the CPTPlotSpaceCoordinateMappingDidChangeNotification to indicat...
Definition: CPTPlotSpace.m:10
CPTResponder-p
The basis of all event processing in Core Plot.
Definition: CPTResponder.h:6
NSObject
-[CPTPlotSpace init]
nonnull instancetype init()
Initializes a newly allocated CPTPlotSpace object.
Definition: CPTPlotSpace.m:93
CPTPlotRange
Defines an immutable range of plot data.
Definition: CPTPlotRange.h:27
CGPoint
typedef CGPoint
CPTPlotSpace::graph
CPTGraph * graph
The graph of the space.
Definition: CPTPlotSpace.h:183
NSUInteger
typedef NSUInteger
CPTPlotSpace
Defines the coordinate system of a plot.
Definition: CPTPlotSpace.h:178
CPTPlotSpaceArray
NSArray< __kindof CPTPlotSpace * > CPTPlotSpaceArray
An array of plot spaces.
Definition: CPTPlotSpace.h:169
-[NSObject copy]
id copy
CPTPlotSpace(AbstractMethods)
CPTPlotSpace abstract methods—must be overridden by subclasses.
Definition: CPTPlotSpace.h:214
CPTPlotSpaceCoordinateKey
CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceCoordinateKey
The userInfo dictionary key used by the CPTPlotSpaceCoordinateMappingDidChangeNotification to indicat...
Definition: CPTPlotSpace.m:9
CPTPlotSpace::isDragging
BOOL isDragging
Returns YES when the user is actively dragging the plot space.
Definition: CPTPlotSpace.h:182
BOOL
typedef BOOL
CPTMutablePlotSpaceArray
NSMutableArray< __kindof CPTPlotSpace * > CPTMutablePlotSpaceArray
A mutable array of plot spaces.
Definition: CPTPlotSpace.h:174
CPTLayer
Base class for all Core Animation layers in Core Plot.
Definition: CPTLayer.h:83
CPTDefinitions.h
CGFloat
typedef CGFloat
CPTPlot.h
CPTPlotSpaceDisplacementKey
CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceDisplacementKey
The userInfo dictionary key used by the CPTPlotSpaceCoordinateMappingDidChangeNotification to indicat...
Definition: CPTPlotSpace.m:11
CPTCoordinate
CPTCoordinate
Enumeration of axis coordinates.
Definition: CPTDefinitions.h:164
NSArray
cpt_swift_struct
#define cpt_swift_struct
Marks a type definition to be imported into Swift as a structure.
Definition: CPTDefinitions.h:73
NSString
-[CPTPlotSpace removeAllCategories]
void removeAllCategories()
Remove all categories for every coordinate.
Definition: CPTPlotSpace.m:291
cpt_weak_property
#define cpt_weak_property
A custom definition for automatic reference counting (ARC) weak properties that falls back to assign ...
Definition: CPTDefinitions.h:32
CPTScaleType
CPTScaleType
Enumeration of axis scale types.
Definition: CPTDefinitions.h:152
NSDecimal
typedef NSDecimal
CPTResponder.h
CPTGraph
An abstract graph class.
Definition: CPTGraph.h:74
CPTPlotSpace::identifier
id< NSCopying, NSCoding, NSObject > identifier
An object used to identify the plot in collections.
Definition: CPTPlotSpace.h:180
NSSecureCoding-p
NSCoder
CPTPlotSpace::numberOfCoordinates
NSUInteger numberOfCoordinates
The number of coordinate values that determine a point in the plot space.
Definition: CPTPlotSpace.h:186
CPTPlotSpaceDelegate-p
Plot space delegate.
Definition: CPTPlotSpace.h:61