# Yahoo! UI Library

### charts 3.3.0

Yahoo! UI Library > charts > Shape
Search:
Filters Show Private Show Protected Show Deprecated

## Class Shape - extends Graphic

The Shape class creates a graphic object with editable properties.

### Constructor

Shape `( )`

### Properties

#### _typeConversionHash - `private Object`

Used to convert shape declarations to the appropriate node type.

#### autoSize - `string`

Indicates whether or not the instance will size itself based on its contents.

#### pointerEvents - `string`

Determines whether the instance will receive mouse events.

#### type - `string`

Indicates the type of shape.

#### Properties inherited from Graphic:

`autoSize`

### Methods

#### _addBorder

`private void _addBorder ( )`
Adds a border to the shape node.

#### _addFill

`private void _addFill ( )`
Adds a fill to the shape node.

#### _draw

`private void _draw ( )`
Draws the graphic.

#### _getNodeShapeType

`private _getNodeShapeType ( type )`
Converts a shape type to the appropriate node attribute.

Parameters:
  `type <String>` The type of shape.

Returns: ``
  String

#### _initialize

`private void _initialize ( )`
Initializes the graphic instance.

#### _setPath

`private void _setPath ( )`
Adds a path to the shape node.

#### _setProps

`private void _setProps ( cfg )`
Updates properties for the shape.

Parameters:
  `cfg <Object>` Properties to update.

#### addClass

`void addClass ( className )`
Adds a class to the shape's node.

Parameters:
  `className <String>` Name of the class to add.

#### end

`void end ( )`
Completes a drawing operation.

#### setPosition

`void setPosition ( , )`
Positions the parent node of the shape.

Parameters:
  `, <Number>` x The x-coordinate
  `, <Number>` y The y-coordinate

#### toggleVisible

`void toggleVisible ( val )`
Sets the visibility of a shape.

Parameters:
  `val <Boolean>` indicates whether or not the shape is visible.

#### update

`void update ( cfg )`
Updates the properties of the shape instance.

Parameters:
  `cfg <Object>` Object literal containing properties to update.

#### Methods inherited from Graphic:

`_clearPath, _createGraphicNode, _createGraphics, _draw, _getFill, _getLinearGradient, _getWedgePath, _initProps, _removeChildren, _styleGroup, _toggleVisible, _trackSize, beginBitmapFill, beginFill, beginGradientFill, clear, curveTo, destroy, drawCircle, drawEllipse, drawRect, drawWedge, end, getShape, initializer, lineGradientStyle, lineStyle, lineTo, moveTo, quadraticCurveTo, render, setPosition, setSize, toggleVisible`

Copyright © 2011 Yahoo! Inc. All rights reserved.