NChartStaticLine Class Reference

Inherits from NChartObject : NSObject
Declared in NChartStaticLine.h

Overview

The NChartStaticLine class provides methods to control static lines displayed on top of the chart. These lines do not move with the chart and do not respond to any user interactions. They can be used as custom borders, indicators, static grid, etc.

+ staticLine

Create new static line instance.

+ (NChartStaticLine *)staticLine

Return Value

new static line instance.

Declared In

NChartStaticLine.h

  color

Color of the static line. The default value is black color.

@property (nonatomic, strong) NSColor *color

Declared In

NChartStaticLine.h

  thickness

Thickness of the static line. The default value is 1.0.

@property (nonatomic, assign) float thickness

Declared In

NChartStaticLine.h

  position

Position of static line relative to the chart plot area. The default value is 0.5, which means the middle of the plot area.

@property (nonatomic, assign) float position

Declared In

NChartStaticLine.h

– nearestPointIndicesForSeries:

Get indices and interpolation parameter of nearest points relative to the static line (taking into account current chart position).

- (NChartInterpolationRange *)nearestPointIndicesForSeries:(NChartSeries *)series

Parameters

series
  • series to get points of.

Return Value

an instance of interpolation range. Its properties have following meaning: left - reference to the variable where to write nearest point left to the static line. If no points of series are left to the static line, the value is -1. right - reference to the variable where to write nearest point right to the static line. If no points of series are right to the static line, the value is -1. t - interpolation parameter in range [0; 1], if static line is between points with indices left and right, -1 otherwise.

Declared In

NChartStaticLine.h

– underlyingPointStateForSeries:shouldInterpolate:

Get chart point state of given series under the static line (taking into account current chart position).

- (NChartPointState *)underlyingPointStateForSeries:(NChartSeries *)series shouldInterpolate:(BOOL)shouldInterpolate

Parameters

series
  • series to get the point state for.
shouldInterpolate
  • flag indicating if the values should be interpolated between neighbor points (YES) or the nearest point value should be used (NO).

Return Value

point state or nil, if the series has no data under the static line.

Discussion

The state contains values only (this means brush, borderBrush and marker properties are undefined).

Declared In

NChartStaticLine.h