CFXCustomLegendItem Class Reference

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

Overview

A CustomLegendItem is an additional item added to the legend of a chart that contains relevant information to explain what is being depicted in a chart.

The CustomLegendItem fills the void when the series legend and values cannot convey the desired information. The supported members of the CustomLegendItem allow you to configure and add extra legend items to the standard legend box.

The CustomLegendItem needs to be created and added to the chart, as shown in the following example:

In order to use this functionality you must include jchartfx.advanced.js in your project.

Properties

alternateColor

Gets or sets the background color of a custom legend item marker when a pattern is configured using the pattern property.

@property(nonatomic) UIColor alternateColor
Discussion

The forecolor of the pattern is configured using the color property.

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

Declared In
ChartFX.h

attributes

Gets or sets the PointAttributes object for the custom legend item.

@property(nonatomic) CFXPointAttributes attributes
Discussion

The Attributes property is used to obtain the CFXPointAttributes object for a CustomLegendItem. This allows the developer to apply unique visual attributes for the legend item.

Please see the the CFXPointAttributes class for additional information regarding the supported members.

Declared In
ChartFX.h

border

Gets a BorderAttributes object allowing you to modify the border properties for this CustomLegendItem.

@property(nonatomic) CFXBorderAttributes border
Declared In
ChartFX.h

color

Gets or sets the Color for the marker of the Custom Legend Item.

@property(nonatomic) UIColor color
Discussion

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

Declared In
ChartFX.h

markerShape

Represents the shape of the marker.

@property(nonatomic) CFXMarkerShape markerShape
Discussion

If you hide the markers using CFXMarkerShapeNone, labels will be numbered.

The MarkerShape BorderAttributes may be configured by accessing the border property.

Declared In
ChartFX.h

pattern

Gets or sets a HatchStyle pattern for the marker of a CustomLegendItem.

@property(nonatomic) CFXHatchStyle pattern
Discussion

The forecolor of the pattern is configured using the color property. The background color of the pattern is configured using the alternateColor property.

Declared In
ChartFX.h

picture

Gets or sets an image to be used as a marker for a CustomLegendItem.

@property(nonatomic) UIImage picture
Discussion

Setting this property will override any settings configured using the markerShape property.

You can use any of the supported image formats. For more information regarding the image formats, refer to the Xcode and Objective-C .

Declared In
ChartFX.h

showLine

Gets or sets a value used to display a line marker for a CustomLegendItem.

@property(nonatomic) BOOL showLine
Discussion

The markerShape property may be used in combination with this property to display a different marker shape.

Declared In
ChartFX.h

text

Gets or sets the text string of the custom legend item.

@property(nonatomic) NSString *text
Discussion

The Text property of the CFXLegendBox object is used to access the CustomLegendItemCollection object of a chart. By accessing a CustomLegendItem from the collection, you can modify the text of the item using this property.

The textColor property is used to control the color for a legend's text.

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

Constants

CFXHatchStyle

Specifies the different hatch patterns available.

