Options
All
  • Public
  • Public/Protected
  • All
Menu

The RenderContext provides methods for drawing to a WebGL WebAssembly Canvas or standard HTML5 Canvas. This interface is used in SciChart's High Performance Realtime JavaScript Charts to draw shapes, lines, fills, images and more

Hierarchy

Implemented by

Index

Methods

createPen

  • createPen(stroke: string, strokeThickness: number, strokeDashArray?: number[], antiAliased?: boolean): IPen2D
  • description

    creates a pen (which you should cache) from the provided stroke and strokeThickness

    Parameters

    • stroke: string

      in hex format e.g. #FF6600 or CSS rgba format rgb(255,70,30,0.8)

    • strokeThickness: number

      in pixels

    • Optional strokeDashArray: number[]
    • Optional antiAliased: boolean

      true if the pen draws an Anti-Aliased linez

    Returns IPen2D

createSolidBrush

  • createSolidBrush(fill: string, opacity?: number): IBrush2D
  • description

    creates a solid color brush (which you should cache) from the provided fillColor and opacity

    Parameters

    • fill: string

      color in hex format, e.g. #FF6600 or CSS rgba format rgb(255,70,30,0.8)

    • Optional opacity: number

      from 0.0 to 1.0

    Returns IBrush2D

delete

  • delete(): void
  • Deletes native (WebAssembly) memory used by this type, after which it cannot be used.

    remarks

    Call .delete() before finishing with the object to ensure that WebAssmembly memory leaks do not occur.

    All elements within SciChart's High Performance Realtime JavaScript Charts which implement IDeletable must be deleted manually to free native (WebAssembly) memory

    Returns void

drawLine

  • drawLine(x1: number, y1: number, x2: number, y2: number, strokePen: IPen2D, viewRect: Rect): void
  • description

    Draws a single line from (x1,y1) to (x2,y2) with the specified Pen

    Parameters

    • x1: number

      The X1 coordinate in pixels

    • y1: number

      The Y1 coordinate in pixels

    • x2: number

      The X2 coordinate in pixels

    • y2: number

      The Y2 coordinate in pixels

    • strokePen: IPen2D

      the pen to draw with

    • viewRect: Rect

      the series viewRect, used for translate and clipping

    Returns void

drawLines

  • description

    Draws a polyline with the specified Pen

    Parameters

    • xyValues: number[]

      An array of x,y points arranged as x0y0 x1y1 ... xnyn

    • strokePen: IPen2D

      the pen to draw with

    • viewRect: Rect

      the series viewRect, used for translate and clipping

    • Optional lineDrawMode: ELineDrawMode

      whether to draw lines as a polyline, or disconnected lines

    Returns void

drawRect

  • description

    Draws a Rect with optional fill and stroke

    Parameters

    • rect: Rect

      the Rect dimensions to draw

    • viewRect: Rect

      the series viewRect, used for translate and clipping

    • Optional strokePen: IPen2D

      the stroke pen to draw the outline with

    • Optional fillBrush: IBrush2D

      the fill brush to draw the fill with

    Returns void

Generated using TypeDoc