CFXLegendItemAttributes Class Reference

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

Overview

The LegendItemAttributes class allows you to configure how CFXSeriesAttributes, CFXConditionalAttributes, CFXCustomGridLine, or keyLabels of the CFXAxis class are rendered in the CFXLegendBox.CFX

First, a new LegendItemAttributes object needs to be created. Next, this object needs to be mapped to the specific object it will customize. The final stage consists of modifying properties of the LegendItemAttributes object such as fontStyle and textColor. Notice that the visible property is usefull if you do not want a specific object being displayed in the CFXLegendBox.

Properties

fontStyle

Gets or sets the font style for the legend box item.

@property(nonatomic) CFXFontStyle fontStyle
Declared In
ChartFX.h

inverted

Gets or sets a value allowing you to invert the order of the LegendBox Items.

@property(nonatomic) BOOL inverted
Declared In
ChartFX.h

orderIndex

Gets or sets the index for ordering the legend box items.

@property(nonatomic) int orderIndex
Discussion

When you use this feature, you must set an OrderIndex value to all the items in the LegendBox, or you will get unexpected results.

Chart FX will reorder the items in the LegenBox by sorting them by the assigned OrderIndex values. This values do not have to be correlative values. The above example would have produced the same results if the values 1, 10, 50, 200 were used.

Declared In
ChartFX.h

textColor

Gets or sets a value allowing you to set the text color for the legend item.

@property(nonatomic) UIColor textColor
Discussion

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

Declared In
ChartFX.h

visible

Gets or sets a value allowing you hide or show the legend item.

@property(nonatomic) BOOL visible
Discussion

When a legend item is hidden in the legend, the chart element will still be displayed in the chart.

Declared In
ChartFX.h

Constants

CFXFontStyle

Specifies style information applied to text.

typedef enum {
   CFXFontStyleBold,
   CFXFontStyleItalic,
   CFXFontStyleRegular,
   CFXFontStyleStrikeout,
   CFXFontStyleUnderline
} CFXFontStyle;
Constants
CFXFontStyleBold
Bold text.
CFXFontStyleItalic
Italic text.
CFXFontStyleRegular
Regular text.
CFXFontStyleStrikeout
Text with a line through the middle.
CFXFontStyleUnderline
Underline text.
Declared In
chartfx.h