Core Plot (macOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTXYAxis Class Reference

A 2-dimensional cartesian (X-Y) axis class. More...

#import <CPTXYAxis.h>

+ Inheritance diagram for CPTXYAxis:
+ Collaboration diagram for CPTXYAxis:

Public Instance Methods

Initialization
(nonnull instancetype) - initWithFrame: [implementation]
 Initializes a newly allocated CPTXYAxis object with the provided frame rectangle. More...
 
- Public Instance Methods inherited from CPTAxis
(CGPoint- viewPointForCoordinateValue: [implementation]
 Converts a position on the axis to drawing coordinates. More...
 
(void) - drawGridLinesInContext:isMajor: [implementation]
 Draws grid lines into the provided graphics context. More...
 
(void) - drawBackgroundBandsInContext: [implementation]
 Draws alternating background bands into the provided graphics context. More...
 
(void) - drawBackgroundLimitsInContext: [implementation]
 Draws background limit ranges into the provided graphics context. More...
 
(nullable CPTNumberSet *) - filteredMajorTickLocations:
 Removes any major ticks falling inside the label exclusion ranges from the set of tick locations. More...
 
(nullable CPTNumberSet *) - filteredMinorTickLocations:
 Removes any minor ticks falling inside the label exclusion ranges from the set of tick locations. More...
 
(void) - layoutSublayers [implementation]
 Updates the layout of all sublayers. The axes are relabeled if needed and all axis labels are repositioned. 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...
 
(CGPoint- viewPointForCoordinateValue:
 
(void) - updateAxisTitle
 Update the axis title position. More...
 
(void) - relabel
 Updates the axis labels. More...
 
(void) - setNeedsRelabel
 Marks the receiver as needing to update the labels before the content is next drawn. More...
 
(void) - updateMajorTickLabels
 Update the major tick mark labels. More...
 
(void) - updateMinorTickLabels
 Update the minor tick mark labels. More...
 
(void) - drawGridLinesInContext:isMajor:
 
(void) - addBackgroundLimitBand:
 Add a background limit band. More...
 
(void) - removeBackgroundLimitBand:
 Remove a background limit band. More...
 
(void) - removeAllBackgroundLimitBands
 Remove all background limit bands. More...
 
(void) - drawBackgroundBandsInContext:
 
(void) - drawBackgroundLimitsInContext:
 
- Public Instance Methods inherited from CPTLayer
(nullable instancetype) - initWithCoder:
 Returns an object initialized from data in a given unarchiver. More...
 
(nonnull instancetype) - initWithLayer:
 Override to copy or initialize custom fields of the specified layer. More...
 
(nonnull instancetype) - init [implementation]
 Initializes a newly allocated CPTLayer object with an empty frame rectangle. More...
 
(void) - logLayers
 Logs this layer and all of its sublayers. More...
 
(BOOL- pointingDeviceDownEvent:atPoint: [implementation]
 
(BOOL- pointingDeviceUpEvent:atPoint: [implementation]
 
(BOOL- pointingDeviceDraggedEvent:atPoint: [implementation]
 
(BOOL- pointingDeviceCancelledEvent: [implementation]
 
(BOOL- scrollWheelEvent:fromPoint:toPoint: [implementation]
 
(nonnull CPTNativeImage *) - imageOfLayer
 Gets an image of the layer contents. More...
 
(void) - setNeedsDisplayAllLayers
 Recursively marks this layer and all sublayers as needing to be redrawn. More...
 
(void) - renderAsVectorInContext:
 Draws layer content into the provided graphics context. More...
 
(void) - recursivelyRenderInContext:
 Draws layer content and the content of all sublayers into the provided graphics context. More...
 
(void) - layoutAndRenderInContext:
 Updates the layer layout if needed and then draws layer content and the content of all sublayers into the provided graphics context. More...
 
(nonnull NSData *) - dataForPDFRepresentationOfLayer
 Draws layer content and the content of all sublayers into a PDF document. More...
 
(void) - applySublayerMaskToContext:forSublayer:withOffset:
 Recursively sets the clipping path of the given graphics context to the sublayer masking paths of its superlayers. More...
 
(void) - applyMaskToContext:
 Sets the clipping path of the given graphics context to mask the content. More...
 
(void) - pixelAlign
 Align the receiver’s position with pixel boundaries. More...
 
(void) - sublayerMarginLeft:top:right:bottom:
 Returns the margins that should be left between the bounds of the receiver and all sublayers. More...
 
- Public Instance Methods inherited from CALayer
(BOOL- containsPoint:
 
(void) - drawInContext:
 
(id- init
 
(id- initWithLayer
 
(void) - layoutSublayers
 
(void) - setNeedsDisplay
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout
 
- 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:
 
- Public Instance Methods inherited from <NSCoding>
(id- initWithCoder:
 
(void) - encodeWithCoder:
 
- Public Instance Methods inherited from <CPTResponder>
(BOOL- pointingDeviceDraggedEvent:atPoint:
 (Required) Informs the receiver that the user has moved the mouse with the button pressed. More...
 
(BOOL- pointingDeviceCancelledEvent:
 (Required) Informs the receiver that tracking of mouse moves has been cancelled for any reason. More...
 
(BOOL- scrollWheelEvent:fromPoint:toPoint:
 (Required) Informs the receiver that the user has moved the scroll wheel. More...
 

Properties

Positioning
NSNumberorthogonalPosition
 The data coordinate value where the axis crosses the orthogonal axis. If the axisConstraints is non-nil, the constraints take priority and this property is ignored. More...
 
CPTConstraintsaxisConstraints
 The constraints used when positioning relative to the plot area. If nil (the default), the axis is fixed relative to the plot space coordinates, crossing the orthogonal axis at orthogonalPosition and moves only whenever the plot space ranges change. More...
 
- Properties inherited from CPTAxis
CPTLineStyleaxisLineStyle
 The line style for the axis line. If nil, the line is not drawn. More...
 
CPTCoordinate coordinate
 The axis coordinate. More...
 
NSNumberlabelingOrigin
 The origin used for axis labels. The default value is 0. It is only used when the axis labeling policy is CPTAxisLabelingPolicyFixedInterval. The origin is a reference point used to being labeling. Labels are added at the origin, as well as at fixed intervals above and below the origin. More...
 
CPTSign tickDirection
 The tick direction. The direction is given as the sign that ticks extend along the axis (e.g., positive or negative). More...
 
CPTPlotRangevisibleRange
 The plot range over which the axis and ticks are visible. Use this to restrict an axis and its grid lines to less than the full plot area width. Use the visibleAxisRange to specify a separate range for the axis line, if needed. Set to nil for no restriction. More...
 
CPTPlotRangevisibleAxisRange
 The plot range over which the axis itself is visible. Use this to restrict an axis line to less than the full plot area width. This range is independent of the visibleRange and overrides it for the axis line and line cap. Set to nil to use the visibleRange instead. More...
 
CPTLineCapaxisLineCapMin
 The line cap for the end of the axis line with the minimum value. More...
 
CPTLineCapaxisLineCapMax
 The line cap for the end of the axis line with the maximum value. More...
 
NSNumbermajorIntervalLength
 The distance between major tick marks expressed in data coordinates. More...
 
CGFloat majorTickLength
 The length of the major tick marks. More...
 
CPTLineStylemajorTickLineStyle
 The line style for the major tick marks. If nil, the major ticks are not drawn. More...
 
CPTNumberSetmajorTickLocations
 A set of axis coordinates for all major tick marks. More...
 
NSUInteger preferredNumberOfMajorTicks
 The number of ticks that should be targeted when auto-generating positions. This property only applies when the CPTAxisLabelingPolicyAutomatic or CPTAxisLabelingPolicyEqualDivisions policies are in use. If zero (0) (the default), Core Plot will choose a reasonable number of ticks. More...
 
NSUInteger minorTicksPerInterval
 The number of minor tick marks drawn in each major tick interval. More...
 
CGFloat minorTickLength
 The length of the minor tick marks. More...
 
CPTLineStyleminorTickLineStyle
 The line style for the minor tick marks. If nil, the minor ticks are not drawn. More...
 
CPTNumberSetminorTickLocations
 A set of axis coordinates for all minor tick marks. More...
 
CPTPlotSpaceplotSpace
 The plot space for the axis. More...
 
BOOL separateLayers
 Use separate layers for drawing grid lines? More...
 
CPTPlotAreaplotArea
 The plot area that the axis belongs to. More...
 
CPTGridLinesminorGridLines
 The layer that draws the minor grid lines. More...
 
CPTGridLinesmajorGridLines
 The layer that draws the major grid lines. More...
 
CPTAxisSetaxisSet
 The axis set that the axis belongs to. More...
 
CPTTextStyletitleTextStyle
 The text style used to draw the axis title text. More...
 
CPTAxisTitleaxisTitle
 The axis title. If nil, no title is drawn. More...
 
CGFloat titleOffset
 The offset distance between the axis title and the axis line. More...
 
NSStringtitle
 A convenience property for setting the text title of the axis. More...
 
NSAttributedStringattributedTitle
 A convenience property for setting the styled text title of the axis. More...
 
CGFloat titleRotation
 The rotation angle of the axis title in radians. If NaN (the default), the title will be parallel to the axis. More...
 
CPTSign titleDirection
 The offset direction for the axis title. The direction is given as the sign that ticks extend along the axis (e.g., positive or negative). If the title direction is CPTSignNone (the default), the title is offset in the direction indicated by the tickDirection. More...
 
NSNumbertitleLocation
 The position along the axis where the axis title should be centered. If NaN (the default), the defaultTitleLocation will be used. More...
 
NSNumberdefaultTitleLocation
 The position along the axis where the axis title should be centered if titleLocation is NaN. More...
 
CPTAxisLabelingPolicy labelingPolicy
 The axis labeling policy. More...
 
CGFloat labelOffset
 The offset distance between the tick marks and labels. More...
 
CGFloat minorTickLabelOffset
 The offset distance between the minor tick marks and labels. More...
 
CGFloat labelRotation
 The rotation of the axis labels in radians. Set this property to π/2 to have labels read up the screen, for example. More...
 
CGFloat minorTickLabelRotation
 The rotation of the axis minor tick labels in radians. Set this property to π/2 to have labels read up the screen, for example. More...
 
CPTAlignment labelAlignment
 The alignment of the axis label with respect to the tick mark. More...
 
CPTAlignment minorTickLabelAlignment
 The alignment of the axis label with respect to the tick mark. More...
 
CPTTextStylelabelTextStyle
 The text style used to draw the label text. More...
 
CPTTextStyleminorTickLabelTextStyle
 The text style used to draw the label text of minor tick labels. More...
 
CPTSign tickLabelDirection
 The offset direction for major tick labels. The direction is given as the sign that ticks extend along the axis (e.g., positive or negative). If the label direction is CPTSignNone (the default), the labels are offset in the direction indicated by the tickDirection. More...
 
CPTSign minorTickLabelDirection
 The offset direction for minor tick labels. The direction is given as the sign that ticks extend along the axis (e.g., positive or negative). If the label direction is CPTSignNone (the default), the labels are offset in the direction indicated by the tickDirection. More...
 
NSFormatterlabelFormatter
 The number formatter used to format the label text. If you need a non-numerical label, such as a date, you can use a formatter than turns the numerical plot coordinate into a string (e.g., “Jan 10, 2010”). The CPTCalendarFormatter and CPTTimeFormatter classes are useful for this purpose. More...
 
NSFormatterminorTickLabelFormatter
 The number formatter used to format the label text of minor ticks. If you need a non-numerical label, such as a date, you can use a formatter than turns the numerical plot coordinate into a string (e.g., “Jan 10, 2010”). The CPTCalendarFormatter and CPTTimeFormatter classes are useful for this purpose. More...
 
CPTAxisLabelSetaxisLabels
 The set of axis labels. More...
 
CPTAxisLabelSetminorTickAxisLabels
 The set of minor tick axis labels. More...
 
BOOL needsRelabel
 If YES, the axis needs to be relabeled before the layer content is drawn. More...
 
CPTPlotRangeArraylabelExclusionRanges
 An array of CPTPlotRange objects. Any tick marks and labels falling inside any of the ranges in the array will not be drawn. More...
 
CPTShadowlabelShadow
 The shadow applied to each axis label. More...
 
CPTShadowminorTickLabelShadow
 The shadow applied to each minor tick axis label. More...
 
CPTLineStylemajorGridLineStyle
 The line style for the major grid lines. If nil, the major grid lines are not drawn. More...
 
CPTLineStyleminorGridLineStyle
 The line style for the minor grid lines. If nil, the minor grid lines are not drawn. More...
 
CPTPlotRangegridLinesRange
 The plot range over which the grid lines are visible. Note that this range applies to the orthogonal coordinate, not the axis coordinate itself. Set to nil for no restriction. More...
 
CPTFillArrayalternatingBandFills
 An array of two or more fills to be drawn between successive major tick marks. More...
 
NSNumberalternatingBandAnchor
 The starting location of the first band fill. More...
 
CPTLimitBandArraybackgroundLimitBands
 An array of CPTLimitBand objects. More...
 
- Properties inherited from CPTLayer
CPTGraphgraph
 The graph for the layer. More...
 
CGFloat paddingLeft
 Amount to inset the left side of each sublayer. More...
 
CGFloat paddingTop
 Amount to inset the top of each sublayer. More...
 
CGFloat paddingRight
 Amount to inset the right side of each sublayer. More...
 
CGFloat paddingBottom
 Amount to inset the bottom of each sublayer. More...
 
id< NSCopying, NSCoding, NSObjectidentifier
 An object used to identify the layer in collections. More...
 
CGFloat contentsScale
 The scale factor applied to the layer. More...
 
BOOL useFastRendering
 If YES, subclasses should optimize their drawing for speed over precision. More...
 
CPTShadowshadow
 The shadow drawn under the layer content. If nil (the default), no shadow is drawn. More...
 
CGSize shadowMargin
 The maximum margin size needed to fully enclose the layer shadow. More...
 
BOOL masksToBorder
 If YES, a sublayer mask is applied to clip sublayer content to the inside of the border. More...
 
CGPathRef outerBorderPath
 A drawing path that encompasses the outer boundary of the layer border. More...
 
CGPathRef innerBorderPath
 A drawing path that encompasses the inner boundary of the layer border. More...
 
CGPathRef maskingPath
 A drawing path that encompasses the layer content including any borders. Set to NULL when no masking is desired. More...
 
CGPathRef sublayerMaskingPath
 A drawing path that encompasses the layer content excluding any borders. Set to NULL when no masking is desired. More...
 
CPTSublayerSetsublayersExcludedFromAutomaticLayout
 A set of sublayers that should be excluded from the automatic sublayer layout. More...
 
- Properties inherited from CALayer
CGPoint anchorPoint
 
CGRect bounds
 
CGFloat contentsScale
 
CGFloat cornerRadius
 
id delegate
 
CGRect frame
 
BOOL masksToBounds
 
BOOL needsDisplayOnBoundsChange
 
BOOL opacity
 
BOOL opaque
 
- Properties inherited from <CAMediaTiming>
BOOL autoreverses
 
CFTimeInterval beginTime
 
CFTimeInterval duration
 
NSStringfillMode
 
float repeatCount
 
id repeatDuration
 
float speed
 
CFTimeInterval timeOffset
 

Additional Inherited Members

- Public Class Methods inherited from CALayer
(id+ layer
 
- 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:
 

Detailed Description

A 2-dimensional cartesian (X-Y) axis class.

Method Documentation

◆ initWithFrame:

- (nonnull instancetype) initWithFrame: (CGRect newFrame
implementation

Initializes a newly allocated CPTXYAxis object with the provided frame rectangle.

This is the designated initializer. The initialized layer will have the following properties:

Parameters
newFrameThe frame rectangle.
Returns
The initialized CPTXYAxis object.

Reimplemented from CPTAxis.

Property Documentation

◆ axisConstraints

- (nullable CPTConstraints *) axisConstraints
readwritenonatomicstrong

The constraints used when positioning relative to the plot area. If nil (the default), the axis is fixed relative to the plot space coordinates, crossing the orthogonal axis at orthogonalPosition and moves only whenever the plot space ranges change.

See also
orthogonalPosition

◆ orthogonalPosition

- (nullable NSNumber *) orthogonalPosition
readwritenonatomicstrong

The data coordinate value where the axis crosses the orthogonal axis. If the axisConstraints is non-nil, the constraints take priority and this property is ignored.

See also
axisConstraints

The documentation for this class was generated from the following files: