Core Plot (iOS and tvOS)
Cocoa plotting framework for macOS, iOS, and tvOS
|
Defines the coordinate system of a plot. More...
#import <CPTPlotSpace.h>
Public Instance Methods | |
(CGPoint) | - plotAreaViewPointForPlotPoint: [implementation] |
Converts a data point to plot area drawing coordinates. More... | |
(CGPoint) | - plotAreaViewPointForPlotPoint:numberOfCoordinates: [implementation] |
Converts a data point to plot area drawing coordinates. More... | |
(CGPoint) | - plotAreaViewPointForDoublePrecisionPlotPoint:numberOfCoordinates: [implementation] |
Converts a data point to plot area drawing coordinates. More... | |
(nullable CPTNumberArray *) | - plotPointForPlotAreaViewPoint: [implementation] |
Converts a point given in plot area drawing coordinates to the data coordinate space. More... | |
(void) | - plotPoint:numberOfCoordinates:forPlotAreaViewPoint: [implementation] |
Converts a point given in plot area drawing coordinates to the data coordinate space. More... | |
(void) | - doublePrecisionPlotPoint:numberOfCoordinates:forPlotAreaViewPoint: [implementation] |
Converts a point given in drawing coordinates to the data coordinate space. More... | |
(CGPoint) | - plotAreaViewPointForEvent: [implementation] |
Converts the interaction point of an OS event to plot area drawing coordinates. More... | |
(nullable CPTNumberArray *) | - plotPointForEvent: [implementation] |
Converts the interaction point of an OS event to the data coordinate space. More... | |
(void) | - plotPoint:numberOfCoordinates:forEvent: [implementation] |
Converts the interaction point of an OS event to the data coordinate space. More... | |
(void) | - doublePrecisionPlotPoint:numberOfCoordinates:forEvent: [implementation] |
Converts the interaction point of an OS event to the data coordinate space. More... | |
(void) | - setPlotRange:forCoordinate: [implementation] |
Sets the range of values for a given coordinate. More... | |
(nullable CPTPlotRange *) | - plotRangeForCoordinate: [implementation] |
Gets the range of values for a given coordinate. More... | |
(void) | - setScaleType:forCoordinate: [implementation] |
Sets the scale type for a given coordinate. More... | |
(CPTScaleType) | - scaleTypeForCoordinate: [implementation] |
Gets the scale type for a given coordinate. More... | |
(void) | - scaleToFitPlots: [implementation] |
Scales the plot ranges so that the plots just fit in the visible space. More... | |
(void) | - scaleToFitEntirePlots: [implementation] |
Scales the plot ranges so that the plots just fit in the visible space. More... | |
(void) | - scaleBy:aboutPoint: [implementation] |
Zooms the plot space equally in each dimension. More... | |
Categorical Data | |
(void) | - addCategory:forCoordinate: |
Add a new category name for the given coordinate. More... | |
(void) | - removeCategory:forCoordinate: |
Removes the named category for the given coordinate. More... | |
(void) | - insertCategory:forCoordinate:atIndex: |
Add a new category name for the given coordinate at the given index in the list of category names. More... | |
(void) | - setCategories:forCoordinate: |
Replace all category names for the given coordinate with the names in the supplied array. More... | |
(void) | - removeAllCategories |
Remove all categories for every coordinate. More... | |
(nonnull CPTStringArray *) | - categoriesForCoordinate: |
Returns a list of all category names for the given coordinate. More... | |
(nullable NSString *) | - categoryForCoordinate:atIndex: |
Returns the category name for the given coordinate at the given index in the list of category names. More... | |
(NSUInteger) | - indexOfCategory:forCoordinate: |
Returns the index of the given category name in the list of category names for the given coordinate. More... | |
Initialization | |
(nonnull instancetype) | - init |
Initializes a newly allocated CPTPlotSpace object. More... | |
(nullable instancetype) | - initWithCoder: |
Returns an object initialized from data in a given unarchiver. More... | |
User Interaction | |
(BOOL) | - pointingDeviceDownEvent:atPoint: [implementation] |
Informs the receiver that the user has touched the screen. More... | |
(BOOL) | - pointingDeviceUpEvent:atPoint: [implementation] |
Informs the receiver that the user has lifted their finger off the screen. More... | |
(BOOL) | - pointingDeviceDraggedEvent:atPoint: [implementation] |
Informs the receiver that the user has moved their finger while touching the screen. More... | |
(BOOL) | - pointingDeviceCancelledEvent: [implementation] |
Informs the receiver that tracking of touches has been cancelled for any reason. More... | |
Coordinate Space Conversions | |
(CGPoint) | - plotAreaViewPointForPlotPoint: |
(CGPoint) | - plotAreaViewPointForPlotPoint:numberOfCoordinates: |
(CGPoint) | - plotAreaViewPointForDoublePrecisionPlotPoint:numberOfCoordinates: |
(nullable CPTNumberArray *) | - plotPointForPlotAreaViewPoint: |
(void) | - plotPoint:numberOfCoordinates:forPlotAreaViewPoint: |
(void) | - doublePrecisionPlotPoint:numberOfCoordinates:forPlotAreaViewPoint: |
(CGPoint) | - plotAreaViewPointForEvent: |
(nullable CPTNumberArray *) | - plotPointForEvent: |
(void) | - plotPoint:numberOfCoordinates:forEvent: |
(void) | - doublePrecisionPlotPoint:numberOfCoordinates:forEvent: |
Coordinate Range | |
(void) | - setPlotRange:forCoordinate: |
(nullable CPTPlotRange *) | - plotRangeForCoordinate: |
Scale Types | |
(void) | - setScaleType:forCoordinate: |
(CPTScaleType) | - scaleTypeForCoordinate: |
Adjusting Ranges | |
(void) | - scaleToFitPlots: |
(void) | - scaleToFitPlots:forCoordinate: |
Scales the plot range for the given coordinate so that the plots just fit in the visible space. More... | |
(void) | - scaleToFitEntirePlots: |
(void) | - scaleToFitEntirePlots:forCoordinate: |
Scales the plot range for the given coordinate so that the plots just fit in the visible space. More... | |
(void) | - scaleBy:aboutPoint: |
Public Instance Methods inherited from NSObject | |
(Class) | - classForCoder |
(id) | - copy |
(void) | - dealloc |
(void) | - finalize |
(id) | - init |
(id) | - mutableCopy |
Public Instance Methods inherited from <NSObject> | |
(NSString *) | - description |
(NSUInteger) | - hash |
(BOOL) | - isEqual: |
User Interaction | |
Public Instance Methods inherited from <NSCoding> | |
(id) | - initWithCoder: |
(void) | - encodeWithCoder: |
Properties | |
id< NSCopying, NSCoding, NSObject > | identifier |
An object used to identify the plot in collections. More... | |
BOOL | allowsUserInteraction |
Determines whether user can interactively change plot range and/or zoom. More... | |
BOOL | isDragging |
Returns YES when the user is actively dragging the plot space. More... | |
CPTGraph * | graph |
The graph of the space. More... | |
id< CPTPlotSpaceDelegate > | delegate |
The plot space delegate. More... | |
NSUInteger | numberOfCoordinates |
The number of coordinate values that determine a point in the plot space. More... | |
Additional Inherited Members | |
Public Class Methods inherited from NSObject | |
(id) | + alloc |
(Class) | + class |
(void) | + initialize |
(void) | + load |
(id) | + new |
Public Class Methods inherited from <NSSecureCoding> | |
(BOOL) | + supportsSecureCoding: |
Defines the coordinate system of a plot.
A plot space determines the mapping between data coordinates and device coordinates in the plot area.
- (void) addCategory: | (nonnull NSString *) | category | |
forCoordinate: | (CPTCoordinate) | coordinate | |
Add a new category name for the given coordinate.
Category names must be unique for each coordinate. Adding the same name more than once has no effect.
category | The category name. |
coordinate | The axis coordinate. |
- (nonnull CPTStringArray *) categoriesForCoordinate: | (CPTCoordinate) | coordinate |
Returns a list of all category names for the given coordinate.
coordinate | The axis coordinate. |
- (nullable NSString *) categoryForCoordinate: | (CPTCoordinate) | coordinate | |
atIndex: | (NSUInteger) | idx | |
Returns the category name for the given coordinate at the given index in the list of category names.
coordinate | The axis coordinate. |
idx | The index in the list of category names. |
|
implementation |
Converts the interaction point of an OS event to the data coordinate space.
plotPoint | A c-style array of data point coordinates (as double values). |
count | The number of coordinate values in the plotPoint array. |
event | The event. |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) doublePrecisionPlotPoint: | (nonnull double *) | plotPoint | |
numberOfCoordinates: | (NSUInteger) | count | |
forEvent: | (nonnull CPTNativeEvent *) | event | |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Converts a point given in drawing coordinates to the data coordinate space.
plotPoint | A c-style array of data point coordinates (as double values). |
count | The number of coordinate values in the plotPoint array. |
point | The drawing coordinates of the data point. |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) doublePrecisionPlotPoint: | (nonnull double *) | plotPoint | |
numberOfCoordinates: | (NSUInteger) | count | |
forPlotAreaViewPoint: | (CGPoint) | point | |
Provided by category CPTPlotSpace(AbstractMethods).
- (NSUInteger) indexOfCategory: | (nonnull NSString *) | category | |
forCoordinate: | (CPTCoordinate) | coordinate | |
Returns the index of the given category name in the list of category names for the given coordinate.
category | The category name. |
coordinate | The axis coordinate. |
- (nonnull instancetype) init |
Initializes a newly allocated CPTPlotSpace object.
The initialized object will have the following properties:
Reimplemented in CPTXYPlotSpace.
- (nullable instancetype) initWithCoder: | (nonnull NSCoder *) | coder |
Returns an object initialized from data in a given unarchiver.
coder | An unarchiver object. |
- (void) insertCategory: | (nonnull NSString *) | category | |
forCoordinate: | (CPTCoordinate) | coordinate | |
atIndex: | (NSUInteger) | idx | |
Add a new category name for the given coordinate at the given index in the list of category names.
Category names must be unique for each coordinate. Adding the same name more than once has no effect.
category | The category name. |
coordinate | The axis coordinate. |
idx | The index in the list of category names. |
|
implementation |
Converts a data point to plot area drawing coordinates.
plotPoint | A c-style array of data point coordinates (as double values). |
count | The number of coordinate values in the plotPoint array. |
Provided by category CPTPlotSpace(AbstractMethods).
- (CGPoint) plotAreaViewPointForDoublePrecisionPlotPoint: | (nonnull double *) | plotPoint | |
numberOfCoordinates: | (NSUInteger) | count | |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Converts the interaction point of an OS event to plot area drawing coordinates.
event | The event. |
Provided by category CPTPlotSpace(AbstractMethods).
- (CGPoint) plotAreaViewPointForEvent: | (nonnull CPTNativeEvent *) | event |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Converts a data point to plot area drawing coordinates.
plotPoint | An array of data point coordinates (as NSNumber values). |
Provided by category CPTPlotSpace(AbstractMethods).
- (CGPoint) plotAreaViewPointForPlotPoint: | (nonnull CPTNumberArray *) | plotPoint |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Converts a data point to plot area drawing coordinates.
plotPoint | A c-style array of data point coordinates (as NSDecimal structs). |
count | The number of coordinate values in the plotPoint array. |
Provided by category CPTPlotSpace(AbstractMethods).
- (CGPoint) plotAreaViewPointForPlotPoint: | (nonnull NSDecimal *) | plotPoint | |
numberOfCoordinates: | (NSUInteger) | count | |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Converts the interaction point of an OS event to the data coordinate space.
plotPoint | A c-style array of data point coordinates (as NSDecimal structs). |
count | The number of coordinate values in the plotPoint array. |
event | The event. |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) plotPoint: | (nonnull NSDecimal *) | plotPoint | |
numberOfCoordinates: | (NSUInteger) | count | |
forEvent: | (nonnull CPTNativeEvent *) | event | |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Converts a point given in plot area drawing coordinates to the data coordinate space.
plotPoint | A c-style array of data point coordinates (as NSDecimal structs). |
count | The number of coordinate values in the plotPoint array. |
point | The drawing coordinates of the data point. |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) plotPoint: | (nonnull NSDecimal *) | plotPoint | |
numberOfCoordinates: | (NSUInteger) | count | |
forPlotAreaViewPoint: | (CGPoint) | point | |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Converts the interaction point of an OS event to the data coordinate space.
event | The event. |
Provided by category CPTPlotSpace(AbstractMethods).
- (nullable CPTNumberArray *) plotPointForEvent: | (nonnull CPTNativeEvent *) | event |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Converts a point given in plot area drawing coordinates to the data coordinate space.
point | The drawing coordinates of the data point. |
Provided by category CPTPlotSpace(AbstractMethods).
- (nullable CPTNumberArray *) plotPointForPlotAreaViewPoint: | (CGPoint) | point |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Gets the range of values for a given coordinate.
coordinate | The axis coordinate. |
Provided by category CPTPlotSpace(AbstractMethods).
- (nullable CPTPlotRange *) plotRangeForCoordinate: | (CPTCoordinate) | coordinate |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Informs the receiver that tracking of touches has been cancelled for any reason.
If the receiver does not have a delegate, this method always returns NO. Otherwise, the -plotSpace:shouldHandlePointingDeviceCancelledEvent: delegate method is called. If it returns NO, this method returns YES to indicate that the event has been handled and no further processing should occur.
event | The OS event. |
Reimplemented from <CPTResponder>.
|
implementation |
Informs the receiver that the user has touched the screen.
If the receiver does not have a delegate, this method always returns NO. Otherwise, the -plotSpace:shouldHandlePointingDeviceDownEvent:atPoint: delegate method is called. If it returns NO, this method returns YES to indicate that the event has been handled and no further processing should occur.
event | The OS event. |
interactionPoint | The coordinates of the interaction. |
Reimplemented from <CPTResponder>.
Reimplemented in CPTXYPlotSpace.
|
implementation |
Informs the receiver that the user has moved their finger while touching the screen.
If the receiver does not have a delegate, this method always returns NO. Otherwise, the -plotSpace:shouldHandlePointingDeviceDraggedEvent:atPoint: delegate method is called. If it returns NO, this method returns YES to indicate that the event has been handled and no further processing should occur.
event | The OS event. |
interactionPoint | The coordinates of the interaction. |
Reimplemented from <CPTResponder>.
Reimplemented in CPTXYPlotSpace.
|
implementation |
Informs the receiver that the user has lifted their finger off the screen.
If the receiver does not have a delegate , this method always returns NO. Otherwise, the -plotSpace:shouldHandlePointingDeviceUpEvent:atPoint: delegate method is called. If it returns NO, this method returns YES to indicate that the event has been handled and no further processing should occur.
event | The OS event. |
interactionPoint | The coordinates of the interaction. |
Reimplemented from <CPTResponder>.
Reimplemented in CPTXYPlotSpace.
- (void) removeAllCategories |
Remove all categories for every coordinate.
- (void) removeCategory: | (nonnull NSString *) | category | |
forCoordinate: | (CPTCoordinate) | coordinate | |
Removes the named category for the given coordinate.
category | The category name. |
coordinate | The axis coordinate. |
|
implementation |
Zooms the plot space equally in each dimension.
interactionScale | The scaling factor. One (1 ) gives no scaling. |
interactionPoint | The plot area view point about which the scaling occurs. |
Provided by category CPTPlotSpace(AbstractMethods).
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Scales the plot ranges so that the plots just fit in the visible space.
plots | An array of the plots that have to fit in the visible area. |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) scaleToFitEntirePlots: | (nullable CPTPlotArray *) | plots |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) scaleToFitEntirePlots: | (nullable CPTPlotArray *) | plots | |
forCoordinate: | (CPTCoordinate) | coordinate | |
Scales the plot range for the given coordinate so that the plots just fit in the visible space.
plots | An array of the plots that have to fit in the visible area. |
coordinate | The axis coordinate. |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Scales the plot ranges so that the plots just fit in the visible space.
plots | An array of the plots that have to fit in the visible area. |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) scaleToFitPlots: | (nullable CPTPlotArray *) | plots |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) scaleToFitPlots: | (nullable CPTPlotArray *) | plots | |
forCoordinate: | (CPTCoordinate) | coordinate | |
Scales the plot range for the given coordinate so that the plots just fit in the visible space.
plots | An array of the plots that have to fit in the visible area. |
coordinate | The axis coordinate. |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Gets the scale type for a given coordinate.
coordinate | The axis coordinate. |
Provided by category CPTPlotSpace(AbstractMethods).
- (CPTScaleType) scaleTypeForCoordinate: | (CPTCoordinate) | coordinate |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) setCategories: | (nullable CPTStringArray *) | newCategories | |
forCoordinate: | (CPTCoordinate) | coordinate | |
Replace all category names for the given coordinate with the names in the supplied array.
newCategories | An array of category names. |
coordinate | The axis coordinate. |
|
implementation |
Sets the range of values for a given coordinate.
newRange | The new plot range. |
coordinate | The axis coordinate. |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) setPlotRange: | (nonnull CPTPlotRange *) | newRange | |
forCoordinate: | (CPTCoordinate) | coordinate | |
Provided by category CPTPlotSpace(AbstractMethods).
|
implementation |
Sets the scale type for a given coordinate.
newType | The new scale type. |
coordinate | The axis coordinate. |
Provided by category CPTPlotSpace(AbstractMethods).
- (void) setScaleType: | (CPTScaleType) | newType | |
forCoordinate: | (CPTCoordinate) | coordinate | |
Provided by category CPTPlotSpace(AbstractMethods).
|
readwritenonatomicassign |
Determines whether user can interactively change plot range and/or zoom.
|
readwritenonatomicweak |
The plot space delegate.
|
readwritenonatomicweak |
The graph of the space.
An object used to identify the plot in collections.
|
readnonatomicassign |
Returns YES when the user is actively dragging the plot space.
|
readnonatomicassign |
The number of coordinate values that determine a point in the plot space.