Home Reference Source
public class | source

Canvas

Static Method Summary

Static Public Methods
public static
public static

drawBar(x: *, width: *, value: *, fill: *)

drawBar with given Value..

public static

drawBars(data: *, fill: *)

drawBars with given data..

public static

drawLine(data: *, lwidth: *, dash: *, fill: *)

drawLine with given Value..@Array lwidth : lineWidth @number dash: default false @bool fill: closeLine to a polygon

public static

drawPoint(coords: *, radius: *, fill: *, image: *, rotate: *, text: *)

draw Circle with given x, y.

public static

drawRect(bbox: *, fill: boolean)

drawRect with given BBox{minX, minY, maxX, maxY}

public static

init(ele: *)

public static

restore(coords: *)

public static

rotateCtx(coords: *, rotate: *)

rotate by the obj! first save ctx and translate to the obj center..

public static

setFill(colorStr: *)

set ctx.fillStyle with rgba().

public static

setStroke(colorStr: *)

set ctx.strokeStyle with rgba() @string

public static

setWidth(pixel: *)

set ctx.strokeWidth and lineWidth.

Static Public Methods

public static clearCanv() source

public static drawBar(x: *, width: *, value: *, fill: *) source

drawBar with given Value.. x: where to draw in X axis.. width: bar width, value: bar y value. fill: fill or stroke. default false.

Params:

NameTypeAttributeDescription
x *
width *
value *
fill *

public static drawBars(data: *, fill: *) source

drawBars with given data.. width: bar width, data: Array of values.. fill: fill or stroke. default false.

Params:

NameTypeAttributeDescription
data *
fill *

public static drawLine(data: *, lwidth: *, dash: *, fill: *) source

drawLine with given Value..@Array lwidth : lineWidth @number dash: default false @bool fill: closeLine to a polygon

Params:

NameTypeAttributeDescription
data *
lwidth *
dash *
fill *

public static drawPoint(coords: *, radius: *, fill: *, image: *, rotate: *, text: *) source

draw Circle with given x, y. radius: radius of Circle @number fill @bool

Params:

NameTypeAttributeDescription
coords *
radius *
fill *
image *
rotate *
text *

public static drawRect(bbox: *, fill: boolean) source

drawRect with given BBox{minX, minY, maxX, maxY}

Params:

NameTypeAttributeDescription
bbox *
fill boolean
  • optional
  • default: false

public static init(ele: *) source

Params:

NameTypeAttributeDescription
ele *

public static restore(coords: *) source

Params:

NameTypeAttributeDescription
coords *

public static rotateCtx(coords: *, rotate: *) source

rotate by the obj! first save ctx and translate to the obj center.. draw obj after ctx rotate !! then translate back and retore

Params:

NameTypeAttributeDescription
coords *
rotate *

public static setFill(colorStr: *) source

set ctx.fillStyle with rgba(). @string

Params:

NameTypeAttributeDescription
colorStr *

public static setStroke(colorStr: *) source

set ctx.strokeStyle with rgba() @string

Params:

NameTypeAttributeDescription
colorStr *

public static setWidth(pixel: *) source

set ctx.strokeWidth and lineWidth. @number

Params:

NameTypeAttributeDescription
pixel *