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/
8 YUI.add('series-combo', function (Y, NAME) {
11 * Provides functionality for creating a combo series.
14 * @submodule series-combo
17 * The ComboSeries class renders a combination of lines, plots and area fills in a single series.
18 * Each series type has a corresponding boolean attribute indicating if it is rendered. By default,
19 * lines and plots are rendered and area is not.
22 * @extends CartesianSeries
27 * @param {Object} config (optional) Configuration parameters.
28 * @submodule series-combo
30 Y.ComboSeries = Y.Base.create("comboSeries", Y.CartesianSeries, [Y.Fills, Y.Lines, Y.Plots], {
38 drawSeries: function()
40 if(this.get("showAreaFill"))
42 this.drawFill.apply(this, this._getClosingPoints());
44 if(this.get("showLines"))
48 if(this.get("showMarkers"))
57 * @method _toggleVisible
58 * @param {Boolean} visible indicates visibilitye
61 _toggleVisible: function(visible)
67 if(this.get("showAreaFill") && this._path)
69 this._path.set("visible", visible);
71 if(this.get("showLines") && this._lineGraphic)
73 this._lineGraphic.set("visible", visible);
75 if(this.get("showMarkers"))
77 markers = this.get("markers");
87 marker.set("visible", visible);
97 * Returns the default hash for the `styles` attribute.
99 * @method _getDefaultStyles
102 _getDefaultStyles: function()
104 var styles = Y.ComboSeries.superclass._getDefaultStyles();
105 styles.line = this._getLineDefaults();
106 styles.marker = this._getPlotDefaults();
107 styles.area = this._getAreaDefaults();
114 * Read-only attribute indicating the type of series.
125 * Indicates whether a fill is displayed.
127 * @attribute showAreaFill
136 * Indicates whether lines are displayed.
138 * @attribute showLines
147 * Indicates whether markers are displayed.
149 * @attribute showMarkers
158 * Reference to the styles of the markers. These styles can also
159 * be accessed through the `styles` attribute. Below are default
162 * <dt>fill</dt><dd>A hash containing the following values:
164 * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the
165 * graph. The color will be retrieved from the below array:<br/>
166 * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`
168 * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>
171 * <dt>border</dt><dd>A hash containing the following values:
173 * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph.
174 * The color will be retrieved from the below array:<br/>
175 * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`
176 * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>
177 * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>
180 * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>
181 * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>
182 * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default
183 * values for each style is null. When an over style is not set, the non-over value will be used. For example,
184 * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>
194 return this.get("styles").marker;
196 setter: function(val)
198 this.set("styles", {marker:val});
203 * Reference to the styles of the lines. These styles can also be accessed through the `styles` attribute.
204 * Below are the default values:
206 * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color
207 * will be retrieved from the following array:
208 * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`
209 * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>
210 * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>
211 * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd>
212 * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>
213 * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>
214 * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value
215 * between points. The default value is true.</dd>
216 * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default
217 * value is solid.</dd>
218 * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default
220 * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default
231 return this.get("styles").line;
233 setter: function(val)
235 this.set("styles", {line:val});
240 * Reference to the styles of the area fills. These styles can also be accessed through the `styles` attribute.
241 * Below are the default values:
244 * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the
245 * graph. The color will be retrieved from the following array:
246 * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`
248 * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>
258 return this.get("styles").area;
260 setter: function(val)
262 this.set("styles", {area:val});
267 * Style properties for the series. Contains a key indexed hash of the following:
269 * <dt>marker</dt><dd>Style properties for the markers in the series. Specific style attributes are listed
270 * <a href="#attr_marker">here</a>.</dd>
271 * <dt>line</dt><dd>Style properties for the lines in the series. Specific
272 * style attributes are listed <a href="#attr_line">here</a>.</dd>
273 * <dt>area</dt><dd>Style properties for the area fills in the series. Specific style attributes are listed
274 * <a href="#attr_area">here</a>.</dd>
290 }, '3.13.0', {"requires": ["series-cartesian", "series-line-util", "series-plot-util", "series-fill-util"]});