src/cm/media/js/lib/yui/yui_3.10.3/build/series-range/series-range-debug.js
changeset 525 89ef5ed3c48b
equal deleted inserted replaced
524:322d0feea350 525:89ef5ed3c48b
       
     1 /*
       
     2 YUI 3.10.3 (build 2fb5187)
       
     3 Copyright 2013 Yahoo! Inc. All rights reserved.
       
     4 Licensed under the BSD License.
       
     5 http://yuilibrary.com/license/
       
     6 */
       
     7 
       
     8 YUI.add('series-range', function (Y, NAME) {
       
     9 
       
    10 /**
       
    11  * Provides functionality for creating a range series.
       
    12  *
       
    13  * @module charts
       
    14  * @submodule series-range
       
    15  */
       
    16 
       
    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()
       
    32 {
       
    33     RangeSeries.superclass.constructor.apply(this, arguments);
       
    34 }
       
    35 
       
    36 RangeSeries.NAME = "rangeSeries";
       
    37 
       
    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     },
       
    49 
       
    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     }
       
    66 };
       
    67 
       
    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 });
       
    93 
       
    94 Y.RangeSeries = RangeSeries;
       
    95 
       
    96 
       
    97 
       
    98 
       
    99 }, '3.10.3', {"requires": ["series-cartesian"]});