Core Plot (macOS)
Cocoa plotting framework for macOS, iOS, and tvOS
|
A plot space using a two-dimensional cartesian coordinate system. More...
#import <CPTXYPlotSpace.h>
Public Instance Methods | |
User Interaction | |
(void) | - cancelAnimations |
Reset the dragging state and cancel any active animations. More... | |
(BOOL) | - pointingDeviceDownEvent:atPoint: [implementation] |
Informs the receiver that the user has pressed the mouse button. More... | |
(BOOL) | - pointingDeviceUpEvent:atPoint: [implementation] |
Informs the receiver that the user has released the mouse button. More... | |
(BOOL) | - pointingDeviceDraggedEvent:atPoint: [implementation] |
Informs the receiver that the user has moved the mouse with the button pressed. More... | |
(BOOL) | - scrollWheelEvent:fromPoint:toPoint: [implementation] |
Informs the receiver that the user has moved the scroll wheel. More... | |
Initialization | |
(nonnull instancetype) | - init [implementation] |
Initializes a newly allocated CPTXYPlotSpace object. More... | |
Public Instance Methods inherited from CPTPlotSpace | |
(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... | |
(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... | |
(nullable instancetype) | - initWithCoder: |
Returns an object initialized from data in a given unarchiver. More... | |
(BOOL) | - pointingDeviceCancelledEvent: [implementation] |
Informs the receiver that tracking of mouse moves has been cancelled for any reason. More... | |
(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: |
(void) | - setPlotRange:forCoordinate: |
(nullable CPTPlotRange *) | - plotRangeForCoordinate: |
(void) | - setScaleType:forCoordinate: |
(CPTScaleType) | - scaleTypeForCoordinate: |
(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: |
Public Instance Methods inherited from <NSKeyValueBindingCreation> | |
(NSArray *) | - exposedBindings |
(Class) | - valueClassForBinding: |
(void) | - bind:toObject:withKeyPath:options: |
(NSArray *) | - optionDescriptionsForBinding: |
(NSDictionary *) | - infoForBinding: |
(void) | - unbind: |
User Interaction | |
Public Instance Methods inherited from <NSCoding> | |
(id) | - initWithCoder: |
(void) | - encodeWithCoder: |
Public Instance Methods inherited from <CPTAnimationDelegate> | |
(void) | - animationDidStart: |
(Optional) Informs the delegate that an animation operation started animating. More... | |
(void) | - animationDidFinish: |
(Optional) Informs the delegate that an animation operation stopped after reaching its full duration. More... | |
(void) | - animationCancelled: |
(Optional) Informs the delegate that an animation operation was stopped before reaching its full duration. More... | |
(void) | - animationWillUpdate: |
(Optional) Informs the delegate that the animated property is about to update. More... | |
(void) | - animationDidUpdate: |
(Optional) Informs the delegate that the animated property has been updated. More... | |
Properties | |
CPTPlotRange * | xRange |
The range of the x coordinate. Defaults to a range with location zero (0 ) and a length of one (1 ). More... | |
CPTPlotRange * | yRange |
The range of the y coordinate. Defaults to a range with location zero (0 ) and a length of one (1 ). More... | |
CPTPlotRange * | globalXRange |
The global range of the x coordinate to which the xRange is constrained. More... | |
CPTPlotRange * | globalYRange |
The global range of the y coordinate to which the yRange is constrained. More... | |
CPTScaleType | xScaleType |
The scale type of the x coordinate. Defaults to CPTScaleTypeLinear. More... | |
CPTScaleType | yScaleType |
The scale type of the y coordinate. Defaults to CPTScaleTypeLinear. More... | |
BOOL | allowsMomentum |
If YES, plot space scrolling in any direction slows down gradually rather than stopping abruptly. Defaults to NO. More... | |
BOOL | allowsMomentumX |
If YES, plot space scrolling in the x-direction slows down gradually rather than stopping abruptly. Defaults to NO. More... | |
BOOL | allowsMomentumY |
If YES, plot space scrolling in the y-direction slows down gradually rather than stopping abruptly. Defaults to NO. More... | |
CPTAnimationCurve | momentumAnimationCurve |
The animation curve used to stop the motion of the plot ranges when scrolling with momentum. Defaults to CPTAnimationCurveQuadraticOut. More... | |
CPTAnimationCurve | bounceAnimationCurve |
The animation curve used to return the plot range back to the global range after scrolling. Defaults to CPTAnimationCurveQuadraticOut. More... | |
CGFloat | momentumAcceleration |
Deceleration in pixels/second^2 for momentum scrolling. Defaults to 2000.0 . More... | |
CGFloat | bounceAcceleration |
Bounce-back acceleration in pixels/second^2 when scrolled past the global range. Defaults to 3000.0 . More... | |
CGFloat | minimumDisplacementToDrag |
The minimum distance the interaction point must move before the event is considered a drag. Defaults to 2.0 . More... | |
Properties inherited from CPTPlotSpace | |
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 <NSKeyValueBindingCreation> | |
(void) | + exposeBinding: |
Public Class Methods inherited from <NSSecureCoding> | |
(BOOL) | + supportsSecureCoding: |
A plot space using a two-dimensional cartesian coordinate system.
The xRange and yRange determine the mapping between data coordinates and the screen coordinates in the plot area. The “end” of a range is the location plus its length. Note that the length of a plot range can be negative, so the end point can have a lesser value than the starting location.
The global ranges constrain the values of the xRange and yRange. Whenever the global range is set (non-nil), the corresponding plot range will be adjusted so that it fits in the global range. When a new range is set to the plot range, it will be adjusted as needed to fit in the global range. This is useful for constraining scrolling, for instance.
- (void) cancelAnimations |
Reset the dragging state and cancel any active animations.
|
implementation |
Initializes a newly allocated CPTXYPlotSpace object.
The initialized object will have the following properties:
0
, 1
]0
, 1
]2000.0
3000.0
2.0
Reimplemented from CPTPlotSpace.
|
implementation |
Informs the receiver that the user has pressed the mouse button.
If the receiver has a delegate and the delegate handles the event, this method always returns YES. If allowsUserInteraction is NO or the graph does not have a plotArea layer, this method always returns NO. Otherwise, if the interactionPoint
is within the bounds of the plotArea , a drag operation starts and this method returns YES.
event | The OS event. |
interactionPoint | The coordinates of the interaction. |
Reimplemented from CPTPlotSpace.
|
implementation |
Informs the receiver that the user has moved the mouse with the button pressed.
If the receiver has a delegate and the delegate handles the event, this method always returns YES. If allowsUserInteraction is NO or the graph does not have a plotArea layer, this method always returns NO. Otherwise, if a drag operation commences or is in progress, the xRange and yRange are shifted to follow the drag and this method returns YES.
event | The OS event. |
interactionPoint | The coordinates of the interaction. |
Reimplemented from CPTPlotSpace.
|
implementation |
Informs the receiver that the user has released the mouse button.
If the receiver has a delegate and the delegate handles the event, this method always returns YES. If allowsUserInteraction is NO or the graph does not have a plotArea layer, this method always returns NO. Otherwise, if a drag operation is in progress, it ends and this method returns YES.
event | The OS event. |
interactionPoint | The coordinates of the interaction. |
Reimplemented from CPTPlotSpace.
|
implementation |
Informs the receiver that the user has moved the scroll wheel.
If the receiver does not have a delegate, this method always returns NO. Otherwise, the -plotSpace:shouldHandleScrollWheelEvent:fromPoint:toPoint: 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. |
fromPoint | The starting coordinates of the interaction. |
toPoint | The ending coordinates of the interaction. |
Reimplemented from CPTPlotSpace.
|
readwritenonatomicassign |
|
readwritenonatomicassign |
|
readwritenonatomicassign |
|
readwritenonatomicassign |
Bounce-back acceleration in pixels/second^2 when scrolled past the global range. Defaults to 3000.0
.
|
readwritenonatomicassign |
The animation curve used to return the plot range back to the global range after scrolling. Defaults to CPTAnimationCurveQuadraticOut.
|
readwritenonatomiccopy |
The global range of the x coordinate to which the xRange is constrained.
If non-nil, the xRange and any changes to it will be adjusted so that it always fits within the globalXRange. If nil (the default), there is no constraint on x.
|
readwritenonatomiccopy |
The global range of the y coordinate to which the yRange is constrained.
If non-nil, the yRange and any changes to it will be adjusted so that it always fits within the globalYRange. If nil (the default), there is no constraint on y.
|
readwritenonatomicassign |
The minimum distance the interaction point must move before the event is considered a drag. Defaults to 2.0
.
|
readwritenonatomicassign |
Deceleration in pixels/second^2 for momentum scrolling. Defaults to 2000.0
.
|
readwritenonatomicassign |
The animation curve used to stop the motion of the plot ranges when scrolling with momentum. Defaults to CPTAnimationCurveQuadraticOut.
|
readwritenonatomiccopy |
The range of the x coordinate. Defaults to a range with location zero (0
) and a length of one (1
).
The location of the xRange defines the data coordinate associated with the left edge of the plot area. Similarly, the end of the xRange defines the data coordinate associated with the right edge of the plot area.
|
readwritenonatomicassign |
The scale type of the x coordinate. Defaults to CPTScaleTypeLinear.
|
readwritenonatomiccopy |
The range of the y coordinate. Defaults to a range with location zero (0
) and a length of one (1
).
The location of the yRange defines the data coordinate associated with the bottom edge of the plot area. Similarly, the end of the yRange defines the data coordinate associated with the top edge of the plot area.
|
readwritenonatomicassign |
The scale type of the y coordinate. Defaults to CPTScaleTypeLinear.