NChart Class Reference
Inherits from | NSObject |
---|---|
Declared in | NChart.h |
– addSeries:
Add series to chart.
- (void)addSeries:(NChartSeries *)series
Parameters
series |
|
---|
See Also
Declared In
NChart.h
– removeSeries:
Remove series from chart.
- (void)removeSeries:(NChartSeries *)series
Parameters
series |
|
---|
See Also
Declared In
NChart.h
– addSeriesSettings:
Add global settings for the series. If you previously set some settings, they will be overwritten by new ones.
- (void)addSeriesSettings:(NChartSeriesSettings *)settings
Parameters
settings |
|
---|
See Also
Declared In
NChart.h
– removeSeriesSettings:
Remove all the global settings for the series by given class.
- (void)removeSeriesSettings:(Class)settingsClass
Parameters
settingsClass |
|
---|
Declared In
NChart.h
– removeAllSeriesSettings
Remove all the global settings for the series.
- (void)removeAllSeriesSettings
Declared In
NChart.h
– seriesSettings:
Get settings of given settings class. If there were no settings set, default settings container for the given type is returned.
- (NChartSeriesSettings *)seriesSettings:(Class)settingsClass
Parameters
settingsClass |
|
---|
Return Value
settings of the given class.
See Also
Declared In
NChart.h
– updateData
Force chart to be updated. Call this method when you want to reload data from the data source and rebuild the chart. Data are processed by this call and minimums / maximums on axes are calculated.
- (void)updateData
Declared In
NChart.h
– extendData
Force chart to extend the points arrays of series. Only newly added data are processed by this call.
Minimums and maximums may change.
Call this method always you want to extend the data array without changing old data. This method causes
series to query new portion of data through - (NSArray )seriesDataSourceExtraPointsForSeries:(NChartSeries )series;
call of their data sources. But you cannot extend the array of points forever, so there is a property
pointsHistoryLength that determines the length of history.
- (void)extendData
Discussion
The difference with updateData is that only newly added points are processed and the array of these points is
queried through - (NSArray )seriesDataSourceExtraPointsForSeries:(NChartSeries )series;
call of
NChartSeriesDataSource
. This can save you time by updating large data sets.
See Also
Declared In
NChart.h
pointsHistoryLength
Property that determines the maximal length of series' points array. The default value is 1000.
The array of points in series is determined after updateData call (by querying points from series'
data sources) and then can be extended after extendData call. The property pointsHistoryLength
takes effect by using extendData only. The new points are added to the end of the points' array of the
series and if the array exceeds the given length, first n points are deleted, where
n = array.length - pointsHistoryLength
.
@property (nonatomic, assign) NSUInteger pointsHistoryLength
Declared In
NChart.h
– rebuildSeries
Force series to rebuild by reloading data from data source. Call this method when you know that the chart layout (including layout of axes, so min and max values) has not changed, but the data in series have. This method invokes updateSeries automatically. Data are not processed by this call, so values on axes remain unchanged. Use this method if you are absolutely sure minimums and maximums have not changed!
- (void)rebuildSeries
Declared In
NChart.h
– updateSeries
Force series to be updated without reloading data from data source. Call this method when you want to reflect
some changes you made in the visual appearance of a series (brush, etc.). A call of rebuildSeries invokes
updateSeries
automatically.
- (void)updateSeries
Declared In
NChart.h
streamingMode
Flag determining if streaming mode is enabled. The default value is NO.
@property (nonatomic, assign) BOOL streamingMode
Discussion
If streaming mode is set to YES, pointSelectionEnabled is automatically set to NO to boost the performance of data updating.
See Also
Declared In
NChart.h
– streamData
Stream the data. This causes the updating of chart to display new states of points. The data are going to be processed, so minimum and maximum on the axes may change. Use this method in the following use-case: if your set of points was not changed, but the values in the states of points do, you can update the chart through this method much faster than through regular updateData.
- (void)streamData
Discussion
The difference with rebuildSeries is that streamData
does not reload data from data source,
but does the optimized data processing (it’s faster than regular data processing). Series will use the points they
already have (the points are mutable, so you can change their data anywhere you want).
The difference with updateSeries is that streamData
is even faster and does the optimized data
processing. So use it to reflect some realtime “streaming” changes of data.
This method requires streamingMode to be on, use streamingMode = YES
for this.
The first appearance of series should be initialized by the updateData call. streamData
is to
change the already displayed series only.
If you want to change the data in separate thread, you should wrap all the data changing routines in the beginTransaction and endTransaction calls.
Declared In
NChart.h
incrementalMinMaxMode
Incremental minimum and maximum calculation mode. This mode makes sense in streaming mode only. If the incremental mode is on, new minimum cannot be greater and new maximum cannot be less than the ones calculated on the previous datasets. The default value is NO.
@property (nonatomic, assign) BOOL incrementalMinMaxMode
Declared In
NChart.h
– flushChanges
Synchronize all the changes with visual appearance. You may call this method after all your data is updated (it means
after you called updateData and playTransition:reverse:
because playTransition:reverse:
only says that transition should start playing and does not wait till it plays completely) to ensure that the visual
appearance will be updated as soon as possible.
You may call this method on the big dataset to reduce lag between your updateData call and actual updating.
Alternatively, you may call
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
but this will affect your runloop, while flushChanges
will not.
- (void)flushChanges
Declared In
NChart.h
– relayout
Force chart to relayout. Call this method if you made some changes but do not want to update data. A call of updateData invokes relayout automatically.
- (void)relayout
Declared In
NChart.h
– alignCenter:
Change position so that the chart is aligned to the center of the screen. This method takes effect in 3D mode only.
- (void)alignCenter:(float)duration
Parameters
duration |
|
---|
Declared In
NChart.h
– fitToScreen:
Change zoom and position so that the chart fits the screen (with current rotation, if in 3D).
- (void)fitToScreen:(float)duration
Parameters
duration |
|
---|
Declared In
NChart.h
zoom
Zoom of the chart. The default zoom is 1 which corresponds to the fitting the chart to screen (both in 2D and 3D).
The zooming is proportional. If you want non-proportional zoom in 2D mode, you should use
zoomToRegionFrom
method of NChartValueAxis.
@property (nonatomic, assign) float zoom
Discussion
If you want to alter the initial zoom, you should change the value of this property after
updateData
call.
Declared In
NChart.h
– zoomTo:duration:delay:
Set zoom for the chart with animation. The zooming is proportional. If you want non-proportional zoom in 2D mode,
you should use zoomToRegionFrom
method of NChartValueAxis.
- (void)zoomTo:(float)zoom duration:(float)duration delay:(float)delay
Parameters
zoom |
|
---|---|
duration |
|
delay |
|
Discussion
If you want to alter the initial zoom, you should change the value of this property after
updateData
call.
Declared In
NChart.h
minZoom
Minimal zoom of the chart. After this zoom is reached by user interactions, chart starts bouncing zoom. The minimal zoom differs in 2D and 3D mode. In 3D mode the default value is 0.5. In 2D it is 1.
@property (nonatomic, assign) float minZoom
Declared In
NChart.h
maxZoom
Maximal zoom of the chart. After this zoom is reached by user interactions, chart starts bouncing zoom. The maximal zoom differs in 2D and 3D mode. In 2D mode the default value is recalculated each time the chart is laid out (by changing of the frame or by updating data) according to the data on the axes in case shouldCalculate2DZoomBoundsAutomatically flag is set to YES. In 3D the default value is 2.
@property (nonatomic, assign) float maxZoom
Declared In
NChart.h
shouldCalculate2DZoomBoundsAutomatically
Flag determining if zoom in 2D mode should be calculated automatically (YES) or not (NO). The default value is YES.
@property (nonatomic, assign) BOOL shouldCalculate2DZoomBoundsAutomatically
Declared In
NChart.h
pivot
Pivot of the chart in the internal chart scene coordinates.
Use this property if you want to save and than restore position of the chart. This property works for 2D
and 3D modes. Theoretically you can use this property to pan the chart programmatically, however it is better to use
zoomToRegionFrom
method of NChartValueAxis.
@property (nonatomic, assign) CGPoint pivot
Declared In
NChart.h
– rotateAroundYToAngle:duration:delay:
Rotate chart around the Y-Axis (vertical axis) with animation (has effect in 3D mode only).
- (void)rotateAroundYToAngle:(float)angle duration:(float)duration delay:(float)delay
Parameters
angle |
|
---|---|
duration |
|
delay |
|
Declared In
NChart.h
– rotateAroundYToAngle:duration:delay:interpolator:
Rotate chart around the Y-Axis (vertical axis) with animation (has effect in 3D mode only).
- (void)rotateAroundYToAngle:(float)angle duration:(float)duration delay:(float)delay interpolator:(NChartInterpolator *)interpolator
Parameters
angle |
|
---|---|
duration |
|
delay |
|
interpolator |
|
See Also
Declared In
NChart.h
yAngle
Rotation angle around the Y-Axis (vertical axis) in radians (has effect in 3D mode only). The default value is 3.93 (225 degrees).
@property (nonatomic, assign) float yAngle
Declared In
NChart.h
initialYAngle
Initial rotation angle around the Y-Axis (vertical axis) in radians (has effect in 3D mode only).
The default value is 3.93 (225 degrees).
This is the angle the chart is rotated back to if you call resetTransformations:
method.
@property (nonatomic, assign) float initialYAngle
Declared In
NChart.h
permanentRotationY
Flag determining if permanent rotation around Y-Axis is on (YES), or off (NO). The default value is NO. Use this flag if you want the chart to rotate around Y-Axis without any interactions. This property takes effect in 3D mode only.
@property (nonatomic, assign) BOOL permanentRotationY
Declared In
NChart.h
permanentRotationYSpeed
Speed of permanent rotation around Y-Axis (in radians per second). The default value is 0. See permanentRotationY for more info about permanent rotation.
@property (nonatomic, assign) float permanentRotationYSpeed
Declared In
NChart.h
– rotateAroundXToAngle:duration:delay:
Rotate chart around the X-Axis (horizontal axis) with animation (has effect in 3D mode only).
- (void)rotateAroundXToAngle:(float)angle duration:(float)duration delay:(float)delay
Parameters
angle |
|
---|---|
duration |
|
delay |
|
Declared In
NChart.h
– rotateAroundXToAngle:duration:delay:interpolator:
Rotate chart around the X-Axis (horizontal axis) with animation (has effect in 3D mode only).
- (void)rotateAroundXToAngle:(float)angle duration:(float)duration delay:(float)delay interpolator:(NChartInterpolator *)interpolator
Parameters
angle |
|
---|---|
duration |
|
delay |
|
interpolator |
|
See Also
Declared In
NChart.h
xAngle
Rotation angle around the X-Axis (horizontal axis) in radians (has effect in 3D mode only). The default value is -0.87 (-50 degrees).
@property (nonatomic, assign) float xAngle
Declared In
NChart.h
initialXAngle
Initial rotation angle around the X-Axis (horizontal axis) in radians (has effect in 3D mode only).
The default value is -0.87 (-50 degrees).
This is the angle the chart is rotated back to if you call resetTransformations:
method.
@property (nonatomic, assign) float initialXAngle
Declared In
NChart.h
permanentRotationX
Flag determining if permanent rotation around X-Axis is on (YES), or off (NO). The default value is NO. Use this flag if you want the chart to rotate around X-Axis without any interactions. This property takes effect in 3D mode only.
@property (nonatomic, assign) BOOL permanentRotationX
Declared In
NChart.h
permanentRotationXSpeed
Speed of permanent rotation around X-Axis (in radians per second). The default value is 0. See permanentRotationX for more info about permanent rotation.
@property (nonatomic, assign) float permanentRotationXSpeed
Declared In
NChart.h
shouldLimitRotationX
Flag determining if rotation around X-Axis is limited (YES) or not (NO). The default value is YES.
@property (nonatomic, assign) BOOL shouldLimitRotationX
Declared In
NChart.h
– rotatePolarToAngle:duration:delay:
Rotate polar coordinate system with animation (has effect in 2D mode only).
- (void)rotatePolarToAngle:(float)angle duration:(float)duration delay:(float)delay
Parameters
angle |
|
---|---|
duration |
|
delay |
|
Declared In
NChart.h
– rotatePolarToAngle:duration:delay:interpolator:
Rotate polar coordinate system with animation (has effect in 2D mode only).
- (void)rotatePolarToAngle:(float)angle duration:(float)duration delay:(float)delay interpolator:(NChartInterpolator *)interpolator
Parameters
angle |
|
---|---|
duration |
|
delay |
|
interpolator |
|
Declared In
NChart.h
polarAngle
Rotation angle of the polar coordinate system in radians (has effect in 2D mode only). The default value is 0 (0 degrees).
@property (nonatomic, assign) float polarAngle
Declared In
NChart.h
initialPolarAngle
Initial rotation angle of the polar coordinate system in radians (has effect in 2D mode only).
The default value is 0 (0 degrees).
This is the angle the chart is rotated back to if you call resetTransformations:
method.
@property (nonatomic, assign) float initialPolarAngle
Declared In
NChart.h
background
Brush that fills the chart’s background.
@property (nonatomic, strong) NChartBrush *background
See Also
Declared In
NChart.h
drawIn3D
Flag that determines if a chart should be drawn in 3D (YES) or in 2D (NO). The default value is NO.
@property (nonatomic, assign) BOOL drawIn3D
Declared In
NChart.h
useParallelProjection
Flag that determines if a chart use parallel projection (YES) or perspective projection (NO) in 3D-mode. The default value is NO.
@property (nonatomic, assign) BOOL useParallelProjection
Discussion
This flag takes effect in 3D-mode only.
Declared In
NChart.h
cartesianSystem
Cartesian coordinates system used to store value axes and supplementary visual items.
@property (nonatomic, readonly) NChartCartesianSystem *cartesianSystem
See Also
Declared In
NChart.h
polarSystem
Polar coordinates system used to store value axes and supplementary visual items.
@property (nonatomic, readonly) NChartPolarSystem *polarSystem
See Also
Declared In
NChart.h
sizeAxis
Size axis used to scale the sizes of markers.
@property (nonatomic, readonly) NChartSizeAxis *sizeAxis
See Also
Declared In
NChart.h
timeAxis
Time axis used to navigate through the time ticks.
@property (nonatomic, readonly) NChartTimeAxis *timeAxis
See Also
Declared In
NChart.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
Declared In
NChart.h
– resetTransformations:
Reset all transformations to initial values.
- (void)resetTransformations:(float)duration
Parameters
duration |
|
---|
Declared In
NChart.h
– playTransition:reverse:
Play animated transition from old state to new one. The old state is cached automatically, so the only thing you need
to do for animation is to change the series (by calling addSeries: / removeSeries: / removeAllSeries) or data in
the series (by updating data source and calling updateData) and than call playTransition:reverse:
.
State is cached when updateData is called.
- (void)playTransition:(float)duration reverse:(BOOL)reverse
Parameters
duration |
|
---|---|
reverse |
|
Declared In
NChart.h
– resetTransition
Reset transition by cleaning up the cache made from the previous updateData call. Call this method if you want to see animation from the default start positions as if you just started the app.
- (void)resetTransition
Declared In
NChart.h
– isTransitionPlaying
Check if transition is playing.
- (BOOL)isTransitionPlaying
Return Value
YES if playing, NO if not.
Declared In
NChart.h
– stopTransition
Stop transition. This will stop all the transition animations, even if they are not played till the end or if they where delayed and did not even start animating.
- (void)stopTransition
Declared In
NChart.h
legend
Legend of the chart.
@property (nonatomic, readonly) NChartLegend *legend
See Also
Declared In
NChart.h
scaleLegends
Scale legends array. It’s empty by default.
@property (nonatomic, readonly) NSArray *scaleLegends
See Also
Declared In
NChart.h
– addScaleLegend:
Add scale legend.
- (void)addScaleLegend:(NChartScaleLegend *)scaleLegend
Parameters
scaleLegend |
|
---|
See Also
Declared In
NChart.h
– removeScaleLegend:
Remove scale legend.
- (void)removeScaleLegend:(NChartScaleLegend *)scaleLegend
Parameters
scaleLegend |
|
---|
See Also
Declared In
NChart.h
– removeAllScaleLegends
Remove all scale legends.
- (void)removeAllScaleLegends
See Also
Declared In
NChart.h
caption
Caption of the chart.
@property (nonatomic, readonly) NChartCaption *caption
See Also
Declared In
NChart.h
margin
Margin of the chart that determines how far the content of chart starts from view’s bounds. The default margin is zero on all sides.
@property (nonatomic, assign) NChartMargin margin
Declared In
NChart.h
showFPS
Flag that determines if FPS rate should be displayed (YES) or not (NO). You may use this for debug purposes or if you are just curious, but it’s a very bad idea to show FPS in production code, because it results in continuous rendering that loads CPU and consumes power. If FPS is off, the picture is re-rendered only if it’s really needed. The default value is NO.
@property (nonatomic, assign) BOOL showFPS
Declared In
NChart.h
shouldAntialias
Flag that determines if the image should be anti-aliased (YES) or not (NO). Antialiasing makes the picture smoother, but impacts performance. The default value is NO.
@property (nonatomic, assign) BOOL shouldAntialias
Declared In
NChart.h
adaptiveAntialiasing
Flag that determines if anti-aliasing is adaptive (YES) or not (NO). Adaptivity means that it is switched off automatically for the time-critical periods like user interactions or animation playing. This property takes effect if shouldAntialias is YES only. The default value is YES.
@property (nonatomic, assign) BOOL adaptiveAntialiasing
Declared In
NChart.h
zoomMode
Zoom mode used in chart. The default is NChartZoomModeProportional
.
@property (nonatomic, assign) NChartZoomMode zoomMode
See Also
Declared In
NChart.h
zoomToPointMode
Flag that determines if chart is zoomed to the cursor (YES) or to the screen center (NO). The default value is NO.
@property (nonatomic, assign) BOOL zoomToPointMode
Declared In
NChart.h
shouldBounceZoom
Flag that determines if zoom should bounce (YES) or not (NO). The default value is YES.
@property (nonatomic, assign) BOOL shouldBounceZoom
Declared In
NChart.h
shouldBouncePan
Flag that determines if pan should bounce (YES) or not (NO). The default value is YES.
@property (nonatomic, assign) BOOL shouldBouncePan
Declared In
NChart.h
userInteractionMode
Interaction mode used in the chart. The default is NChartUserInteractionAll
.
@property (nonatomic, assign) NSUInteger userInteractionMode
Discussion
You can use multiple interactions concatenated with bitwise OR to specify the mask of what is available.
See Also
Declared In
NChart.h
shadingModel
Shading model that is used in 3D mode. The default value is NChartShadingModelPhong.
@property (nonatomic, assign) NChartShadingModel shadingModel
Discussion
This property controls shading for the 3D charts like surfaces, columns, etc. Shading model for point markers is controlled through their brushes.
This property takes effect in 3D mode only.
Declared In
NChart.h
alwaysPreserveZoomAndPosition
Flag determining if chart content always preserves zoom and position (YES) or not (NO). This flag takes effect in 3D
mode only. If this flag is set to NO, when you change the frame of the chart, 3D content will be zoomed and shifted
to fit the screen. If this flag is set to YES, you should call resetTransformations: to fit the content in the
screen manually. The default value is NO.
The common use-case for this flag is when you smoothly change the size of the chart. For such resize
session you should set this flag to YES, and after the session you should probably call resetTransformations:.
@property (nonatomic, assign) BOOL alwaysPreserveZoomAndPosition
Declared In
NChart.h
– beginTransaction
Begin data changing transaction. You should call this method before any changes of chart settings/data in separate
thread. After the changes are made, you should call endTransaction
. The typical use-case of
multithreading in NChart3D is the streaming - the realtime data updating.
- (void)beginTransaction
Discussion
there is no sense to call this method in main thread.
See Also
Declared In
NChart.h
– endTransaction
End data changing transaction.
- (void)endTransaction
See Also
Declared In
NChart.h
shouldConvertZoomToAllowed
Flag determining if all zoom should be converted to the allowed zoom modes (YES) or not (NO). The default value is YES.
If this flag is YES, all the zoom directions are converted to the allowed zoom directions. For example,
if only horizontal zoom is allowed, and user zooms in diagonal direction, chart is zoomed horizontally with this flag
set to YES.
@property (nonatomic, assign) BOOL shouldConvertZoomToAllowed
Declared In
NChart.h
shouldAutoScroll
Flag determining if chart should automatically scroll (YES) or not (NO) to the end if new data are added by the
extendData call. The default value is NO.
This flag takes effect in 2D mode only.
@property (nonatomic, assign) BOOL shouldAutoScroll
Declared In
NChart.h
autoScrollDuration
Duration of auto scroll in seconds. The default value is 0.25.
@property (nonatomic, assign) float autoScrollDuration
See Also
Declared In
NChart.h
shouldToggleAutoScrollByPan
Flag determining if automatical scroll should be automatically toggled by pan (YES) or not (NO). The default value is NO.
If this flag is YES, automatical scroll is switched on (shouldAutoScroll is set to YES) if user pans
to the right-most position of the chart and switched off (shouldAutoScroll is set to NO) if user pans left.
This flag takes effect in 2D mode only.
@property (nonatomic, assign) BOOL shouldToggleAutoScrollByPan
See Also
Declared In
NChart.h
autoScrollLabel
Label that indicates whenever automatical scroll is switched on or off. The default value is nil.
This label takes effect in 2D mode only.
@property (nonatomic, strong) NChartAutoScrollLabel *autoScrollLabel
Declared In
NChart.h
staticLines
Array of static lines. Static line are the lines drawn on top of the chart plot area in the given position, not moving with the chart series and not responding to the user interactions.
@property (nonatomic, readonly) NSArray *staticLines
Discussion
You can use static lines to make custom borders or static visual indicators.
Declared In
NChart.h
– addStaticLine:
Add static line.
- (void)addStaticLine:(NChartStaticLine *)staticLine
Parameters
staticLine |
|
---|
See Also
Declared In
NChart.h
– removeAllStaticLines
Remove all static lines.
- (void)removeAllStaticLines
See Also
Declared In
NChart.h
shouldStopAtCenter
Flag indicating if series should stop scrolling at the center of the chart plot area (YES) or at the right/left border (NO). The default value is NO.
@property (nonatomic, assign) BOOL shouldStopAtCenter
Discussion
This property has effect in 2D mode only and only with the series based on the Cartesian system.
Declared In
NChart.h
isAccessibilityElement
Flag determining if accessibility features are switched on for the chart (YES) or not (NO). The default value is NO.
@property (nonatomic, assign) BOOL isAccessibilityElement
Declared In
NChart.h
– performScrollAt:translation:velocity:touchesCount:phase:
Perform scroll. This method is useful if you need to simulate the event of scroll interaction (like pan or drag).
- (void)performScrollAt:(CGPoint)location translation:(CGPoint)translation velocity:(CGPoint)velocity touchesCount:(int)touchesCount phase:(NChartEventPhase)phase
Parameters
location |
|
---|---|
translation |
|
velocity |
|
touchesCount |
|
phase |
|
Declared In
NChart.h
– performScaleAt:direction:scale:velocity:phase:
Perform scale. This method is useful if you need to simulate the event of scale interaction (like pinch or zoom).
- (void)performScaleAt:(CGPoint)location direction:(CGPoint)direction scale:(float)scale velocity:(float)velocity phase:(NChartEventPhase)phase
Parameters
location |
|
---|---|
direction |
|
scale |
|
velocity |
|
phase |
|
Declared In
NChart.h
licenseKey
License key of product.
@property (nonatomic, strong) NSString *licenseKey
Declared In
NChart.h
versionInfo
Get version info.
@property (nonatomic, readonly) NSString *versionInfo
Declared In
NChart.h
delegate
Chart delegate.
@property (nonatomic, assign) id<NChartDelegate> delegate
See Also
Declared In
NChart.h