NChartSeries Class Reference

Inherits from NChartObject : NSObject
Declared in NChartSeries.h

Overview

The NChartSeries class provides common methods for the series of the chart.

+ series

Create instance of series.

+ (id)series

Return Value

an autoreleased instance of the series.

Declared In

NChartSeries.h

  points

Array of points.

@property (nonatomic, readonly) NSArray *points

Declared In

NChartSeries.h

  name

Name of the series.

@property (nonatomic, readonly) NSString *name

Declared In

NChartSeries.h

  nameColor

Color of the series name displayed in the legend. If nil, the textColor from the legend is used. The default value is nil.

@property (nonatomic, strong) UIColor *nameColor

Declared In

NChartSeries.h

  disabledNameColor

Color of the series name displayed in the legend when the series is hidden (aka disabled). If nil, the textColor from the legend is used. The default value is nil.

@property (nonatomic, strong) UIColor *disabledNameColor

Declared In

NChartSeries.h

  image

Image that is displayed in the legend. This property returns the image only if it was provided by the data source. If the default image is used, nil is returned.

@property (nonatomic, readonly) UIImage *image

Declared In

NChartSeries.h

  disabledImage

Image that is displayed in the legend when the series is hidden (aka disabled). This property returns the image only if it was provided by the data source. If the default image is used, nil is returned.

@property (nonatomic, readonly) UIImage *disabledImage

Declared In

NChartSeries.h

  legendMarkerSize

Size of default series' marker in legend in pixels. The default value is 20.

@property (nonatomic, assign) float legendMarkerSize

Declared In

NChartSeries.h

  scale

Brush scale of the series used to color the map.

@property (nonatomic, strong) NChartBrushScale *scale

Declared In

NChartSeries.h

  tag

Tag of the series. You may use it as you want.

@property (nonatomic, assign) NSInteger tag

Declared In

NChartSeries.h

  hostsOnSX

Flag that determines if the series is hosted on the secondary X-axis. If YES, it will be drawn according to the secondary X-axis, if NO according to the normal X-axis. The secondary axis appears opposite the normal axis and is managed separately: it can have its own min and max; its own color settings and so on.

@property (nonatomic, assign) BOOL hostsOnSX

Declared In

NChartSeries.h

  hostsOnSY

Flag that determines if the series is hosted on the secondary Y-axis. If YES, it will be drawn according to the secondary Y-axis, if NO according to the normal Y-axis. The secondary axis appears opposite the normal axis and is managed separately: it can have its own min and max; its own color settings and so on.

@property (nonatomic, assign) BOOL hostsOnSY

Declared In

NChartSeries.h

  hostsOnSZ

Flag that determines if the series is hosted on the secondary Z-axis. If YES, it will be drawn according to the secondary Z-axis, if NO according to the normal Z-axis. The secondary axis appears opposite the normal axis and is managed separately: can have its own min and max; its own color settings and so on.

@property (nonatomic, assign) BOOL hostsOnSZ

Declared In

NChartSeries.h

  forceAbsolute

Flag that determines if the series forces absolute value axis. If YES, the series is drawn as if value axes type would be absolute, even if it’s not. If NO, the series is drawn according to the actual value axes type set in Cartesian system. The default value is NO.

@property (nonatomic, assign) BOOL forceAbsolute

Discussion

This property has effect for Cartesian system based series only. Otherwise it’s ignored.

Declared In

NChartSeries.h

  dataSource

Data source for the series.

@property (nonatomic, assign) id<NChartSeriesDataSource> dataSource

Declared In

NChartSeries.h

  dataSmoother

Data smoother used. The default value is nil (no data smoother used).

@property (nonatomic, strong) NChartDataSmoother *dataSmoother

See Also

Declared In

NChartSeries.h

  pointSelectionEnabled

Flag determining if the chart points can be selected by tap (YES) or not (NO). The default value is YES. If you do not want to select points by tap, it is better to disable selection, because it will save memory and boost the data updating.

@property (nonatomic, assign) BOOL pointSelectionEnabled

Discussion

This property works in conjunction with pointSelectionEnabled of NChart allowing to fine-tune the point selection for individual series.

Declared In

NChartSeries.h

  needsSeparateSums

Flag determining if in the additive value axis mode (when cartesianSystem.valueAxesType = NChartValueAxesTypeAdditive) positive and negative values are added separately, so all positives are above zero and all negatives are below zero (YES), or all the values are just added together (NO). The default value is YES. Normally it’s reasonable to separate the sums (so keep this flag in its default state), but sometimes you may want to preserve the series order when they are stacked on the additive axis. In this case you may want to toggle this flag to NO.

@property (nonatomic, assign) BOOL needsSeparateSums

Declared In

NChartSeries.h

  updateAllowed

Flag providing a hint that the series has no modifications and should not be updated by the next rebuildSeries or updateSeries call (NO) or it should be updated as normal (YES). The default value is YES.

@property (nonatomic, assign) BOOL updateAllowed

Discussion

Let’s imagine the situation when you have a heavy chart, say, a scatter of several millions of points, and a lightweight chart, say, a line of just a few points on top of that. According to your logic, you want to update the line, for example, changing its colour, and then you should use updateSeries, or slightly changing its values, and then you should use rebuildSeries. The scatter stays unchanged. But in both cases, the updateSeries and rebuildSeries calls will initiate the update process of both your series, which will take unnecessary long time. To prevent this, you can set updateAllowed flag of the scatter series to NO, and it will remain untouched improving the update performance.

Though, you have to be aware, that this flag is only a hint. In the end, NChart3D decides itself whether the series should be updated or not, because internally the series are combined in batches, and if one series of the batch is to be updated, while the other is not, the whole batch is going to be updated anyway.

Also, you should never set this flag to NO before the first appearance of the series. So the good idea to operate is to set this flag right before the update call, and then revert it back to prevent unwanted side-effects.

Declared In

NChartSeries.h