NChartSubChart Class Reference

Inherits from NChartObject : NSObject
Declared in NChartSubChart.h

Overview

The NChartSubChart class provides methods to display a subchart on top of the main chart.

Normally, subcharts are used to show advanced details about the objects displayed by the main chart. For example, imagine you have a data set of monthly revenue of 10 companies over 10 years, so you have 10 * 10 * 12 = 1200 data points. Being far away from the Big Data, it is still already quite some number, so, to display this data set in a reasonable way, you may need some Big Data analysis practives like the Shneiderman’s mantra: “Overview first, zoom and filter, then details on demand”. As an overview, you can display a histogram of average revenue for the companies, which gives you 10 columns. Upon click on a column, you can place a subchart on top of that showing a line chart with 120 points characterizing the selected company.

+ subChartForChart:

Create a subchart.

+ (NChartSubChart *)subChartForChart:(NChart *)parentChart

Parameters

parentChart
  • chart to create the subchart for.

Return Value

newly created instance of a subchart.

Declared In

NChartSubChart.h

– initWithChart:

Initialize subchart.

- (instancetype)initWithChart:(NChart *)parentChart

Parameters

parentChart
  • chart to create the subchart for.

Return Value

initialized instance of a subchart.

Declared In

NChartSubChart.h

  parentChart

Reference to the parent chart.

@property (nonatomic, readonly) NChart *parentChart

Discussion

To get the subchart, use the chart property.

Declared In

NChartSubChart.h

  size

Size (in pixels) of the subchart. The default value is (300, 300).

@property (nonatomic, assign) CGSize size

Declared In

NChartSubChart.h

  targetPoint

Target chart point, for which the subchart is shown. If nil, you have to use x, y, and z values to define an arbitrary point in the chart space. The default value is nil.

@property (nonatomic, assign) NChartPoint *targetPoint

Declared In

NChartSubChart.h

  targetX

X value in the chart space of the target location, for which the subchart is shown. The default value is 0. Alternatively, you can use targetPoint.

@property (nonatomic, assign) double targetX

Declared In

NChartSubChart.h

  targetY

Y value in the chart space of the target location, for which the subchart is shown. The default value is 0. Alternatively, you can use targetPoint.

@property (nonatomic, assign) double targetY

Declared In

NChartSubChart.h

  targetZ

Z value in the chart space of the target location, for which the subchart is shown. The default value is 0. Alternatively, you can use targetPoint.

@property (nonatomic, assign) double targetZ

Declared In

NChartSubChart.h

  hostsOnSX

Flag that determines if the target location is hosted on the secondary X-axis. The default value is NO. 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

NChartSubChart.h

  hostsOnSY

Flag that determines if the target location is hosted on the secondary Y-axis. The default value is NO. 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

NChartSubChart.h

  hostsOnSZ

Flag that determines if the target location is hosted on the secondary Z-axis. The default value is NO. 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: it can have its own min and max; its own color settings and so on.

@property (nonatomic, assign) BOOL hostsOnSZ

Declared In

NChartSubChart.h

  targetAreaOffset

Offset from the target area in pixels. The default value is (50, 50).

@property (nonatomic, assign) CGPoint targetAreaOffset

Discussion

The offset direction may be altered automatically so that both the target area and the subchart are visible.

Declared In

NChartSubChart.h

  targetAreaSize

Size (in pixels) of the highlighted area around the target. The default value is (10, 10).

@property (nonatomic, assign) CGSize targetAreaSize

Declared In

NChartSubChart.h

  targetAreaBorderRadius

Border radius of the highlighted target area (in pixels). The default value is 5.

@property (nonatomic, assign) double targetAreaBorderRadius

Declared In

NChartSubChart.h

  borderThickness

Border thickness (in pixels). The default value is 1.

@property (nonatomic, assign) double borderThickness

Declared In

NChartSubChart.h

  borderColor

Border color. The default value is black.

@property (nonatomic, retain) UIColor *borderColor

Declared In

NChartSubChart.h

– setVisible:animated:

Change visibility of the subchart animated.

- (void)setVisible:(BOOL)visible animated:(float)duration

Parameters

visible
  • flag of visibility.
duration
  • duration of animation in seconds.

Declared In

NChartSubChart.h