IGAxis Class Reference

Inherits from NSObject
Declared in Axis.h

Overview

This is the base class for all axis types of the chart view. This class should not be allocated.

  useSmartAxisPanel

This property specifies whether or not the chart should use the smart axis panel.

@property (nonatomic) BOOL useSmartAxisPanel

Discussion

Smart axis panel automatically layouts axis labels based on provided constraints.

Declared In

Axis.h

  smartAxisExtent

Specifies the extent of the axis panel.

@property (nonatomic) double smartAxisExtent

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisActualExtent

Returns the actual calculated extent of the smart axis panel.

@property (nonatomic, readonly) double smartAxisActualExtent

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisMinimumExtent

Specifies the minimum allowable extent for the axis panel.

@property (nonatomic) double smartAxisMinimumExtent

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisMaximumExtent

Specifies the maximum allowable extent for the axis panel.

@property (nonatomic) double smartAxisMaximumExtent

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisExtentType

Specifies whether the extent is measured in pixels or percentage of the chart’s bounds.

@property (nonatomic) IGAxisExtentType smartAxisExtentType

Discussion

Only applies when useSmartAxisPanel is set to YES. Pixels is the default setting.

Declared In

Axis.h

  smartAxisAngle

Specifies the label angle for the axis panel.

@property (nonatomic) double smartAxisAngle

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisMinimumAngle

Specifies the minimum allowable label angle for the axis panel.

@property (nonatomic) double smartAxisMinimumAngle

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisMaximumAngle

Specifies the maximum allowable label angle for the axis panel.

@property (nonatomic) double smartAxisMaximumAngle

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisActualAngle

Returns the actual calculated label angle.

@property (nonatomic, readonly) double smartAxisActualAngle

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisFont

Specifies the font used for axis labels.

@property (nonatomic, retain, nullable) UIFont *smartAxisFont

Discussion

Only applies when useSmartAxisPanel is set to YES. This property will set both font name and font size, so once set, the font size will not automatically adjust. To set the font name only use smartAxisFontName property.

Declared In

Axis.h

  smartAxisFontName

Specifies the font name used for axis labels.

@property (nonatomic, copy, nullable) NSString *smartAxisFontName

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisFontSize

Specifies the font size used for axis labels.

@property (nonatomic) double smartAxisFontSize

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisMinimumFontSize

Specifies the minimum allowable font size for the axis panel labels.

@property (nonatomic) double smartAxisMinimumFontSize

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisMaximumFontSize

Specifies the maximum allowable font size for the axis panel labels.

@property (nonatomic) double smartAxisMaximumFontSize

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisActualFontSize

Returns the actual calculated font size used by the axis labels.

@property (nonatomic) double smartAxisActualFontSize

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisNumberOfStaggerLevels

Specifies the number of levels of staggering labels.

@property (nonatomic) NSInteger smartAxisNumberOfStaggerLevels

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisMinimumStaggerLevels

Specifies the minimum allowable number of stagger levels.

@property (nonatomic) NSInteger smartAxisMinimumStaggerLevels

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisMaximumStaggerLevels

Specifies the maximum allowable number of stagger levels.

@property (nonatomic) NSInteger smartAxisMaximumStaggerLevels

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisActualNumberOfStaggerLevels

Returns the actual calculated number of stagger levels.

@property (nonatomic, readonly) NSInteger smartAxisActualNumberOfStaggerLevels

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisVerticalAlignment

Specifies the label alignment.

@property (nonatomic) IGVerticalAlign smartAxisVerticalAlignment

Discussion

Only applies when useSmartAxisPanel is set to YES. Top is the default value.

Declared In

Axis.h

  smartAxisTopMargin

Specifies the amount of space between the labels and the top of the axis panel.

@property (nonatomic) double smartAxisTopMargin

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  smartAxisProximityMargin

Specifies the least amount of space between consecutive labels before they consider to be overlapping each other.

@property (nonatomic) double smartAxisProximityMargin

Discussion

Only applies when useSmartAxisPanel is set to YES.

Declared In

Axis.h

  key

