ShinobiChart Class Reference

Inherits from UIView
Declared in SChart.h
Availability Standard
Premium
Related samples Area
BarChart
ColumnChart
FinancialChart
LargeDataSet
LineChart
PieChart

Overview

A ShinobiChart displays data arranged in either cartesian or radial series. Here is an example with a few of the common features labelled:

A ShinobiChart will display its cartesian series (line, column, bar, scatter) if a cartesian series is added to it first, or all its radial series (donuts, pies) if a radial series is added to it first. If a radial series is added to a ‘cartesian chart’ or vice versa, a warning will be issued and that series discarded.

Data is always represented in a series or a set of series. The SChartSeries determines the look and style of the data contained in a SChartDataSeries. There is a one-to-one relationship between a chart series and the data series it represents.

A chart must have a minimum of one x-axis and one y-axis to display cartesian series, however, these will be automatically generated if none are specified.

A ShinobiChart must have an object that acts as the data source to display any data and optionally can have an object that acts as the delegate. The data source must adopt the SChartDatasource protocol and the delegate must adopt the SChartDelegate protocol. The data source provides the information needed by the chart to construct the series and represent the data. Series are identified by an index integer by the data source.

The ShinobiChart is a subclass of UIView, and as such it can be added to other parent views or set as the root view of a view controller.

A ShinobiChart will only update to reflect any changes to data when the reloadData method is called.

Tasks

Layout and Styling

Notifications through the delegate

Managing the delegate and data source

Information about the chart axes

Configuring the axes

Information about the series displayed on the chart

Animation

Setting the title

Configuring a legend

Styling the chart

Interacting with the chart

Initializing a ShinobiChart object

Reloading the Chart

Interaction

Annotations

Properties

animationTracker

The chart’s animation tracker

@property (nonatomic, strong, readonly) SChartAnimationTracker *animationTracker

Discussion

This class enables series to be shown or hidden using any SChartAnimation.

Declared In

SChart.h

annotations

An array of all annotations on the chart.

@property (nonatomic, strong, readonly) NSArray<SChartAnnotation *> *annotations

Availability

Premium

Declared In

SChart.h

borderColor

The color of the border around the chart view.

@property (nullable, nonatomic, strong) UIColor *borderColor

Discussion

Default value is clearColor.

Declared In

SChart.h

borderThickness

The thickness of the border chart view.

@property (nullable, nonatomic, strong) NSNumber *borderThickness

Discussion

Default value is 1.0f.

Declared In

SChart.h

canvas

A reference to the canvas object of the chart

@property (nonatomic, readonly) SChartCanvas *canvas

Discussion

The chart canvas is responsible for drawing all of the axes and series on a chart.

Declared In

SChart.h

canvasAreaBackgroundColor

The background color of the canvas area where the axes and plots are drawn.

@property (nullable, nonatomic, strong) UIColor *canvasAreaBackgroundColor

Discussion

This area does not include any titles and legends etc. To set the background color of the whole chart area use setBackgroundColor.

By default, this property is set to clearColor.

Declared In

SChart.h

canvasInset

The Inset of the chart’s canvas frame using the top, left, bottom & right values in the UIEdgeInsets object given.

@property (nonatomic, assign) UIEdgeInsets canvasInset

Discussion

This inset will get applied after the canvas has taken everything else into account (e.g. chart and axis title positioning).

Declared In

SChart.h

crosshair

The object displayed after a tap-and-hold gesture on the chart

@property (nonatomic, strong, nullable) id<SChartCrosshair> crosshair

Discussion

The default crosshair implementation will draw a target cirle with axis markers and also display a tooltip. To customize, set this property to an object conforming to the SChartCrosshair protocol.

Declared In

SChart.h

datasource

The object that acts as the data source of the receiving chart.

@property (nonatomic, weak, nullable) id<SChartDatasource> datasource

Discussion

