NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / series-area / series-area.js
blob0c6da5e01bd902c882a2b37e3ac03caab8951c69
1 /*
2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 YUI.add('series-area', function (Y, NAME) {
10 /**
11  * Provides functionality for creating a area series.
12  *
13  * @module charts
14  * @submodule series-area
15  */
16 /**
17  * The AreaSeries class renders quantitative data on a graph by creating a fill between 0
18  * and the relevant data points.
19  *
20  * @class AreaSeries
21  * @extends CartesianSeries
22  * @uses Fills
23  * @constructor
24  * @param {Object} config (optional) Configuration parameters.
25  * @submodule series-area
26  */
27 Y.AreaSeries = Y.Base.create("areaSeries", Y.CartesianSeries, [Y.Fills], {
28     /**
29      * @protected
30      *
31      * Renders the series.
32      *
33      * @method drawSeries
34      */
35     drawSeries: function()
36     {
37         this.drawFill.apply(this, this._getClosingPoints());
38     },
40     /**
41      * @protected
42      *
43      * Method used by `styles` setter. Overrides base implementation.
44      *
45      * @method _setStyles
46      * @param {Object} newStyles Hash of properties to update.
47      * @return Object
48      */
49     _setStyles: function(val)
50     {
51         if(!val.area)
52         {
53             val = {area:val};
54         }
55         return Y.AreaSeries.superclass._setStyles.apply(this, [val]);
56     },
58     /**
59      * @protected
60      *
61      * Gets the default value for the `styles` attribute. Overrides
62      * base implementation.
63      *
64      * @method _getDefaultStyles
65      * @return Object
66      */
67     _getDefaultStyles: function()
68     {
69         var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());
70         return styles;
71     }
74     ATTRS: {
75         /**
76          * Read-only attribute indicating the type of series.
77          *
78          * @attribute type
79          * @type String
80          * @default area
81          */
82         type: {
83             value:"area"
84         }
86         /**
87          * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:
88          *
89          *  <dl>
90          *      <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
91          *      retrieved from the following array:
92          *      `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`
93          *      </dd>
94          *      <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>
95          *  </dl>
96          *
97          * @attribute styles
98          * @type Object
99          */
100     }
110 }, '3.13.0', {"requires": ["series-cartesian", "series-fill-util"]});