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

An axis label. More...

#import <CPTAxisLabel.h>

+ Inheritance diagram for CPTAxisLabel:
+ Collaboration diagram for CPTAxisLabel:

Public Instance Methods

Initialization
(nonnull instancetype) - initWithText:textStyle:
 Initializes a newly allocated text-based CPTAxisLabel object with the provided text and style. More...
 
(nonnull instancetype) - initWithContentLayer:
 Initializes a newly allocated CPTAxisLabel object with the provided layer. This is the designated initializer. More...
 
(nullable instancetype) - initWithCoder:
 Returns an object initialized from data in a given unarchiver. More...
 
Layout
(void) - positionRelativeToViewPoint:forCoordinate:inDirection:
 Positions the axis label relative to the given point. The algorithm for positioning is different when the rotation property is non-zero. When zero, the anchor point is positioned along the closest side of the label. When non-zero, the anchor point is left at the center. This has consequences for the value taken by the offset. More...
 
(void) - positionBetweenViewPoint:andViewPoint:forCoordinate:inDirection:
 Positions the axis label between two given points. More...
 
Comparison
(BOOL- isEqual: [implementation]
 Returns a boolean value that indicates whether the received is equal to the given object. Axis labels are equal if they have the same tickLocation. More...
 
- 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 <NSCoding>
(id- initWithCoder:
 
(void) - encodeWithCoder:
 

Properties

CPTLayercontentLayer
 The label content. More...
 
CGFloat offset
 The offset distance between the axis and label. More...
 
CGFloat rotation
 The rotation of the label in radians. More...
 
CPTAlignment alignment
 The alignment of the axis label with respect to the tick mark. More...
 
NSNumbertickLocation
 The data coordinate of the tick location. 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:
 

Detailed Description

An axis label.

The label can be text-based or can be the content of any CPTLayer provided by the user.

Method Documentation

◆ initWithCoder:

- (nullable instancetype) initWithCoder: (nonnull NSCoder *)  coder

Returns an object initialized from data in a given unarchiver.

Parameters
coderAn unarchiver object.
Returns
An object initialized from data in a given unarchiver.

◆ initWithContentLayer:

- (nonnull instancetype) initWithContentLayer: (nonnull CPTLayer *)  layer

Initializes a newly allocated CPTAxisLabel object with the provided layer. This is the designated initializer.

Parameters
layerThe label content.
Returns
The initialized CPTAxisLabel object.

◆ initWithText:textStyle:

- (nonnull instancetype) initWithText: (nullable NSString *)  newText
textStyle: (nullable CPTTextStyle *)  newStyle 

Initializes a newly allocated text-based CPTAxisLabel object with the provided text and style.

Parameters
newTextThe label text.
newStyleThe text style for the label.
Returns
The initialized CPTAxisLabel object.

◆ isEqual:

- (BOOL) isEqual: (nullable id object
implementation

Returns a boolean value that indicates whether the received is equal to the given object. Axis labels are equal if they have the same tickLocation.

Parameters
objectThe object to be compared with the receiver.
Returns
YES if object is equal to the receiver, NO otherwise.

Reimplemented in CPTAxisTitle.

◆ positionBetweenViewPoint:andViewPoint:forCoordinate:inDirection:

- (void) positionBetweenViewPoint: (CGPoint firstPoint
andViewPoint: (CGPoint secondPoint
forCoordinate: (CPTCoordinate coordinate
inDirection: (CPTSign direction 

Positions the axis label between two given points.

Parameters
firstPointThe first view point.
secondPointThe second view point.
coordinateThe axis coordinate.
directionThe offset direction.

◆ positionRelativeToViewPoint:forCoordinate:inDirection:

- (void) positionRelativeToViewPoint: (CGPoint point
forCoordinate: (CPTCoordinate coordinate
inDirection: (CPTSign direction 

Positions the axis label relative to the given point. The algorithm for positioning is different when the rotation property is non-zero. When zero, the anchor point is positioned along the closest side of the label. When non-zero, the anchor point is left at the center. This has consequences for the value taken by the offset.

Parameters
pointThe view point.
coordinateThe coordinate in which the label is being position. Orthogonal to the axis coordinate.
directionThe offset direction.

Property Documentation

◆ alignment

- (CPTAlignment) alignment
readwritenonatomicassign

The alignment of the axis label with respect to the tick mark.

◆ contentLayer

- (nullable CPTLayer *) contentLayer
readwritenonatomicstrong

The label content.

◆ offset

- (CGFloat) offset
readwritenonatomicassign

The offset distance between the axis and label.

◆ rotation

- (CGFloat) rotation
readwritenonatomicassign

The rotation of the label in radians.

◆ tickLocation

- (nonnull NSNumber *) tickLocation
readwritenonatomicstrong

The data coordinate of the tick location.


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