The object must adopt the SChartDatasource protocol. The data source provides the chart with the information it needs to construct the chart object. In general, styling and event response is handled by objects implementing the SChartDelegate protocol - the data source has minimal impact on the look and feel of the chart.

Declared In

SChart.h

delegate

The object that acts as the chart’s delegate.

@property (nonatomic, weak, nullable) id<SChartDelegate> delegate

Discussion

The object must adopt the SChartDelegate protocol. The SChartDelegate protocol provides the chart with a target to relay events to, such as when the user is zooming or other touch events. Objects that act as a delegate to the ShinobiChart can use these notifications to synchronise other charts or update objects with the current status of this chart.

Declared In

SChart.h

gestureManager

The chart’s gesture manager

@property (nonatomic, strong, readonly) SChartGestureManager *gestureManager

Discussion

This class holds the gestures used on the chart, providing access should an extra responder be required for one of the chart’s gestures.

Declared In

SChart.h

legend

The object that represents the chart’s legend.

@property (nonatomic, strong) SChartLegend *legend

Declared In

SChart.h

loadDataInBackground

When set to YES, the chart will load its data on a background thread. Otherwise, the chart will load its data on the main UI thread.

@property (nonatomic, assign) BOOL loadDataInBackground

Discussion

By default, this property is set to NO. If the chart is loading its data asynchronously, it will pop up an activity indicator while the data is loading. See loadingIndicator for more information on this.

Declared In

SChart.h

loadingIndicator

This view will be displayed whilst an asynchronous data reload is in progress. By default it is a UIActivityIndicatorView, but can be assigned any UIView based class – such as an SEssentialsActivityIndicator, UIImageView etc. To support animation of the view, it may also conform to the SChartActivityIndicator protocol and implement it’s animation methods.

@property (nullable, nonatomic, strong) UIView *loadingIndicator

Declared In

SChart.h

overlapChartTitle

A BOOLean to indicate if the chart title label should reserve space at the top of the chart or overlap the canvas.

@property (nonatomic, assign) BOOL overlapChartTitle

Discussion

Setting this attribute to YES will allow the UILabel to appear over the chart plot area. Setting it to NO will push the canvas area down and reserve space obove the chart plots for the title. calculateTargetBounds controls the space reserved for chart objects outside of the canvas area.

Declared In

SChart.h

plotAreaBackgroundColor

The background color of the plot area where the series are drawn.

@property (nullable, nonatomic, strong) UIColor *plotAreaBackgroundColor

Discussion

To set the background color of the whole chart area use backgroundColor - also see canvasAreaBackgroundColor.

By default, this property is set to clearColor.

Declared In

SChart.h

plotAreaBorderColor

The color of the border around the plot area where the series are drawn.

@property (nullable, nonatomic, strong) UIColor *plotAreaBorderColor

Discussion

To set the border color of the whole chart area use borderColor.

By default, this property is set to clearColor.

Declared In

SChart.h

plotAreaBorderThickness

The thickness of the border around the plot area where the series are drawn.

@property (nonatomic, assign) CGFloat plotAreaBorderThickness

Discussion

To set the border thickness of the whole chart area use borderThickness.

By default, this property is set to 1.0f .

Declared In

SChart.h

plotAreaFrame

The frame of the plot area in the coordinate system of the chart view.

@property (nonatomic, assign, readonly) CGRect plotAreaFrame

Discussion

This is the area in which your data is visualised in series. This area does not usually contain the chart title, legend, axes or axis titles, or any tickmarks or ticklabels unless they are explicitly positioned inside the plot area.

Declared In

SChart.h

rotatesOnDeviceRotation

Defines whether the chart rotates when the device is rotated.

@property (nonatomic) BOOL rotatesOnDeviceRotation

Discussion

If the view that contains the chart doesn’t actually rotate for a device orientation, set this flag to NO to prevent unnecessary fade out/in of the axes and the crosshair.

By default, this property is set to YES.

