API Docs for: 3.17.2
Show:

File: graphics/js/SVGPieSlice.js

  1. /**
  2. * Draws pie slices
  3. *
  4. * @module graphics
  5. * @class SVGPieSlice
  6. * @constructor
  7. */
  8. SVGPieSlice = function()
  9. {
  10. SVGPieSlice.superclass.constructor.apply(this, arguments);
  11. };
  12. SVGPieSlice.NAME = "svgPieSlice";
  13. Y.extend(SVGPieSlice, Y.SVGShape, Y.mix({
  14. /**
  15. * Indicates the type of shape
  16. *
  17. * @property _type
  18. * @type String
  19. * @private
  20. */
  21. _type: "path",
  22.  
  23. /**
  24. * Change event listener
  25. *
  26. * @private
  27. * @method _updateHandler
  28. */
  29. _draw: function()
  30. {
  31. var x = this.get("cx"),
  32. y = this.get("cy"),
  33. startAngle = this.get("startAngle"),
  34. arc = this.get("arc"),
  35. radius = this.get("radius");
  36. this.clear();
  37. this.drawWedge(x, y, startAngle, arc, radius);
  38. this.end();
  39. }
  40. }, Y.SVGDrawing.prototype));
  41. SVGPieSlice.ATTRS = Y.mix({
  42. cx: {
  43. value: 0
  44. },
  45.  
  46. cy: {
  47. value: 0
  48. },
  49. /**
  50. * Starting angle in relation to a circle in which to begin the pie slice drawing.
  51. *
  52. * @config startAngle
  53. * @type Number
  54. */
  55. startAngle: {
  56. value: 0
  57. },
  58.  
  59. /**
  60. * Arc of the slice.
  61. *
  62. * @config arc
  63. * @type Number
  64. */
  65. arc: {
  66. value: 0
  67. },
  68.  
  69. /**
  70. * Radius of the circle in which the pie slice is drawn
  71. *
  72. * @config radius
  73. * @type Number
  74. */
  75. radius: {
  76. value: 0
  77. }
  78. }, Y.SVGShape.ATTRS);
  79. Y.SVGPieSlice = SVGPieSlice;
  80.