API Docs for: 3.8.0
Show:

File: charts/js/AreaSeries.js

  1. /**
  2.  * The AreaSeries class renders quantitative data on a graph by creating a fill between 0
  3.  * and the relevant data points.
  4.  *
  5.  * @module charts
  6.  * @submodule charts-base
  7.  * @class AreaSeries
  8.  * @extends CartesianSeries
  9.  * @uses Fills
  10.  * @constructor
  11.  */
  12. Y.AreaSeries = Y.Base.create("areaSeries", Y.CartesianSeries, [Y.Fills], {
  13.     /**
  14.      * @protected
  15.      *
  16.      * Renders the series.
  17.      *
  18.      * @method drawSeries
  19.      */
  20.     drawSeries: function()
  21.     {
  22.         this.drawFill.apply(this, this._getClosingPoints());
  23.     },

  24.     /**
  25.      * @protected
  26.      *
  27.      * Method used by `styles` setter. Overrides base implementation.
  28.      *
  29.      * @method _setStyles
  30.      * @param {Object} newStyles Hash of properties to update.
  31.      * @return Object
  32.      */
  33.     _setStyles: function(val)
  34.     {
  35.         if(!val.area)
  36.         {
  37.             val = {area:val};
  38.         }
  39.         return Y.AreaSeries.superclass._setStyles.apply(this, [val]);
  40.     },

  41.     /**
  42.      * @protected
  43.      *
  44.      * Gets the default value for the `styles` attribute. Overrides
  45.      * base implementation.
  46.      *
  47.      * @method _getDefaultStyles
  48.      * @return Object
  49.      */
  50.     _getDefaultStyles: function()
  51.     {
  52.         var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());
  53.         return styles;
  54.     }
  55. },
  56. {
  57.     ATTRS: {
  58.         /**
  59.          * Read-only attribute indicating the type of series.
  60.          *
  61.          * @attribute type
  62.          * @type String
  63.          * @default area
  64.          */
  65.         type: {
  66.             value:"area"
  67.         }

  68.         /**
  69.          * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:
  70.          *
  71.          *  <dl>
  72.          *      <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be
  73.          *      retrieved from the following array:
  74.          *      `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`
  75.          *      </dd>
  76.          *      <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>
  77.          *  </dl>
  78.          *
  79.          * @attribute styles
  80.          * @type Object
  81.          */
  82.     }
  83. });







  84.