Declared In

SChart.h

series

A readonly array of the SChartSeries objects displayed on the chart.

@property (atomic, strong, readonly) NSArray<SChartSeries *> *series

Discussion

Series are provided to the chart by its data source. Once it has pulled them in from the data source and rendered them, you can query the series on the chart via this property.

Modifying the data points in any of these series will have no effect on the data rendered in the chart. To update it, update the chart data source, and then call reloadData on the chart.

If you are reloading the data in your chart asynchronously, you will want to be notified when new data has loaded, as this will affect the series on the chart. To do this, you should implement the SChartDelegate protocol, and use the sChartWillStartLoadingData: and the sChartDidFinishLoadingData: methods.

See Also

Declared In

SChart.h

title

Sets the text value of the chart title and displays in the standard position.

@property (nonatomic, strong, nullable) NSString *title

Discussion

See also titleLabel for the property representing the actual SChartTitle object.

Declared In

SChart.h

titleCentresOn

Sets how the title centers.

@property (nonatomic, assign) SChartTitleCentresOn titleCentresOn

Discussion

  • SChartTitleCentreOnChart: Centers the title on the full chart view.
  • SChartTitleCentreOnPlottingArea: Centers the title on the plot area.
  • SChartTitleCentreOnCanvas: Centers the title on the canvas.

Declared In

SChart.h

titleLabel

The title for the chart.

@property (nonatomic, strong) SChartTitle *titleLabel

Discussion

This object is created and automatically handled through the title property. However, modifying this object will give greater control over the title attributes.

Declared In

SChart.h

titlePosition

Where the title will appear relative to the chart

@property (nonatomic, assign) SChartTitlePosition titlePosition

Declared In

SChart.h

xAxis

The primary x-axis for this chart.

@property (nonatomic, strong, nullable) SChartAxis *xAxis

Discussion

The chart contains an array of x axes, as different series on the chart could use different axes. The primary axis is the main one used by the chart. If you haven’t explicitly specified which axis is the primary one, this will be automatically generated by the chart.

Declared In

SChart.h

yAxis

The primary y-axis for this chart.

@property (nonatomic, strong, nullable) SChartAxis *yAxis

Discussion

The chart contains an array of y axes, as different series on the chart could use different axes. The primary axis is the main one used by the chart. If you haven’t explicitly specified which axis is the primary one, this will be automatically generated by the chart.

Declared In

SChart.h

Instance Methods

addAnnotation:

Add an annotation view to be displayed on the chart plot area

- (void)addAnnotation:(SChartAnnotation *)newAnnotation

Parameters

newAnnotation

The new annotation to add to the chart.

Availability

Premium

See Also

Declared In

SChart.h

addXAxis:

Adds an X-Axis for the chart

- (void)addXAxis:(SChartAxis *)newXAxis

Parameters

newXAxis

The new x axis which will be added to the chart.

Declared In

SChart.h

addYAxis:

Adds a Y-Axis for the chart

- (void)addYAxis:(SChartAxis *)newYAxis

Parameters

newYAxis

The new y axis which will be added to the chart.

Declared In

SChart.h

allAxes

Returns all axes associated with this chart

- (NSArray<SChartAxis *> *)allAxes

Return Value

An array containing all the axes associated with this chart. The x axes will be first in the array, followed by the y axes.

Discussion

A chart can contain multiple x and y axes, if the series on the chart use different axes.

Declared In

SChart.h

allXAxes

Returns all X axes associated with this chart

- (NSArray<SChartAxis *> *)allXAxes

Return Value

An array containing all the x axes associated with the chart. The primary axis will be the first one in the array.

Discussion

A chart can contain multiple x axes, if the series on the chart use different axes. A chart will always have one primary x axis, unless it is radial.

Declared In

SChart.h

allYAxes

Returns all Y axes associated with this chart

- (NSArray<SChartAxis *> *)allYAxes

Return Value

