CFXPointLabelAttributes Class Reference

Inherits from
Conforms to
Framework
Availability
Available in iOS 5.0 and later.
Companion guide
Declared in
ChartFX.h

Overview

Unless defined otherwise, all the point labels of the chart share the same settings. Those global settings are available through the pointLabels property of the CFXGlobalAttributes. The CFXGlobalAttributes class is accessible through the allSeries property of the chart.

Properties

alignment

Gets or sets the vertical alignment for the point label.

@property(nonatomic) CFXStringAlignment alignment
Declared In
ChartFX.h

angle

Gets or sets the angle of the point label.

@property(nonatomic) short int angle
Discussion

The default rotation angle is 0 degree (i.e., horizontal). Use a positive number to rotate the labels from lower left to upper right. Use negative degrees to rotate text from upper left to lower right.

When generating charts using Xcode and Objective-C , the angles "0" and "90" are the only supported configurations.

This property is also available in the CFXSeriesAttributes or CFXPointAttributes objects. Therefore, a label angle can be set to a specific series or point instead of all series in the chart.

To use this property, you must make sure the pointLabels are visible.

Declared In
ChartFX.h

backColor

Gets or sets the backgrond color of the point label.

@property(nonatomic) UIColor backColor
Discussion

The pointLabels property of the CFXPointAttributes class returns a PointLabelsAttributes object.

The borderColor property gets or sets the border color of the point label.

The borderWidth property gets or sets a value indicating the width of the border surrounding the point label.

The visible property is a boolean indicating if point label should be displayed or not.

For more information regarding the Color type, please refer to your Xcode and Objective-C documentation.

Declared In
ChartFX.h

borderColor

Gets or sets the border color of the point label.

@property(nonatomic) UIColor borderColor
Discussion

The pointLabels property of the CFXPointAttributes class returns a PointLabelsAttributes object.

The backColor property gets or sets the backgrond color of the point label.

The borderWidth property gets or sets a value indicating the width of the border surrounding the point label.

The alignment property is used to control the vertical alignment for the point label.

The visible property is a boolean indicating if point label should be displayed or not.

For more information regarding the Color type, please refer to your Xcode and Objective-C documentation.

Declared In
ChartFX.h

borderWidth

Gets or sets a value indicating the width of the border surrounding the point label.

@property(nonatomic) short int borderWidth
Discussion

The pointLabels property of the CFXPointAttributes class returns a PointLabelsAttributes object.

The borderColor property gets or sets the border color of the point label.

The backColor property gets or sets the background color of the point label.

Declared In
ChartFX.h

font

Gets or sets a Font object to use as rendering font for the point label.

@property(nonatomic) UIFont font
Discussion

When setting a font, you must create a new font object with the desired attributes and assign that object to the desired chart element every time.

See the Font class in Xcode and Objective-C

Declared In
ChartFX.h

format

Gets or sets a string pattern mask used to format the label.

@property(nonatomic) NSString *format
Discussion

Variables can be accessed using the % following the variable you want to include:

l Shows X-Axis Legend.

k Shows X-Axis Key Legend.

s Shows Series Legend.

S Shows the Series Index.

x Shows XValue (XY charts, when they were set with X values).

i Shows IniValues (Gantt).

v Shows Data Value.

v <n> For types that require more than one series, these are replaced by the value of each one. (n represents an index).

t Series Total (Sum of all points in this series).

p Percentage of total this point represents (Pie).

T Point Total (Sum of all series for this point).

P Percentage of total this series represents (Used in stacked charts).

X displays the marker X value for any chart type including those that do not support X values such as bar.

N Shows the index for the point.

L Shows the text property of the CFXPoint object.

Availability
  • Available in iOS 5.0 and later.
Declared In
ChartFX.h

lineAlignment

Gets or sets the horizontal alignment for the point label.

@property(nonatomic) CFXStringAlignment lineAlignment
Declared In
ChartFX.h

textColor

Gets or sets a value for the point label color.

@property(nonatomic) UIColor textColor
Discussion

It is recommended to use a light color when the inside color of the chart is dark (and, vice versa).

See Color class in Xcode and Objective-C

Declared In
ChartFX.h

visible

Gets or sets a value indicating if point label should be displayed or not.

@property(nonatomic) BOOL visible
Discussion

The pointLabels property of the CFXPointAttributes class returns a PointLabelsAttributes object.

The alignment property is used to control the vertical alignment for the point label.

The backColor property gets or sets the background color of the point label.

The borderColor property gets or sets the border color of the point label.

The borderWidth property gets or sets a value indicating the width of the border surrounding the point label.

Declared In
ChartFX.h

Constants

CFXStringAlignment

The StringAlignment type specifies how a string is aligned in reference to the bounding rectangle. A bounding rectangle is used to define the area in which the text displays.

typedef enum {

} CFXStringAlignment;
Constants
CFX
Specifies that alignment is towards the origin of the bounding rectangle. May be used for alignment of characters along the line or for alignment of lines within the rectangle. For a right to left bounding rectangle, the origin is at the upper right.
CFX
Specifies that alignment is centered between origin and extent (width) of the formatting rectangle.
CFX
Specifies that alignment is to the far extent (right side) of the formatting rectangle.
Declared In
chartfx.h