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

Positions a content layer relative to an anchor point in a reference layer. More...

#import <CPTLayerAnnotation.h>

+ Inheritance diagram for CPTLayerAnnotation:
+ Collaboration diagram for CPTLayerAnnotation:

Public Instance Methods

Initialization
(nonnull instancetype) - initWithAnchorLayer:
 Initializes a newly allocated CPTLayerAnnotation object with the provided reference layer. More...
 
(nullable instancetype) - initWithCoder:
 Returns an object initialized from data in a given unarchiver. More...
 
- Public Instance Methods inherited from CPTAnnotation
(nonnull instancetype) - init
 Initializes a newly allocated CPTAnnotation object. More...
 
(void) - positionContentLayer
 Positions the content layer relative to its reference anchor. 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

CPTLayeranchorLayer
 The reference layer. More...
 
CPTRectAnchor rectAnchor
 The anchor position for the annotation. More...
 
CPTConstraintsxConstraints
 The constraints used to position the content layer relative to the reference layer in the x-direction. Setting the rectAnchor resets the constraints. More...
 
CPTConstraintsyConstraints
 The constraints used to position the content layer relative to the reference layer in the y-direction. Setting the rectAnchor resets the constraints. More...
 
- Properties inherited from CPTAnnotation
CPTLayercontentLayer
 The annotation content. More...
 
CPTAnnotationHostLayerannotationHostLayer
 The host layer for the annotation content. More...
 
CGPoint contentAnchorPoint
 The anchor point for the content layer. More...
 
CGPoint displacement
 The displacement from the layer anchor point. More...
 
CGFloat rotation
 The rotation of the label in radians. 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

Positions a content layer relative to an anchor point in a reference layer.

Layer annotations are positioned relative to a reference layer. This allows the annotation content layer to move with changes in the reference layer. This is useful for applications such as titles attached to an edge of the reference layer.

Method Documentation

◆ initWithAnchorLayer:

- (nonnull instancetype) initWithAnchorLayer: (nonnull CPTLayer *)  newAnchorLayer

Initializes a newly allocated CPTLayerAnnotation object with the provided reference layer.

This is the designated initializer. The initialized layer will be anchored to CPTRectAnchorTop by default.

Parameters
newAnchorLayerThe reference layer. Must be non-nil.
Returns
The initialized CPTLayerAnnotation object.

◆ 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.

Reimplemented from CPTAnnotation.

Property Documentation

◆ anchorLayer

- (nullable CPTLayer *) anchorLayer
readnonatomicweak

The reference layer.

◆ rectAnchor

- (CPTRectAnchor) rectAnchor
readwritenonatomicassign

The anchor position for the annotation.

◆ xConstraints

- (CPTConstraints *) xConstraints
readwritenonatomicstrong

The constraints used to position the content layer relative to the reference layer in the x-direction. Setting the rectAnchor resets the constraints.

◆ yConstraints

- (CPTConstraints *) yConstraints
readwritenonatomicstrong

The constraints used to position the content layer relative to the reference layer in the y-direction. Setting the rectAnchor resets the constraints.


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