An array containing all the y axes associated with the chart. The primary axis will be the first one in the array.

Discussion

A chart can contain multiple y axes, if the series on the chart use different axes. A chart will always have one primary y axis, unless it is radial.

Declared In

SChart.h

appendNumberOfDataPoints:toEndOfSeriesAtIndex:

Notifies the chart that the specified number of data points are available to be appended to the end of the specified chart series.

- (void)appendNumberOfDataPoints:(NSInteger)numberOfDataPoints toEndOfSeriesAtIndex:(NSInteger)seriesIndex

Parameters

numberOfDataPoints

The number of data points which are available to be appended to the end of the series.

seriesIndex

The index of the series which should append the new data.

Discussion

More information about using this method can be found in our tutorial Data streaming, crosshairs and custom tooltips in ShinobiCharts.

Declared In

SChart.h

applyTheme:

Applies a theme to the chart.

- (void)applyTheme:(SChartTheme *)theme

Discussion

A ShinobiChart will take all of its UI configuration - colors, line thicknesses, etc - from the SChartTheme object. The chart can be initially created with a theme - see initWithFrame:usingTheme:. If a theme is not explicitly set on a chart, an instance of SChartLightTheme will be applied by default on charts running on versions of iOS prior to iOS 7, otherwise an instance of SChartiOS7Theme will be applied.

This method applies the styling properties of the given theme to the chart, overwriting any changes which you have made to sub-objects on the chart. After this, changes made to individual objects will have precendence - for example setting the series color in the data source. To reset the styling configuration on a chart to a theme, alloc a new theme and call applyTheme: - this will clear all styling configuration from the chart and set it to the theme defaults.

SChartTheme *chartTheme = [SChartiOS7Theme new];
[yourChart applyTheme: chartTheme];

Declared In

SChart.h

axesForSeries:storeX:andStoreY:

Finds the axes associated with the chart which are linked to the specified chart series.

- (void)axesForSeries:(SChartSeries *)series storeX:(SChartAxis *_Nullable *_Nonnull)xStore andStoreY:(SChartAxis *_Nullable *_Nonnull)yStore

Parameters

series

The chart series of interest

xStore

A pointer to a chart axis. In this method, we set the pointer to reference the x axis associated with the chart series.

yStore

A pointer to a chart axis. In this method, we set the pointer to reference the y axis associated with the chart series.

Discussion

This method then sets the axis pointers, which are passed in as arguments, to reference the axes which are associated with the chart series.

Exceptions

The

chart will throw a fatal exception if it cannot find an x axis and a y axis on the chart which are linked to the specified chart series.

Declared In

SChart.h

chartBackgroundColor

Background color of the chart view

- (nullable UIColor *)chartBackgroundColor

Declared In

SChart.h

delegate

The object assigned as the chart delegate

- (id<SChartDelegate>)delegate

Declared In

SChart.h

flushPendingGLOperations

This ensures all pending OpenGL operations are flushed to the graphics card, preventing issues where an App may be put in the background and attempt to invoke OpenGL commands, causing the App to be signalled/killed.

- (void)flushPendingGLOperations

Declared In

SChart.h

initWithFrame:

Initialise a chart object with a specified frame.

- (id)initWithFrame:(CGRect)frame

Parameters

frame

The frame to give the new chart.

Return Value

An initialized chart object or nil if the chart couldn’t be created.

Discussion

As we haven't specified a theme, the default one is used.  This is SChartLightTheme.

Declared In

SChart.h

initWithFrame:withPrimaryXAxisType:withPrimaryYAxisType:

Initialise the chart object with the specified frame and axes

- (id)initWithFrame:(CGRect)frame withPrimaryXAxisType:(SChartAxisType)xAxisType withPrimaryYAxisType:(SChartAxisType)yAxisType

Parameters

frame

The frame to give the new chart.

xAxisType

The type of the primary x axis on the chart.