This property specifies the axis identifier key.

@property (nonatomic, readonly) NSString *key

Discussion

A key must be specified on an axis when an axis is initialized.

Declared In

Axis.h

  actualStroke

Returns the resolved brush used to draw the axis line. (read-only)

@property (nonatomic, readonly) IGBrush *actualStroke

Declared In

Axis.h

  actualMajorStroke

Returns the resolved brush used to draw the axis major gridlines. (read-only)

@property (nonatomic, readonly) IGBrush *actualMajorStroke

Declared In

Axis.h

  actualMinorStroke

Returns the resolved brush used to draw the axis minor gridlines. (read-only)

@property (nonatomic, readonly) IGBrush *actualMinorStroke

Declared In

Axis.h

  extent

Amount of white space in pixels between the axis and the edge of the chart view.

@property (nonatomic) CGFloat extent

Discussion

This property determines the amount of space used for axis labels.

Declared In

Axis.h

  labelsVisible

A Boolean value that determines whether the axis labels are visible.

@property (nonatomic) BOOL labelsVisible

Declared In

Axis.h

  axisVisible

A Boolean value that determines whether the axis is visible.

@property (nonatomic) BOOL axisVisible

Discussion

When set to NO, this property hides the axis line, all axis gridlines and labels.

Declared In

Axis.h

  isInverted

A Boolean value that determines whether the axis is inverted.

@property (nonatomic) BOOL isInverted

Discussion

This property can be used to reverse the direction of the axis.

Declared In

Axis.h

  crossingAxis

Specifies the axis to intersect with the current axis.

@property (nonatomic, retain, nullable) IGAxis *crossingAxis

Discussion

This property is used in conjunction with crossingValue property. The pair of properties can be used to determine which two axes intersect each other at specified values.

Declared In

Axis.h

  crossingValue

Specifies the value, at which the current axis will cross its crossing axis.

@property (nonatomic) CGFloat crossingValue

Discussion

This property is used in conjunction with crossingAxis property. When both properties are set, the current axis will use this property to determine the location, at which to cross the crossingAxis. For example, if an X axis has a crossing value of 5, it will intersect Y axis at Y=5.

Declared In

Axis.h

  labelsLocation

An enumeration value that determines where the labels are displayed.

@property (nonatomic) IGAxisLabelsLocation labelsLocation

Discussion

One of the values from IGAxisLabelsLocation enumeration can be used to set the axis labels placement. The enumeration contains values that can be used for both horizontal and vertical axes. However, only some values can be used with one particular axis type. For example, OutsideBottom, OutsideTop, InsideBottom and InsideTop can be used with a horizontal axis, but not a vertical one.

When labels are set to be outside, they reside within the axis extent. When the labels are set to be inside, they are positioned immediately above or below the horizontal axis line, or to the right or left of the vertical axis line. If there is not enough space for inside labels to display, they will be placed outside. IGAxisLabelsLocationOutsideBottom is the default for horizontal axes. IGAxisLabelsLocationOutsideLeft is the default for vertical axes.

Declared In

Axis.h

  labelBrush

The brush used for the axis labels.

@property (nonatomic, retain, nullable) IGBrush *labelBrush

Declared In

Axis.h

  stroke

The brush used for the axis line.

@property (nonatomic, retain, nullable) IGBrush *stroke

Declared In

Axis.h

  majorStroke

The brush used for major grid lines.

@property (nonatomic, retain, nullable) IGBrush *majorStroke

Declared In

Axis.h

  minorStroke

The brush used for minor grid lines.

@property (nonatomic, retain, nullable) IGBrush *minorStroke

Declared In

Axis.h

  strip

The brush used for axis strips.

@property (nonatomic, retain, nullable) IGBrush *strip

Discussion

Strips are alternating highlighted regions of the axis between major grid lines.

Declared In

Axis.h

  strokeDashArray

Determines the pattern of the axis line.

@property (nonatomic, retain, nullable) NSArray<__kindofNSNumber*> *strokeDashArray

Discussion

