CFXDataValues Class Reference

Inherits from
Conforms to
Framework
Availability
Available in iOS 5.0 and later.
Companion guide
Declared in
ChartFX.h

Overview

You can also assign x-values to create an XY Plot using the x property.

You can set initial values using the yFrom property. Used in conjunction with the y property, you can create a 'floating bars' effect for bar charts.

Many times charts contain a large amount of data whereby visualizing such data via a chart has little or no value. For example, you may have the number of sales per day for all 365 days of the year however seeing a trend from month to month is very difficult due to the busy and excess information in the chart. Instead you can use ChartFX Data Compacting feature to provide meaningful summarized data. For convenience, ChartFX provides predefined formulas for popular compacting schemes such as First, Last, Min, Max, and Average.

Please note that instead of the value associated with the point, you can assign a hidden constant which will cause the point to be hidden in the chart. Although a hidden point is physically in the data array, when you use this constant the marker will not appear in the chart, and if you have charts like a line or area chart, the line will break at that particular point.

Properties

aggressiveAllocation

Gets or sets a value indicating ChartFX should agreesively allocate space for future values. This increases performance at the cost of additional memory usage.

@property(nonatomic) BOOL aggressiveAllocation
Discussion

When set to YES, Chart FX will double the current memory allotment when it is required allocate additional memory for the chart's data array. This is the default behavior. When set to NO, memory is allocated in single units.

AggressiveAllocation should only become a factor when dealing with very large amounds of data (millions).

The data method of the Chart object is used to access the DataValues object of a chart.

Availability
  • Available in iOS 5.0 and later.
Declared In
ChartFX.h

compacted

Gets a value indicating whether or not the data is compacted.

@property(nonatomic) BOOL compacted
Discussion

The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact method is used to complete the compacting process.

The undoCompact method is used to decompress compacted data and show all values.

The compactedBy method is used to configure a value indicating the interval of units to compress data.

The data method is used to access the DataValues object for a chart.

Availability
  • Available in iOS 5.0 and later.
Declared In
ChartFX.h

compactedBy

Gets or sets a value indicating the interval of units to compress data.

@property(nonatomic) double compactedBy
Discussion

This method is used to configure the units for compression in the X Axis. If the XAxis has been passed DateTime XValues and has been formated for Date, the units represented by the CompactBy method would be Days. For example a value of 30 would be interperted into 1 Month. If you do not have configured XValues in the chart, then the unit base is 1 (categorical axis).

The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact method is used to complete the compacting process.

The compacted returns a value indicating whether or not the data is compacted.

The undoCompact method is used to decompress compacted data and show all values.

The data method is used to access the DataValues object for a chart.

Availability
  • Available in iOS 5.0 and later.
Declared In
ChartFX.h

initializeHidden

Gets or sets a value indicating to intialize all non-initialized values to hidden value.

@property(nonatomic) BOOL initializeHidden
Discussion

This method will affect the data points which will be allocated, not the data points which are already allocated.

Declared In
ChartFX.h

interpolateHidden

Gets or sets a value specifying to draw a connecting line over a missing data point.

@property(nonatomic) BOOL interpolateHidden
Discussion

When this method is set to NO, hidden points in the chart will be result in a "broken" line in the chart. When set to YES, the chart will draw a connecting so prevent the broken line.

The initializeHidden method is used to instruct the chart to intialize all non-initialized values to a hidden value.

Availability
  • Available in iOS 5.0 and later.
Declared In
ChartFX.h

labels

Provides access to label collection of the main x-axis.

@property(nonatomic) LabelCollection labels
Parameters
index
A zero based index indicating the Label index of the main x-axis.
Discussion

Provides a shortcut to the labels method of the main axisX of the CFXChart.

Availability
  • Available in iOS 5.0 and later.
Declared In
ChartFX.h

points

Gets or sets a value indicating the number of series allocated for the chart.

@property(nonatomic) int points
Discussion

The Points and series methods are usually set a design-time using the method dialog box for the Chart object. The only time these methods should be included in code is when you wish to read the number of series or points in a chart.

This method is normally used to get the number of data points per series available in the chart for administration purposes. For example, if you want to change the values of each data point in a series, you will need the number of available points per series to complete the For loop.

Availability
  • Available in iOS 5.0 and later.
See Also
Declared In
ChartFX.h

series

Gets or sets a value indicating the number of series allocated for the chart.

@property(nonatomic) int series
Discussion

The points and Series methods are usually set a design-time using the property dialog box for the Chart object. The only time these methods should be included in code is when you wish to read the number of series or points in a chart.

This method is normally used to get the number of series available on the chart for administration purposes. For example, if you want to set a different color for each data series using the color method, you will need the number of available data series to complete the For loop.

Declared In
ChartFX.h

x

Allows you to set X-Values for specific point of XY plots.

@property(nonatomic) CFXIDataArray x
Parameters
series
The series the value belongs to.
point
The point on the series.
Availability
  • Available in iOS 5.0 and later.
Declared In
ChartFX.h

y

Allows you to access the Y coordinates of the data points.

@property(nonatomic) CFXIDataArray y
Parameters
series
The series the value belongs to.
point
The point on the series.
Availability
  • Available in iOS 5.0 and later.
Declared In
ChartFX.h

yFrom

Allows you to set the starting Y-value for a specific value on the chart.

@property(nonatomic) CFXIDataArray yFrom
Parameters
series
The series the value belongs to.
point
The point on the series.
Declared In
ChartFX.h

Instance Methods

clear

Clears all the data values in the chart.

- (void) clear
Declared In
ChartFX.h

commitChanges

Finalizes chart data and invokes selected data related tasks.

- (BOOL)commitChanges
Declared In
ChartFX.h

recalculateScale

Recalculates the scale of the chart based on the data available.

- (void) recalculateScale
Availability
  • Available in iOS 5.0 and later.
Declared In
ChartFX.h

compactByStep:

Compacts the data in order to display more summarized information.

- (void) compactByStep:(double *)step
Parameters
step
The number of points to agregate while compacting data.
Declared In
ChartFX.h

removeSeries:

Remove a Series from the collection by index.

- (void) removeSeries:(int *)seriesIndex
Parameters
seriesIndex
Index of Series to be removed.
Declared In
ChartFX.h

undoCompact

If the data is compacted, this method uncompacts the data and shows all values.

- (void) undoCompact
Declared In
ChartFX.h

setValue:forPoint:value:forSeries:andPoint:

Used to set the value for a particular point and series.

- (void) setValue:(double *)value forPoint(int *)point: value(double *)value: forSeries(int *)series: andPoint(int *)point
Parameters
value
The value to be set.
forPoint
Zero-based index of chart point to set value to.
value
The value to be set.
forSeries
Zero-based index of chart series to set value to.
andPoint
Zero-based index of chart point to set value to.
Discussion

When passing the value forPoint only, the chart must have one single series.

Declared In
ChartFX.h

valueForSeries:andPoint:

Gets the value for a particular series and point.

- (double)valueForSeries:(int *)series andPoint(int *)point
Parameters
series
Zero-based index of the series to retrieve its value.
andPoint
Zero-based index of the point to retrieve its value.
Declared In
ChartFX.h

valueForPoint:

Gets the value for a particular point.

- (double)valueForPoint:(int *)point
Parameters
point
Zero-based index of the point to retrieve its value.
Declared In
ChartFX.h