yAxisType

The type of the primary y axis on the chart.

Return Value

An initialized chart object or nil if the chart couldn’t be created.

Discussion

As we haven’t specified a theme, the default one is used. This is SChartLightTheme. In this method, we specify the types of axes which we would like on our chart. The init method will create an axis of this type, and set it as the primary axis on the chart. The chart will contain one x axis and one y axis when it is created. We can then add more axes if required.

Declared In

SChart.h

initWithFrame:withTheme:

Initialise the chart object with the specified frame and the specified theme

- (id)initWithFrame:(CGRect)frame withTheme:(nullable SChartTheme *)theme

Parameters

frame

The frame to give the new chart.

theme

The theme to use to style the new chart.

Return Value

An initialized chart object or nil if the chart couldn’t be created.

Declared In

SChart.h

initWithFrame:withTheme:withPrimaryXAxisType:withPrimaryYAxisType:

Initialise the chart object with the specified frame, theme and axes

- (id)initWithFrame:(CGRect)frame withTheme:(nullable SChartTheme *)theme withPrimaryXAxisType:(SChartAxisType)xAxisType withPrimaryYAxisType:(SChartAxisType)yAxisType

Parameters

frame

The frame to give the new chart.

theme

The theme to use to style the chart.

xAxisType

The type of the primary x axis on the chart.

yAxisType

The type of the primary y axis on the chart.

Return Value

An initialized chart object or nil if the chart couldn’t be created.

Discussion

In this method, we specify the types of axes which we would like on our chart. The init method will create an axis of this type, and set it as the primary axis on the chart. The chart will contain one x axis and one y axis when it is created. We can then add more axes if required.

Declared In

SChart.h

plotBackgroundColor

Background colour of the plot area - ie: the area inside the axis.

- (nullable UIColor *)plotBackgroundColor

Declared In

SChart.h

pointIsVisible:onSeries:

Returns whether the specified chart point is currently visible on the chart

- (BOOL)pointIsVisible:(SChartPoint)point onSeries:(SChartSeries *)series

Parameters

point

The point of interest on the chart.

series

The chart series which contains the point.

Return Value

YES if the specified point is visible on the chart.

Declared In

SChart.h

positionLegend

Tells the chart to reposition its legend.

- (void)positionLegend

Discussion

The chart legend is an instance of SChartLegend. The chart uses the value of its position property to position the legend on its canvas.

Declared In

SChart.h

prependNumberOfDataPoints:toStartOfSeriesAtIndex:

Notifies the chart that the specified number of data points are available to be prepended to the start of the specified chart series.

- (void)prependNumberOfDataPoints:(NSInteger)numberOfDataPoints toStartOfSeriesAtIndex:(NSInteger)seriesIndex

Parameters

numberOfDataPoints

The number of data points which are available to be prepended to the start of the series.

seriesIndex

The index of the series to which the new data should be prepended.

Declared In

SChart.h

primaryAxes

Returns all Primary axes associated with this chart

- (NSArray<SChartAxis *> *)primaryAxes

Return Value

An array containing the primary axes associated with the chart. The array will contain the primary x axis, followed by the primary y axis.

Discussion

A chart can contain multiple x and y axes, if the series on the chart use different axes. A chart will always have one primary x axis, and one primary y axis, unless it is radial.

Declared In

SChart.h

primaryXAxis

Returns this chart’s primary X Axis

- (nullable SChartAxis *)primaryXAxis

Discussion

A chart can contain multiple x axes, if the series on the chart use different axes. A chart will always have one primary x axis, unless it is radial.

See Also

Declared In

SChart.h

primaryYAxis

Returns this chart’s primary Y Axis

- (nullable SChartAxis *)primaryYAxis

Discussion

A chart can contain multiple y axes, if the series on the chart use different axes. A chart will always have one primary y axis, unless it is radial.

See Also

Declared In

SChart.h

redrawChart

