iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x

ISCIStrokePaint

@protocol ISCIStrokePaint <NSObject>

Defines a protocol which provides a way to draw lines, rects, ellipses or CGPathRef on CGContextRef.

  • Paints a rectangle stroke on passed in CGContextRef.

    Declaration

    Objective-C

    - (void)drawRect:(CGRect)rect withContext:(nonnull CGContextRef)context;

    Swift

    func draw(_ rect: CGRect, with context: CGContext)

    Parameters

    rect

    The rectangle, specified in user space coordinates.

    context

    The graphics context to draw on.

  • Paints an ellipse stroke that fits inside the specified rectangle in passed in.

    Declaration

    Objective-C

    - (void)drawEllipseWithContext:(nonnull CGContextRef)context
                            inRect:(CGRect)rect;

    Swift

    func drawEllipse(with context: CGContext, in rect: CGRect)

    Parameters

    context

    The graphics context to draw on.

    rect

    The rectangle that defines the area for the ellipse to fit in.

  • Paints a CGPathRef stroke on passed in CGContextRef.

    Declaration

    Objective-C

    - (void)drawPath:(nonnull CGPathRef)path
         withContext:(nonnull CGContextRef)context
              inRect:(CGRect)rect;

    Swift

    func draw(_ path: CGPath, with context: CGContext, in rect: CGRect)

    Parameters

    path

    The CGPathRef instange to be drawn on the context

    context

    The graphics context to draw on.

    rect

    A rectangle defining the portion of the view to draw in.

  • Paints lines strokes on passed in CGContextRef.

    Note

    Four points per line is used, e.g.: first line - [x0, y0, x1, y1]; second line - [x2, y2, x3, y3];

    Declaration

    Objective-C

    - (void)drawLines:(nonnull const CGFloat *)coordinates
                count:(int)count
          withContext:(nonnull CGContextRef)context
               inRect:(CGRect)rect;

    Swift

    func drawLines(_ coordinates: UnsafePointer<CGFloat>, count: Int32, with context: CGContext, in rect: CGRect)

    Parameters

    coordinates

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

    count

    The amount of points to draw.

    context

    The graphics context to draw on.

    rect

    A rectangle defining the portion of the view to draw in.