typedef enum {
   CFXBackwardDiagonal,
   CFXCross,
   CFXDarkDownwardDiagonal,
   CFXDarkHorizontal,
   CFXDarkUpwardDiagonal,
   CFXDarkVertical,
   CFXDashedDownwardDiagonal,
   CFXDashedHorizontal,
   CFXDashedUpwardDiagonal,
   CFXDashedVertical,
   CFXDiagonalBrick,
   CFXDiagonalCross,
   CFXDivot,
   CFXDottedDiamond,
   CFXDottedGrid,
   CFXForwardDiagonal,
   CFXHorizontal,
   CFXHorizontalBrick,
   CFXLargeCheckerBoard,
   CFXLargeConfetti,
   CFXLargeGrid,
   CFXLightDownwardDiagonal,
   CFXLightHorizontal,
   CFXLightUpwardDiagonal,
   CFXLightVertical,
   CFXMax,
   CFXMin,
   CFXNarrowHorizontal,
   CFXNarrowVertical,
   CFXOutlinedDiamond,
   CFXPercent05,
   CFXPercent10,
   CFXPercent20,
   CFXPercent25,
   CFXPercent30,
   CFXPercent40,
   CFXPercent50,
   CFXPercent60,
   CFXPercent70,
   CFXPercent75,
   CFXPercent80,
   CFXPercent90,
   CFXPlaid,
   CFXShingle,
   CFXSmallCheckerBoard,
   CFXSmallConfetti,
   CFXSmallGrid,
   CFXSolidDiamond,
   CFXSphere,
   CFXTrellis,
   CFXVertical,
   CFXWave,
   CFXWeave,
   CFXWideDownwardDiagonal,
   CFXWideUpwardDiagonal,
   CFXZigZag
} CFXHatchStyle;
Constants
CFXBackwardDiagonal
A pattern of lines on a diagonal from upper right to lower left.
CFXCross
Specifies horizontal and vertical lines that cross.
CFXDarkDownwardDiagonal
Specifies diagonal lines that slant to the right from top points to bottom points, are spaced 50 percent closer together than, and are twice the width of ForwardDiagonal. This hatch pattern is not antialiased.
CFXDarkHorizontal
Specifies horizontal lines that are spaced 50 percent closer together than Horizontal and are twice the width of HatchStyleHorizontal.
CFXDarkUpwardDiagonal
Specifies diagonal lines that slant to the left from top points to bottom points, are spaced 50 percent closer together than BackwardDiagonal, and are twice its width, but the lines are not antialiased.
CFXDarkVertical
Specifies vertical lines that are spaced 50 percent closer together than Vertical and are twice its width.
CFXDashedDownwardDiagonal
Specifies dashed diagonal lines, that slant to the right from top points to bottom points.
CFXDashedHorizontal
Specifies dashed horizontal lines.
CFXDashedUpwardDiagonal
Specifies dashed diagonal lines, that slant to the left from top points to bottom points.
CFXDashedVertical
Specifies dashed vertical lines.
CFXDiagonalBrick
Specifies a hatch that has the appearance of layered bricks that slant to the left from top points to bottom points.
CFXDiagonalCross
Specifies forward diagonal and backward diagonal lines that cross. The lines are antialiased.
CFXDivot
Specifies a hatch that has the appearance of divots.
CFXDottedDiamond
Specifies forward diagonal and backward diagonal lines, each of which is composed of dots, that cross.
CFXDottedGrid
Specifies horizontal and vertical lines, each of which is composed of dots, that cross.
CFXForwardDiagonal
A pattern of lines on a diagonal from upper left to lower right.
CFXHorizontal
A pattern of horizontal lines.
CFXHorizontalBrick
Specifies a hatch that has the appearance of horizontally layered bricks.
CFXLargeCheckerBoard
Specifies a hatch that has the appearance of a checkerboard with squares that are twice the size of SmallCheckerBoard.
CFXLargeConfetti
Specifies a hatch that has the appearance of confetti, and is composed of larger pieces than SmallConfetti.
CFXLargeGrid
Specifies the hatch style Cross.
CFXLightDownwardDiagonal
Specifies diagonal lines that slant to the right from top points to bottom points and are spaced 50 percent closer together than DownwardDiagonal, but they are not antialiased.
CFXLightHorizontal
Specifies horizontal lines that are spaced 50 percent closer together than Horizontal.
CFXLightUpwardDiagonal
Specifies diagonal lines that slant to the left from top points to bottom points and are spaced 50 percent closer together than BackwardDiagonal, but they are not antialiased.
CFXLightVertical
Specifies vertical lines that are spaced 50 percent closer together than Vertical.
CFXMax
Specifies hatch style SolidDiamond.
CFXMin
Specifies hatch style Horizonal.
CFXNarrowHorizontal
Specifies horizontal lines that are spaced 75 percent closer together than hatch style Horizontal (or 25 percent closer together than LightHorizontal).
CFXNarrowVertical
Specifies vertical lines that are spaced 75 percent closer together than hatch style Vertical (or 25 percent closer together than LightVertical).
CFXOutlinedDiamond
Specifies forward diagonal and backward diagonal lines that cross but are not antialiased.
CFXPercent05
Specifies a 5-percent hatch. The ratio of foreground color to background color is 5:100.
CFXPercent10
Specifies a 10-percent hatch. The ratio of foreground color to background color is 10:100.
CFXPercent20
Specifies a 20-percent hatch. The ratio of foreground color to background color is 20:100.
CFXPercent25
Specifies a 25-percent hatch. The ratio of foreground color to background color is 25:100.
CFXPercent30
Specifies a 30-percent hatch. The ratio of foreground color to background color is 30:100.
CFXPercent40
Specifies a 40-percent hatch. The ratio of foreground color to background color is 40:100.
CFXPercent50
Specifies a 50-percent hatch. The ratio of foreground color to background color is 50:100.
CFXPercent60
Specifies a 60-percent hatch. The ratio of foreground color to background color is 60:100.
CFXPercent70
Specifies a 70-percent hatch. The ratio of foreground color to background color is 70:100.
CFXPercent75
Specifies a 75-percent hatch. The ratio of foreground color to background color is 75:100.
CFXPercent80
Specifies a 80-percent hatch. The ratio of foreground color to background color is 80:100.
CFXPercent90
Specifies a 90-percent hatch. The ratio of foreground color to background color is 90:100.
CFXPlaid
Specifies a hatch that has the appearance of a plaid material.
CFXShingle
Specifies a hatch that has the appearance of diagonally-layered shingles that slant to the right from top points to bottom points.
CFXSmallCheckerBoard
Specifies a hatch that has the appearance of a checkerboard.
CFXSmallConfetti
Specifies a hatch that has the appearance of confetti.
CFXSmallGrid
Specifies horizontal and vertical lines that cross and are spaced 50 percent closer together than hatch style Cross.
CFXSolidDiamond
Specifies a hatch that has the appearance of a checkerboard placed diagonally.
CFXSphere
Specifies a hatch that has the appearance of spheres laid adjacent to one another.
CFXTrellis
Specifies a hatch that has the appearance of a trellis.
CFXVertical
A pattern of vertical lines.
CFXWave
Specifies horizontal lines that are composed of tildes.
CFXWeave
Specifies a hatch that has the appearance of a woven material.
CFXWideDownwardDiagonal
Specifies diagonal lines that slant to the right from top points to bottom points, have the same spacing as hatch style ForwardDiagonal, and are triple its width, but are not antialiased.
CFXWideUpwardDiagonal
Specifies diagonal lines that slant to the left from top points to bottom points, have the same spacing as hatch style BackwardDiagonal, and are triple its width, but are not antialiased.
CFXZigZag
Specifies horizontal lines that are composed of zigzags.
Declared In
chartfx.h

CFXMarkerShape

Defines different shapes used to paint point markers in the chart.

typedef enum {
   CFXNone,
   CFXRect,
   CFXCircle,
   CFXTriangle,
   CFXDiamond,
   CFXMarble,
   CFXHorizontalLine,
   CFXVerticalLine,
   CFXCross,
   CFXInvertedTriangle,
   CFXX,
   CFXMany,
   CFXPicture
} CFXMarkerShape;
Constants
CFXNone
Do not display point markers.
CFXRect
Displays a rectangle.
CFXCircle
Displays a circle.
CFXTriangle
Displays a triangle.
CFXDiamond
Displays a diamond.
CFXMarble
Displays a 3D marble.
CFXHorizontalLine
Displays a horizontal line.
CFXVerticalLine
Displays a vertical line.
CFXCross
Displays a cross.
CFXInvertedTriangle
Displays a rotated triangle.
CFXX
Displays an X.
CFXMany
Selects a combination of marker shapes.
CFXPicture
Displays a configured picture.
Declared In
chartfx.h