Tells the chart to redraw itself. The chart is redrawn during the next draw cycle.

- (void)redrawChart

Declared In

SChart.h

redrawChartIncludePlotArea:

Tells the chart to redraw itself

- (void)redrawChartIncludePlotArea:(BOOL)includePlotArea

Parameters

includePlotArea

YES if the chart needs to redraw the data for its series, which is done in the chart plot area.

Discussion

The chart will redraw itself during the next draw cycle. This does not affect the data in the chart. If the data provided by the data source has changed, then you should call reloadData to refresh the data in the chart.

Declared In

SChart.h

reloadData

Reloads the data points for the chart.

When the data provided by the data source changes, we use this method to tell the chart to reload. The data is reloaded during the next draw cycle. This method doesn’t redraw the chart, for that you can call either redrawChart or redrawChartIncludePlotArea: after the data has been reloaded.

- (void)reloadData

Discussion

This method reloads the data on the main thread. If you wish to load data asynchronously, you should set the loadDataInBackground property to YES before you call this method.

Declared In

SChart.h

removeAllAnnotations

Remove all annotations from the chart

- (void)removeAllAnnotations

Availability

Premium

Declared In

SChart.h

removeAnnotation:

Remove an annotation from the chart

- (void)removeAnnotation:(SChartAnnotation *)annotation

Parameters

annotation

The annotation to remove.

Availability

Premium

Declared In

SChart.h

removeNumberOfDataPoints:fromStartOfSeriesAtIndex:

Notifies the chart that the specified number of data points should be removed from the start of the specified chart series.

- (void)removeNumberOfDataPoints:(NSInteger)numberOfDataPoints fromStartOfSeriesAtIndex:(NSInteger)seriesIndex

Parameters

seriesIndex

The index of the series which should append the new data.

numberOfPointsToRemoveFromStart

The number of data points which should be removed from the start of the series.

Declared In

SChart.h

removeXAxis:

Removes an X-Axis from the chart

- (void)removeXAxis:(SChartAxis *)xAxis

Parameters

xAxis

The axis which will be removed from the chart.

Discussion

If this is the only x axis on the chart, it won’t be removed.

Declared In

SChart.h

removeYAxis:

Removes a Y-Axis from the chart

- (void)removeYAxis:(SChartAxis *)yAxis

Parameters

yAxis

The axis which will be removed from the chart.

Discussion

If this is the only y axis on the chart, it won’t be removed.

Declared In

SChart.h

replaceAnnotationAtIndex:withAnnotation:

Replace an annotation on the chart with a new one

- (void)replaceAnnotationAtIndex:(NSInteger)index withAnnotation:(SChartAnnotation *)newAnnotation

Parameters

index

The index of the existing annotation within the array which the chart holds.

newAnnotation

The new annotation which you will replace it with.

Availability

Premium

Discussion

Annotations are held in a chart within an array. This method allows you to replace one of those annotations with the new one you have specified.

See Also

Declared In

SChart.h

replaceXAxis:withAxis:

Replaces a X-Axis on the chart

- (void)replaceXAxis:(SChartAxis *)oldXAxis withAxis:(SChartAxis *)newXAxis

Parameters

oldXAxis

The axis which will be replaced.

newXAxis

The axis which will replace it.

Declared In

SChart.h

replaceYAxis:withAxis:

Replaces a Y-Axis on the chart

- (void)replaceYAxis:(SChartAxis *)oldYAxis withAxis:(SChartAxis *)newYAxis

Parameters

oldYAxis

The axis which will be replaced.

newYAxis

The axis which will replace it.

Declared In

SChart.h

secondaryAxes

Returns all Secondary axes associated with this chart

- (NSArray<SChartAxis *> *)secondaryAxes

Return Value

An array containing the secondary axes associated with the chart. The array will contain the secondary x axes, followed by the secondary y axes.

Discussion

