SChartCanvas Class Reference

Inherits from UIView
Declared in SChartCanvas.h
Availability Standard
Premium
Related samples

Overview

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.

Tasks

Other Methods

Initializing the canvas

Managing our drawing objects

Properties

animationRedrawCalculator

Determines whether a subsequent redraw call to the chart should be queued.

@property (nonatomic, retain) id<SChartRedrawCalculator> animationRedrawCalculator

Discussion

Often, you’ll want to leave this as the default SChartRedrawCalculatorFeedbackLoop which will ensure that the chart is redrawn if an animation is currently in progress.

If you wish to prevent the chart from being automatically redrawn, e.g. because you are animating a series based on an axis' span value, you can set this property to nil.

Declared In

SChartCanvas.h

chart

The chart which contains this canvas

@property (nonatomic, assign) ShinobiChart *chart

Declared In

SChartCanvas.h

glView

This is the layer upon which we draw all of our chart series and also any chart annotations.

@property (nonatomic, retain) SChartGLView *glView

Discussion

This layer is rendered using openGL and therefore uses GL based coordinates.

Declared In

SChartCanvas.h

overlay

This is the layer where we render things like the crosshair.

@property (nonatomic, retain) SChartCanvasOverlay *overlay

Declared In

SChartCanvas.h

underlay

The underlay is the layer upon which we draw all of our axes.

@property (nonatomic, retain) SChartCanvasUnderlay *underlay

Discussion

We use pixel based coordinates on the underlay.

Declared In

SChartCanvas.h

underlayForAnnotations

This is the layer where we draw all of our annotation views that are visualised under our data

@property (nonatomic, retain) UIView *underlayForAnnotations

Declared In

SChartCanvas.h

Instance Methods

initWithFrame:usingChart:

Initializes and returns a newly allocated canvas object with the specified frame rectangle.

- (id)initWithFrame:(CGRect)frame usingChart:(ShinobiChart *)parentChart

Parameters

frame

The frame rectangle for the canvas, measured in points.

parentChart

The chart which will contain the new canvas.

Return Value

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

Declared In

SChartCanvas.h