NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / series-range / series-range-debug.js
blob24281d86a5ad35f29649b669a357f2d19ed36e98
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-range', function (Y, NAME) {
10 /**
11  * Provides functionality for creating a range series.
12  *
13  * @module charts
14  * @submodule series-range
15  */
17 /**
18  * An abstract class for creating range series instances.
19  * RangeSeries is used by the following classes:
20  * <ul>
21  *      <li>{{#crossLink "CandlestickSeries"}}{{/crossLink}}</li>
22  *      <li>{{#crossLink "OHLCSeries"}}{{/crossLink}}</li>
23  *  </ul>
24  *
25  * @class RangeSeries
26  * @extends CartesianSeries
27  * @constructor
28  * @param {Object} config (optional) Configuration parameters.
29  * @submodule series-range
30  */
31 function RangeSeries()
33     RangeSeries.superclass.constructor.apply(this, arguments);
36 RangeSeries.NAME = "rangeSeries";
38 RangeSeries.ATTRS = {
39     /**
40      * Read-only attribute indicating the type of series.
41      *
42      * @attribute type
43      * @type String
44      * @default range
45      */
46     type: {
47         value: "range"
48     },
50     /**
51      * Values to be used for open, high, low and close keys.
52      *
53      * @attribute ohlc
54      * @type Object
55      */
56     ohlckeys: {
57         valueFn: function() {
58             return {
59                 open: "open",
60                 high: "high",
61                 low: "low",
62                 close: "close"
63             };
64         }
65     }
68 Y.extend(RangeSeries, Y.CartesianSeries, {
69     /**
70      * Draws the series.
71      *
72      * @method drawSeries
73      * @protected
74      */
75     drawSeries: function()
76     {
77         var xcoords = this.get("xcoords"),
78             ycoords = this.get("ycoords"),
79             styles = this.get("styles"),
80             padding = styles.padding,
81             len = xcoords.length,
82             dataWidth = this.get("width") - (padding.left + padding.right),
83             keys = this.get("ohlckeys"),
84             opencoords = ycoords[keys.open],
85             highcoords = ycoords[keys.high],
86             lowcoords = ycoords[keys.low],
87             closecoords = ycoords[keys.close],
88             width = dataWidth/len,
89             halfwidth = width/2;
90         this._drawMarkers(xcoords, opencoords, highcoords, lowcoords, closecoords, len, width, halfwidth, styles);
91     }
92 });
94 Y.RangeSeries = RangeSeries;
99 }, '3.13.0', {"requires": ["series-cartesian"]});