The array is a collection of alternating spaces and dashes represented by their length. For example, an array {2, 2} will create a repeating line pattern of 2 pixels of white space followed by a 2 pixel dash.

Declared In

Axis.h

  majorStrokeDashArray

Determines the pattern of the major grid lines.

@property (nonatomic, retain, nullable) NSArray<__kindofNSNumber*> *majorStrokeDashArray

Discussion

The array is a collection of alternating spaces and dashes represented by their length. For example, an array {2, 2} will create a repeating line pattern of 2 pixels of white space followed by a 2 pixel dash.

Declared In

Axis.h

  minorStrokeDashArray

Determines the pattern of the minor grid lines.

@property (nonatomic, retain, nullable) NSArray<__kindofNSNumber*> *minorStrokeDashArray

Discussion

The array is a collection of alternating spaces and dashes represented by their length. For example, an array {2, 2} will create a repeating line pattern of 2 pixels of white space followed by a 2 pixel dash.

Declared In

Axis.h

  strokeThickness

A value that determines the thickness (in pixels) of the axis line.

@property (nonatomic) CGFloat strokeThickness

Declared In

Axis.h

  majorStrokeThickness

A value that determines the thickness (in pixels) of the major grid lines.

@property (nonatomic) CGFloat majorStrokeThickness

Declared In

Axis.h

  minorStrokeThickness

A value that determines the thickness (in pixels) of the minor grid lines.

@property (nonatomic) CGFloat minorStrokeThickness

Declared In

Axis.h

  tickStroke

A value that determines the IGBrush that will be used for the tickmarks.

@property (nonatomic, retain, nullable) IGBrush *tickStroke

Declared In

Axis.h

  tickStrokeDashArray

Determines the pattern of the tickmarks.

@property (nonatomic, retain, nullable) NSArray<__kindofNSNumber*> *tickStrokeDashArray

Discussion

The array is a collection of alternating spaces and dashes represented by their length. For example, an array {2, 2} will create a repeating line pattern of 2 pixels of white space followed by a 2 pixel dash.

Declared In

Axis.h

  tickLength

The length, in pixels, of the tickmarks.

@property (nonatomic) CGFloat tickLength

Declared In

Axis.h

  tickStrokeThickness

The thickness, in pixels, of the tickmarks.

@property (nonatomic) CGFloat tickStrokeThickness

Declared In

Axis.h

  labelFont

Determines the axis label font.

@property (nonatomic, retain, nullable) UIFont *labelFont

Declared In

Axis.h

  showFirstLabel

Determines whether or not the first label is displayed when the zoom level is set to 1.

@property (nonatomic) BOOL showFirstLabel

Declared In

Axis.h

– initWithKey:

Initializes the axis with a string key.

- (instancetype)initWithKey:(NSString *)key

Parameters

key

The string identifier for this axis.

Declared In

Axis.h

– convertToScreen:

Converts a value on the axis to a screen pixel coordinate.

- (double)convertToScreen:(double)axisValue

Parameters

axisValue

value on the axis.

Return Value

Screen value in pixels.

Declared In

Axis.h

– convertFromScreen:

Converts a pixel value on the screen to an axis value. The returned value will be mapped to the current axis range.

- (double)convertFromScreen:(double)screenValue

Parameters

screenValue

pixel coordinate on the screen.

Return Value

value on the axis, mapped to the current axis range.

Declared In

Axis.h

– unlockSmartAxisLabelPanel

When using smart axis, calling this method forces the chart to unlock the current height of the panel and resize it.

- (void)unlockSmartAxisLabelPanel

Declared In

Axis.h

  currentVisibleLabels

Returns an array of the currently visible lables on the axis.

@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *currentVisibleLabels

Declared In

Axis.h

  title

@property (nonatomic, retain) NSString *title

  titleFont

@property (nonatomic, retain) UIFont *titleFont

  titleAngle

@property (nonatomic, assign) CGFloat titleAngle

  titleVisible

@property (nonatomic, assign) BOOL titleVisible

  titleTextColor

@property (nonatomic, retain) IGBrush *titleTextColor