Yahoo! UI Library

charts  3.3.0

Yahoo! UI Library > charts > CanvasGraphics
Search:
 
Filters

Class CanvasGraphics

CanvasGraphics is a fallback drawing api used for basic drawing operations when SVG is not available.

Constructor

CanvasGraphics ( )

Properties

node - private object

Reference to the node for the graphics object

Methods

_createGraphicNode

private _createGraphicNode ( type , pe )
Creates a graphic node
Parameters:
type <String> node type to create
pe <String> specified pointer-events value
Returns:
HTMLElement

_removeChildren

private void _removeChildren ( node )
Removes all child nodes.
Parameters:
node <HTMLElement>

_trackSize

private void _trackSize ( w , h )
Updates the size of the graphics object
Parameters:
w <Number> width
h <Number> height

destroy

void destroy ( )
Removes all nodes.

render

void render ( parentNode )
Adds the graphics node to the dom.
Parameters:
parentNode <HTMLElement> node in which to render the graphics node into.

setPosition

void setPosition ( x , y )
Sets the positon of the graphics object.
Parameters:
x <Number> x-coordinate for the object.
y <Number> y-coordinate for the object.

setSize

void setSize ( w , h )
Sets the size of the graphics object.
Parameters:
w <Number> width to set for the instance.
h <Number> height to set for the instance.

toggleVisible

void toggleVisible ( val )
Shows and and hides a the graphic instance.
Parameters:
val <Boolean> indicates whether the instance should be visible.


Copyright © 2011 Yahoo! Inc. All rights reserved.