Classes

The following classes are available globally.

  • 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.

    See more

    Declaration

    Objective-C

    @interface ShinobiChart : UIView

    Swift

    class ShinobiChart : UIView
  • An SChartAnimation object determines how some elements of the chart are animated.

    For example, to show a series, you should use the chart’s ‘animation tracker’ object to schedule an animation:

         [_chart.animationTracker showSeries:_series
                                   animation:[SChartAnimation growAnimation]
                          progressCalculator:[[SChartTimeProgressCalculator alloc] initWithDuration:5]
                                  completion:nil];
    

    The properties you can set on an animation are:

    • The duration of the animation. See duration for more information.
    • The origin point on the chart from where the series animates to its final position. See absoluteOriginX, absoluteOriginY, normalisedOriginX and normalisedOriginY for more information.
    • How the chart series scales as the animation progresses. See xScaleCurve, yScaleCurve or radiusCurve for more information.
    • How the transparency of the series varies over the period of the animation. See alphaCurve for more information.
    • For pie/donut chart series, you can specify how the series rotates around the origin during the animation. See angleCurve for more information.

    The SChartAnimation object is composed of several objects conforming to the SChartAnimationCurve protocol, which each describe the transition of an aspect of the chart series from the start of the animation to the end. We have defined concrete implementations of this protocol to support common animation use cases which you might have. Some of the concrete animation curve classes are:

    Other animation curves are also available, see the API documentation for more information.

    To save you having to create animation classes from scratch, we’ve provided some pre-defined types for you. Have a look at the factory methods we’ve provided in the Creating Animations sections of this page.

    Warning

    This feature isn’t currently supported on radial charts.

    More information about using SChartAnimation can be found in our tutorial ‘Animating ShinobiChart Series’.

    See more

    Declaration

    Objective-C

    @interface SChartAnimation : NSObject <NSCopying>

    Swift

    class SChartAnimation : NSObject, NSCopying
  • Informs the chart about which series it should show or hide using the corresponding animation.

    See more

    Declaration

    Objective-C

    @interface SChartAnimationTracker : NSObject

    Swift

    class SChartAnimationTracker : NSObject
  • An SChartAnnotation is a UIView that can be displayed on a chart - maintaining aspect ratio at all times and position in accordance with the panning of the data range (see below).

    There are several predefined annotations for convenience - these can be created using the methods below and are bands, lines and text.

    An SChartAnnotation is fixed to a single point on the chart which means that it will pan but will remain a fixed size regardless of zoom level. If you would like to annotate an area that will scale as the data range is zoomed use SChartAnnotationZooming, which is anchored between two limits on either axis.

    An annotation can be attached to one of the x axes, and one of the y-axes in the chart. This is done using the xAxis and yAxis properties on the annotation. If an annotation is attached to an axis, the position of the annotation on the chart will correspond to its value on that axis. The position of the annotation on the x axis will correspond to xValue and its position on the y axis will correspond to yValue.

    More information about using SChartAnnotation can be found in the user guide

    Warning

    This feature isn’t currently supported on radial charts.

    Note

    This is a Premium feature

    See more

    Declaration

    Objective-C

    @interface SChartAnnotation : UIView

    Swift

    class SChartAnnotation : UIView
  • An SChartAnnotationZooming object is pinned between two points on each axis in the chart and will scale according to the current range of the axis. It is pinned between xValue and xValueMax on the x axis, and yValue and yValueMax on the y axis.

    This kind of annotation is useful for highlighting areas of data, etc. As we zoom in on a range of data, the zooming annotation will also zoom so that it covers the same range of data on the chart axes. Due to this, it will not maintain its aspect ratio as the chart is zoomed.

    Note

    This is a Premium feature
    See more

    Declaration

    Objective-C

    @interface SChartAnnotationZooming : SChartAnnotation

    Swift

    class SChartAnnotationZooming : SChartAnnotation
  • The SChartAxis is responsible for managing the coordinate space of the chart. It is the link between the set of real data in a series and the laying down of that series on a chart in a desired manner. Each series on the chart is linked to an axis and this SChartAxis is responsible for managing all of the series linked to it. Here is a sample chart with some key axis features highlighted:

    For cartesian series, it is expected that you will provide instances of a subclass of SChartAxis each for the xAxis and yAxis of the chart. If not set, both axes will default to instances of SChartNumberAxis.

    The axis range can be set to a desired range or left to calculate its own minimum and maximum. When auto-calculating the range, it will consider all data series associated with it.

    The axis is also the home of the tick marks and their labels. These can be auto-calculated or set to specific values.

    More information about using SChartAxis can be found in the user guide.

    See more

    Declaration

    Objective-C

    @interface SChartAxis : NSObject

    Swift

    class SChartAxis : NSObject
  • The axis title style object controls the look and feel for the axis title.

    Warning

    Axis titles are not currently supported by radial charts.
    See more

    Declaration

    Objective-C

    @interface SChartAxisTitleStyle : SChartTitleStyle <NSCopying>

    Swift

    class SChartAxisTitleStyle : SChartTitleStyle, NSCopying
  • SChartBandSeries is a type of SChartSeries that uses its data points to construct a band series.

    Data points in a band series will contain multiple values. This means that they will be instances of SChartMultiXDataPoint or SChartMultiYDataPoint, depending on the orientation of the series. The keys for the values in each data point will be SChartBandSeriesHigh and SChartBandSeriesLow.

    The band series is visualised as two line series, one for the High values and one for the Low, with an area fill between the lines. The colour of this fill depends on the relationship between the lines, for example it may be green if the High value is greater than the Low value, and red if the opposite is true.

    In order to provide the High and Low values to the chart, the data points in the band series should implement either the [SChartData sChartXValueForKey:] method or the [SChartData sChartYValueForKey:] method on the SChartData protocol, depending on the series orientation.

    The band series contains an instance of SChartBandSeriesStyle, which manages the appearance of the series.

    Note

    This is a Premium feature
    See more

    Declaration

    Objective-C

    @interface SChartBandSeries : SChartCartesianSeries

    Swift

    class SChartBandSeries : SChartCartesianSeries
  • SChartBandSeriesStyle manages the appearance of an instance of SChartBandSeries on a chart.

    The band series is visualised as two line series, one for the High values and one for the Low, with an area fill between the lines.

    SChartBandSeriesStyle allows you to configure the appearance of various aspects of the series, such as:

  • The width and color of the lines series.
  • Whether the area between the lines series is filled, and the color of the fill if it is.
  • The appearance of points in the series, both when they are selected and when they are not.

  • Note

    This is a Premium feature

    See more

    Declaration

    Objective-C

    @interface SChartBandSeriesStyle : SChartSeriesStyle

    Swift

    class SChartBandSeriesStyle : SChartSeriesStyle
  • Displays a bar series on the chart. A bar series is visualized as a horizontal rectangle on the chart, where the width of the rectange equates to the x value of the data point. The area of the bar can be filled, depending on the style of the series.

    Declaration

    Objective-C

    @interface SChartBarSeries : SChartBarColumnSeries

    Swift

    class SChartBarSeries : SChartBarColumnSeries
  • SChartBasePointStyle is the base class for all point styles in ShinobiCharts. This point style object manages the appearance of datapoint on a chart.

    This base class is used for the point style in the SChartRadialLineSeriesStyle class. It is also subclassed by SChartBaselinePointStyle which every other point style class corresponds to. For more information on these other point styles see SChartBaselinePointStyle.

    .

    See more

    Declaration

    Objective-C

    @interface SChartBasePointStyle : NSObject <NSCopying>

    Swift

    class SChartBasePointStyle : NSObject, NSCopying
  • This curve evaluator describes a curve similar to that described by SChartBounceAnimation but where the ‘bounce’ occurs over a shorter proportion of the duration (50%).

    For the remainder of the duration, the curve is constant at 1. This is the ‘delay’ where there is no change.

    See the SChartAnimationCurve protocol for more information on curve evaluation.

    Declaration

    Objective-C

    @interface SChartBounceDelayAnimationCurve : NSObject <SChartAnimationCurve>

    Swift

    class SChartBounceDelayAnimationCurve : NSObject, SChartAnimationCurve
  • If you set the [ShinobiChart gesturePanType] property on a chart to SChartGesturePanTypeBoxDraw, the chart will draw a box on the chart during a pan. When the pan is finished, the chart will zoom to the limits of the box.

    The SChartBoxGestureStyle class manages the look and feel of the box gesture. An instance of the class is contained by the chart’s theme. To update the look of the box gesture on a chart, you could use the following code:

        chart.theme.boxGestureStyle.boxLineColor = [UIColor redColor];
        [chart applyTheme];
    

    The definition of the chart theme can be found in SChartTheme.

    See more

    Declaration

    Objective-C

    @interface SChartBoxGestureStyle : NSObject <NSCopying>

    Swift

    class SChartBoxGestureStyle : NSObject, NSCopying
  • SChartBubbleSeries is a type of SChartSeries that uses its data points to construct a bubble series.

    This type of series focuses on allowing bubble sizes to be controlled via the use of data point objects of type SChartBubbleDataPoint. As such this series ignores attempts to set the size/radius of its data points in any other way.

    The size of the bubbles in this series are independent of any axes that the series might be linked to. This makes the concept of a scale that alters the size of all bubbles in the series useful. You can supply your own scale or let the series be scaled via an auto-calculated value such that the largest bubble in the series matches some chosen diameter (see biggestBubbleDiameterForAutoScaling).

    This series has the corresponding series and point styles SChartBubbleSeriesStyle and SChartBubblePointStyle respectively.

    See more

    Declaration

    Objective-C

    @interface SChartBubbleSeries : SChartPointSeries

    Swift

    class SChartBubbleSeries : SChartPointSeries
  • SChartCandlestickSeries is a type of SChartSeries which displays Open-High-Low-Close data on a chart.

    Each data point in a candlestick series is visualised as a thick candle between the open and close values, with ‘wicks’ indicating the high and low positions.

    Data points in a candlestick series will contain multiple values. This means that they will be instances of SChartMultiXDataPoint or SChartMultiYDataPoint, depending on the orientation of the series. The keys for the values in each data point will be SChartCandlestickKeyOpen, SChartCandlestickKeyHigh, SChartCandlestickKeyLow and SChartCandlestickKeyClose.

    In order to provide the Open, High, Low, and Close values to the chart, the data points in the candlestick series should implement either the [SChartData sChartXValueForKey:] method or the [SChartData sChartYValueForKey:] method on the SChartData protocol, depending on the series orientation.

    The series contains an instance of SChartCandlestickSeriesStyle, which manages the appearance of the series on the chart.

    Note

    This is a Premium feature
    See more

    Declaration

    Objective-C

    @interface SChartCandlestickSeries : SChartOHLCSeries

    Swift

    class SChartCandlestickSeries : SChartOHLCSeries
  • SChartCandlestickSeriesStyle manages the appearance of an instance of SChartCandlestickSeries on the chart.

    Each data point in a candlestick series is visualised as a thick candle between the open and close values, with ‘wicks’ indicating the high and low positions.

    SChartCandlestickSeriesStyle inherits some of its behavior from its parent, SChartOHLCSeriesStyle. This controls things like the colors which are used for data points when their data values are rising or falling. Have a look at the API documentation of the parent class for more information.

    This style object allows you to configure properties which are specific to the appearance of candlestick charts. These are:

  • The color and width of the sticks (or ‘wicks’) at either end of the candle. See stickColor or stickWidth for more information.
  • The color and width of the outline of the candle. See outlineColor and outlineWidth for more information.

  • Note

    This is a Premium feature

    See more

    Declaration

    Objective-C

    @interface SChartCandlestickSeriesStyle : SChartOHLCSeriesStyle

    Swift

    class SChartCandlestickSeriesStyle : SChartOHLCSeriesStyle
  • For each ShinobiChart, one single SChartCanvas will exist to contain the drawing of all of the axes and series. Titles, legends and other chart level objects appear outside of this area in the ShinobiChart view. The canvas is responsible for managing the layers that make up the axis and series.

    The canvas itself has no objects drawn directly onto it. The canvas decides how much space it will need to draw any axis and their labels. The plot area view is then sized and laid down to draw the series. This is followed by the SChartCanvasOverlay layer that is used to draw the axes at the highest level.

    You should never need to modify this object directly. We’ve included information on this class as we refer to the chart canvas at various points in our documentation.

    See more

    Declaration

    Objective-C

    @interface SChartCanvas : UIView

    Swift

    class SChartCanvas : UIView
  • The canvas overlay is responsible for drawing objects that appear over the plot area - such as crosshairs. It’s a transparent layer that is rendered above the openGL layer.

    See more

    Declaration

    Objective-C

    @interface SChartCanvasOverlay : UIView <SChartLayer>

    Swift

    class SChartCanvasOverlay : UIView, SChartLayer
  • The canvas underlay is responsible for drawing things like gridlines and the axes. It’s a transparent layer that is currently rendered below the openGL layer.

    See more

    Declaration

    Objective-C

    @interface SChartCanvasUnderlay : UIView <SChartLayer>

    Swift

    class SChartCanvasUnderlay : UIView, SChartLayer
  • SChartCartesianSeries represents an instance of a cartesian series on a chart.

    Cartesian coordinates are points defined in a plane by a pair of numerical coordinates, which are the signed distances from the point to either axis in the plane. In our charts, we are using an x and a y axis.

    SChartCartesianSeries is the base class for all of the concrete cartesian series which are provided in ShinobiCharts. The concrete series types which are available are:

    Some types of chart series can be stacked. This means that they are rendered on top of each other, with the first series rendered at the bottom, and subsequent series offset so that they begin at the top of the previous series. The types of series which can be stacked are bar series, column series, line series and stepped line series. See the stackIndex property for more information.

    See more

    Declaration

    Objective-C

    @interface SChartCartesianSeries : SChartMappedSeries

    Swift

    class SChartCartesianSeries : SChartMappedSeries
  • A SChartCategoryAxis is a subclass of SChartAxis designed to work with discrete data points with no linear correlation between values.

    For the purposes of ranges, each data point value for a category axis is represented by an integer (generated by the order in which data points are added to the series - but removing duplicates). This determines order and can be used to set ranges.

    For example, for datapoint values June, 5 and Frog passed to the chart in that order along a category axis:

    1. June is equivalent to 0.
    2. 5 is equivalent to 1.
    3. Frog is equivalent to 2.
    4. The range of this data is 0 to 2.
    5. Setting a range of 0 to 1 would show June and 5, but not Frog.

    However, the dataIndex from the datasource may not correspond to the NSNumber mapped to the category.

    For example, when points are prepended and new categories are added they will be given negative values. This is due to prepending points not reloading the entire chart’s data again.

    The data point values are not sorted and do not need to be members of the same class - as long as they respond to the ‘description’ selector.
    Each series linked to the Category Axis can only have one datapoint per Category. If a second data point is added with the same value, it will replace the first.

    Since one cannot interpolate between ‘5’ and a ‘Frog’, or group ‘June’ and ‘5’ into an encapsulating value, minor tick marks are disabled on Category Axes.
    Major tick marks and labels, if enabled, will be shown for each datapoint.
    Setting major or minor tick frequencies will have no effect.

    See more

    Declaration

    Objective-C

    @interface SChartCategoryAxis : SChartAxis

    Swift

    class SChartCategoryAxis : SChartAxis
  • Displays a column series on the chart. A column series is visualized as a vertical rectangle on the chart, where the height of the rectange equates to the y value of the data point.

    The area of the column can be filled, depending on the style of the series.

    Declaration

    Objective-C

    @interface SChartColumnSeries : SChartBarColumnSeries

    Swift

    class SChartColumnSeries : SChartBarColumnSeries
  • The SChartCrosshair provides a small circle target with lines that extend to the axis. This is accompanied by a tooltip object - nominally a UIView. The default implementation for the tooltip is provided by SChartCrosshairTooltip. For data points with multiple values at a single point, another implementation, SChartCrosshairMultiValueTooltip, has also been provided.

    The crosshair is enabled with a tap-and-hold gesture and will lock to the nearest series to pan through the values. On a line series the values will be interpolated between data points, on all other series types the crosshair will jump from data point to data point. Note that line series interpolation can be switched off by setting interpolatePoints to NO.

    In order for a crosshair to be displayed on a chart series, the series must have its [SChartSeries crosshairEnabled] property set to YES. This defaults to NO, so you will need to set this property on the series in your chart.

    More information about using SChartCrosshair can be found in the user guide, and in our tutorials ‘Customizing that Crosshair’ and ‘Data streaming, crosshairs and custom tooltips in ShinobiCharts’.

    An alternative crosshair implementation, SChartSeriesCrosshair, has also been provided.

    Warning

    Crosshairs are not currently supported on radial charts.
    See more

    Declaration

    Objective-C

    @interface SChartCrosshair : UIView <SChartCrosshair>

    Swift

    class SChartCrosshair : SChartCrosshairProtocol
  • A tooltip that can handle the display of multi-value data points.

    To use a tooltip of this class type simply assign it to your chart’s crosshair like so:

    chart.crosshair.tooltip = [[SChartCrosshairMultiValueTooltip new]autorelease];

    A tooltip of this type handles the multi-values of a datapoint by building a dictionary of key-value strings to be displayed. For example, a crosshair (with a tooltip of this type) that is tracking an OHLC series will likely read from multi-value datapoints such that the following dictionary of strings is to be displayed { Open : value1, High : value2, Low : value3, Close: value4 }. This dictionary is constructed via the method keyValueDisplayPairsForDataPoint:onSeries:withXAxis:withYAxis: (which can be overriden in a subclass if you wish to change the key-value pairs that the tooltip finally displays).

    A tooltip of this type is made up from an array of labels (one label for each key or value) and a main label (inherited from SChartCrosshairTooltip) which will display any left over values that do not belong to the key-value pairs.

    See more

    Declaration

    Objective-C

    @interface SChartCrosshairMultiValueTooltip : SChartCrosshairTooltip

    Swift

    class SChartCrosshairMultiValueTooltip : SChartCrosshairTooltip
  • Styling properties for the cross hair object SChartCrosshair

    See more

    Declaration

    Objective-C

    @interface SChartCrosshairStyle : NSObject <NSCopying>

    Swift

    class SChartCrosshairStyle : NSObject, NSCopying
  • A simple extension of the UIView class to use as the standard cross hair tooltip.

    To create a custom tooltip - subclass this class and override the functions below. When the standard crosshair moves position it will call the following functions in order:

    1. setTooltipStyle:
    2. setDataPoint:fromSeries:fromChart:
    3. setPosition:onCanvas:

    More information about using SChartCrosshairTooltip can be found in our tutorials ‘Customizing that Crosshair’ and ‘Data streaming, crosshairs and custom tooltips in ShinobiCharts’.

    See more

    Declaration

    Objective-C

    @interface SChartCrosshairTooltip : UIView

    Swift

    class SChartCrosshairTooltip : UIView
  • The SChartDarkTheme uses softer colors based on a dark background. For a more detailed explanation of how themes work, see the documentation for the SChartTheme class.

    Declaration

    Objective-C

    @interface SChartDarkTheme : SChartTheme

    Swift

    class SChartDarkTheme : SChartTheme
  • This class represents the data items contained within an SChartSeries.

    Each SChartDataPoint represents a simple data point in a SChartDataSeries. The simple data point is made up of an x and a y object (not multiple x or y objects). It doesn’t need to know what these objects are, it merely looks after them. Knowing how to interpet and translate these objects onto a chart is the job of the axis on the chart, which is an instance of SChartAxis.

    When creating a Radar or Polar chart using a SChartRadialLineSeries, use the xValue and yValue properties to plot your data. The xValue property stores data corresponding to the circular (radial) axis that renders clockwise around the chart. The yValue property stores data corresponding to the horizontal (polar) axis which renders from the center to the outer edge of the chart.

    More information about using SChartDataPoint can be found in the user guide.

    See more

    Declaration

    Objective-C

    @interface SChartDataPoint : NSObject <SChartData>

    Swift

    class SChartDataPoint : NSObject, SChartData
  • The data point label style object controls the look and feel for labels appearing next to a series data point.

    See more

    Declaration

    Objective-C

    @interface SChartDataPointLabelStyle : NSObject <NSCopying>

    Swift

    class SChartDataPointLabelStyle : NSObject, NSCopying
  • Each SChartSeries requires a set of data points that it will visually represent. The SChartDataSeries looks after these points. The set of data points it contains will adopt the SChartData protocol.

    SChartDataSeries is not concerned with style or aesthetics. All the properties defined here are related to the data only.

    See more

    Declaration

    Objective-C

    @interface SChartDataSeries : NSObject

    Swift

    class SChartDataSeries : NSObject
  • An SChartDateFrequency is used to specify the desired frequency of tick marks on a SChartDateTimeAxis. For example, a frequency of 2 hours will cause the axis to attempt to display a tick mark at every 2 hour mark. No class type other than SChartDateFrequency (or one of its subclasses) may be used to define a date frequency on the axis.

    A frequency of a particular calendar unit may be set from one of the following supported units: year, month, week, day, hour, minute, second. This can be done by either:

    • Initialising an SChartDateFrequency object, then using the setter method for the appropriate unit of time (as listed above).
    • Using one of the convenience init methods provided (such as initWithSecond:).
    • Using one of the factory methods provided (such as dateFrequencyWithSecond:).

    A frequency can only be specified in terms of one type of calendar unit. For example - a frequency of 1 hour AND 3 minutes cannot be set. In this case the frequency can only be of the type hour or of the type minute and will be set to the last component specified. To specify partial units it is necessary to use the lowest denominator - in the case of 1 hour and 3 minutes we would create a frequency of 63 minutes.

    If an attempt is made to set frequency to a negative or zero value, a default of 1 for the given component will be set. For example, if an attempt is made to set a frequency of -9 years the actual frequency set will be 1 year.

    Once the frequency is created, it is given a frequency denomination. The available frequency denominations are:

    • SChartDateFrequencyDenominationSeconds Configures the frequency denomination of the date frequency object to be seconds.
    • SChartDateFrequencyDenominationMinutes Configures the frequency denomination of the date frequency object to be minutes.
    • SChartDateFrequencyDenominationHours Configures the frequency denomination of the date frequency object to be hours.
    • SChartDateFrequencyDenominationDays Configures the frequency denomination of the date frequency object to be days.
    • SChartDateFrequencyDenominationWeeks Configures the frequency denomination of the date frequency object to be weeks.
    • SChartDateFrequencyDenominationMonths Configures the frequency denomination of the date frequency object to be months.
    • SChartDateFrequencyDenominationYears Configures the frequency denomination of the date frequency object to be years.
    See more

    Declaration

    Objective-C

    @interface SChartDateFrequency : NSObject <NSCopying>

    Swift

    class SChartDateFrequency : NSObject, NSCopying
  • An SChartDateTimeAxis is a subclass of SChartAxis designed to work with data points that use NSDate.

    The frequency values for tick marks are expected to be SChartDateFrequency objects.

    Warning

    This axis is not currently supported on radial charts.
    See more

    Declaration

    Objective-C

    @interface SChartDateTimeAxis : SChartAxis

    Swift

    class SChartDateTimeAxis : SChartAxis
  • This curve evaluator describes a curve similar to that described by SChartBounceAnimation but at the start the curve is constant at 0. This is the ‘delay’ where there is no change. The ‘bounce’ occurs over a shorter proportion of the duration (50%) at the end.

    See the SChartAnimationCurve protocol for more information on curve evaluation.

    Declaration

    Objective-C

    @interface SChartDelayBounceAnimationCurve : NSObject <SChartAnimationCurve>

    Swift

    class SChartDelayBounceAnimationCurve : NSObject, SChartAnimationCurve
  • This curve evaluator describes a curve similar to that described by SChartBounceAnimation but at the start the curve is constant at 0.1. This is the ‘delay’ where there is no change. The ‘bounce’ occurs over a shorter proportion of the duration (50%) at the end.

    The important difference between this curve and a SChartDelayBounceAnimationCurve is that this curve never returns 0 during the delay - it returns 0.1 which means that the series will be visible.

    See the SChartAnimationCurve protocol for more information on curve evaluation.

    Declaration

    Objective-C

    @interface SChartDelayBounceWithMinimumAnimationCurve
        : NSObject <SChartAnimationCurve>

    Swift

    class SChartDelayBounceWithMinimumAnimationCurve : NSObject, SChartAnimationCurve
  • SChartDonutSeries displays magnitude data on the chart - the larger the value of the data point, the larger the slice representing that data point.

    A donut series contains an instance of SChartDonutSeriesStyle, which manages its appearance.

    You can configure the radius of the slices in the chart, and how big the hole in the middle of the donut is. See innerRadius and outerRadius for more information.

    When a slice is selected in the chart, it protrudes out of the donut, and rotates to a given position. You can set the amount of protrusion which a selected slice has by setting the [SChartDonutSeriesStyle protrusion] property on the series selectedStyle. You can set the position it rotates to using the selectedPosition property. The series contains an instance of SChartAnimation which describes the motion of the slice as it rotates to its selected position. See selectionAnimation for more information.

    You can enable panning on a donut series. If panning is enabled, performing a swipe gesture on the series will cause it to rotate. Whether panning is enabled is controlled by the gesturePanningEnabled property. By default this is set to NO.

    Legends on donut charts show an entry for each data point, or slice, of the donut series.

    See more

    Declaration

    Objective-C

    @interface SChartDonutSeries : SChartRadialSeries

    Swift

    class SChartDonutSeries : SChartRadialSeries
  • SChartDonutSeriesStyle manages the appearance of donut series on a ShinobiChart. The API for donut series is defined in SChartDonutSeries.

    Donut slices (and also pie slices, as SChartPieSeriesStyle inherits its behavior from this class) are made up of an outline (or ‘crust’) and a filled area (or ‘flavour’). This style object allows you to manage the following properties of a donut series:

    • The color and thickness of the crust around the slices. You can also configure whether the crust is shown. See showCrust, crustThickness and crustColors for more information.
    • The fill colors of the slices, and whether slices are filled at all. See showFlavour and flavourColors for more information.

    When a donut series is drawn, it calls the crustColorAtIndex: and flavourColorAtIndex: methods on the style to get the crust and flavour colors for each slice.

    You can configure whether labels are drawn on a donut series. By default, they will be. The labels annotate each slice in the series. See showLabels, labelFont, labelFontColor and labelBackgroundColor for more information.

    When a slice in a donut series is selected, it protrudes out from the rest of the series. You can control how much it protrudes using the protrusion property.

    See more

    Declaration

    Objective-C

    @interface SChartDonutSeriesStyle : SChartSeriesStyle

    Swift

    class SChartDonutSeriesStyle : SChartSeriesStyle
  • The gesture manager contains all of the gestures used by a ShinobiChart, along with gesture-related properties which enable certain gestures.

    See more

    Declaration

    Objective-C

    @interface SChartGestureManager : NSObject

    Swift

    class SChartGestureManager : NSObject
  • Style properties for the grid stripes that can appear between major tick marks.

    See more

    Declaration

    Objective-C

    @interface SChartGridStripeStyle : NSObject <NSCopying>

    Swift

    class SChartGridStripeStyle : NSObject, NSCopying
  • Series data can be displayed in a legend on a ShinobiChart. The SChartLegend is a UIView-based object that represents the legend as a visual item on the chart. The legend may appear in a number of preset positions within the chart.

    • SChartLegendPlacementOutsidePlotArea Configures the legend to be placed outside of the plot area.
    • SChartLegendPlacementInsidePlotArea Configures the legend to be placed inside of the plot area.
    • SChartLegendPlacementOnPlotAreaBorder Configures the legend to be placed on the plot area border.

    The placement of the legend inside or outside the plot area has different effects. See the placement property for more information.

    Irrespective of how the plot area behaves, we can anchor the legend to several preset positions in the chart area:

    • SChartLegendPositionTopRight Configures the legend to be anchored in the top right of the chart area.
    • SChartLegendPositionMiddleRight Configures the legend to be anchored vertically center on the right of the chart area.
    • SChartLegendPositionBottomRight Configures the legend to be anchored in the bottom right of the chart area.
    • SChartLegendPositionBottomMiddle Configures the legend to be anchored in the center at the bottom of the chart area.
    • SChartLegendPositionBottomLeft Configures the legend to be anchored in the bottom left of the chart area.
    • SChartLegendPositionMiddleLeft Configures the legend to be anchored vertically center on the left of the chart area.
    • SChartLegendPositionTopLeft Configures the legend to be anchored in the top left of the chart area.
    • SChartLegendPositionTopMiddle Configures the legend to be anchored in the center at the top of the chart area.

    See the position property for more information.

    To create a custom legend object, you can subclass SChartLegend and override its drawLegend method. You can then assign the new legend object to [ShinobiChart legend].

    Any instance of SChartSeries will adopt the SChartLegendItem protocol, which means that series can also customize how they appear in the legend. SChartLegendItem allows a series to specify the title or symbol which should represent it in the legend. For radial series, it allows the series to specify how each slice should be represented. See the protocol’s API documentation for more information.

    More information about using SChartLegend can be found in the user guide, and in our tutorial ‘The making of a legend’.

    See more

    Declaration

    Objective-C

    @interface SChartLegend : UIView

    Swift

    class SChartLegend : UIView
  • Manages the appearance of the legend on the chart. The legend is an instance of SChartLegend.

    See more

    Declaration

    Objective-C

    @interface SChartLegendStyle : NSObject <NSCopying>

    Swift

    class SChartLegendStyle : NSObject, NSCopying
  • A symbol designed to represent a band series in the chart legend.

    The symbol makes use of the series styling, in order to better represent it in the legend.

    Note

    This is a Premium feature
    See more

    Declaration

    Objective-C

    @interface SChartLegendSymbolBandSeries : SChartLegendSymbol

    Swift

    class SChartLegendSymbolBandSeries : SChartLegendSymbol
  • A symbol designed to represent a candlestick series in the chart legend.

    The symbol makes use of the series styling, in order to better represent it in the legend.

    Note

    This is a Premium feature
    See more

    Declaration

    Objective-C

    @interface SChartLegendSymbolCandlestickSeries : SChartLegendSymbol

    Swift

    class SChartLegendSymbolCandlestickSeries : SChartLegendSymbol
  • A symbol designed to represent an OHLC series in the chart legend.

    The symbol makes use of the series styling, in order to better represent it in the legend.

    Note

    This is a Premium feature
    See more

    Declaration

    Objective-C

    @interface SChartLegendSymbolOHLCSeries : SChartLegendSymbol

    Swift

    class SChartLegendSymbolOHLCSeries : SChartLegendSymbol
  • The SChartLightTheme uses brighter colors based on a white background. For a more detailed explanation of how themes work, see the documentation for the SChartTheme class.

    Declaration

    Objective-C

    @interface SChartLightTheme : SChartTheme

    Swift

    class SChartLightTheme : SChartTheme
  • SChartLineSeries is a type of SChartSeries that uses the data points to construct a line series.

    The line series consists of a number of points which may or may not be marked, and which are connected by a line with an optional fill (ie: area series) between the line and the chart axis.

    See more

    Declaration

    Objective-C

    @interface SChartLineSeries : SChartScatterSeries

    Swift

    class SChartLineSeries : SChartScatterSeries
  • An SChartLogarithmicAxis is a subclass of SChartNumberAxis used for displaying logarithmic data.

    Unlike a ‘standard’ number axis, the distance between n and n+1 is not the same as the distance between n+7 and n+8. Rather, the distance between base^(n) and base^(n+1) is the same as the distance between base^(n+7) and base^(n+8).

    Note

    This is a Premium feature

    Warning

    This axis is not currently supported on radial charts.

    See more

    Declaration

    Objective-C

    @interface SChartLogarithmicAxis : SChartNumberAxis

    Swift

    class SChartLogarithmicAxis : SChartNumberAxis
  • A look of a chart is managed by an instance of SChartTheme or one of its sub-classes. Themes contain a set of style objects, each of which are responsible for managing the look of a particular aspect of the chart.

    The SChartMainTitleStyle class is responsible for managing the look of the main chart title. As well as the properties it inherits from SChartTitleStyle, it also allows you to specify the chart element on which the title should center, and whether the title should overlap with the chart canvas.

    Warning

    Chart titles are not currently supported on radial charts.
    See more

    Declaration

    Objective-C

    @interface SChartMainTitleStyle : SChartTitleStyle <NSCopying>

    Swift

    class SChartMainTitleStyle : SChartTitleStyle, NSCopying
  • Style properties for the major grid lines.

    See more

    Declaration

    Objective-C

    @interface SChartMajorGridlineStyle : NSObject <NSCopying>

    Swift

    class SChartMajorGridlineStyle : NSObject, NSCopying
  • SChartMappedSeries represents an instance of a series that maps its data to axes on a chart.

    Coordinates are points defined in a plane by a pair of numerical coordinates, which are the signed distances from the point to either axis in the plane. Mapped series require a chart with at least one X and at least one Y axis.

    SChartMappedSeries is the base class for all of the mapped series which are provided in ShinobiCharts. The mapped series types which are available are:

    Some types of chart series can be stacked. This means that they are rendered on top of each other, with the first series rendered at the bottom, and subsequent series offset so that they begin at the top of the previous series. The types of series which can be stacked are bar series, column series, line series and stepped line series. See the stackIndex property for more information.

    See more

    Declaration

    Objective-C

    @interface SChartMappedSeries : SChartSeries

    Swift

    class SChartMappedSeries : SChartSeries
  • An SChartNumberAxis is a subclass of SChartAxis designed to work with data points that use NSNumber. When mapping coordinates it will cast each object to an NSNumber.

    The frequency values for tick marks are expected to be NSNumber objects.

    See more

    Declaration

    Objective-C

    @interface SChartNumberAxis : SChartAxis

    Swift

    class SChartNumberAxis : SChartAxis
  • SChartOHLCSeries is a type of SChartSeries which displays Open-High-Low-Close (OHLC) data on a chart.

    Each data point in an OHLC series is visualised as a line between the high and low values, with short perpendicular bars indicating the open and close positions.

    Data points in an OHLC series will contain multiple values. This means that they will be instances of SChartMultiXDataPoint or SChartMultiYDataPoint, depending on the orientation of the series. The keys for the values in each data point will be SChartOHLCKeyOpen, SChartOHLCKeyHigh, SChartOHLCKeyLow and SChartOHLCKeyClose.

    In order to provide the Open, High, Low, and Close values to the chart, the data points in the OHLC series should implement either the [SChartData sChartXValueForKey:] method or the [SChartData sChartYValueForKey:] method on the SChartData protocol, depending on the series orientation.

    The series contains an instance of SChartOHLCSeriesStyle, which manages the appearance of the series on the chart.

    Note

    This is a Premium feature
    See more

    Declaration

    Objective-C

    @interface SChartOHLCSeries : SChartBarColumnSeries

    Swift

    class SChartOHLCSeries : SChartBarColumnSeries
  • SChartOHLCSeriesStyle manages the appearance of an instance of SChartOHLCSeries on the chart.

    Each data point in an OHLC series is visualised as a line between the high and low values, with short perpendicular bars indicating the open and close positions.

    The colors used to represent each data point are different dependent on whether the data value is rising or falling. You can set the colors for both cases in this class. A gradient is applied to the colors in each data point, going from top to bottom if the series is horizontal, and from left to right if the series is vertical. See risingColor, fallingColor, risingColorGradient or fallingColorGradient for more information.

    Note

    This is a Premium feature
    See more

    Declaration

    Objective-C

    @interface SChartOHLCSeriesStyle : SChartSeriesStyle <NSCopying>

    Swift

    class SChartOHLCSeriesStyle : SChartSeriesStyle, NSCopying
  • SChartPieSeries displays magnitude data on the chart - the larger the value of the datapoint, the larger the slice representing that datapoint.

    SChartPieSeries inherits most of its behavior from its parent SChartDonutSeries. Have a look at the SChartDonutSeries API documentation for more information on the common behavior.

    One way in which pie series differ from donut series is with regard to styling. A pie series contains an instance of SChartPieSeriesStyle, which manages its appearance.

    See more

    Declaration

    Objective-C

    @interface SChartPieSeries : SChartDonutSeries

    Swift

    class SChartPieSeries : SChartDonutSeries
  • A class capable of mapping a pixel point onto a datapoint, series and suggested pixel point in a ShinobiChart. Intended for use by user crosshairs.

    This class is responsible for asking each series how far it is from a given point, and ensuring the point is in the correct coordinate space for the series. The chart also has hit-detectors whose responsiblity it is to be asked and to calculate the distance to their series, for a certain point.

    See more

    Declaration

    Objective-C

    @interface SChartPixelToPointMapper : NSObject

    Swift

    class SChartPixelToPointMapper : NSObject
  • A tuple of pixel-point, series and datapoint, used for passing information about a closest-point and series back from a SChartPixelToPointMapper

    See more

    Declaration

    Objective-C

    @interface SChartPixelToPointMapping : NSObject

    Swift

    class SChartPixelToPointMapping : NSObject
  • SChartPointStyle manages the appearance of data points within chart series. It is used by instances of SChartBandSeries, SChartLineSeries and SChartScatterSeries, as all of these types of series can display individual points.

    By default, points are displayed as two circles, one displayed within the other. You can configure the color and radius of both circles. You can also add a gradient to a point, so that it fades as you move out from its center.

    You also have the option to display images for each point, rather than displaying two circles. This is managed using the texture property.

    See more

    Declaration

    Objective-C

    @interface SChartPointStyle : SChartBaselinePointStyle

    Swift

    class SChartPointStyle : SChartBaselinePointStyle
  • A ShinobiChart can contain either cartesian, radial or pie/donut chart series. Pie and donut chart series contain instances of SChartRadialDataPoint. You should look at the documentation for SChartMappedSeries for the data points which are used by other types of series.

    Note

    The name of this class will be changed in a future version of this framework. The current naming isn’t clear, as these types of data points are not used by radial series - they use instances of SChartDataPoint instead. We have kept the current naming for now to maintain backwards compatibility.

    A radial data point is made up of a name and a value (magnitude). Unlike data points in cartesian series, a SChartRadialDataPoint can have only one value.

    See more

    Declaration

    Objective-C

    @interface SChartRadialDataPoint : SChartDataPoint <SChartData>

    Swift

    class SChartRadialDataPoint : SChartDataPoint, SChartData
  • SChartRadialLineSeries is a type of SChartMappedSeries that uses datapoints to construct a line series on a radial chart. The line series consists of a number of points which may or may not be selected, and which are connected by a line with an optional fill between the line and the chart’s center.

    See more

    Declaration

    Objective-C

    @interface SChartRadialLineSeries : SChartMappedSeries

    Swift

    class SChartRadialLineSeries : SChartMappedSeries
  • Note: The SChartRadialSeries class will be removed in a future release. It has only been left in this release in order to maintain backwards compatibility. Please use SChartDonutSeries instead.

    SChartRadialSeries is the base class for all pie or donut series within a ShinobiChart. Typically you would use one of its subclasses in your chart. Currently the following subclasses are available:

    Whereas datapoints for cartesian series require an x and a y value, pie and donut series require a name and a value. The x value of a datapoint within a pie/donut series is set as the name of the slice, and the y value is set as its magnitude. See SChartRadialDataPoint for more information.

    See more

    Declaration

    Objective-C

    @interface SChartRadialSeries : SChartSeries

    Swift

    class SChartRadialSeries : SChartSeries
  • SChartRange represents a range of values on a chart. It is used by the chart axes, which are defined in SChartAxis. SChartRange is the base class for the concrete range types which are available in ShinobiCharts. The concrete types are:

    See more

    Declaration

    Objective-C

    @interface SChartRange : NSObject

    Swift

    class SChartRange : NSObject
  • SChartScatterSeries is a type of SChartSeries that uses its data points to construct a scatter series.

    A common use case for scatter series is to use images for your data points. In order to set a default image for each point in your scatter series, you can configure the series style. The following code shows how:

        scatterSeries.style.pointStyle.texture = [UIImage imageNamed:@"texture.png"];
    

    In order to configure the radius of your data points, you can also configure the series style, as follows:

        scatterSeries.style.pointStyle.radius = @10;
    

    Note that there is an SChartBubbleSeries that allows you to control the size of the bubbles via the data point objects returned from your data source.

    Data points are rendered as an inner point and an outer point (the drawing of the outer points is handled by the superclass SChartPointSeries). In the case where you just wish to render a single image for your data point, rather than a larger image with a smaller image inside it, you would set the [SChartPointStyle innerRadius] property of the the series style to @0.

    For more information on styling data points, see SChartPointStyle.

    Configuring individual data points

    As well as setting default properties for the whole series, you can set properties for individual data points in your chart series.

    You specify properties for individual data points in the chart’s datasource (which will adopt the SChartDatasource protocol).

    To set the radius of an individual data point in the series, you would implement the [SChartDatasource sChartRadiusForDataPoint:dataPointAtIndex:forSeriesAtIndex:] method on the datasource, and provide the correct radius for each point.

    To set an image to use for a particular data point in your series, you would implement the [SChartDatasource sChartTextureForPoint:dataPointAtIndex:forSeriesAtIndex:] method on the datasource.

    You can also set the inner radius of individual points, by implementing the [SChartDatasource sChartInnerRadiusForDataPoint:dataPointAtIndex:forSeriesAtIndex:] method on the datasource.

    See more

    Declaration

    Objective-C

    @interface SChartScatterSeries : SChartPointSeries

    Swift

    class SChartScatterSeries : SChartPointSeries
  • SChartSeries manages the display of a data series on a ShinobiChart. It contains a set of data points.

    There are various things which you can do to configure the behavior and appearance of a chart series:

    • A series can optionally use animations when it appears and disappears on the chart. You can set whether animation should be enabled, and if so, you can configure the animations which the series uses.
    • You can configure whether the series is selectable, and if so, its behavior when it is selected.
    • The series contains instances of SChartSeriesStyle, or one of its sub-classes, to manage its appearance. Tweaking these style objects allows you to change the look of the series on the chart.
    • You can update the representation of the series in the chart legend, and whether the chart crosshair is enabled for the series.

    We have created sub-classes of SChartSeries for each of the concrete types of chart series which are available on a chart. These are:

    • SChartLineSeries draws data points and connects them, in the order given, using a line. The display of individual points may be enabled or disabled as required. Similarly the area fill under the line may be enabled or disabled as required to form area series.

    Line/Area Series

    Scatter Series

    • SChartBubbleSeries draws bubbles that are placed at the x and y values of the data. A third property, Area, controls the magnitude of the bubble at each point. Use SChartBubbleDataPoint for this series.

    Bubble Series

    Column Series

    Bar Series

    • SChartBandSeries draws two lines (high and low) and can shade the area between them. (Premium Edition only).

    Band Series

    • SChartCandleStickSeries draws candlestick data points (Premium Edition only).

    CandleStick Series

    • SChartOHLCSeries draws Open High Low Close data points (Premium Edition only).

    OHLC Series

    • SChartStepLineSeries draws a line chart where the connecting line will only travel in a vertical or horizontal direction to connect the data points.

    Step Line Series

    Pie Series

    Donut Series

    Series are always drawn in order with the lowest series index first. This means that higher numbered series sit on top and potentially obscure lower numbered series.

    More information about using SChartSeries can be found in the user guide.

    See more

    Declaration

    Objective-C

    @interface SChartSeries : NSObject <SChartLegendItem>

    Swift

    class SChartSeries : NSObject, SChartLegendItem
  • SChartSeriesCrosshair draws a small circle around the current point being tracked, accompanied by a tooltip of type SChartSeriesCrosshairTooltip. This tooltip has a caret that points in the direction of the circled datapoint and is capable of displaying both single and multi-value datapoints.

    To use this crosshair, simply assign an instance of SChartSeriesCrosshair to the chart’s crosshair property:

     chart.crosshair = [[SChartSeriesCrosshair alloc] init];
    

    The crosshair is enabled with a tap-and-hold gesture and will lock to the nearest series to pan through the values.

    In order for a crosshair to be displayed on a chart series, the series must have its crosshairEnabled property set to YES. This defaults to NO, so you will need to set this property on the series in your chart.

    More details about this crosshair can be found in our user guide.

    See more

    Declaration

    Objective-C

    @interface SChartSeriesCrosshair : UIView <SChartCrosshair>

    Swift

    class SChartSeriesCrosshair : UIView, SChartCrosshair
  • Calculates an appropriate position for the tooltip.

    The calculated center position is series dependent. By default, all series with an orientation of SChartSeriesOrientationHorizontal will have their tooltips positioned above or below the datapoint, with those SChartSeriesOrientationVertical positioning the tooltip to the left or the right.

    This positioner constrains the tooltip within the chart’s plot area.

    Also offsets the tooltip by a default of 20 points from the currently tracked datapoint.

    Declaration

    Objective-C

    @interface SChartSeriesCrosshairTooltipPositioner
        : NSObject <SChartSeriesCrosshairTooltipPositionerProtocol>

    Swift

    class SChartSeriesCrosshairTooltipPositioner : NSObject, SChartSeriesCrosshairTooltipPositionerProtocol
  • SChartSeriesStyle is the base class for all series styles in ShinobiCharts. Series style objects manage the appearance of series on a chart.

    SChartSeriesStyle allows you to modify the representation of the series in the chart legend. In order to tweak properties on a series style object which are specific to that kind of series, you should look at the documentation for the concrete series styles which are available. These are:

    See more

    Declaration

    Objective-C

    @interface SChartSeriesStyle : NSObject

    Swift

    class SChartSeriesStyle : NSObject
  • This class can be used to easily setup your chart with series and simple data.

    The SChartSimpleDatasource implements the SChartDatasource protocol and must be assigned to a chart’s datasource to take effect.

    The series & data you have added to this SChartSimpleDatasource will be passed to and displayed by the chart it’s been assigned to.

    See more

    Declaration

    Objective-C

    @interface SChartSimpleDatasource : NSObject <SChartDatasource>

    Swift

    class SChartSimpleDatasource : NSObject, SChartDatasource
  • SChartSpokeStyle manages the appearance of spokes for SChartDonutSeries and SChartPieSeries objects.

    Spokes provide an alternative way to display labels on a pie or donut chart. Labels are positioned outside the series with a line drawn from them to the center of the slice.

    For spokes to be drawn, showSpokes must be enabled.

    Spokes can be enabled on a per-slice basis. Please see our user guide for a code sample.

    See more

    Declaration

    Objective-C

    @interface SChartSpokeStyle : NSObject <NSCopying>

    Swift

    class SChartSpokeStyle : NSObject, NSCopying
  • SChartStepLineSeries is a type of SChartLineSeries that uses its data points to construct a step line series.

    The step line series consists of a number of points which may or may not be marked, that are connected by a stepping line with an optional fill (i.e. an area series) between the line and the axis.

    Declaration

    Objective-C

    @interface SChartStepLineSeries : SChartLineSeries

    Swift

    class SChartStepLineSeries : SChartLineSeries
  • A look of a chart is managed by an instance of SChartTheme or one of its sub-classes. Themes contain a set of style objects, each of which are responsible for managing the look of a particular aspect of the chart.

    The SChartStyle class is responsible for managing the overall look of the chart. This includes things like:

    • The background color of the chart.
    • The color and width of the chart border.
    • The background color of the chart plot area.
    • The color and width of the chart plot area border.

    More information about using SChartStyle can be found in the user guide.

    See more

    Declaration

    Objective-C

    @interface SChartStyle : NSObject <NSCopying>

    Swift

    class SChartStyle : NSObject, NSCopying
  • The SChartTheme class is responsible for storing styling information for the chart’s visual components, such as its titles, axes & tickmarks, and series.

    Each theme contains a number of style objects that affect the look of certain aspects of the chart such as its axis, its title or its crosshair. These style objects are exposed as properties on the theme. There are also a number of style objects for each series type - for most series, six different styles are provided per theme. Radial and financial (ohlc, candlestick) series only have a one style per theme. These are accessed via a method on the theme, for example line series styles are returned by:

         SChartLineSeriesStyle *thirdSelectedLineSeriesStyle = [theme lineSeriesStyleForSeriesAtIndex: 2 selected: YES];
         SChartColumnSeriesStyle *secondUnselectedColumnSeriesStyle = [theme columnSeriesStyleForSeriesAtIndex: 2 selected: NO];
    

    Note that if there are more series on the chart than there are series styles provided by the theme, the chart will loop through the style objects it has, using the first style object again once it has cycled through its available styles.

    A theme is applied to a chart via the applyTheme: method. For example:

        [chart applyTheme: theme];
    

    The applyTheme: message is passed to the chart upon the initialisation of the chart, applying either the theme you provided to the chart via initWithFrame:withTheme: (or initWithFrame:withTheme:withPrimaryXAxisType:withPrimaryYAxisType:) or the default theme. Applying a theme to a chart will overwrite any changes to any of the style objects on the chart or its series previously - you should make any further customisations after applying the theme.

    ShinobiCharts comes with several pre-created subclasses of SChartTheme:

    • iOS Seven Theme: Solid colors without gradients, crisp & clear text (default iOS 7+)
    • Light Theme: Brighter colors based on a white background (default pre-iOS 7)
    • Dark Theme: Softer colors on a black background

    A chart running on a version of iOS older than iOS 7 will use the light theme by default, whereas a chart running on iOS 7 or later will default to using our SChartiOS7Theme All themes are, however, available to all versions of iOS - just use them as normal. For example, you could use SChartiOS7Theme on iOS 5.

    There are two recommended ways to provide your own custom theme:

    • You can use one of the provided SChartTheme classes and customise the style objects provided on it.
    • You can subclass one of the SChartTheme classes, customise the style objects provided, and override the ‘{line, band, bar, column, donut, ohlc}SeriesStyleForSeriesAtIndex:selected:’ method to return your own series styles.

    More information about using SChartTheme can be found in the user guide.

    See more

    Declaration

    Objective-C

    @interface SChartTheme : NSObject <NSCopying>

    Swift

    class SChartTheme : NSObject, NSCopying
  • A wrapper object that contains an appropriate NSFormatter for the axes for which it is formatting tick labels.

    Instances of SChartDateTimeAxis and SChartNumberAxis (and subclasses thereof) are assigned a sensible SChartTickLabelFormatter when they are initialized. Set properties on the formatter property to customise your formatting. You can also subclass SChartTickLabelFormatter and set your custom object to an axis to handle formatting.

    See more

    Declaration

    Objective-C

    @interface SChartTickLabelFormatter : NSObject

    Swift

    class SChartTickLabelFormatter : NSObject
  • This class provides a simple way to adjust the rate at which tick labels are refreshed.

    By default, slower devices (see list below) will skip every second call to refresh the tick marks, while faster devices will process every call.

    Slow devices:

    • iPad Mini 1
    • iPad 3rd Generation and below
    • iPhone 4S and below
    See more

    Declaration

    Objective-C

    @interface SChartTickLabelRefreshRateDeviceBased
        : NSObject <SChartTickLabelRefreshRate>

    Swift

    class SChartTickLabelRefreshRateDeviceBased : NSObject, SChartTickLabelRefreshRate
  • The style properties for tick marks

    See more

    Declaration

    Objective-C

    @interface SChartTickStyle : NSObject <NSCopying>

    Swift

    class SChartTickStyle : NSObject, NSCopying
  • An SChartTimePeriod represents a period of time. It starts at a point in time, and has a length defined by an instance of SChartDateFrequency.

    Instances of SChartTimePeriod are used by the discontinuous date/time axis (defined in SChartDiscontinuousDateTimeAxis). The axis defines periods of time over which it will skip.

    See more

    Declaration

    Objective-C

    @interface SChartTimePeriod : NSObject

    Swift

    class SChartTimePeriod : NSObject
  • A SChartRepeatedTimePeriod represents a repeated period of time, starting at a particular point in time. Each period has a length, and the periods repeat at a given frequency. The length of each period, and the frequency at which they repeat, are expressed as instances of SChartDateFrequency.

    Instances of SChartRepeatedTimePeriod are used by the discontinuous date/time axis (defined in SChartDiscontinuousDateTimeAxis). The axis uses SChartRepeatedTimePeriod to define repeated periods of time over which it will skip.

    See more

    Declaration

    Objective-C

    @interface SChartRepeatedTimePeriod : SChartTimePeriod

    Swift

    class SChartRepeatedTimePeriod : SChartTimePeriod
  • Calculates a progress value based on time.

    It uses the duration time value its initialised with to calculate a progress value. The calculator records a start time when we call the progress method for first time and will produce a progress value of 0 at this point. The progress value will be 1 when the current time equals the start time the calculator recorded + the duration.

    See more

    Declaration

    Objective-C

    @interface SChartTimeProgressCalculator
        : NSObject <SChartProgressCalculator, NSCopying>

    Swift

    class SChartTimeProgressCalculator : NSObject, SChartProgressCalculator, NSCopying
  • A title object used by the chart and chart axes to display a UILabel with appropriate text.

    The look and feel of titles on the chart is managed by instances of one of the sub-classes of SChartTitleStyle. The look and feel of the chart title is managed by SChartMainTitleStyle. The look and feel of axis titles is managed by SChartAxisTitleStyle. SChartTitleStyle contains any common styling properties of all titles.

    By default, the chart title is displayed below the chart, and the chart canvas makes room for the title. If you wish to update the position of the title, you can use the [SChartTitleStyle position] property. This allows you to specify the position of the title relative to the chart. SChartMainTitleStyle also offers you some properties to fine-tune the title appearance. These are:

    • [SChartMainTitleStyle titleCentresOn]: Allows you to specify whether the title centers on the full chart view, the plot area, or the canvas.
    • [SChartMainTitleStyle overlapChartTitle]: Allows you to specify whether the title overlaps with the chart, or whether the chart canvas makes room for it.

    By default, the axes titles are displayed in the center of each axis. If you wish to update the position of the title, you can use the [SChartTitleStyle position] property. SChartAxisTitleStyle also allows you to specify the orientation of the axis title, to be either horizontal or vertical.

    Warning

    Currently, chart titles are not supported by radial charts.

    Declaration

    Objective-C

    @interface SChartTitle : UILabel

    Swift

    class SChartTitle : UILabel
  • The look of a chart is managed by an instance of SChartTheme or one of its sub-classes. Themes contain a set of style objects, each of which are responsible for managing the look of a particular aspect of the chart. You’ll find instances of this class or a subclass on the theme for axes titles and for the chart title.

    The SChartTitleStyle class is responsible for managing the look of the titles on the chart. This includes things like:

    • The title color.
    • The title font.
    • The minimum font size for the title.
    • The background color of the title label.
    • The position of the title.

    There are two subclasses of SChartTitleStyle. SChartAxisTitleStyle is used for the titles on the chart axes. SChartMainTitleStyle is used for the main title on the chart.

    See more

    Declaration

    Objective-C

    @interface SChartTitleStyle : NSObject <NSCopying>

    Swift

    class SChartTitleStyle : NSObject, NSCopying
  • The SChartiOS7Theme features solid-colored series without gradients on a light background and crisp & clear text to fit in with your iOS 7 app.

    See SChartTheme for an explanation of how themes work.

    Declaration

    Objective-C

    @interface SChartiOS7Theme : SChartTheme

    Swift

    class SChartiOS7Theme : SChartTheme
  • A utility class which allows you to set themes and trialKeys for all the ShinobiChart instances in your app, rather than having to configure each independently.

    This is best done early on, before any charts are created.

    See more

    Declaration

    Objective-C

    @interface ShinobiCharts : NSObject

    Swift

    class ShinobiCharts : NSObject