iOS Charting Documentation - SciChart iOS Charts SDK v3.x

ISCIRenderContext2D

@protocol ISCIRenderContext2D <ISCIDisposable>

Defines the protocol to a 2D RenderContext, allowing rendering of pens, brushes, sprites and textures on the ISCIRenderSurface.

  • The viewport size in user space coordinate system.

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGSize viewportSize;

    Swift

    var viewportSize: CGSize { get }
  • Draws a single line on the ISCIRenderSurface using the specified ISCIPen2D.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawLineWithPen:(nonnull id<ISCIPen2D>)pen
                    atStart:(CGPoint)start
                        end:(CGPoint)end;

    Swift

    func drawLine(with pen: ISCIPen2D, atStart start: CGPoint, end: CGPoint)

    Parameters

    pen

    The pen to draw line with.

    start

    The start point coordinates.

    end

    The end point coordinates.

  • Begins a line segment, returning the ISCIPathDrawingContext.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (nonnull id<ISCIPathDrawingContext>)beginLineWithPen:
                                              (nonnull id<ISCIPen2D>)pen
                                                        at:(CGPoint)point;

    Swift

    func beginLine(with pen: ISCIPen2D, at point: CGPoint) -> ISCIPathDrawingContext

    Parameters

    pen

    The pen for line segment.

    point

    The point coordinates.

    Return Value

    The ISCIPathDrawingContext to continue the line.

  • Draws a series of lines. Each line is taken from 4 consecutive values in the points array. Thus to draw 1 line, the array must contain at least 4 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawLinesWithPen:(nonnull id<ISCIPen2D>)pen
                      points:(nonnull float *)points
                  startIndex:(int)startIndex
                       count:(int)count;

    Swift

    func drawLines(with pen: ISCIPen2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32)

    Parameters

    pen

    The pen to draw lines with.

    points

    Array of points to draw [x0, y0, x1, y1, x2, y2 ...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

  • Draws a lines strip. Each line is taken from 4 consecutive values in the points array. Thus to draw 1 line, the array must contain at least 4 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawLinesStripWithPen:(nonnull id<ISCIPen2D>)pen
                           points:(nonnull float *)points
                       startIndex:(int)startIndex
                            count:(int)count;

    Swift

    func drawLinesStrip(with pen: ISCIPen2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32)

    Parameters

    pen

    The pen to draw lines with.

    points

    Array of points to draw [x0, y0, x1, y1, x2, y2 ...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

  • Draws a triangle strip. Each line is taken from 6 consecutive values in the points array. Thus to draw 1 triangle, the array must contain at least 6 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawTrianglesStripWithBrush:(nonnull id<ISCIBrush2D>)brush
                                 points:(nonnull float *)points
                             startIndex:(int)startIndex
                                  count:(int)count;

    Swift

    func drawTrianglesStrip(with brush: ISCIBrush2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32)

    Parameters

    brush

    The brush to fill triangles with.

    points

    Array of points to draw [x0, y0, x1, y1, x2, y2 ...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

  • Begins a filled triangle strips segment, returning the ISCIPathDrawingContext.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (nonnull id<ISCIPathDrawingContext>)
        beginTrianglesStripWithBrush:(nonnull id<ISCIBrush2D>)brush
                                  at:(CGPoint)point;

    Swift

    func beginTrianglesStrip(with brush: ISCIBrush2D, at point: CGPoint) -> ISCIPathDrawingContext

    Parameters

    brush

    The brush for triangle strips segment.

    point

    The point coordinates.

    Return Value

    The ISCIPathDrawingContext to continue the line.

  • Draws a single rectangle on the ISCIRenderSurface using the specified ISCIPen2D.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawRect:(CGRect)rect withPen:(nonnull id<ISCIPen2D>)pen;

    Swift

    func draw(_ rect: CGRect, with pen: ISCIPen2D)

    Parameters

    rect

    The CGRect coordinates.

    pen

    The pen to draw rect with.

  • Fills a single rectangle on the ISCIRenderSurface using the specified ISCIBrush2D.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)fillRect:(CGRect)rect withBrush:(nonnull id<ISCIBrush2D>)brush;

    Swift

    func fill(_ rect: CGRect, with brush: ISCIBrush2D)

    Parameters

    rect

    The CGRect coordinates.

    brush

    The brush to fill rectangle with.

  • Draws a series of rectangles. Each point for sprite is taken from 4 consecutive values in the points array. Thus to draw 1 rectangle, the array must contain at least 4 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawRectsWithPen:(nonnull id<ISCIPen2D>)pen
                      points:(nonnull float *)points
                  startIndex:(int)startIndex
                       count:(int)count;

    Swift

    func drawRects(with pen: ISCIPen2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32)

    Parameters

    pen

    The pen to draw rectangles with.

    points

    Array of points to draw [x0, y0, x1, y1...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

  • Fills a series of rectangles. Each point for sprite is taken from 4 consecutive values in the points array. Thus to draw 1 rectangle, the array must contain at least 4 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)fillRectsWithBrush:(nonnull id<ISCIBrush2D>)brush
                        points:(nonnull float *)points
                    startIndex:(int)startIndex
                         count:(int)count;

    Swift

    func fillRects(with brush: ISCIBrush2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32)

    Parameters

    brush

    The brush to fill rectangles with.

    points

    Array of points to draw [x0, y0, x1, y1...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

  • Draws a single ellipse on the ISCIRenderSurface using the specified ISCIPen2D.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawEllipseWithPen:(nonnull id<ISCIPen2D>)pen
                       andSize:(CGSize)size
                            at:(CGPoint)center;

    Swift

    func drawEllipse(with pen: ISCIPen2D, andSize size: CGSize, at center: CGPoint)

    Parameters

    pen

    The pen to draw ellipse stroke with.

    size

    The size of ellipse.

    center

    The center coordinates.

  • Draws a single ellipse on the ISCIRenderSurface using the specified ISCIBrush2D.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)fillEllipseWithBrush:(nonnull id<ISCIBrush2D>)brush
                         andSize:(CGSize)size
                              at:(CGPoint)center;

    Swift

    func fillEllipse(with brush: ISCIBrush2D, andSize size: CGSize, at center: CGPoint)

    Parameters

    brush

    The brush to fill ellipse with.

    size

    The size of ellipse.

    center

    The center coordinates.

  • Draws a single ellipse on the ISCIRenderSurface using the specified ISCIBrush2D and ISCIPen2D.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawEllipseWithPen:(nonnull id<ISCIPen2D>)pen
                         brush:(nonnull id<ISCIBrush2D>)brush
                       andSize:(CGSize)size
                            at:(CGPoint)center;

    Swift

    func drawEllipse(with pen: ISCIPen2D, brush: ISCIBrush2D, andSize size: CGSize, at center: CGPoint)

    Parameters

    pen

    The pen to draw ellipse stroke with.

    brush

    The brush to fill ellipse with.

    size

    The size of ellipse.

    center

    The center coordinates.

  • Draws a series of ellipses. Each point for sprite is taken from 4 consecutive values in the points array representing rectangle in which each ellipse will be drawn. Thus to draw 1 ellipse, the array must contain at least 4 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawEllipsesWithPen:(nonnull id<ISCIPen2D>)pen
                         points:(nonnull float *)points
                     startIndex:(int)startIndex
                          count:(int)count;

    Swift

    func drawEllipses(with pen: ISCIPen2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32)

    Parameters

    pen

    The pen to draw ellipse stroke with.

    points

    Array of points to draw [x0, y0, x1, y1...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

  • Draws a series of ellipses. Each point for sprite is taken from 4 consecutive values in the points array representing rectangle in which each ellipse will be drawn. Thus to draw 1 ellipse, the array must contain at least 4 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.*

    Declaration

    Objective-C

    - (void)fillEllipsesWithBrush:(nonnull id<ISCIBrush2D>)brush
                           points:(nonnull float *)points
                       startIndex:(int)startIndex
                            count:(int)count;

    Swift

    func fillEllipses(with brush: ISCIBrush2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32)

    Parameters

    brush

    The brush to fill ellipses with.

    points

    Array of points to draw [x0, y0, x1, y1...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

  • Draws a series of ellipses. Each point for sprite is taken from 4 consecutive values in the points array representing rectangle in which each ellipse will be drawn. Thus to draw 1 ellipse, the array must contain at least 4 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawEllipsesWithPen:(nonnull id<ISCIPen2D>)pen
                          brush:(nonnull id<ISCIBrush2D>)brush
                         points:(nonnull float *)points
                     startIndex:(int)startIndex
                          count:(int)count;

    Swift

    func drawEllipses(with pen: ISCIPen2D, brush: ISCIBrush2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32)

    Parameters

    pen

    The pen to draw ellipse stroke with.

    brush

    The brush to fill ellipses with.

    points

    Array of points to draw [x0, y0, x1, y1...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

  • Fills a single rectangle on the ISCIRenderSurface using the specified ISCITexture2D.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawTexture:(nonnull id<ISCITexture2D>)texture inRect:(CGRect)rect;

    Swift

    func draw(_ texture: ISCITexture2D, in rect: CGRect)

    Parameters

    texture

    The texture to draw.

    rect

    The rect coordinates to draw texture in.

  • Fills a single rectangle on the ISCIRenderSurface using the specified ISCITexture2D.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawTexture:(nonnull id<ISCITexture2D>)texture
                 inRect:(CGRect)rect
            withOpacity:(float)opacity;

    Swift

    func draw(_ texture: ISCITexture2D, in rect: CGRect, withOpacity opacity: Float)

    Parameters

    texture

    The texture to draw.

    rect

    The rect coordinates to draw texture in.

    opacity

    The opacity to draw texture with.

  • Draws a series of textures. Each point for sprite is taken from 4 consecutive values in the points array. Thus to draw 1 texture, the array must contain at least 4 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.*

    Declaration

    Objective-C

    - (void)drawTextures:(nonnull id<ISCITexture2D>)texture
                  points:(nonnull float *)points
              startIndex:(int)startIndex
                   count:(int)count;

    Swift

    func drawTextures(_ texture: ISCITexture2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32)

    Parameters

    texture

    The texture to draw.

    points

    Array of points to draw [x0, y0, x1, y1...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

  • Draws a series of textures. Each point for sprite is taken from 4 consecutive values in the points array. Thus to draw 1 texture, the array must contain at least 4 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawTextures:(nonnull id<ISCITexture2D>)texture
                  points:(nonnull float *)points
              startIndex:(int)startIndex
                   count:(int)count
                 opacity:(float)opacity;

    Swift

    func drawTextures(_ texture: ISCITexture2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32, opacity: Float)

    Parameters

    texture

    The texture to draw.

    points

    Array of points to draw [x0, y0, x1, y1...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

    opacity

    The opacity to draw texture with.

  • Sets the texture pixels based on values provided by pixels array.

    Declaration

    Objective-C

    - (void)updateTexture:(nonnull id<ISCITexture2D>)texture
               withPixels:(nonnull unsigned int *)pixels;

    Swift

    func update(_ texture: ISCITexture2D, withPixels pixels: UnsafeMutablePointer<UInt32>)

    Parameters

    texture

    The texture to set pixels for.

    pixels

    The array with values of texture pixels.

  • Sets the region of texture pixels based on values provided by pixels array.

    Declaration

    Objective-C

    - (void)updateFloatTexture:(nonnull id<ISCITexture2D>)texture
                    withPixels:(nonnull float *)pixels;

    Swift

    func updateFloat(_ texture: ISCITexture2D, withPixels pixels: UnsafeMutablePointer<Float>)

    Parameters

    texture

    The texture to set pixels for.

    pixels

    The array with values of texture pixels.

  • Draws a sprite at specified x, y coordinate.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawSprite:(nonnull id<ISCITexture2D>)sprite at:(CGPoint)point;

    Swift

    func drawSprite(_ sprite: ISCITexture2D, at point: CGPoint)

    Parameters

    sprite

    The sprite to draw.

    point

    The sprite coordinates.

  • Draws a sprite at specified x, y coordinate.

    Note

    Please note, that coordinates should be provided in user space coordinate system.*

    Declaration

    Objective-C

    - (void)drawSprite:(nonnull id<ISCITexture2D>)sprite
                    at:(CGPoint)point
           withOpacity:(float)opacity;

    Swift

    func drawSprite(_ sprite: ISCITexture2D, at point: CGPoint, withOpacity opacity: Float)

    Parameters

    sprite

    The sprite to draw.

    point

    The sprite coordinates.

    opacity

    The opacity to draw sprite with.

  • Draws a series of sprites. Each point for sprite is taken from 2 consecutive values in the points array. Thus to draw 1 sprite, the array must contain at least 2 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawSprites:(nonnull id<ISCITexture2D>)sprite
                 points:(nonnull float *)points
             startIndex:(int)startIndex
                  count:(int)count;

    Swift

    func drawSprites(_ sprite: ISCITexture2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32)

    Parameters

    sprite

    The spite to draw.

    points

    Array of points to draw [x0, y0, x1, y1, x2, y2 ...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

  • Draws a series of sprites. Each point for sprite is taken from 2 consecutive values in the points array. Thus to draw 1 sprite, the array must contain at least 2 values.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawSprites:(nonnull id<ISCITexture2D>)sprite
                 points:(nonnull float *)points
             startIndex:(int)startIndex
                  count:(int)count
                opacity:(float)opacity;

    Swift

    func drawSprites(_ sprite: ISCITexture2D, points: UnsafeMutablePointer<Float>, start startIndex: Int32, count: Int32, opacity: Float)

    Parameters

    sprite

    The spite to draw.

    points

    Array of points to draw [x0, y0, x1, y1, x2, y2 ...].

    startIndex

    Start index in points array to start drawing with.

    count

    The amount of points to draw from points array.

    opacity

    The opacity to draw sprite with.

  • Draws a single heatmap on the ISCIRenderSurface using the specified float texture and gradient color map.

    Note

    Please note, that coordinates should be provided in user space coordinate system.

    Declaration

    Objective-C

    - (void)drawHeatmapTexure:(nonnull id<ISCITexture2D>)heatmap
                       inRect:(CGRect)rect
                  andColorMap:(nonnull id<ISCITexture2D>)colorMap;

    Swift

    func drawHeatmapTexure(_ heatmap: ISCITexture2D, in rect: CGRect, andColorMap colorMap: ISCITexture2D)

    Parameters

    heatmap

    The heatmap texture with normalized float values which will be converted to colors using colorMap.

    rect

    The rect coordinates to draw texture in.

    colorMap

    The colorMap texture, which will be used to calculate colors for heatmap normalized values.

  • Saves the current transformation and clip rect onto a private stack.

    Declaration

    Objective-C

    - (void)save;

    Swift

    func save()
  • This call balances a previous call to -save. It’s used to remove all modifications made by -translateXBy:yBy:, rotateByDegrees:, -scaleXBy:yBy: and -setClipRect: calls since the last save call.

    Warning

    Make sure, to synchronize your -save and -restore calls. It is an error to call -restore more times than -save was called.

    Declaration

    Objective-C

    - (void)restore;

    Swift

    func restore()
  • Translates this ISCIRenderContext2D by specified x, y offset.

    Declaration

    Objective-C

    - (void)translateXBy:(float)deltaX yBy:(float)deltaY;

    Swift

    func translateX(by deltaX: Float, yBy deltaY: Float)

    Parameters

    deltaX

    The x offset in pixels.

    deltaY

    The y offset in pixels.

  • Rotates this ISCIRenderContext2D on specified angle.

    Declaration

    Objective-C

    - (void)rotateByDegrees:(float)angle;

    Swift

    func rotate(byDegrees angle: Float)

    Parameters

    angle

    The amount to rotate, in degrees.

  • Scales this ISCIRenderContext2D by the provided x, y values.

    Declaration

    Objective-C

    - (void)scaleXBy:(float)scaleX yBy:(float)scaleY;

    Swift

    func scaleX(by scaleX: Float, yBy scaleY: Float)

    Parameters

    scaleX

    The amount to scale in x direction.

    scaleY

    The amount to scale in y direction.

  • Sets clip rect for this ISCIRenderContext2D at specified coordinates in pixels.

    Declaration

    Objective-C

    - (void)setClipRect:(CGRect)clipRect;

    Swift

    func setClipRect(_ clipRect: CGRect)

    Parameters

    clipRect

    The rect which will be used to clip this render context.

  • Clears the ISCIRenderSurface.

    Declaration

    Objective-C

    - (void)clear;

    Swift

    func clear()