Inherits from UIView
Conforms to UIScrollViewDelegate
Declared in IGChartView.h

Overview

A chart view is a data visualization control that creates a graphical representation of the user’s data. This control is designed to display high amounts of data and can handle constant data updates.

A chart view consists of two or more IGAxis objects and one or more IGSeries objects. The type of axes will depend on which series are used in the chart view. Each IGSeries object has a detailed description about axes requirements. The chart view supports an unlimited number of axes and an unlimited number of series. A typical chart view may include an IGCategoryXAxis, an IGNumericYAxis and a series such as IGColumnSeries.

Tasks

Other Methods

Initializing the chart view

Configuring the chart view

Notifying the chart view of data source changes

Properties

animateSeriesWhenAxisRangeChanges

Specifies whether series animation will proceed when a change in the axis range has been detected.

@property (nonatomic) BOOL animateSeriesWhenAxisRangeChanges

Declared In

IGChartView.h

antiAliasing

Gets or sets when anti-aliasing should occur while rendering the chart.

@property (nonatomic, assign) IGChartAntiAliasing antiAliasing

Discussion

Setting this property to IGChartAntiAliasingAlways will result in the best looking chart, however it will have slower performance. Setting it to IGChartAntiAliasingNever will result in the best performance, however the chart will not be rendered smoothly. The last option, which is also the default, IGChartAntiAliasingAlwaysExceptWhilePanningAndZooming, will result in the chart looking smooth, except while zooming and panning, however the zooming and panning operations will be much faster.

Declared In

IGChartView.h

axes

Returns an array of IGAxis objects used by the chart view. (read-only)

@property (nonatomic, readonly) NSArray *axes

Discussion

This property will return a read-only list of axes. To add or remove an axis, use addAxis and removeAxis methods.

Declared In

IGChartView.h

brushes

Returns an array of IGBrush objects used by the chart’s series.

@property (nonatomic, retain) NSArray *brushes

Discussion

This property will return a list of brushes used by the series. Each of the chart’s series will use a brush from the brushes array in the same order. Setting a brush on a series directly takes precedence over this array, in which case, the brush from the array will be skipped over.

Declared In

IGChartView.h

crosshairsBackground

The color of the crosshairs.

@property (nonatomic, retain) UIColor *crosshairsBackground

Declared In

IGChartView.h

crosshairsThickness

The thickness of the crosshair lines.

@property (nonatomic) float crosshairsThickness

Discussion

This property determines the thickness of both crosshairs. The default value is 1.5.

Declared In

IGChartView.h

crosshairsVisibility

Determines the visibility of the crosshairs.

@property (nonatomic) IGCrosshairsVisibility crosshairsVisibility

Discussion

The chart view can display both crosshairs, vertical or horizontal, or none.

Declared In

IGChartView.h

delegate

Sets the IGChartViewDelegate for the chart view

@property (nonatomic, assign) id<> delegate

Declared In

IGChartView.h

gridMode

Determines how the grid lines are displayed.

@property (nonatomic) IGGridMode gridMode

Discussion

This enumeration property determines whether the grid lines are displayed on top of all series or underneath them. The enumeration is of type IGGridMode

Declared In

IGChartView.h

isSquare

A Boolean value indicating whether a square aspect ratio should be used for the chart view.

@property (nonatomic) BOOL isSquare

Discussion

A square aspect ratio is locked to YES for polar and radial charts.

Declared In

IGChartView.h

legend

Specifies the legend control used by the chart.

@property (nonatomic, assign) IGLegendBase *legend

Discussion

This property lets the user set a reference to an existing legend control. When this property is set, all series in the chart will use the specified legend, unless a series has a legend property set directly on it.

Declared In

IGChartView.h

markerBrushes

Returns an array of IGBrush objects used by the chart’s series markers.

@property (nonatomic, retain) NSArray *markerBrushes

Discussion

This property will return a list of brushes used by the series markers. Each of the chart’s series will use a marker brush from the markerBrushes array in the same order. Setting a marker brush on a series directly takes precedence over this array, in which case, the brush from the array will be skipped over.

Declared In

IGChartView.h

markerOutlines

Returns an array of IGBrush objects used to draw a border around the series markers.

@property (nonatomic, retain) NSArray *markerOutlines

Discussion

This property will return a list of outlines used by the series markers. Each of the chart’s series will use a marker outline from the markerOutlines array in the same order. Setting a marker outline on a series directly takes precedence over this array, in which case, the outline from the array will be skipped over. To add or remove an outline, use addMarkerOutline and removeMarkerOutline methods.

Declared In

IGChartView.h

maximumZoomScale

Specifies the maximum zoom scale.

@property (nonatomic) float maximumZoomScale

Discussion

This property determines how far the chart view should be allowed to zoom in. The default value is 200. Set minimumZoomScale to be greater than maximumZoomScale to disable zooming.

Declared In

IGChartView.h

minimumZoomScale

Specifies the minimum zoom scale.

@property (nonatomic) float minimumZoomScale

Discussion