A chart can contain multiple x and y axes, if the series on the chart use different axes. A chart will always have one primary x axis, and one primary y axis, unless it is radial. All the other axes on the chart are regarded as secondary.

Declared In

SChart.h

secondaryXAxes

Returns all secondary X axes associated with this chart

- (NSArray<SChartAxis *> *)secondaryXAxes

Return Value

An array containing all the secondary x axes associated with the chart.

Discussion

A chart can contain multiple x axes, if the series on the chart use different axes. A chart will always have one primary x axis, unless it is radial. All the other axes on the chart are regarded as secondary.

Declared In

SChart.h

secondaryYAxes

Returns all secondary Y axes associated with this chart

- (NSArray<SChartAxis *> *)secondaryYAxes

Return Value

An array containing all the secondary y axes associated with the chart.

Discussion

A chart can contain multiple y axes, if the series on the chart use different axes. A chart will always have one primary y axis, unless it is radial. All the other axes on the chart are regarded as secondary.

Declared In

SChart.h

setIsEnteringBackground:

This allows the user to prevent our OpenGL operations from initialising OpenGL objects if the application is about to be put in the background.

- (void)setIsEnteringBackground:(BOOL)enteringBackground

Parameters

isEnteringBackground

YES if the application will go to the background. NO if the application will go to the foreground.

Declared In

SChart.h

setNeedsLayoutIfHaveAxesAndData

Tells the chart to redraw itself, as long as it has basic componenents. If the chart is radial, it doesn’t need to have any axes set in order to redraw.

- (void)setNeedsLayoutIfHaveAxesAndData

Declared In

SChart.h

stringForIdX:andIdY:usingSeries:

Returns a string representing the given x and y values in the specified chart series

- (NSString *)stringForIdX:(id)fx andIdY:(id)fy usingSeries:(SChartSeries *)series

Parameters

fx

The value on the x axis.

fy

The value on the y axis.

series

The chart series with which the values are associated.

Return Value

A string representing the given values in the specified chart series.

Discussion

This method queries the series for the string representation of the given x and y values. It then concatenates those strings together. The x value is displayed before the y value.

This method is commonly used for displaying the tooltip on the chart crosshair.

Declared In

SChart.h

stringForX:andY:

Returns a string that represents the specified x and y values

- (NSString *)stringForX:(double)x andY:(double)y

Parameters

x

The specified x value.

y

The specified y value.

Discussion

A primary use case for this method is to generate text for the crosshair.

Declared In

SChart.h

stringForX:andY:usingSeries:

Returns a string representing the given x and y double values in the specified chart series

- (NSString *)stringForX:(double)fx andY:(double)fy usingSeries:(SChartSeries *)series

Parameters

fx

The value on the x axis.

fy

The value on the y axis.

series

The chart series with which the values are associated

Return Value

A string representing the given double values in the specified chart series.

Discussion

This method queries the series for the string representation of the given x and y values. It then concatenates those strings together. The x value is displayed before the y value.

This method is commonly used for displaying the tooltip on the chart crosshair.

Declared In

SChart.h

stringForX:andY:usingXAxis:andYAxis:

Returns a string representing the given x and y double values on the specified chart axes

- (NSString *)stringForX:(double)fx andY:(double)fy usingXAxis:(SChartAxis *)xAxis andYAxis:(SChartAxis *)yAxis

Parameters

fx

The value on the x axis.

fy

The value on the y axis.

xAxis

The x axis on the chart with which the x value is associated.

yAxis

The y axis on the chart with which the y value is associated.

Return Value

A string representing the given x and y values on the specified chart axes.

Discussion

This method queries each axis for a string which represents the given value, then concatenates them together to give a single string. The x value is displayed before the y value.

This method is commonly used for displaying the tooltip on the chart crosshair.

Declared In

SChart.h

updateCanvasSize

Update the canvas to allow for axes, titles, and legend.

- (void)updateCanvasSize

Declared In

SChart.h