    import Canvas from 'mapbox-plugins/src/chart/canvas.js'

public class | source

# Canvas

## Static Method Summary

Static Public Methods
public static | clearCanv() |
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:

Name | Type | Attribute | Description
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:

Name | Type | Attribute | Description
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:

Name | Type | Attribute | Description
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:

Name | Type | Attribute | Description
coords | * |  |
radius | * |  |
fill | * |  |
image | * |  |
rotate | * |  |
text | * |  |

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

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

#### Params:

Name | Type | Attribute | Description
bbox | * |  |
fill | boolean | optional default: false |

### public static init(ele: *) source

#### Params:

Name | Type | Attribute | Description
ele | * |  |

### public static restore(coords: *) source

#### Params:

Name | Type | Attribute | Description
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:

Name | Type | Attribute | Description
coords | * |  |
rotate | * |  |

### public static setFill(colorStr: *) source

set ctx.fillStyle with rgba(). @string

#### Params:

Name | Type | Attribute | Description
colorStr | * |  |

### public static setStroke(colorStr: *) source

set ctx.strokeStyle with rgba() @string

#### Params:

Name | Type | Attribute | Description
colorStr | * |  |

### public static setWidth(pixel: *) source

set ctx.strokeWidth and lineWidth. @number

#### Params:

Name | Type | Attribute | Description
pixel | * |  |