This property determines how far the chart view should be allowed to zoom out. The default value is 1. Set minimumZoomScale to be greater than maximumZoomScale to disable zooming.

Declared In

IGChartView.h

outlines

Returns an array of IGBrush objects used to draw a border around the series shapes.

@property (nonatomic, retain) NSArray *outlines

Discussion

This property will return a list of outlines used by the series. Each of the chart’s series will use an outline from the outlines array in the same order. Setting an outline on a series directly takes precedence over this array, in which case, the outline from the array will be skipped over.

Declared In

IGChartView.h

plotAreaBrush

Represents the brush used to color the chart view’s plot area.

@property (nonatomic, retain) IGBrush *plotAreaBrush

Discussion

The plot area is the portion of the chart view that contains axis lines, axis gridlines and all the series. It excludes the region marked by the axis extent.

Declared In

IGChartView.h

series

Returns an array of IGSeries objects used by the chart view. (read-only)

@property (nonatomic, readonly) NSArray *series

Discussion

This property will return a read-only list of series. To add or remove a series, use addSeries and removeSeries methods.

Declared In

IGChartView.h

theme

An object that defines a set of brushes and fonts that will be used to style the chart.

@property (nonatomic, retain) IGChartThemeDefinition *theme

Declared In

IGChartView.h

tooltipPinLocation

Specifies the tooltip location.

@property (nonatomic) IGTooltipPinLocation tooltipPinLocation

Discussion

This property determines where the tooltip will be positioned. The default setting uses a floating tooltip, which follows the location of the long press. Tooltip can also be pinned to top, bottom, left, or right.

Declared In

IGChartView.h

zoomContentOffset

The point at which the origin of the content view is offset from the origin of the chart view.

@property (nonatomic) CGPoint zoomContentOffset

Declared In

IGChartView.h

zoomScale

Specifies the zoom scale.

@property (nonatomic) float zoomScale

Discussion

This property determines what the chart view’s zoom scale should be. The default value is 1, which means fully zoomed out.

Declared In

IGChartView.h

Instance Methods

addAxis:

Adds an axis to the chart view.

- (void)addAxis:(IGAxis *)axis

Parameters

axis

Axis object to be added to the chart view.

Declared In

IGChartView.h

addSeries:

Adds a series to the chart view.

- (void)addSeries:(IGSeries *)series

Parameters

series

Series to be added to the chart view.

Declared In

IGChartView.h

addSeriesForType:usingKey:withDataSource:firstAxisKey:secondAxisKey:

Creates a series from a series type and adds it to the chart.

- (IGSeries *)addSeriesForType:(Class)seriesType usingKey:(NSString *)seriesKey withDataSource:(id<IGSeriesDataSource>)dataSource firstAxisKey:(NSString *)axisKey1 secondAxisKey:(NSString *)axisKey2

Parameters

seriesType

Series type, such as IGColumnSeries or IGFinancialSeries.

seriesKey

A unique series string identifier.

dataSource

Series data source.

axisKey1

First axis key.

axisKey2

Second axis key.

Return Value

Returns a new instance of a series that was added to the chart.

Discussion

This method creates an IGSeries based on the specified series type. It also creates appropriate axes based on the specified axis keys. If any of the keys already exist, the chart will attempt to use that axis, provided that the axis type can be applied to the series. The first axis key is typically the X axis, while the second key is the Y axis. For polar and radial series, the first axis key is the angle axis, while the second key is the radius axis.

Declared In

IGChartView.h

addStackedSeriesForType:usingKey:withDataSource:firstAxisKey:secondAxisKey:

Creates a stacked series from a series type and adds it to the chart.

- (IGStackedSeriesBase *)addStackedSeriesForType:(Class)seriesType usingKey:(NSString *)seriesKey withDataSource:(id<IGStackedSeriesDataSource>)dataSource firstAxisKey:(NSString *)axisKey1 secondAxisKey:(NSString *)axisKey2

Parameters

seriesType

Series type, such as IGStackedColumnSeries.

seriesKey

A unique series string identifier.

dataSource

Series data source.

axisKey1

First axis key.

axisKey2

Second axis key.

Return Value

Returns a new instance of a stacked series that was added to the chart.

Discussion

This method creates a stacked series based on the specified series type. It also creates appropriate axes based on the specified axis keys. If any of the keys already exist, the chart will attempt to use that axis, provided that the axis type can be applied to the series. The first axis key is the X axis, while the second key is the Y axis.

Declared In

IGChartView.h

clearItemsForDataSource:

Notifies the chart view that all items in the data source were cleared.

- (void)clearItemsForDataSource:(id<IGSeriesDataSource>)source

Parameters

source

Data source that had its items removed.

Discussion

This method is used to tell the chart view that all of the items in a given data source have been removed.

Declared In

IGChartView.h

clearItemsForStackedDataSource:

Notifies the chart view that all items in the stacked data source were cleared.

- (void)clearItemsForStackedDataSource:(id<IGStackedSeriesDataSource>)source

Parameters

source

Data source that had its items removed.

Discussion

This method is used to tell the chart view that all of the items in a given data source have been removed.

