Inherits from NSObject
Declared in TKChartAxis.h

Overview

Represents a single axis of the chart.

TKChart renders its points in a coordinate system defined by its axes. To do this axes specify the minimum and maximum values that can be presented on the plot area. There are a few different types of axes that can be used with TKChart. They include: numeric, date/time and categorical. You can assign each axis to different series and you can show multiple axes in chart. Axes contain various properties to control their position, style and behavior. All chart axes subclass from TKChartAxis.

Properties

allowPan

Allows panning and zooming of series by this axis.

@property (nonatomic) BOOL allowPan

Declared In

TKChartAxis.h

allowZoom

Allows panning and zooming of series by this axis.

@property (nonatomic) BOOL allowZoom

Declared In

TKChartAxis.h

attributedTitle

The axis attributed title (if needed).

@property (nonatomic, strong) NSAttributedString *attributedTitle

Declared In

TKChartAxis.h

customLabels

This dictionary represents key-value pairs of the wished positions to be rendered ticks and labels and the respective color of the axis from the previous tick to the given tick.

@property (nonatomic, strong) NSDictionary *customLabels

Declared In

TKChartAxis.h

hidden

Determines whether the axis is hidden or visible in chart.

@property (nonatomic, assign) BOOL hidden

Declared In

TKChartAxis.h

isVertical

Returns YES for vertical axis and NO for horizontal ones.

@property (nonatomic, readonly) BOOL isVertical

Declared In

TKChartAxis.h

labelFormat

Defines a text format. If the label formatter is not nil, it preserves this property.

@property (nonatomic, copy) NSString *labelFormat

Declared In

TKChartAxis.h

labelFormatter

Defines a text formatter that preserves the labelFormat property.

@property (nonatomic, strong) NSFormatter *labelFormatter

Declared In

TKChartAxis.h

majorTickCount

Returns the tick count for this axis.

@property (nonatomic, readonly) NSUInteger majorTickCount

Declared In

TKChartAxis.h

normalizedPan

A normalized pan value in range between [0;1]

@property (nonatomic) double normalizedPan

Declared In

TKChartAxis.h

pan

The pan level of the axis.

@property (nonatomic) double pan

Declared In

TKChartAxis.h

plotMode

Defines how data points are plotted by an axis.

@property (nonatomic, assign, readonly) TKChartAxisPlotMode plotMode

Discussion

The axis plot modes are defined as follows:

 typedef enum TKChartAxisPlotMode {
 TKChartAxisPlotModeOnTicks,        // Points are plotted in the middle of the range, defined between each two ticks.
 TKChartAxisPlotModeBetweenTicks,   // Points are plotted over each tick.
 } TKChartAxisPlotMode;

Declared In

TKChartAxis.h

position

Determines the position of the axis.

@property (nonatomic, assign) TKChartAxisPosition position

Discussion

The axis positions are defined as follows:

 typedef enum TKChartAxisPosition {
 TKChartAxisPositionLeft,    // The axis should be positioned at the left side of the chart.
 TKChartAxisPositionRight,   // The axis shuld be positioned at the right side of the chart.
 TKChartAxisPositionTop,     // The axis should be positioned at the top side of the chart.
 TKChartAxisPositionBottom,  // The axis should be positioned at the bottom side of the chart.
 } TKChartAxisPosition;

Declared In

TKChartAxis.h

range

The axis range.

@property (nonatomic, strong) TKRange *range

Declared In

TKChartAxis.h

style

Defines the axis style.

@property (nonatomic, strong) TKChartAxisStyle *style

Declared In

TKChartAxis.h

title

The axis title (in plain text).

@property (nonatomic, copy) NSString *title

Declared In

TKChartAxis.h

visibleRange

The currently visible range.

@property (nonatomic, strong, readonly) TKRange *visibleRange

Declared In

TKChartAxis.h

zoom

The zoom level of the axis.

@property (nonatomic) double zoom

Declared In

TKChartAxis.h

zoomRange

If set, defines the allowed zoom range.

@property (nonatomic) TKRange *zoomRange

Declared In

TKChartAxis.h

Instance Methods

formatValue:

Formats a value to string

- (NSString *__nullable)formatValue:(id __nonnull)value

Parameters

value

The value

Declared In

TKChartAxis.h

initWithMinimum:andMaximum:

Initializes the axis with its minimum and maximum range.

- (instancetype __nonnull)initWithMinimum:(id __nonnull)minimum andMaximum:(id __nonnull)maximum

Parameters

minimum

The minimum value that specifies the start of the range.

maximum

The maximum value that specifies the end of the range.

Declared In

TKChartAxis.h

initWithMinimum:andMaximum:position:

Initializes the axis with its minimum, maximum and position.

- (instancetype __nonnull)initWithMinimum:(id __nonnull)minimum andMaximum:(id __nonnull)maximum position:(TKChartAxisPosition)position

Parameters

minimum

The minimum value that specifies the start of the range.

maximum

The maximum value that specifies the end of the range.

position

The position value that specifies where to place the axis (left, right, top or bottom side)

Declared In

TKChartAxis.h

initWithRange:

Initializes the axis with range.

- (instancetype __nonnull)initWithRange:(TKRange *__nonnull)range

Parameters

range

The range that represents the span of the axis.

Declared In

TKChartAxis.h

numericValue:

Returns the numeric representation of a value specific for this axis.

- (double)numericValue:(id __nonnull)value

Parameters

value

The value which is converted to.

Return Value

The numeric representation of the value.

Declared In

TKChartAxis.h

panToDataPoint:

Pans the axis to specific data point.

- (void)panToDataPoint:(id<TKChartData> __nonnull)dataPoint

Parameters

dataPoint

the data point the axis will be panned to.

Declared In

TKChartAxis.h

renderForChart:

Creates a renderer for the partical axis.

- (TKChartAxisRender *__nonnull)renderForChart:(TKChart *__nonnull)chart

Parameters

chart

The chart.

Declared In

TKChartAxis.h

tickValue:

Returns the tick’s value at a specific index.

- (id __nullable)tickValue:(NSInteger)index

Parameters

index

The index.

Return Value

A value representing the value at this index.

Declared In

TKChartAxis.h