CanvasPieSlice.js revision cff2b8ec796b9316395b305e8867408a6d7c3549
/**
* Draws pie slices
*/
CanvasPieSlice = function()
{
CanvasPieSlice.superclass.constructor.apply(this, arguments);
};
CanvasPieSlice.NAME = "canvasPieSlice";
Y.extend(CanvasPieSlice, Y.CanvasPath, {
/**
* Indicates the type of shape
*
* @property _type
* @readOnly
* @type String
*/
_type: "path",
/**
* Change event listener
*
* @private
* @method _updateHandler
*/
_updateHandler: function(e)
{
var x = this.get("cx"),
y = this.get("cy"),
startAngle = this.get("startAngle"),
arc = this.get("arc"),
radius = this.get("radius");
this.clear();
this._left = x;
this._right = radius;
this._top = y;
this._bottom = radius;
this.drawWedge(x, y, startAngle, arc, radius);
this._draw();
}
});
CanvasPieSlice.ATTRS = Y.mix(Y.CanvasPath.ATTRS, {
cx: {
value: 0
},
cy: {
value: 0
},
/**
* Starting angle in relation to a circle in which to begin the pie slice drawing.
*
* @attribute startAngle
* @type Number
*/
startAngle: {
value: 0
},
/**
* Arc of the slice.
*
* @attribute arc
* @type Number
*/
arc: {
value: 0
},
/**
* Radius of the circle in which the pie slice is drawn
*
* @attribute radius
* @type Number
*/
radius: {
value: 0
}
});
Y.CanvasPieSlice = CanvasPieSlice;