Declared In

IGChartView.h

exportVisualData

Returns a data representation of the visuals of the chart.

- (VisualChartData *)exportVisualData

Discussion

This method is available to provide a way to do validation for testing of the visuals of the chart.

Declared In

IGChartView.h

findAxisByKey:

Gets an axis from the chart for a specified key.

- (IGAxis *)findAxisByKey:(NSString *)key

Parameters

key

Unique axis identifier key.

Discussion

This method returns a reference to the axis in the chart’s axes array for a given key. If the axis cannot be found the method returns nil.

Declared In

IGChartView.h

findSeriesByKey:

Gets a series form the chart for a specified key.

- (IGSeries *)findSeriesByKey:(NSString *)key

Parameters

key

Unique series identifier key.

Discussion

This method returns a reference to the series in the chart’s series array for a given key. If the series cannot be found the method returns nil.

Declared In

IGChartView.h

initWithFrame:

Initializes the chart view with a given frame

- (id)initWithFrame:(CGRect)frame

Parameters

frame

A rectangular frame that specifies the location and size of the chart view.

Return Value

Returns an initialized IGChartView object.

Declared In

IGChartView.h

insertItemAtIndex:withSource:

Notifies the chart view that an item has been inserted in the data source.

- (void)insertItemAtIndex:(int)index withSource:(id<IGSeriesDataSource>)source

Parameters

index

Index of an item that has been inserted.

source

Data source that had an item inserted.

Discussion

This method is used to tell the chart view that an item has been inserted into a given data source at a given index.

Declared In

IGChartView.h

insertStackedItemAtIndex:withSource:

Notifies the chart view that an item has been inserted in the stacked data source.

- (void)insertStackedItemAtIndex:(int)index withSource:(id<IGStackedSeriesDataSource>)source

Parameters

index

Index of an item that has been inserted.

source

Data source that had an item inserted.

Discussion

This method is used to tell the chart view that an item has been inserted into a given data source at a given index.

Declared In

IGChartView.h

refresh

Causes the chart view to refresh itself.

- (void)refresh

Declared In

IGChartView.h

removeAxis:

Removes a specified axis from the chart view.

- (void)removeAxis:(IGAxis *)axis

Parameters

axis

Axis object to be removed from the chart view.

Declared In

IGChartView.h

removeItemAtIndex:withSource:

Notifies the chart view that an item has been removed from the data source.

- (void)removeItemAtIndex:(int)index withSource:(id<IGSeriesDataSource>)source

Parameters

index

Index of an item that has been removed.

source

Data source that had an item removed.

Discussion

This method is used to tell the chart view that an item has been removed from a given data source at a given index.

Declared In

IGChartView.h

removeSeries:

Removes a specified series from the chart view.

- (void)removeSeries:(IGSeries *)series

Parameters

series

Series to be removed from the chart view.

Declared In

IGChartView.h

removeStackedItemAtIndex:withSource:

Notifies the chart view that an item has been removed from the stacked data source.

- (void)removeStackedItemAtIndex:(int)index withSource:(id<IGStackedSeriesDataSource>)source

Parameters

index

Index of an item that has been removed.

source

Data source that had an item removed.

Discussion

This method is used to tell the chart view that an item has been removed from a given data source at a given index.

Declared In

IGChartView.h

replaceItemAtIndex:withSource:

Notifies the chart view that an item has been replaced in the data source.

- (void)replaceItemAtIndex:(int)index withSource:(id<IGSeriesDataSource>)source

Parameters

index

Index of an item that has been replaced.

source

Data source that had an item replaced.

Discussion

This method is used to tell the chart view that an item has been replaced in a given data source at a given index.

Declared In

IGChartView.h

replaceStackedItemAtIndex:withSource:

Notifies the chart view that an item has been replaced in the stacked data source.

- (void)replaceStackedItemAtIndex:(int)index withSource:(id<IGStackedSeriesDataSource>)source

Parameters

index

Index of an item that has been replaced.

source

Data source that had an item replaced.

Discussion

This method is used to tell the chart view that an item has been replaced in a given data source at a given index.

Declared In

IGChartView.h

updateItemAtIndex:withSource:

Notifies the chart view that an item has been updated in the data source.

- (void)updateItemAtIndex:(int)index withSource:(id<IGSeriesDataSource>)source

Parameters

index

Index of an item that has been replaced.

source

Data source that had an item replaced.

Discussion

This method is used to tell the chart view that an item has been updated in a given data source at a given index.

Declared In

IGChartView.h

updateStackedItemAtIndex:withSource:forFragment:

Notifies the chart view that an item has been updated in the stacked data source.

- (void)updateStackedItemAtIndex:(int)index withSource:(id<IGStackedSeriesDataSource>)source forFragment:(IGStackedFragmentSeries *)fragment

Parameters

index

Index of an item that has been replaced.

source

Data source that had an item replaced.

fragment

Stacked fragment containing the replaced item.

Discussion

This method is used to tell the chart view that an item has been updated in a given data source at a given index.

Declared In

IGChartView.h