CartesianSeries.js revision 14bfa36e35102dbf271dcff98f773a01c75bd503
39c4970fb513131af091c2d6404e41437c45fc82Matt Sweeney * The CartesianSeries class creates a chart with horizontal and vertical axes.
39c4970fb513131af091c2d6404e41437c45fc82Matt Sweeney * @module charts
39c4970fb513131af091c2d6404e41437c45fc82Matt Sweeney * @class CartesianSeries
39c4970fb513131af091c2d6404e41437c45fc82Matt Sweeney * @extends Base
39c4970fb513131af091c2d6404e41437c45fc82Matt Sweeney * @uses Renderer
39c4970fb513131af091c2d6404e41437c45fc82Matt Sweeney * @constructor
39c4970fb513131af091c2d6404e41437c45fc82Matt SweeneyY.CartesianSeries = Y.Base.create("cartesianSeries", Y.Base, [Y.Renderer], {
39c4970fb513131af091c2d6404e41437c45fc82Matt Sweeney * Storage for `xDisplayName` attribute.
39c4970fb513131af091c2d6404e41437c45fc82Matt Sweeney * @property _xDisplayName
39c4970fb513131af091c2d6404e41437c45fc82Matt Sweeney * @type String
39c4970fb513131af091c2d6404e41437c45fc82Matt Sweeney * Storage for `yDisplayName` attribute.
_yDisplayName: null,
_leftOrigin: null,
_bottomOrigin: null,
render: function()
this._setCanvas();
this.addListeners();
this.validate();
addListeners: function()
if(xAxis)
if(yAxis)
if(axesReady)
this.draw();
if(axesReady)
this.draw();
if(axesReady)
this.draw();
_xAxisChangeHandler: function(e)
_yAxisChangeHandler: function(e)
if(axesReady)
this.draw();
if(axesReady)
this.draw();
* Checks to ensure that both xAxis and yAxis data are available. If so, set the `xData` and `yData` attributes and return `true`. Otherwise, return `false`.
_updateAxisData: function()
validate: function()
this.draw();
_setCanvas: function()
setAreaData: function()
xcoords = [],
ycoords = [],
xMarkerPlane = [],
yMarkerPlane = [],
for (; i < dataLength; ++i)
draw: function()
if((isFinite(w) && isFinite(h) && w > 0 && h > 0) && ((this.get("xData") && this.get("yData")) || this._updateAxisData()))
if(this._drawing)
this._callLater = true;
this._drawing = true;
this._callLater = false;
this.setAreaData();
this.drawSeries();
this._drawing = false;
if(this._callLater)
this.draw();
_getDefaultStyles: function()
return {padding:{
_defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],
_defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],
_defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],
* Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.
_defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],
var colors = {
if(index >= l)
_handleVisibleChange: function(e)
getTotalValues: function()
return total;
destructor: function()
if(this._path)
if(this._lineGraphic)
this._lineGraphic = null;
ATTRS: {
xDisplayName: {
getter: function()
return val;
yDisplayName: {
getter: function()
return val;
readOnly: true,
getter: function()
readOnly: true,
getter: function()
type: {
order: {},
graphOrder: {},
xcoords: {},
ycoords: {},
chart: {
readOnly: true,
getter: function()
graph: {},
xAxis: {},
yAxis: {},
xKey: {
yKey: {
xData: {},
yData: {},
rendered: {
value: false
width: {
readOnly: true,
getter: function()
height: {
readOnly: true,
getter: function()
visible: {
value: true
xMarkerPlane: {},
yMarkerPlane: {},
getter: function() {
return this._defaultPlaneOffset;
getter: function() {
return this._defaultPlaneOffset;
direction: {
* Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.
groupMarkers: {
getter: function()
return this._groupMarkers;
return val;