charts.js revision e393eced613f9b4a5fb6bdd461d0e0bf5064d5ec
};
autoSize: true,
initializer: function(config) {
{
this._styleGroup(this.node);
}
else
{
this.node = this._createGraphics();
this.setSize(w, h);
}
this._initProps();
},
/**
*Specifies a bitmap fill used by subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object.
*/
beginBitmapFill: function(config) {
var fill = {};
this._fillProps = fill;
{
this._gradientBox = {
};
}
else
{
this._gradientBox = null;
}
},
/**
* Specifes a solid fill used by subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object.
*/
if (color) {
this._fillColor = color;
this._fillType = 'solid';
this._fill = 1;
}
return this;
},
/**
*Specifies a gradient fill used by subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object.
*/
beginGradientFill: function(config) {
if(!this._defs)
{
}
this._fillAlphas = alphas;
return this;
},
/**
* Removes all nodes
*/
destroy: function()
{
this._removeChildren(this.node);
{
}
},
/**
* @private
*/
_removeChildren: function(node)
{
if(node.hasChildNodes())
{
var child;
while(node.firstChild)
{
this._removeChildren(child);
}
}
},
toggleVisible: function(val)
{
},
{
i = 0,
len;
if(children)
{
for(; i < len; ++i)
{
}
}
},
/**
* Clears the graphics object.
*/
clear: function() {
if(this._graphicsList)
{
{
}
}
this.path = '';
},
/**
* Draws a bezier curve
*/
this._shapeType = "path";
{
this._pathType = "C";
this.path += ' C';
}
this.path += Math.round(cp1x) + ", " + Math.round(cp1y) + ", " + Math.round(cp2x) + ", " + Math.round(cp2y) + ", " + x + ", " + y + " ";
this._trackSize(x, y);
},
/**
* Draws a quadratic bezier curve
*/
{
this._pathType = "Q";
this.path += " Q";
}
},
/**
* Draws a circle
*/
drawCircle: function(x, y, r) {
this._shape = {
x:x - r,
y:y - r,
w:r * 2,
h:r * 2
};
this._x = x - r;
this._y = y - r;
this._shapeType = "circle";
this._draw();
},
/**
* Draws an ellipse
*/
drawEllipse: function(x, y, w, h) {
this._shape = {
x:x,
y:y,
w:w,
h:h
};
this._width = w;
this._height = h;
this._x = x;
this._y = y;
this._shapeType = "ellipse";
this._draw();
},
/**
* Draws a rectangle
*/
drawRect: function(x, y, w, h) {
this._shape = {
x:x,
y:y,
w:w,
h:h
};
this._x = x;
this._y = y;
this._width = w;
this._height = h;
this.moveTo(x, y);
this.lineTo(x + w, y);
this.lineTo(x + w, y + h);
this.lineTo(x, y + h);
this.lineTo(x, y);
this._draw();
},
/**
* Draws a rectangle with rounded corners
*/
this._shape = {
x:x,
y:y,
w:w,
h:h
};
this._x = x;
this._y = y;
this._width = w;
this._height = h;
this.quadraticCurveTo(x, y + h, x + ew, y + h);
this.quadraticCurveTo(x + w, y + h, x + w, y + h - eh);
this.quadraticCurveTo(x + w, y, x + w - ew, y);
this.quadraticCurveTo(x, y, x, y + eh);
this._draw();
},
/**
* @private
* Draws a wedge.
*
* @param x x component of the wedge's center point
* @param y y component of the wedge's center point
* @param startAngle starting angle in degrees
* @param arc sweep of the wedge. Negative values draw clockwise.
* @param radius radius of wedge. If [optional] yRadius is defined, then radius is the x radius.
* @param yRadius [optional] y radius for wedge.
*/
{
this._drawingComplete = false;
this.path = this._getWedgePath({x:x, y:y, startAngle:startAngle, arc:arc, radius:radius, yRadius:yRadius});
this._shapeType = "path";
this._draw();
},
end: function() {
if(this._shapeType)
{
this._draw();
}
this._initProps();
},
/**
* @private
* Not implemented
* Specifies a gradient to use for the stroke when drawing lines.
*/
lineGradientStyle: function() {
},
/**
* Specifies a line style used for subsequent calls to drawing methods
*/
this._stroke = 1;
this._strokeWeight = thickness;
if (color) {
this._strokeColor = color;
}
},
/**
* Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates.
*/
i,
len;
}
this._shapeType = "path";
{
this._pathType = "L";
this.path += ' L';
}
for (i = 0; i < len; ++i) {
}
},
/**
* Moves the current drawing position to specified x and y coordinates.
*/
moveTo: function(x, y) {
this._pathType = "M";
},
/**
* @private
* @description Generates a path string for a wedge shape
*/
_getWedgePath: function(config)
{
var x = config.x,
y = config.y,
segs,
ax,
ay,
bx,
by,
cx,
cy,
i = 0,
// limit sweep to reasonable numbers
{
arc = 360;
}
// First we calculate how many segments are needed
// for a smooth arc.
// Now calculate the sweep of each segment.
// The math requires radians rather than degrees. To convert from degrees
// use the formula (degrees/180)*Math.PI to get radians.
// convert angle startAngle to radians
if(segs > 0)
{
// draw a line from the center to the start of the curve
path += " Q";
for(; i < segs; ++i)
{
}
}
return path;
},
/**
* Sets the size of the graphics object
*/
setSize: function(w, h) {
if(this.autoSize)
{
{
}
{
}
}
},
/**
* @private
* Updates the size of the graphics object
*/
_trackSize: function(w, h) {
if (w > this._width) {
this._width = w;
}
if (h > this._height) {
this._height = h;
}
this.setSize(w, h);
},
setPosition: function(x, y)
{
},
/**
* @private
*/
render: function(parentNode) {
this.setSize(w, h);
this._initProps();
return this;
},
/**
* @private
* Clears the properties
*/
_initProps: function() {
this._shape = null;
this._fillColor = null;
this._strokeColor = null;
this._strokeWeight = 0;
this._fillProps = null;
this._fillAlphas = null;
this._fillColors = null;
this._fillType = null;
this._fillRatios = null;
this._fillRotation = null;
this._fillWidth = null;
this._fillHeight = null;
this.path = '';
this._width = 0;
this._height = 0;
this._x = 0;
this._y = 0;
this._fill = null;
this._stroke = 0;
this._stroked = false;
this._pathType = null;
this._attributes = {};
},
/**
* @private
* Clears path properties
*/
_clearPath: function()
{
this._shape = null;
this._shapeType = null;
this.path = '';
this._width = 0;
this._height = 0;
this._x = 0;
this._y = 0;
this._pathType = null;
this._attributes = {};
},
/**
* @private
* Completes a vml shape
*/
_draw: function()
{
i,
if(this.path)
{
if(this._fill)
{
this.path += 'z';
}
}
else
{
for(i in this._attributes)
{
if(this._attributes.hasOwnProperty(i))
{
}
}
}
if(this._strokeColor)
{
}
{
if(this._fillColor)
{
}
else
{
}
}
else if(this._fillType === "linear")
{
}
this._clearPath();
},
/**
* @private
* Returns ths actual fill object to be used in a drawing or shape
*/
_getFill: function() {
fill;
switch (type) {
case 'linear':
break;
case 'radial':
//fill = this._getRadialGradient('fill');
break;
case 'bitmap':
//fill = this._bitmapFill;
break;
}
return fill;
},
/**
* @private
* Returns a linear gradient fill
*/
_getLinearGradient: function(type) {
w = this._fillWidth || (this._shape.w),
h = this._fillHeight || (this._shape.h),
r = this[prop + 'Rotation'],
i,
l,
def,
stop,
cx = w/2,
cy = h/2,
/*
if(r > 0 && r < 90)
{
r *= h/w;
}
else if(r > 90 && r < 180)
{
r = 90 + ((r-90) * w/h);
}
*/
{
if(r < 180)
{
y1 = 0;
y2 = h;
}
else
{
y1 = h;
y2 = 0;
}
}
else
{
if(r > 90 && r < 270)
{
x1 = w;
x2 = 0;
}
else
{
x1 = 0;
x2 = w;
}
}
/*
fill.setAttribute("spreadMethod", "pad");
fill.setAttribute("x1", Math.round(100 * x1/w) + "%");
fill.setAttribute("y1", Math.round(100 * y1/h) + "%");
fill.setAttribute("x2", Math.round(100 * x2/w) + "%");
fill.setAttribute("y2", Math.round(100 * y2/h) + "%");
*/
def = 0;
for(i = 0; i < l; ++i)
{
def = (i + 1) / l;
}
return fill;
},
/**
* @private
* Creates a group element
*/
_createGraphics: function() {
this._styleGroup(group);
return group;
},
_styleGroup: function(group)
{
},
/**
* @private
* Creates a vml node.
*/
{
v = pe || "none";
{
}
if(type != "svg")
{
if(!this._graphicsList)
{
this._graphicsList = [];
}
}
return node;
},
/**
* Returns a shape.
*/
}
};
var VMLGraphics = function(config) {
};
VMLGraphics.prototype = {
initializer: function(config) {
this.node = this._createGraphics();
this.setSize(w, h);
this._initProps();
},
/**
*Specifies a bitmap fill used by subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object.
*/
beginBitmapFill: function(config) {
var fill = {};
this._fillProps = fill;
{
this._gradientBox = {
};
}
else
{
this._gradientBox = null;
}
},
/**
* Specifes a solid fill used by subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object.
*/
if (color) {
this._fillProps = {
type:"solid",
};
}
this._fillColor = color;
this._fill = 1;
}
return this;
},
/**
*Specifies a gradient fill used by subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object.
*/
beginGradientFill: function(config) {
fill = {
},
i = 0,
oi,
for(;i < len; ++i)
{
}
if(type === "linear")
{
if(config)
{
}
{
}
else if(rotation <= 270)
{
}
else if(rotation <= 360)
{
}
else
{
rotation = 270;
}
}
else if(type === "radial")
{
fill.alignshape = false;
}
{
this._gradientBox = {
};
}
else
{
this._gradientBox = null;
}
this._fillProps = fill;
},
/**
* Clears the graphics object.
*/
clear: function() {
this._path = '';
this._removeChildren(this.node);
},
/**
* Removes all nodes
*/
destroy: function()
{
this._removeChildren(this.node);
},
/**
* @private
*/
_removeChildren: function(node)
{
if(node.hasChildNodes())
{
var child;
while(node.firstChild)
{
this._removeChildren(child);
}
}
},
toggleVisible: function(val)
{
},
{
i = 0,
len;
if(children)
{
for(; i < len; ++i)
{
}
}
},
/**
* Draws a bezier curve
*/
this._shape = "shape";
this._path += ' c ' + Math.round(cp1x) + ", " + Math.round(cp1y) + ", " + Math.round(cp2x) + ", " + Math.round(cp2y) + ", " + x + ", " + y;
this._trackSize(x, y);
},
/**
* Draws a quadratic bezier curve
*/
},
/**
* Draws a circle
*/
drawCircle: function(x, y, r) {
this._x = x - r;
this._y = y - r;
this._shape = "oval";
//this._path += ' ar ' + this._x + ", " + this._y + ", " + (this._x + this._width) + ", " + (this._y + this._height) + ", " + this._x + " " + this._y + ", " + this._x + " " + this._y;
this._draw();
},
/**
* Draws an ellipse
*/
drawEllipse: function(x, y, w, h) {
this._width = w;
this._height = h;
this._x = x;
this._y = y;
this._shape = "oval";
//this._path += ' ar ' + this._x + ", " + this._y + ", " + (this._x + this._width) + ", " + (this._y + this._height) + ", " + this._x + " " + this._y + ", " + this._x + " " + this._y;
this._draw();
},
/**
* Draws a rectangle
*/
drawRect: function(x, y, w, h) {
this._x = x;
this._y = y;
this._width = w;
this._height = h;
this.moveTo(x, y);
this.lineTo(x + w, y);
this.lineTo(x + w, y + h);
this.lineTo(x, y + h);
this.lineTo(x, y);
this._draw();
},
/**
* Draws a rectangle with rounded corners
*/
this._x = x;
this._y = y;
this._width = w;
this._height = h;
this.quadraticCurveTo(x, y + h, x + ew, y + h);
this.quadraticCurveTo(x + w, y + h, x + w, y + h - eh);
this.quadraticCurveTo(x + w, y, x + w - ew, y);
this.quadraticCurveTo(x, y, x, y + eh);
this._draw();
},
{
this._drawingComplete = false;
this._path += this._getWedgePath({x:x, y:y, startAngle:startAngle, arc:arc, radius:radius, yRadius:yRadius});
this._shape = "shape";
this._draw();
},
/**
* @private
* @description Generates a path string for a wedge shape
*/
_getWedgePath: function(config)
{
var x = config.x,
y = config.y,
path;
{
arc = 360;
}
startAngle *= -65535;
arc *= 65536;
path = " m " + x + " " + y + " ae " + x + " " + y + " " + radius + " " + yRadius + " " + startAngle + " " + arc;
return path;
},
end: function() {
if(this._shape)
{
this._draw();
}
this._initProps();
},
/**
* @private
* Not implemented
* Specifies a gradient to use for the stroke when drawing lines.
*/
lineGradientStyle: function() {
},
/**
* Specifies a line style used for subsequent calls to drawing methods
*/
this._stroke = 1;
this._strokeColor = color;
},
/**
* Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates.
*/
i,
len;
}
this._shape = "shape";
this._path += ' l ';
for (i = 0; i < len; ++i) {
}
},
/**
* Moves the current drawing position to specified x and y coordinates.
*/
moveTo: function(x, y) {
},
/**
* Sets the size of the graphics object
*/
setSize: function(w, h) {
w = Math.round(w);
h = Math.round(h);
this._canvasWidth = w;
this._canvasHeight = h;
},
setPosition: function(x, y)
{
x = Math.round(x);
y = Math.round(y);
},
/**
* @private
*/
render: function(parentNode) {
this.setSize(w, h);
this._initProps();
return this;
},
/**
* @private
* Reference to current vml shape
*/
_shape: null,
/**
* @private
* Updates the size of the graphics object
*/
_trackSize: function(w, h) {
if (w > this._width) {
this._width = w;
}
if (h > this._height) {
this._height = h;
}
},
/**
* @private
* Clears the properties
*/
_initProps: function() {
this._fillColor = null;
this._strokeColor = null;
this._strokeOpacity = null;
this._strokeWeight = 0;
this._fillProps = null;
this._path = '';
this._width = 0;
this._height = 0;
this._x = 0;
this._y = 0;
this._fill = null;
this._stroke = 0;
this._stroked = false;
},
/**
* @private
* Clears path properties
*/
_clearPath: function()
{
this._shape = null;
this._path = '';
this._width = 0;
this._height = 0;
this._x = 0;
this._y = 0;
},
/**
* @private
* Completes a vml shape
*/
_draw: function()
{
fillProps = this._fillProps;
this.setSize(w, h);
if(this._path)
{
if(this._fill || this._fillProps)
{
this._path += ' x';
}
if(this._stroke)
{
this._path += ' e';
}
}
else
{
}
if (this._fill) {
}
else
{
}
{
}
} else {
}
if (fillProps) {
}
this._clearPath();
},
/**
* @private
* Returns ths actual fill object to be used in a drawing or shape
*/
_getFill: function() {
w = this._width,
h = this._height,
fillProps = this._fillProps,
prop,
pct,
i = 0,
colorstring = "",
len,
cx = 50,
cy = 50;
if(this._gradientBox)
{
cx= Math.round( (this._gradientBox.width/2 - ((this._x - this._gradientBox.tx) * hyp/w))/(w * w/hyp) * 100);
cy = Math.round( (this._gradientBox.height/2 - ((this._y - this._gradientBox.ty) * hyp/h))/(h * h/hyp) * 100);
}
{
for(;i < len; ++i) {
}
{
}
}
}
}
{
}
return fill;
},
/**
* @private
* Creates a group element
*/
_createGraphics: function() {
return group;
},
/**
* @private
* Creates a vml node.
*/
_createGraphicNode: function(type)
{
return document.createElement('<' + type + ' xmlns="urn:schemas-microsft.com:vml" class="vml' + type + '"/>');
},
_getNodeShapeType: function(type)
{
var shape = "shape";
{
}
return shape;
},
circle: "oval",
ellipse: "oval",
rect: "rect"
},
/**
* Returns a shape.
*/
},
{
}
};
if(!document.createElementNS)
{
Y.Graphic = VMLGraphics;
}
{
this._initialize(cfg);
this._draw();
}
type: "shape",
autoSize: false,
pointerEvents: "visiblePainted",
_initialize: function(cfg)
{
{
}
},
{
},
_draw: function()
{
var cx,
cy,
rx,
ry,
parentNode = this.parentNode,
borderWeight = 0,
if(!this.node)
{
}
if(this.nodetype == "path")
{
if(this.type == "wedge")
{
}
this._setPath();
}
{
}
this._addBorder();
if(this.nodetype === "ellipse")
{
rx -= borderWeight;
ry -= borderWeight;
}
else
{
}
this._addFill();
return this;
},
_setPath: function()
{
if(this.path)
{
this.path += " Z";
}
},
_addBorder: function()
{
{
}
else
{
}
},
_addFill: function()
{
var fillAlpha;
{
this.beginGradientFill(this.fill);
}
{
this.beginBitmapFill(this.fill);
}
else
{
{
}
else
{
}
}
},
end: function()
{
this._setPath();
},
{
this._draw();
return this;
},
_getNodeShapeType: function(type)
{
{
}
return type;
},
toggleVisible: function(val)
{
if(this.node)
{
}
},
{
if(node)
{
{
}
else
{
}
}
},
circle: "ellipse",
wedge: "path"
}
});
{
this._initialize(cfg);
this._draw();
}
/**
* Type of shape
*/
type: "shape",
_initialize: function(cfg)
{
{
}
},
width: 0,
height: 0,
/**
* Returns a shape.
*/
},
_draw: function()
{
var path,
borderWeight = 0,
if(this.node)
{
}
else if(!this.node)
{
}
if(this.type === "wedge")
{
if(this.fill)
{
path += ' x';
}
if(this.border)
{
path += ' e';
}
}
this._addBorder();
{
}
this._addFill();
return this;
},
_addBorder: function()
{
{
borderWeight = this.borderWeight;
if(borderAlpha < 1)
{
if(!this._strokeNode)
{
}
}
else if(this._strokeNode)
{
}
}
else
{
}
},
_addFill: function()
{
var fillAlpha;
{
}
{
}
else
{
{
}
else
{
if(this.fillnode)
{
}
}
}
},
{
if(node)
{
}
},
toggleVisible: function(val)
{
if(this.node)
{
}
},
{
this._draw();
return this;
}
};
if (!document.createElementNS) {
}
function Renderer(){}
/**
* Hash of style properties for class
*/
{
getter: function()
{
return this._styles;
},
{
}
},
/**
* The graphic in which the series will be rendered.
*/
graphic: {}
};
/**
* @private
* @description Storage for styles
*/
_styles: null,
/**
* Sets multiple style properties on the instance.
*
* @method _setStyles
* @param {Object} styles Hash of styles to be applied.
*/
_setStyles: function(newstyles)
{
},
/**
* Merges to object literals only overriding properties explicitly.
*
* @private
* @param {Object} newHash hash of properties to set
* @param {Object} default hash of properties to be overwritten
* @return {Object}
*/
_mergeStyles: function(a, b)
{
if(!b)
{
b = {};
}
{
{
}
else
{
}
}, this);
return newstyles;
},
/**
* @private
* @description Default style values.
*/
_getDefaultStyles: function()
{
return {padding:{
top:0,
right: 0,
bottom: 0,
left: 0
}};
}
};
/**
* @private
* @description Handler for data changes.
*/
_dataChangeHandler: function(e)
{
if(this.get("rendered"))
{
this._drawAxis();
}
},
/**
* @private
*/
_updateHandler: function(e)
{
if(this.get("rendered"))
{
this._drawAxis();
}
},
/**
* @private
*/
_positionChangeHandler: function(e)
{
if(position == "none")
{
return;
}
if(this.get("rendered"))
{
this._drawAxis();
}
},
/**
* @private
*/
renderUI: function()
{
{
this._setCanvas();
}
},
/**
* @private
*/
syncUI: function()
{
this._drawAxis();
},
/**
* @private
* Creates a <code>Graphic</code> instance.
*/
_setCanvas: function()
{
p = this.get("position"),
pn = this._parentNode,
w = this.get("width"),
h = this.get("height");
if(p === "top" || p === "bottom")
{
}
else
{
}
},
/**
* @private
* @description Returns the default style values for the axis.
*/
_getDefaultStyles: function()
{
var axisstyles = {
majorTicks: {
display:"inside",
length:4,
color:"#808080",
weight:1,
alpha:1
},
minorTicks: {
display:"none",
length:2,
color:"#808080",
weight:1
},
line: {
weight:1,
color:"#808080",
alpha:1
},
majorUnit: {
determinant:"count",
count:11,
distance:75
},
top: "0px",
left: "0px",
width: "100px",
height: "100px",
label: {
color:"#808080",
alpha: 1,
fontSize:"85%",
rotation: 0,
margin: {
top:4,
right:4,
bottom:4,
left:4
}
},
hideOverlappingLabelTicks: false
};
},
_handleSizeChange: function(e)
{
{
this._drawAxis();
}
},
/**
* @private
* @description Strategy for drawing the axis dependent upon the axis position.
*/
_layout: null,
/**
* @private
* @description Returns the correct _layout class instance to be used for drawing the
* axis.
*/
{
var l;
switch(pos)
{
case "top" :
l = new Y.TopAxisLayout({axisRenderer:this});
break;
case "bottom" :
l = new Y.BottomAxisLayout({axisRenderer:this});
break;
case "left" :
l = new Y.LeftAxisLayout({axisRenderer:this});
break;
case "right" :
l = new Y.RightAxisLayout({axisRenderer:this});
break;
}
return l;
},
/**
* @private
* @description Draws line based on start point, end point and line object.
*/
{
},
/**
* @private
* Basic logic for drawing an axis.
*/
_drawAxis: function ()
{
{
len,
i = 0,
layoutLength = this.getLength();
if(drawTicks)
{
}
if(len < 1)
{
return;
}
this._createLabelCache();
this._tickPoints = [];
for(; i < len; ++i)
{
if(drawTicks)
{
}
label.innerHTML = labelFunction.apply(labelFunctionScope, [this.getLabelByIndex(i, len), labelFormat]);
}
this._clearLabelCache();
if(this.get("overlapGraph"))
{
}
for(i = 0; i < len; ++i)
{
}
}
this.fire("axisRendered");
},
/**
* @private
* @description Collection of labels used in creating an axis.
*/
_labels: null,
/**
* @private
* @description Collection of labels to be reused in creating an axis.
*/
_labelCache: null,
/**
* @private
* @description Draws and positions a label based on its style properties.
*/
{
var i,
customStyles = {
rotation: "rotation",
margin: "margin",
alpha: "alpha"
},
cache = this._labelCache,
{
}
else
{
}
for(i in styles)
{
{
}
}
return label;
},
/**
* @private
* Creates a cache of labels for reuse.
*/
_createLabelCache: function()
{
if(this._labels)
{
}
else
{
this._labelCache = [];
}
this._labels = [];
},
/**
* @private
* Removes unused labels from the label cache
*/
_clearLabelCache: function()
{
i = 0,
for(; i < len; ++i)
{
label = labelCache[i];
}
this._labelCache = [];
},
/**
* @private
* Indicates how to include tick length in the size calculation of an
* axis. If set to true, the length of the tick is used to calculate
* this size. If false, the offset of tick will be used.
*/
_calculateSizeByTickLength: true,
/**
* Indicate the end point of the axis line
*/
getLineEnd: function(pt)
{
var w = this.get("width"),
h = this.get("height"),
{
return {x:w, y:pt.y};
}
else
{
return {x:pt.x, y:h};
}
},
/**
* Returns the distance between the first and last data points.
*/
getLength: function()
{
var l,
w = this.get("width"),
h = this.get("height"),
{
}
else
{
}
return l;
},
/**
* Calculates the coordinates for the first point on an axis.
*/
getFirstPoint:function(pt)
{
{
}
else
{
}
return np;
},
/**
* Returns the next majorUnit point.
*/
{
{
}
else
{
}
return point;
},
/**
* Calculates the coordinates for the last point on an axis.
*/
getLastPoint: function()
{
w = this.get("width"),
{
}
else
{
}
},
/**
* Calculates the position of a point on the axis.
*/
getPosition: function(point)
{
var p,
h = this.get("height"),
{
//Numeric data on a vertical axis is displayed from bottom to top.
//Categorical and Timeline data is displayed from top to bottom.
if(dataType === "numeric")
{
}
else
{
}
}
else
{
}
return p;
}
}, {
{
{
value: 0
},
/**
* The graphic in which the axis line and ticks will be rendered.
*/
graphic: {},
/**
* Contains the contents of the axis.
*/
node: {},
/**
* Direction of the axis.
*/
position: {
lazyAdd: false,
setOnce: true,
{
if(val == "none")
{
this.bindUI();
}
return val;
}
},
/**
* Distance determined by the tick styles used to calculate the distance between the axis
* line in relation to the top of the axis.
*/
value: 0
},
/**
* Distance determined by the tick styles used to calculate the distance between the axis
* line in relation to the bottom of the axis.
*/
value: 0
},
/**
* Distance determined by the tick styles used to calculate the distance between the axis
* line in relation to the left of the axis.
*/
value: 0
},
/**
* Distance determined by the tick styles used to calculate the distance between the axis
* line in relation to the right side of the axis.
*/
value: 0
},
labels: {
readOnly: true,
getter: function()
{
return this._labels;
}
},
/**
* Collection of points used for placement of labels and ticks along the axis.
*/
tickPoints: {
readOnly: true,
getter: function()
{
{
}
return this._tickPoints;
}
},
/**
* Indicates whether the axis overlaps the graph. If an axis is the inner most axis on a given
* position and the tick position is inside or cross, the axis will need to overlap the graph.
*/
overlapGraph: {
value:true,
{
}
},
/**
* Object which should have by the labelFunction
*/
}
});
/**
* Contains algorithms for rendering a left axis.
*/
function LeftAxisLayout(config)
{
}
LeftAxisLayout.ATTRS = {
axisRenderer: {
value: null
},
maxLabelSize: {
value: 0
}
};
/**
* Sets the length of the tick on either side of the axis line.
*/
setTickOffsets: function()
{
switch(display)
{
case "inside" :
break;
case "outside" :
break;
case "cross":
break;
default:
break;
}
},
/**
* Draws a tick
*/
{
},
/**
* Calculates the coordinates for the first point on an axis.
*/
getLineStart: function()
{
if(display === "outside")
{
pt.x += tickLength;
}
else if(display === "cross")
{
}
return pt;
},
/**
* Calculates the point for a label.
*/
getLabelPoint: function(point)
{
},
updateMaxLabelSize: function(label)
{
max;
{
}
else
{
if(rot === 0)
{
}
else if(absRot === 90)
{
}
else
{
}
}
},
{
margin = 0,
leftOffset = pt.x,
m11 = cosRadians,
{
}
{
if(rot === 0)
{
}
else if(absRot === 90)
{
}
else if(rot === -90)
{
}
else if(rot > 0)
{
}
else
{
}
if(filterString)
{
filterString += " ";
}
{
filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(labelAlpha * 100) + ")";
}
if(rot !== 0)
{
if(filterString)
{
filterString += " ";
}
else
{
filterString = "";
}
filterString += 'progid:DXImageTransform.Microsoft.Matrix(M11=' + m11 + ' M12=' + m12 + ' M21=' + m21 + ' M22=' + m22 + ' sizingMethod="auto expand")';
}
if(filterString)
{
}
return;
}
if(rot === 0)
{
}
else if(rot === 90)
{
}
else if(rot === -90)
{
}
else
{
if(rot < 0)
{
}
else
{
}
}
leftOffset -= margin;
},
/**
* Calculates the size and positions the content elements.
*/
setSizeAndPosition: function()
{
if(display === "inside")
{
}
else if(display === "cross")
{
}
{
}
},
offsetNodeForTick: function(cb)
{
if(display === "inside")
{
}
else if (display === "cross")
{
}
else
{
}
},
setCalculatedSize: function()
{
}
});
/**
* Contains algorithms for rendering a right axis.
*/
function RightAxisLayout(config)
{
}
RightAxisLayout.ATTRS = {
axisRenderer: {
value: null
}
};
/**
* Sets the length of the tick on either side of the axis line.
*/
setTickOffsets: function()
{
switch(display)
{
case "inside" :
break;
case "outside" :
break;
case "cross":
break;
}
},
{
},
/**
* Calculates the coordinates for the first point on an axis.
*/
getLineStart: function()
{
if(display === "inside")
{
pt.x += tickLength;
}
else if(display === "cross")
{
}
return pt;
},
/**
* Calculates the point for a label.
*/
getLabelPoint: function(point)
{
},
updateMaxLabelSize: function(label)
{
max;
{
}
else
{
if(rot === 0)
{
}
else if(absRot === 90)
{
}
else
{
}
}
},
{
margin = 0,
leftOffset = pt.x,
m11 = cosRadians,
{
}
{
if(rot === 0)
{
}
else if(absRot === 90)
{
}
else if(rot > 0)
{
}
else
{
}
leftOffset += margin;
{
filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(labelAlpha * 100) + ")";
}
if(rot !== 0)
{
if(filterString)
{
filterString += " ";
}
else
{
filterString = "";
}
filterString += 'progid:DXImageTransform.Microsoft.Matrix(M11=' + m11 + ' M12=' + m12 + ' M21=' + m21 + ' M22=' + m22 + ' sizingMethod="auto expand")';
}
if(filterString)
{
}
return;
}
if(rot === 0)
{
}
else if(rot === 90)
{
}
else if(rot === -90)
{
}
else if(rot < 0)
{
}
else
{
}
leftOffset += margin;
},
/**
* Calculates the size and positions the content elements.
*/
setSizeAndPosition: function()
{
if(display === "outside")
{
}
else if(display === "cross")
{
}
},
offsetNodeForTick: function(cb)
{
if(display === "inside")
{
}
else if (display === "cross")
{
}
},
setCalculatedSize: function()
{
}
});
/**
* Contains algorithms for rendering a bottom axis.
*/
function BottomAxisLayout(config)
{
}
axisRenderer: {
value:null
},
maxLabelSize: {
value: 0
}
};
/**
* Sets the length of the tick on either side of the axis line.
*/
setTickOffsets: function()
{
switch(display)
{
case "inside" :
break;
case "outside" :
break;
case "cross":
break;
}
},
/**
* Calculates the coordinates for the first point on an axis.
*/
getLineStart: function()
{
if(display === "inside")
{
pt.y += tickLength;
}
else if(display === "cross")
{
}
return pt;
},
/**
* Draws a tick
*/
{
},
/**
* Calculates the point for a label.
*/
getLabelPoint: function(point)
{
},
updateMaxLabelSize: function(label)
{
max;
{
}
else
{
if(rot === 0)
{
}
else if(absRot === 90)
{
}
else
{
}
}
},
/**
* Rotate and position labels.
*/
{
margin = 0,
leftOffset = pt.x,
m11 = cosRadians,
{
}
{
m11 = cosRadians;
if(absRot === 90)
{
}
else if(rot < 0)
{
}
else if(rot > 0)
{
}
else
{
}
{
filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(labelAlpha * 100) + ")";
}
if(rot !== 0)
{
if(filterString)
{
filterString += " ";
}
else
{
filterString = "";
}
filterString += 'progid:DXImageTransform.Microsoft.Matrix(M11=' + m11 + ' M12=' + m12 + ' M21=' + m21 + ' M22=' + m22 + ' sizingMethod="auto expand")';
}
if(filterString)
{
}
return;
}
if(rot === 0)
{
}
else if(absRot === 90)
{
if(rot === 90)
{
}
else
{
}
}
else
{
if(rot < 0)
{
}
else
{
}
}
},
/**
* Calculates the size and positions the content elements.
*/
setSizeAndPosition: function()
{
if(display === "outside")
{
}
else if(display === "cross")
{
}
{
}
},
/**
* Adjusts position for inner ticks.
*/
offsetNodeForTick: function(cb)
{
if(display === "inside")
{
}
else if (display === "cross")
{
}
},
setCalculatedSize: function()
{
}
});
/**
* Contains algorithms for rendering a top axis.
*/
function TopAxisLayout(config)
{
}
TopAxisLayout.ATTRS = {
axisRenderer: {
value: null
}
};
/**
* Sets the length of the tick on either side of the axis line.
*/
setTickOffsets: function()
{
switch(display)
{
case "inside" :
break;
case "outside" :
break;
case "cross":
break;
}
},
/**
* Calculates the coordinates for the first point on an axis.
*/
getLineStart: function()
{
if(display === "outside")
{
pt.y += tickLength;
}
else if(display === "cross")
{
}
return pt;
},
/**
* Draws a tick
*/
{
},
/**
* Calculates the point for a label.
*/
getLabelPoint: function(pt)
{
},
updateMaxLabelSize: function(label)
{
max;
{
}
else
{
if(rot === 0)
{
}
else if(absRot === 90)
{
}
else
{
}
}
},
{
margin = 0,
leftOffset = pt.x,
m11,
m12,
m21,
m22;
{
}
{
m11 = cosRadians;
if(rot === 0)
{
}
else if(absRot === 90)
{
}
else if(rot > 0)
{
leftOffset -= (cosRadians * label.offsetWidth) + Math.min((sinRadians * label.offsetHeight), (rot/180 * label.offsetHeight));
}
else
{
}
{
filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(labelAlpha * 100) + ")";
}
if(rot !== 0)
{
if(filterString)
{
filterString += " ";
}
else
{
filterString = "";
}
filterString += 'progid:DXImageTransform.Microsoft.Matrix(M11=' + m11 + ' M12=' + m12 + ' M21=' + m21 + ' M22=' + m22 + ' sizingMethod="auto expand")';
}
if(filterString)
{
}
return;
}
if(rot === 0)
{
}
else if(rot === 90)
{
}
else if(rot === -90)
{
topOffset -= 0;
}
else if(rot < 0)
{
}
else
{
}
},
/**
* Calculates the size and positions the content elements.
*/
setSizeAndPosition: function(labelSize)
{
if(display === "outside")
{
}
else if(display === "cross")
{
}
},
offsetNodeForTick: function(cb)
{
if(display === "inside")
{
}
else if (display === "cross")
{
}
},
setCalculatedSize: function()
{
}
});
/**
* BaseAxis is the base class for observable baseAxis classes.
*/
/**
* Creates the BaseAxis instance and contains initialization data
*
* @param {Object} config (optional) Configuration parameters for the Chart.
* @class SWFWidget
* @constructor
*/
/**
* @private
*/
bindUI: function()
{
},
_dataProviderChangeHandler: function(e)
{
i;
if(keys)
{
for(i in keys)
{
if(keys.hasOwnProperty(i))
{
delete keys[i];
}
}
}
{
}
},
/**
* Constant used to generate unique id.
*/
GUID: "yuibaseaxis",
/**
* @private
* Storage for type
*/
_type: null,
/**
* @private
* Storage for maximum when autoMax is false.
*/
_setMaximum: null,
/**
* @private
* Storage for dataMaximum
* is true.
*/
_dataMaximum: null,
/**
* @private
* Storage for minimum when autoMin is false.
*/
_setMinimum: null,
/**
* @private
* Storage for data
*/
_data: null,
/**
* @private
* Storage for keys
*/
_updateTotalDataFlag: true,
/**
* @private
* Indicates that the axis has a data source and at least one
* key.
*/
_dataReady: false,
/**
* Adds an array to the key hash.
*
* @param value Indicates what key to use in retrieving
* the array.
*/
{
},
/**
* @private
* @description Returns an array of values for a given key.
*/
{
var i = 0,
obj,
keyArray = [],
for(; i < len; ++i)
{
}
return keyArray;
},
/**
* @private
*
* Creates an array of data based on a key value.
*/
{
var i,
obj,
arr = [],
for(i = 0; i < len; ++i)
{
}
this._updateTotalDataFlag = true;
},
/**
* @private
*/
_updateTotalData: function()
{
i;
this._data = [];
for(i in keys)
{
if(keys.hasOwnProperty(i))
{
}
}
this._updateTotalDataFlag = false;
},
/**
* Removes an array from the key hash.
*
* @param value Indicates what key to use in removing from
* the hash.
* @return Boolean
*/
{
{
this._keyChangeHandler();
}
},
/**
* Returns a numeric value based of a key value and an index.
*/
{
{
}
return value;
},
/**
* Returns an array of values based on an identifier key.
*/
getDataByKey: function (value)
{
{
}
return null;
},
/**
* @private
* Updates the <code>dataMaximum</code> and <code>dataMinimum</code> values.
*/
_updateMinAndMax: function()
{
max = 0,
min = 0,
len,
num,
i;
{
if(len > 1)
{
for(i = 1; i < len; i++)
{
{
continue;
}
}
}
}
this._dataMaximum = max;
this._dataMinimum = min;
},
/**
* @description
* Returns the total number of majorUnits that will appear on an axis.
*/
getTotalMajorUnits: function()
{
var units,
{
}
{
}
return units;
},
/**
* @description Returns the distance between major units on an axis.
*/
{
var dist;
{
}
{
}
return dist;
},
getEdgeOffset: function(ct, l)
{
return 0;
},
getLabelByIndex: function(i, l)
{
l -= 1;
return label;
},
_keyChangeHandler: function(e)
{
this._updateMinAndMax();
this.fire("dataUpdate");
}
}, {
ATTRS: {
/**
* Hash of array identifed by a string value.
*/
keys: {
value: {},
{
var keys = {},
i,
len,
{
for(i = 0; i < len; ++i)
{
}
}
{
}
else
{
for(i in val)
{
if(val.hasOwnProperty(i))
{
}
}
}
this._updateTotalDataFlag = true;
return keys;
}
},
/**
*Indicates how to round unit values.
* <ul>
* <li>niceNumber</li>
* <li>auto</li>
* <li>numeric value</li>
* <li>null</li>
* </ul>
*/
value: "niceNumber"
},
/**
*Returns the type of axis data
* <ul>
* <li><code>time</code></li>
* <li><code>numeric</code></li>
* <li><code>category</code></li>
* </ul>
*/
type:
{
readOnly: true,
getter: function ()
{
return this._type;
}
},
/**
* Instance of <code>ChartDataProvider</code> that the class uses
* to build its own data.
*/
{
return value;
}
},
/**
* The maximum value contained in the <code>data</code> array. Used for
* <code>maximum</code> when <code>autoMax</code> is true.
*/
dataMaximum: {
getter: function ()
{
if(!this._dataMaximum)
{
this._updateMinAndMax();
}
return this._dataMaximum;
}
},
/**
* The maximum value that will appear on an axis.
*/
maximum: {
getter: function ()
{
if(this.get("setMax"))
{
max = this._setMaximum;
}
return max;
},
{
this._setMaximum = value;
return value;
}
},
/**
* The minimum value contained in the <code>data</code> array. Used for
* <code>minimum</code> when <code>autoMin</code> is true.
*/
dataMinimum: {
getter: function ()
{
if(!this._dataMinimum)
{
this._updateMinAndMax();
}
return this._dataMinimum;
}
},
/**
* The minimum value that will appear on an axis.
*/
minimum: {
getter: function ()
{
if(this.get("setMin"))
{
min = this._setMinimum;
}
return min;
},
{
this._setMinimum = val;
return val;
}
},
/**
* Determines whether the maximum is calculated or explicitly
* set by the user.
*/
setMax: {
readOnly: true,
getter: function()
{
}
},
/**
* Determines whether the minimum is calculated or explicitly
* set by the user.
*/
setMin: {
readOnly: true,
getter: function()
{
}
},
/**
* Array of axis data
*/
data: {
getter: function ()
{
if(!this._data || this._updateTotalDataFlag)
{
this._updateTotalData();
}
return this._data;
}
},
getter: function()
{
i,
col = [];
for(i in keys)
{
if(keys.hasOwnProperty(i))
{
}
}
return col;
},
readOnly: true
},
{
return val;
}
}
}
});
function NumericAxis(config)
{
}
NumericAxis.ATTRS = {
/**
* Indicates whether 0 should always be displayed.
*/
value: true
},
{
if(format)
{
}
return val;
}
},
labelFormat: {
value: {
prefix: "",
thousandsSeparator: "",
decimalSeparator: "",
decimalPlaces: "0",
suffix: ""
}
}
};
{
/**
* @private
*/
_type: "numeric",
/**
* @private
* Storage for alwaysShowZero
*/
_alwaysShowZero: true,
{
},
_getNiceNumber: function(roundingUnit)
{
var tempMajorUnit = roundingUnit,
{
}
else
{
}
if(!isNaN(tempMajorUnit))
{
return tempMajorUnit;
}
return roundingUnit;
},
/**
* @private
* Determines the maximum and minimum values for the axis.
*/
_updateMinAndMax: function()
{
max = 0,
min = 0,
len,
num,
i,
key;
{
if(len > 1)
{
for(i = 1; i < len; i++)
{
{
{
//hloc values
{
{
}
}
}
continue;
}
}
}
}
},
{
var roundingUnit,
if(roundingMethod)
{
if(roundingMethod == "niceNumber")
{
{
{
min = 0;
}
}
else if(maxGreaterThanZero && !minGreaterThanZero)
{
}
else
{
{
max = 0;
}
else
{
}
}
}
else if(roundingMethod == "auto")
{
{
{
min = 0;
}
//roundingUnit = Math.ceil((max - min)/units);
if(useIntegers)
{
}
}
else if(maxGreaterThanZero && !minGreaterThanZero)
{
if(alwaysShowZero)
{
if(useIntegers)
{
}
else
{
}
}
else
{
//roundingUnit = Math.ceil((max - min)/units);
if(useIntegers)
{
}
}
}
else
{
if(useIntegers)
{
}
{
max = 0;
if(useIntegers)
{
Math.ceil(roundingUnit);
}
}
else
{
}
}
}
{
{
{
min = 0;
}
else
{
}
if(!dataRangeGreater)
{
}
else
{
}
}
else if(maxGreaterThanZero && !minGreaterThanZero)
{
if(!dataRangeGreater)
{
}
else
{
}
}
else
{
{
max = 0;
}
else
{
}
if(!dataRangeGreater)
{
}
else
{
}
}
}
}
this._dataMaximum = max;
this._dataMinimum = min;
},
/**
* Rounds a Number to the nearest multiple of an input. For example, by rounding
* 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round().
*
* @param numberToRound the number to round
* @param nearest the number whose mutiple must be found
* @return the rounded number
*
*/
{
if(nearest === 0)
{
return number;
}
},
/**
* Rounds a Number <em>up</em> to the nearest multiple of an input. For example, by rounding
* 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil().
*
* @param numberToRound the number to round up
* @param nearest the number whose mutiple must be found
* @return the rounded number
*
*/
{
if(nearest === 0)
{
return number;
}
},
/**
* Rounds a Number <em>down</em> to the nearest multiple of an input. For example, by rounding
* 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor().
*
* @param numberToRound the number to round down
* @param nearest the number whose mutiple must be found
* @return the rounded number
*
*/
{
if(nearest === 0)
{
return number;
}
},
/**
* Rounds a number to a certain level of precision. Useful for limiting the number of
* decimal places on a fractional number.
*
* @param number the input number to round.
* @param precision the number of decimal digits to keep
* @return the rounded number, or the original input if no rounding is needed
*
*/
{
}
});
Y.NumericAxis = NumericAxis;
function StackedAxis(config)
{
}
{
/**
* @private
* Determines the maximum and minimum values for the axis.
*/
_updateMinAndMax: function()
{
var max = 0,
min = 0,
pos = 0,
neg = 0,
len = 0,
i = 0,
key,
num,
{
{
}
}
for(; i < len; ++i)
{
pos = 0;
neg = 0;
{
{
{
continue;
}
if(num >= 0)
{
}
else
{
}
}
}
if(pos > 0)
{
}
else
{
}
if(neg < 0)
{
}
else
{
}
}
}
});
Y.StackedAxis = StackedAxis;
{
}
{
setMax: {
readOnly: true,
getter: function()
{
}
},
setMin: {
readOnly: true,
getter: function()
{
}
},
maximum: {
getter: function ()
{
{
}
return max;
},
{
return value;
}
},
minimum: {
getter: function ()
{
{
}
return min;
},
{
return value;
}
},
{
if(format)
{
}
return val;
}
},
labelFormat: {
value: "%b %d, %y"
}
};
/**
* Constant used to generate unique id.
*/
GUID: "yuitimeaxis",
/**
* @private
*/
_dataType: "time",
{
var obj,
keyArray = [],
i = 0,
val,
for(; i < len; ++i)
{
{
}
{
}
else
{
}
}
return keyArray;
},
/**
* @private (override)
*/
{
var obj,
arr = [],
i,
val,
for(i = 0; i < len; ++i)
{
{
}
{
}
else
{
}
}
this._updateTotalDataFlag = true;
},
_getNumber: function(val)
{
{
}
{
}
return val;
}
});
function CategoryAxis(config)
{
}
{
/**
* @private
*/
_indices: null,
/**
* Constant used to generate unique id.
*/
GUID: "yuicategoryaxis",
/**
* @private
*/
_type: "category",
/**
* @private
*/
_updateMinAndMax: function()
{
this._dataMinimum = 0;
},
{
var i = 0,
obj,
keyArr = [],
labels = [],
if(!this._indices)
{
this._indices = {};
}
for(; i < len; ++i)
{
keyArr[i] = i;
}
return labels;
},
/**
* @private
*/
_setDataByKey: function(key)
{
var i,
obj,
arr = [],
labels = [],
if(!this._indices)
{
this._indices = {};
}
for(i = 0; i < len; ++i)
{
arr[i] = i;
}
this._updateTotalDataFlag = true;
},
/**
* Returns an array of values based on an identifier key.
*/
getDataByKey: function (value)
{
if(!this._indices)
{
this.get("keys");
}
{
}
return null;
},
{
},
{
var dist;
{
}
{
}
return dist;
},
getEdgeOffset: function(ct, l)
{
return l/ct;
},
getLabelByIndex: function(i, l, format)
{
return this.get("data")[i];
},
{
return this.get("data")[i];
}
});
Y.CategoryAxis = CategoryAxis;
/**
* Utility class used for calculating curve points.
*/
function CurveUtil()
{
}
/**
* @private
* @return {Object}
* Creates an array of start, end and control points for splines.
*/
{
var outpoints = [],
i = 1,
xvals = [],
yvals = [];
// Too few points, need at least two
if (l < 1)
{
return null;
}
outpoints[0] = {
};
// Special case, the Bezier should be a straight line
if (l === 1)
{
return outpoints;
}
for (; i < l; ++i)
{
outpoints.push({startx: Math.round(xcoords[i]), starty: Math.round(ycoords[i]), endx: Math.round(xcoords[i+1]), endy: Math.round(ycoords[i+1])});
}
for (i = 0; i < l; ++i)
{
if (i < l-1)
{
}
else
{
}
}
return outpoints;
},
/**
* @private
*/
getControlPoints: function(vals)
{
x = [],
tmp = [],
b = 2.0,
i = 1;
for (; i < l; ++i)
{
tmp[i] = 1/b;
x[i] = (vals[i] - x[i-1]) / b;
}
for (i = 1; i < l; ++i)
{
x[l-i-1] -= tmp[l-i] * x[l-i];
}
return x;
}
};
/**
* Methods used for creating stacked series
*/
function StackingUtil(){}
/**
* @private
* Adjusts coordinate values for stacked series.
*/
_stackCoordinates: function()
{
i = 0,
len,
if(order === 0)
{
return;
}
if(direction === "vertical")
{
for(; i < len; ++i)
{
{
xcoords[i] += prevXCoords[i];
}
}
}
else
{
for(; i < len; ++i)
{
{
}
}
}
}
};
Y.StackingUtil = StackingUtil;
function Lines(){}
/**
* @private
*/
_lineDefaults: null,
/**
* @private
*/
drawLines: function()
{
{
return;
}
lastValidX = lastX,
lastValidY = lastY,
i,
for(i = 1; i < len; i = ++i)
{
{
lastValidX = nextX;
lastValidY = nextY;
continue;
}
if(lastValidX == lastX)
{
if(lineType != "dashed")
{
}
else
{
gapSpace);
}
}
else if(!connectDiscontinuousPoints)
{
}
else
{
if(discontinuousType != "solid")
{
}
else
{
}
}
}
},
/**
* @private
*/
drawSpline: function()
{
{
return;
}
cx1,
cx2,
cy1,
cy2,
x,
y,
i = 0,
for(; i < len; i = ++i)
{
x = curvecoords[i].endx;
y = curvecoords[i].endy;
}
},
/**
* Draws a dashed line between two points.
*
* @param xStart The x position of the start of the line
* @param yStart The y position of the start of the line
* @param xEnd The x position of the end of the line
* @param yEnd The y position of the end of the line
* @param dashSize the size of dashes, in pixels
* @param gapSize the size of gaps between dashes, in pixels
*/
{
i,
for(i = 0; i < segmentCount; ++i)
{
}
{
}
else if(delta > 0)
{
}
},
_getLineDefaults: function()
{
return {
alpha: 1,
weight: 6,
lineType:"solid",
dashLength:10,
gapSpace:10,
discontinuousType:"solid",
};
}
};
{
var attrs = {
area: {
getter: function()
{
return this._defaults || this._getAreaDefaults();
},
{
}
}
};
this.get("styles");
}
/**
* @private
*/
{
{
return;
}
lastValidX = firstX,
lastValidY = firstY,
i = 1,
for(; i < len; i = ++i)
{
{
lastValidX = nextX;
lastValidY = nextY;
continue;
}
lastValidX = nextX;
lastValidY = nextY;
}
},
/**
* @private
*/
drawAreaSpline: function()
{
{
return;
}
cx1,
cx2,
cy1,
cy2,
x,
y,
i = 0,
for(; i < len; i = ++i)
{
x = curvecoords[i].endx;
y = curvecoords[i].endy;
}
{
}
else
{
}
},
/**
* @private
*/
drawStackedAreaSpline: function()
{
{
return;
}
len,
cx1,
cx2,
cy1,
cy2,
x,
y,
i = 0,
for(; i < len; i = ++i)
{
x = curvecoords[i].endx;
y = curvecoords[i].endy;
}
if(order > 0)
{
i = 0;
for(; i < len; i = ++i)
{
x = curvecoords[i].endx;
y = curvecoords[i].endy;
}
}
else
{
{
}
else
{
}
}
},
/**
* @private
*/
_defaults: null,
_getClosingPoints: function()
{
{
}
else
{
}
},
/**
* @private
* Concatenates coordinate array with the correct coordinates for closing an area stack.
*/
_getStackedClosingPoints: function()
{
if(order > 0)
{
}
else
{
if(direction === "vertical")
{
}
else
{
}
}
return [allXCoords, allYCoords];
},
_getAreaDefaults: function()
{
return {
};
}
};
{
var attrs = {
markers: {
getter: function()
{
return this._markers;
}
}
};
}
/**
* @private
*/
_plotDefaults: null,
drawPlots: function()
{
{
return;
}
i = 0,
left,
offsetWidth = w/2,
offsetHeight = h/2,
fillColors = null,
borderColors = null,
{
}
{
}
this._createMarkerCache();
for(; i < len; ++i)
{
if(!top || !left || top === undefined || left === undefined || top == "undefined" || left == "undefined" || isNaN(top) || isNaN(left))
{
this._markerNodes.push(null);
this._graphicCollection.push(null);
this._graphicNodes.push(null);
continue;
}
top += "px";
left += "px";
if(fillColors)
{
}
if(borderColors)
{
}
}
this._clearMarkerCache();
},
_getPlotDefaults: function()
{
var defs = {
fill:{
type: "solid",
alpha: 1,
colors:null,
alphas: null,
ratios: null
},
border:{
weight: 1,
alpha: 1
},
width: 10,
height: 10,
shape: "circle"
};
return defs;
},
/**
* @private
* Collection of markers to be used in the series.
*/
_markers: null,
/**
* @private
* Collection of markers to be re-used on a series redraw.
*/
_markerCache: null,
/**
* @private
* @description Creates a marker based on its style properties.
*/
{
var marker,
cfg;
{
while(!marker)
{
{
break;
}
}
}
else
{
}
return marker;
},
/**
* @private
* Creates a cache of markers for reuse.
*/
_createMarkerCache: function()
{
{
}
else
{
this._markerCache = [];
}
this._markers = [];
this._graphicNodes = [];
this._markerNodes = [];
this._graphicCollection = [];
},
/**
* @private
* Removes unused markers from the marker cache
*/
_clearMarkerCache: function()
{
i = 0,
for(; i < len; ++i)
{
marker = this._markerCache[i];
if(marker)
{
}
}
this._markerCache = [];
},
updateMarkerState: function(type, i)
{
if(this._markers[i])
{
var w,
h,
w = markerStyles.width;
h = markerStyles.height;
}
},
/**
* @protected
* @description parses a color from an array.
*/
_getItemColor: function(val, i)
{
{
}
return val;
},
/**
* @private
*/
_setStyles: function(val)
{
},
_parseMarkerStyles: function(val)
{
{
var defs = this._getPlotDefaults();
{
}
{
}
}
return val;
},
/**
* Returns marker state based on event type
*/
{
var state;
switch(type)
{
case "mouseout" :
state = "off";
break;
case "mouseover" :
state = "over";
break;
case "mouseup" :
state = "over";
break;
case "mousedown" :
state = "down";
break;
}
return state;
},
/**
* @private
*/
_toggleVisible: function(e)
{
i = 0,
len,
if(graphic)
{
}
if(markers)
{
for(; i < len; ++i)
{
if(marker)
{
}
}
}
},
_stateSyles: null
};
function Histogram(){}
/**
* @private
*/
drawSeries: function()
{
{
return;
}
i = 0,
seriesSize = 0,
totalSize = 0,
offset = 0,
left,
fillColors = null,
borderColors = null,
{
}
{
}
{
setSizeKey = "height";
calculatedSizeKey = "width";
}
else
{
setSizeKey = "width";
calculatedSizeKey = "height";
}
this._createMarkerCache();
for(; i < seriesLen; ++i)
{
renderer = seriesCollection[i];
if(order > i)
{
offset = seriesSize;
}
}
{
seriesSize *= ratio;
}
for(i = 0; i < len; ++i)
{
if(fillColors)
{
}
if(borderColors)
{
}
}
this._clearMarkerCache();
},
_defaultFillColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],
_getPlotDefaults: function()
{
var defs = {
fill:{
type: "solid",
alpha: 1,
colors:null,
alphas: null,
ratios: null
},
border:{
weight: 0,
alpha: 1
},
width: 12,
height: 12,
shape: "rect",
padding:{
top: 0,
left: 0,
right: 0,
bottom: 0
}
};
return defs;
}
};
/**
* @private
*/
_xDisplayName: null,
/**
* @private
*/
_yDisplayName: null,
/**
* @private
*/
_leftOrigin: null,
/**
* @private
*/
_bottomOrigin: null,
render: function()
{
this._setCanvas();
this.addListeners();
this.set("rendered", true);
this.validate();
},
/**
* @private
*/
addListeners: function()
{
if(xAxis)
{
}
if(yAxis)
{
}
this.after("stylesChange", function(e) {
var axesReady = this._updateAxisData();
if(axesReady)
{
this.draw();
}
});
this.after("widthChange", function(e) {
var axesReady = this._updateAxisData();
if(axesReady)
{
this.draw();
}
});
this.after("heightChange", function(e) {
var axesReady = this._updateAxisData();
if(axesReady)
{
this.draw();
}
});
},
_xAxisChangeHandler: function(e)
{
},
_yAxisChangeHandler: function(e)
{
},
/**
* Constant used to generate unique id.
*/
GUID: "yuicartesianseries",
/**
* @private (protected)
* Handles updating the graph when the x < code>Axis</code> values
* change.
*/
_xDataChangeHandler: function(event)
{
var axesReady = this._updateAxisData();
if(axesReady)
{
this.draw();
}
},
/**
* @private (protected)
* Handles updating the chart when the y <code>Axis</code> values
* change.
*/
_yDataChangeHandler: function(event)
{
var axesReady = this._updateAxisData();
if(axesReady)
{
this.draw();
}
},
/**
* @private
*/
_updateAxisData: function()
{
{
return false;
}
{
return false;
}
return true;
},
validate: function()
{
{
this.draw();
}
},
/**
* @private
* Creates a <code>Graphic</code> instance.
*/
_setCanvas: function()
{
},
/**
* @private
*/
setAreaData: function()
{
xcoords = [],
ycoords = [],
i = 0,
xMarkerPlane = [],
yMarkerPlane = [],
xOffset *= 0.5;
yOffset *= 0.5;
if(direction === "vertical")
{
}
if(graphic)
{
}
for (; i < dataLength; ++i)
{
}
},
/**
* @private (override)
*/
draw: function()
{
if(this.get("rendered"))
{
if((isFinite(w) && isFinite(h) && w > 0 && h > 0) && ((this.get("xData") && this.get("yData")) || this._updateAxisData()))
{
this.setAreaData();
this.drawSeries();
this.fire("drawingComplete");
}
}
},
/**
* @private
* @return Default styles for the widget
*/
_getDefaultStyles: function()
{
return {padding:{
top: 0,
left: 0,
right: 0,
bottom: 0
}};
},
/**
* @private
*/
_defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],
/**
* @private
*/
_defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],
/**
* @private
*/
_defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],
/**
* @private
*/
_defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],
/**
* @private
* @description Colors used if style colors are not specified
*/
{
var colors = {
line: this._defaultLineColors,
fill: this._defaultFillColors,
border: this._defaultBorderColors,
slice: this._defaultSliceColors
},
if(index >= l)
{
}
},
/**
* @private
*/
_toggleVisible: function(e)
{
if(graphic)
{
}
}
}, {
ATTRS: {
xDisplayName: {
getter: function()
{
},
{
this._xDisplayName = val;
return val;
}
},
yDisplayName: {
getter: function()
{
},
{
this._yDisplayName = val;
return val;
}
},
readOnly: true,
getter: function()
{
}
},
readOnly: true,
getter: function()
{
}
},
type: {
value: "cartesian"
},
/**
* Order of this ISeries instance of this <code>type</code>.
*/
order: {},
/**
* Order of the ISeries instance
*/
graphOrder: {},
/**
* x coordinates for the series.
*/
xcoords: {},
/**
* y coordinates for the series
*/
ycoords: {},
graph: {},
/**
* Reference to the <code>Axis</code> instance used for assigning
* x-values to the graph.
*/
xAxis: {},
yAxis: {},
/**
* Indicates which array to from the hash of value arrays in
* the x-axis <code>Axis</code> instance.
*/
xKey: {},
/**
* Indicates which array to from the hash of value arrays in
* the y-axis <code>Axis</code> instance.
*/
yKey: {},
/**
* Array of x values for the series.
*/
xData: {},
/**
* Array of y values for the series.
*/
yData: {},
rendered: {
value: false
},
/*
* Returns the width of the parent graph
*/
width: {
readOnly: true,
getter: function()
{
}
},
/**
* Returns the height of the parent graph
*/
height: {
readOnly: true,
getter: function()
{
}
},
/**
* Indicates whether to show the series
*/
visible: {
value: true
},
/**
* Collection of area maps along the xAxis. Used to determine mouseover for multiple
* series.
*/
xMarkerPlane: {},
/**
* Collection of area maps along the yAxis. Used to determine mouseover for multiple
* series.
*/
yMarkerPlane: {},
/**
*/
getter: function() {
{
}
return this._defaultPlaneOffset;
}
},
/**
*/
getter: function() {
{
}
return this._defaultPlaneOffset;
}
},
/**
* Direction of the series
*/
direction: {
value: "horizontal"
}
}
});
/**
* @private
*/
renderUI: function()
{
this._setNode();
},
/**
* @private
*/
drawSeries: function()
{
this.drawPlots();
},
/**
* @private
*/
_setStyles: function(val)
{
{
}
},
/**
* @private
*/
_getDefaultStyles: function()
{
var styles = this._mergeStyles({marker:this._getPlotDefaults()}, Y.MarkerSeries.superclass._getDefaultStyles());
return styles;
}
},{
ATTRS : {
/**
* Indicates the type of graph.
*/
type: {
value:"marker"
}
}
});
drawSeries: function()
{
this.drawLines();
},
_setStyles: function(val)
{
{
}
},
_getDefaultStyles: function()
{
var styles = this._mergeStyles({line:this._getLineDefaults()}, Y.LineSeries.superclass._getDefaultStyles());
return styles;
}
},
{
ATTRS: {
/**
* Indicates the type of graph.
*/
type: {
value:"line"
}
}
});
/**
* @private
*/
drawSeries: function()
{
this.drawSpline();
}
}, {
ATTRS : {
type : {
/**
* Indicates the type of graph.
*/
value:"spline"
}
}
});
/**
* @private
*/
drawSeries: function()
{
this.drawAreaSpline();
}
}, {
ATTRS : {
type: {
/**
* Indicates the type of graph.
*/
value:"areaSpline"
}
}
});
setAreaData: function()
{
this._stackCoordinates.apply(this);
}
}, {
ATTRS: {
/**
* Indicates the type of graph.
*/
type: {
value:"stackedSpline"
}
}
});
setAreaData: function()
{
this._stackCoordinates.apply(this);
}
}, {
ATTRS: {
/**
* Indicates the type of graph.
*/
type: {
value:"stackedMarker"
}
}
});
{
var config = {
};
return config;
},
/**
* @private
* Resizes and positions markers based on a mouse interaction.
*/
updateMarkerState: function(type, i)
{
seriesSize = 0,
offset = 0,
n = 0,
xs = [],
for(; n < seriesLen; ++n)
{
if(order > n)
{
offset = seriesSize;
}
}
for(n = 0; n < seriesLen; ++n)
{
}
}
}, {
ATTRS: {
type: {
value: "column"
}
}
});
/**
* @private
*/
renderUI: function()
{
this._setNode();
},
{
var config = {
left: this._leftOrigin
};
return config;
},
/**
* @private
* Resizes and positions markers based on a mouse interaction.
*/
updateMarkerState: function(type, i)
{
seriesSize = 0,
offset = 0,
n = 0,
ys = [],
for(; n < seriesLen; ++n)
{
if(order > n)
{
offset = seriesSize;
}
}
for(n = 0; n < seriesLen; ++n)
{
}
}
}, {
ATTRS: {
type: {
value: "bar"
},
direction: {
value: "vertical"
}
}
});
drawSeries: function()
{
},
_setStyles: function(val)
{
{
}
},
_getDefaultStyles: function()
{
var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());
return styles;
}
},
{
ATTRS: {
type: {
/**
* Indicates the type of graph.
*/
value:"area"
}
}
});
Y.StackedAreaSplineSeries = Y.Base.create("stackedAreaSplineSeries", Y.AreaSeries, [Y.CurveUtil, Y.StackingUtil], {
/**
* @private
*/
drawSeries: function()
{
this._stackCoordinates();
this.drawStackedAreaSpline();
}
}, {
ATTRS : {
/**
* Indicates the type of graph.
*/
type: {
value:"stackedAreaSpline"
}
}
});
drawSeries: function()
{
if(this.get("showAreaFill"))
{
}
if(this.get("showLines"))
{
this.drawLines();
}
if(this.get("showMarkers"))
{
this.drawPlots();
}
},
/**
* @private
*/
_getDefaultStyles: function()
{
return styles;
}
},
{
ATTRS: {
type: {
value:"combo"
},
showAreaFill: {
value: false
},
showLines: {
value: true
},
showMarkers: {
value: true
},
marker: {
lazyAdd: false,
getter: function()
{
},
{
}
},
line: {
lazyAdd: false,
getter: function()
{
},
{
}
},
area: {
lazyAdd: false,
getter: function()
{
},
{
}
}
}
});
setAreaData: function()
{
this._stackCoordinates.apply(this);
},
drawSeries: function()
{
if(this.get("showAreaFill"))
{
}
if(this.get("showLines"))
{
this.drawLines();
}
if(this.get("showMarkers"))
{
this.drawPlots();
}
}
}, {
ATTRS : {
type: {
value: "stackedCombo"
},
showAreaFill: {
value: true
}
}
});
drawSeries: function()
{
if(this.get("showAreaFill"))
{
this.drawAreaSpline();
}
if(this.get("showLines"))
{
this.drawSpline();
}
if(this.get("showMarkers"))
{
this.drawPlots();
}
}
}, {
ATTRS: {
type: {
value : "comboSpline"
}
}
});
Y.StackedComboSplineSeries = Y.Base.create("stackedComboSplineSeries", Y.StackedComboSeries, [Y.CurveUtil], {
drawSeries: function()
{
if(this.get("showAreaFill"))
{
this.drawStackedAreaSpline();
}
if(this.get("showLines"))
{
this.drawSpline();
}
if(this.get("showMarkers"))
{
this.drawPlots();
}
}
}, {
ATTRS: {
type : {
value : "stackedComboSpline"
},
showAreaFill: {
value: true
}
}
});
setAreaData: function()
{
this._stackCoordinates.apply(this);
}
}, {
ATTRS: {
type: {
/**
* Indicates the type of graph.
*/
value:"stackedLine"
}
}
});
setAreaData: function()
{
this._stackCoordinates.apply(this);
},
drawSeries: function()
{
}
}, {
ATTRS: {
/**
* Indicates the type of graph.
*/
type: {
value:"stackedArea"
}
}
});
/**
* @private
*/
drawSeries: function()
{
{
return;
}
i = 0,
left,
totalWidth = len * w,
this._createMarkerCache();
{
w *= ratio;
w = Math.max(w, 1);
}
if(!useOrigin)
{
}
else
{
negativeBaseValues = [];
positiveBaseValues = [];
}
for(i = 0; i < len; ++i)
{
if(useOrigin)
{
h = this._bottomOrigin - top;
if(top < this._bottomOrigin)
{
positiveBaseValues[i] = top;
negativeBaseValues[i] = this._bottomOrigin;
}
else if(top > this._bottomOrigin)
{
positiveBaseValues[i] = this._bottomOrigin;
negativeBaseValues[i] = top;
}
else
{
positiveBaseValues[i] = top;
negativeBaseValues[i] = top;
}
}
else
{
if(top > this._bottomOrigin)
{
h = negativeBaseValues[i] - top;
negativeBaseValues[i] = top;
}
else if(top < this._bottomOrigin)
{
h = positiveBaseValues[i] - top;
positiveBaseValues[i] = top;
}
}
}
this._clearMarkerCache();
},
/**
* @private
* Resizes and positions markers based on a mouse interaction.
*/
updateMarkerState: function(type, i)
{
var styles,
graphic = this._graphicCollection[i],
offset = 0;
},
/**
* @private
*/
_getPlotDefaults: function()
{
var defs = {
fill:{
type: "solid",
alpha: 1,
colors:null,
alphas: null,
ratios: null
},
border:{
weight: 0,
alpha: 1
},
width: 24,
height: 24,
shape: "rect",
padding:{
top: 0,
left: 0,
right: 0,
bottom: 0
}
};
return defs;
}
}, {
ATTRS: {
type: {
value: "stackedColumn"
},
value: null
},
value: null
}
}
});
drawSeries: function()
{
{
return;
}
i = 0,
left,
totalHeight = len * h,
this._createMarkerCache();
{
h *= ratio;
h = Math.max(h, 1);
}
if(!useOrigin)
{
}
else
{
negativeBaseValues = [];
positiveBaseValues = [];
}
for(i = 0; i < len; ++i)
{
if(useOrigin)
{
w = left - this._leftOrigin;
if(left > this._leftOrigin)
{
positiveBaseValues[i] = left;
negativeBaseValues[i] = this._leftOrigin;
}
else if(left < this._leftOrigin)
{
positiveBaseValues[i] = this._leftOrigin;
negativeBaseValues[i] = left;
}
else
{
positiveBaseValues[i] = left;
negativeBaseValues[i] = this._leftOrigin;
}
left -= w;
}
else
{
if(left < this._leftOrigin)
{
w = negativeBaseValues[i] - left;
negativeBaseValues[i] = left;
}
else if(left > this._leftOrigin)
{
w = left - positiveBaseValues[i];
positiveBaseValues[i] = left;
left -= w;
}
}
top -= h/2;
}
this._clearMarkerCache();
},
/**
* @private
* Resizes and positions markers based on a mouse interaction.
*/
updateMarkerState: function(type, i)
{
graphic = this._graphicCollection[i],
},
_getPlotDefaults: function()
{
var defs = {
fill:{
type: "solid",
alpha: 1,
colors:null,
alphas: null,
ratios: null
},
border:{
weight: 0,
alpha: 1
},
width: 24,
height: 24,
shape: "rect",
padding:{
top: 0,
left: 0,
right: 0,
bottom: 0
}
};
return defs;
}
}, {
ATTRS: {
type: {
value: "stackedBar"
},
direction: {
value: "vertical"
},
value: null
},
value: null
}
}
});
/**
* @private
*/
_categoryDisplayName: null,
/**
* @private
*/
_valueDisplayName: null,
/**
* @private
*/
addListeners: function()
{
if(categoryAxis)
{
}
if(valueAxis)
{
}
},
validate: function()
{
this.draw();
this._renderered = true;
},
_categoryAxisChangeHandler: function(e)
{
},
_valueAxisChangeHandler: function(e)
{
},
/**
* Constant used to generate unique id.
*/
GUID: "pieseries",
/**
* @private (protected)
* Handles updating the graph when the x < code>Axis</code> values
* change.
*/
_categoryDataChangeHandler: function(event)
{
{
this.draw();
}
},
/**
* @private (protected)
* Handles updating the chart when the y <code>Axis</code> values
* change.
*/
_valueDataChangeHandler: function(event)
{
{
this.draw();
}
},
/**
* @private (override)
*/
draw: function()
{
{
this._rendered = true;
this.drawSeries();
this.fire("drawingComplete");
}
},
/**
* @private
*/
drawPlots: function()
{
totalValue = 0,
tfc,
tfa,
startAngle = -90,
halfWidth = w / 2,
halfHeight = h / 2,
i = 0,
angle = 0,
lc,
la,
lw,
for(; i < itemCount; ++i)
{
{
totalValue += value;
}
}
this._createMarkerCache();
for(i = 0; i < itemCount; i++)
{
if(totalValue === 0)
{
}
else
{
}
{
}
{
}
{
}
{
}
{
}
startAngle += angle;
wedgeStyle = {
border: {
},
fill: {
},
shape: "wedge",
props: {
x: halfWidth,
y: halfHeight
},
width: w,
height: h
};
}
this._clearMarkerCache();
},
updateMarkerState: function(type, i)
{
graphicNode = this._graphicNodes[i],
{
}
else
{
}
},
/**
* @private
* @return Default styles for the widget
*/
_getPlotDefaults: function()
{
var defs = {
padding:{
top: 0,
left: 0,
right: 0,
bottom: 0
},
fill:{
alphas:["1"]
},
border: {
weight: 0,
alpha: 1
}
};
return defs;
},
/**
* @private
*/
_defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],
/**
* @private
*/
_defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],
/**
* @private
*/
_defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],
/**
* @private
*/
_defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],
/**
* @private
* @description Colors used if style colors are not specified
*/
{
var colors = {
line: this._defaultLineColors,
fill: this._defaultFillColors,
border: this._defaultBorderColors,
slice: this._defaultSliceColors
},
if(index >= l)
{
}
}
}, {
ATTRS: {
type: {
value: "pie"
},
/**
* Order of this ISeries instance of this <code>type</code>.
*/
order: {},
graph: {},
/**
* Reference to the <code>Axis</code> instance used for assigning
* x-values to the graph.
*/
categoryAxis: {
value: null,
{
}
},
valueAxis: {
value: null,
{
}
},
/**
* Indicates which array to from the hash of value arrays in
* the category <code>Axis</code> instance.
*/
categoryKey: {
value: null,
{
}
},
/**
* Indicates which array to from the hash of value arrays in
* the value <code>Axis</code> instance.
*/
valueKey: {
value: null,
{
}
},
{
this._categoryDisplayName = val;
return val;
},
getter: function()
{
}
},
{
this._valueDisplayName = val;
return val;
},
getter: function()
{
}
},
slices: null
}
});
/**
* @private
*/
render: function()
{
this._setCanvas();
},
remove: function()
{
if(graphic)
{
if(gNode)
{
}
}
},
/**
* Draws the gridlines
*/
draw: function()
{
{
this._drawGridlines();
}
},
/**
* @private
*/
_drawGridlines: function()
{
i = 0,
l,
if(axisPosition == "none")
{
points = [];
for(; i < l; ++i)
{
points[i] = {
x: w * (i/(l-1)),
y: h * (i/(l-1))
};
}
i = 0;
}
else
{
}
if(!graphic)
{
this._setCanvas();
}
for(; i < l; ++i)
{
}
},
{
},
{
},
/**
* @private
* Creates a <code>Graphic</code> instance.
*/
_setCanvas: function()
{
},
/**
* @private
*/
_getDefaultStyles: function()
{
var defs = {
line: {
color:"#fff",
weight: 1,
alpha: 1
}
};
return defs;
}
},
{
ATTRS: {
direction: {},
axis: {},
graph: {}
}
});
bindUI: function()
{
},
/**
* @private
*/
syncUI: function()
{
if(this.get("showBackground"))
{
w = this.get("width"),
h = this.get("height");
if(w)
{
}
if(h)
{
}
}
},
/**
* @private
*/
renderUI: function()
{
i = 0,
for(; i < len; ++i)
{
if(series instanceof Y.CartesianSeries)
{
}
}
{
}
{
}
},
/**
* Hash of arrays containing series mapped to a series type.
*/
seriesTypes: null,
/**
* Returns a series instance based on an index.
*/
getSeriesByIndex: function(val)
{
{
}
return series;
},
/**
* Returns a series instance based on a key value.
*/
getSeriesByKey: function(val)
{
var obj = this._seriesDictionary,
{
}
return series;
},
/**
* Adds dispatcher to collection
*/
addDispatcher: function(val)
{
if(!this._dispatchers)
{
this._dispatchers = [];
}
},
/**
* @private
* @description Collection of series to be displayed in the graph.
*/
_seriesCollection: null,
/**
* @private
*/
_seriesDictionary: null,
/**
* @private
* @description Parses series instances to be displayed in the graph.
* @param {Array} Collection of series instances or object literals containing necessary properties for creating a series instance.
*/
_parseSeriesCollection: function(val)
{
if(!val)
{
return;
}
i = 0,
if(!this.get("seriesCollection"))
{
this._seriesCollection = [];
}
if(!this._seriesDictionary)
{
this._seriesDictionary = {};
}
if(!this.seriesTypes)
{
this.seriesTypes = [];
}
for(; i < len; ++i)
{
{
this._createSeries(series);
continue;
}
this._addSeries(series);
}
for(i = 0; i < len; ++i)
{
}
},
/**
* @private
* @description Adds a series to the graph.
* @param {Series}
*/
_addSeries: function(series)
{
seriesTypes = this.seriesTypes,
{
}
{
this.seriesTypes[type] = [];
}
this.addDispatcher(series);
},
_createSeries: function(seriesData)
{
seriesTypes = this.seriesTypes,
seriesData.graph = this;
{
seriesTypes[type] = [];
}
seriesData.graph = this;
this.addDispatcher(series);
},
/**
* @private
* @description Creates a series instance based on a specified type.
* @param {String} Indicates type of series instance to be created.
* @return {Series} Series instance created.
*/
_getSeries: function(type)
{
var seriesClass;
switch(type)
{
case "line" :
seriesClass = Y.LineSeries;
break;
case "column" :
seriesClass = Y.ColumnSeries;
break;
case "bar" :
seriesClass = Y.BarSeries;
break;
case "area" :
seriesClass = Y.AreaSeries;
break;
case "candlestick" :
break;
case "ohlc" :
seriesClass = Y.OHLCSeries;
break;
case "stackedarea" :
break;
case "stackedline" :
break;
case "stackedcolumn" :
break;
case "stackedbar" :
break;
case "markerseries" :
seriesClass = Y.MarkerSeries;
break;
case "spline" :
seriesClass = Y.SplineSeries;
break;
case "areaspline" :
break;
case "stackedspline" :
break;
case "stackedareaspline" :
break;
case "stackedmarkerseries" :
break;
case "pie" :
seriesClass = Y.PieSeries;
break;
case "combo" :
seriesClass = Y.ComboSeries;
break;
case "stackedcombo" :
break;
case "combospline" :
break;
case "stackedcombospline" :
break;
default:
break;
}
return seriesClass;
},
/**
* @private
*/
_markerEventHandler: function(e)
{
markerNode = e.currentTarget,
},
/**
* @private
*/
_dispatchers: null,
/**
* @private
*/
_updateStyles: function()
{
this._sizeChangeHandler();
},
/**
* @private
*/
_sizeChangeHandler: function(e)
{
i = 0,
l,
w = this.get("width"),
h = this.get("height");
if(this._background)
{
if(w && h)
{
}
}
{
}
{
}
if(sc)
{
for(; i < l; ++i)
{
}
}
},
/**
* @private
*/
_drawingCompleteHandler: function(e)
{
var series = e.currentTarget,
if(index > -1)
{
}
{
this.fire("chartRendered");
}
},
/**
* @private
*/
_getDefaultStyles: function()
{
var defs = {
background: {
shape: "rect",
fill:{
color:"#faf9f2"
},
border: {
color:"#808080",
weight: 1
}
}
};
return defs;
}
}, {
ATTRS: {
getter: function()
{
return this._seriesCollection;
},
{
this._parseSeriesCollection(val);
return this._seriesCollection;
}
},
value: true
},
readOnly: true,
getter: function()
{
return this._seriesDictionary;
}
},
value: null,
{
{
}
{
return val;
}
{
return gl;
}
}
},
value: null,
{
{
}
{
return val;
}
{
return gl;
}
}
}
}
});
function ChartBase() {}
tooltip: {
valueFn: "_getTooltip",
{
return this._updateTooltip(val);
}
},
/**
* @description Indicates the the type of interactions that will fire events.
* <ul>
* <li>marker</li>
* <li>all</li>
* <li>none</li>
*/
value: "marker"
},
/**
* Data used to generate the chart.
*/
dataProvider: {
{
return this._setDataValues(val);
}
},
/**
* Reference to graph instance
* @type Graph
*/
graph: {
valueFn: "_getGraph"
}
};
/**
* @private
* @description Default value function for the <code>graph</code> attribute.
*/
_getGraph: function()
{
this.fire("chartRendered");
}, this));
return graph;
},
/**
* Returns a series instance
* @method getSeries
*/
{
var series = null,
if(graph)
{
{
}
else
{
}
}
return series;
},
/**
* Returns axis by key reference
* @method getAxisByKey
*/
getAxisByKey: function(val)
{
var axis,
{
}
return axis;
},
/**
* Returns the category axis for the chart.
* @method getCategoryAxis
*/
getCategoryAxis: function()
{
var axis,
{
}
return axis;
},
/**
* @private
*/
_direction: "horizontal",
/**
* @private
*/
_dataProvider: null,
/**
* @private
*/
_setDataValues: function(val)
{
{
var hash,
dp = [],
i = 0,
n,
for(; i < l; ++i)
{
for(n = 1; n < sl; ++n)
{
}
}
return dp;
}
return val;
},
/**
* @private
*/
_seriesCollection: null,
/**
* @private
*/
_setSeriesCollection: function(val)
{
this._seriesCollection = val;
},
/**
* @private
*/
_getAxisClass: function(t)
{
return this._axisClass[t];
},
/**
* @private
*/
_axisClass: {
stacked: Y.StackedAxis,
numeric: Y.NumericAxis,
category: Y.CategoryAxis,
},
/**
* @private
*/
_axes: null,
/**
* @private
*/
renderUI: function()
{
//move the position = absolute logic to a class file
this._addAxes();
this._addSeries();
if(this.get("showTooltip"))
{
this._addTooltip();
}
this._redraw();
},
/**
* @private
*/
bindUI: function()
{
if(interactionType == "marker")
{
}
else if(interactionType == "all")
{
}
if(this.get("tooltip"))
{
}
},
/**
* @private
*/
_markerEventHandler: function(e)
{
markerNode = e.currentTarget,
if(type == "mouseenter")
{
type = "mouseover";
}
else if(type == "mouseleave")
{
type = "mouseout";
}
this.fire("markerEvent:" + type, {node:markerNode, x:x, y:y, series:series, index:index, seriesIndex:seriesIndex});
},
_dataProviderChangeHandler: function(e)
{
i,
axis;
for(i in axes)
{
if(axes.hasOwnProperty(i))
{
{
}
}
}
},
/**
* @private
*/
_showTooltip: function(msg, x, y)
{
if(msg)
{
}
},
/**
* @private
*/
_positionTooltip: function(e)
{
if(node)
{
}
},
/**
* @private
*/
_hideTooltip: function()
{
},
/**
* @private
*/
_addTooltip: function()
{
},
/**
* @private
*/
_updateTooltip: function(val)
{
i,
if(styles)
{
for(i in styles)
{
if(styles.hasOwnProperty(i))
{
}
}
}
{
}
return tt;
},
/**
* @private
*/
_getTooltip: function()
{
tt = {
};
return tt;
},
/**
* @private
*/
{
": " + categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) +
": " + valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]);
return msg;
},
/**
* @private
*/
_showTooltipChangeHandler: function(e)
{
if(this.get("showTooltip"))
{
this._addTooltip();
}
}
};
/**
* A basic chart application.
*/
/**
* @private
*/
renderUI: function()
{
//move the position = absolute logic to a class file
this._addAxes();
this._addGridlines();
this._addSeries();
if(this.get("showTooltip"))
{
this._addTooltip();
}
//If there is a style definition. Force them to set.
this.get("styles");
{
}
this._redraw();
},
/**
* @private
*/
_mouseMoveHandler: function(e)
{
x = e.pageX,
y = e.pageY,
i = 0,
oldIndex = this._selectedIndex,
items = [],
//data columns and area data could be created on a graph level
//only change on whole numbers
{
return;
}
for(; i < len; ++i)
{
{
index = i;
break;
}
}
for(i = 0; i < len; ++i)
{
{
}
{
{
}
}
}
this._selectedIndex = index;
if(index > -1)
{
this.fire("markerEvent:mouseover", {x:posX, y:posY, index:index, items:items, direction:direction, graph:graph});
}
else
{
this.fire("markerEvent:mouseout");
}
},
/**
* @private
*/
_type: "combo",
/**
* @private
*/
_axesRenderQueue: null,
/**
* Adds an axis to the queue
*/
_addToAxesRenderQueue: function(axis)
{
if(!this._axesRenderQueue)
{
this._axesRenderQueue = [];
}
{
}
},
/**
* @private
*/
_getDefaultSeriesCollection: function(val)
{
tempKeys = [],
i,
l,
key,
if(dir == "vertical")
{
catAxis = "yAxis";
catKey = "yKey";
valAxis = "xAxis";
seriesKey = "xKey";
}
else
{
catAxis = "xAxis";
catKey = "xKey";
valAxis = "yAxis";
seriesKey = "yKey";
}
for(i = 0; i < l; ++i)
{
if(key)
{
if(index > -1)
{
}
}
}
{
}
for(i = 0; i < l; ++i)
{
if(series instanceof Y.CartesianSeries)
{
this._parseSeriesAxes(series);
continue;
}
if((series.type == "combo" || series.type == "stackedcombo" || series.type == "combospline" || series.type == "stackedcombospline"))
{
if(showAreaFill !== null)
{
}
if(showMarkers !== null)
{
}
if(showLines !== null)
{
}
}
}
if(val)
{
}
return sc;
},
_parseSeriesAxes: function(series)
{
axis;
{
{
}
}
{
{
}
}
},
_getCategoryAxis: function()
{
var axis,
return axis;
},
/**
* @private
* @description Gets the appropriate axis to bind a series to when one is not explicitly
* set.
*/
{
i,
keys,
axis;
if(axes)
{
{
}
else
{
for(i in axes)
{
if(axes.hasOwnProperty(i))
{
{
break;
}
}
}
}
}
return axis;
},
/**
* @private
* @description Gets an attribute from an object, using a getter for Base objects and a property for object
* literals. Used for determining attributes from series/axis references which can be an actual class instance
* or a hash of properties that will be used to create a class instance.
*/
{
{
}
{
}
return null;
},
/**
* @private
* @description Sets an attribute on an object, using a setter of Base objects and a property for object
* literals. Used for setting attributes on a Base class, either directly or to be stored in an object literal
* for use at instantiation.
*/
{
{
}
else
{
}
},
/**
* @private
* Creates Axis and Axis data classes based on hashes of properties.
*/
_parseAxes: function(val)
{
axes = {},
axesAttrs = {
edgeOffset: "edgeOffset",
position: "position",
overlapGraph:"overlapGraph",
labelFunction:"labelFunction",
labelFunctionScope:"labelFunctionScope",
labelFormat:"labelFormat",
maximum:"maximum",
minimum:"minimum",
roundingMethod:"roundingMethod",
alwaysShowZero:"alwaysShowZero"
},
ai,
i,
pos,
axis,
dh,
for(i in hash)
{
if(hash.hasOwnProperty(i))
{
{
}
else
{
config = {};
{
}
{
}
{
{
}
}
}
if(axis)
{
{
}
}
}
}
return axes;
},
/**
* @private
*/
_addAxes: function()
{
i,
axis,
pos,
w = this.get("width"),
h = this.get("height"),
if(!this._axesCollection)
{
this._axesCollection = [];
}
for(i in axes)
{
if(axes.hasOwnProperty(i))
{
{
if(!w)
{
w = this.get("width");
}
if(!h)
{
h = this.get("height");
}
this._addToAxesRenderQueue(axis);
{
}
else
{
}
{
}
}
}
}
},
/**
* @private
*/
_addSeries: function()
{
},
/**
* @private
* @description Adds gridlines to the chart.
*/
_addGridlines: function()
{
if(this._axesCollection)
{
}
if(hgl)
{
{
}
{
}
else
{
}
{
}
{
}
}
if(vgl)
{
{
}
{
}
else
{
}
{
}
{
}
}
},
/**
* @private
*/
_getDefaultAxes: function(axes)
{
axis,
attr,
keys,
newAxes = {},
claimedKeys = [],
i,
l,
ii,
ll,
dv,
valueAxes = [],
if(direction == "vertical")
{
seriesPosition = "bottom";
categoryPosition = "left";
}
else
{
seriesPosition = "left";
categoryPosition = "bottom";
}
if(axes)
{
for(i in axes)
{
if(axes.hasOwnProperty(i))
{
{
categoryAxisName = i;
this.set("categoryAxisName", i);
{
}
}
else if(i == categoryAxisName)
{
}
else
{
{
{
}
}
{
}
{
this._setBaseAttribute(newAxes[i], "position", this._getDefaultAxisPosition(newAxes[i], valueAxes, seriesPosition));
}
}
}
}
}
{
for(i in dv)
{
{
seriesKeys.push(i);
}
}
}
if(cIndex > -1)
{
}
l = claimedKeys.length;
for(i = 0; i < l; ++i)
{
if(cIndex > -1)
{
}
}
{
newAxes[categoryAxisName] = {};
}
{
}
{
}
{
}
{
}
{
{
}
else
{
}
}
{
{
this._setBaseAttribute(newAxes[valueAxisName], "position", this._getDefaultAxisPosition(newAxes[valueAxisName], valueAxes, seriesPosition));
}
{
}
{
}
}
return newAxes;
},
/**
* @private
* @description Determines the position of an axis when one is not specified.
*/
{
{
if(direction == "horizontal")
{
{
position = "right";
}
{
position = "left";
}
}
else
{
{
position = "top";
}
else
{
position = "bottom";
}
}
}
return position;
},
_displayTooltip: function(e) {
categoryItem = {},
valueItem = {},
msg;
{
categoryItem = {
};
valueItem = {
};
}
else
{
valueItem = {
};
categoryItem = {
};
}
if (node) {
}
},
/**
* @private
*/
_displayMultiTooltip: function(e)
{
i = 0,
msg = "",
if(categoryAxis)
{
msg = categoryAxis.get("labelFunction").apply(this, [categoryAxis.getKeyValueAt(this.get("categoryKey"), index), categoryAxis.get("labelFormat")]);
}
for(; i < len; ++i)
{
{
if(horizontal)
{
msg += "<br/><span>" + series.get("yDisplayName") + ": " + yAxis.get("labelFunction").apply(this, [yAxis.getKeyValueAt(series.get("yKey"), index), yAxis.get("labelFormat")]) + "</span>";
}
else
{
msg += "<br/><span>" + series.get("xDisplayName") + " " + xAxis.get("labelFunction").apply(this, [xAxis.getKeyValueAt(series.get("xKey"), index), xAxis.get("labelFormat")]) + "</span>";
}
}
}
},
/**
* @private
*/
_showTooltipChangeHandler: function(e)
{
{
this._addTooltip();
}
},
/**
* @private
* @description Listender for axisRendered event.
*/
_axisRendered: function(e)
{
this._axesRenderQueue = this._axesRenderQueue.splice(1 + Y.Array.indexOf(this._axesRenderQueue, e.currentTarget), 1);
{
this._redraw();
}
},
_sizeChanged: function(e)
{
if(this._axesCollection)
{
var ac = this._axesCollection,
i = 0,
for(; i < l; ++i)
{
this._addToAxesRenderQueue(ac[i]);
}
this._redraw();
}
},
_redraw: function()
{
var w = this.get("width"),
h = this.get("height"),
lw = 0,
rw = 0,
th = 0,
bh = 0,
i = 0,
l,
axis,
pos,
pts = [],
graphOverflow = "visible",
if(lc)
{
for(i = l - 1; i > -1; --i)
{
}
}
if(rc)
{
i = 0;
for(i = l - 1; i > -1; --i)
{
}
}
if(tc)
{
for(i = l - 1; i > -1; --i)
{
}
}
if(bc)
{
for(i = l - 1; i > -1; --i)
{
}
}
l = this._axesCollection.length;
i = 0;
for(; i < l; ++i)
{
axis = this._axesCollection[i];
{
{
}
}
{
{
}
}
{
graphOverflow = "hidden";
}
}
if(graph)
{
}
if(this._overlay)
{
}
}
}, {
ATTRS: {
axesStyles: {
getter: function()
{
i,
styles = this._axesStyles;
if(axes)
{
for(i in axes)
{
{
if(!styles)
{
styles = {};
}
}
}
}
return styles;
},
{
i;
for(i in val)
{
{
}
}
}
},
seriesStyles: {
getter: function()
{
var styles = this._seriesStyles,
dict,
i;
if(graph)
{
if(dict)
{
styles = {};
for(i in dict)
{
if(dict.hasOwnProperty(i))
{
}
}
}
}
return styles;
},
{
var i,
l,
s;
{
s = this.get("seriesCollection");
i = 0;
for(; i < l; ++i)
{
}
}
else
{
for(i in val)
{
if(val.hasOwnProperty(i))
{
s = this.getSeries(i);
}
}
}
}
},
graphStyles: {
getter: function()
{
if(graph)
{
}
return this._graphStyles;
},
{
}
},
styles: {
getter: function()
{
var styles = {
};
return styles;
},
{
{
if(this.get("axesStyles"))
{
}
else
{
}
}
{
if(this.get("seriesStyles"))
{
}
else
{
}
}
{
}
}
},
/**
* Axes to appear in the chart.
*/
axes: {
valueFn: "_parseAxes",
{
return this._parseAxes(val);
}
},
/**
* Collection of series to appear on the chart. This can be an array of Series instances or object literals
* used to describe a Series instance.
*/
valueFn: "_getDefaultSeriesCollection",
{
return this._getDefaultSeriesCollection(val);
}
},
/**
* Element that contains left axes
*/
leftAxesCollection: {},
/**
* Element that contains bottom axes
*/
bottomAxesCollection: {},
/**
* Element that contains right axes
*/
rightAxesCollection: {},
/**
* Element that contains top axes
*/
topAxesCollection: {},
/**
* All axes in a chart
*/
axesCollection: {},
/**
* Indicates whether or not the chart is stacked.
* @type Boolean
*/
stacked: {
value: false
},
/**
* Direction of chart's category axis when there is no series collection specified. Charts can
* be horizontal or vertical. When the chart type is column, the chart is horizontal.
* When the chart type is bar, the chart is vertical.
* @type String
* @default Horizontal
*/
direction: {
getter: function()
{
if(type == "bar")
{
return "vertical";
}
else if(type == "column")
{
return "horizontal";
}
return this._direction;
},
{
this._direction = val;
return this._direction;
}
},
/**
* Indicates whether or not to show a tooltip.
*/
showTooltip: {
value:true
},
/**
* The key value used for the chart's category axis.
* @default "category"
* @type String
*/
categoryKey: {
value: "category"
},
/**
* A collection of keys that map to the series axes. If no keys are set,
* they will be generated automatically depending on the data structure passed into
* the chart.
* @type Array
*/
seriesKeys: {},
/**
* Indicates whether or not an area is filled in a combo chart.
*/
showAreaFill: {},
showMarkers:{},
showLines:{},
/**
* Indicates the type of axis to use for the category axis.
*/
value:"category"
},
/**
* Indicates the key value used to identify a category axis in the <code>axes</code> hash.
*/
},
value: "values"
},
getter: function()
{
if(graph)
{
}
return this._horizontalGridlines;
},
{
{
val = {};
}
if(graph)
{
}
else
{
this._horizontalGridlines = val;
}
}
},
getter: function()
{
if(graph)
{
}
return this._verticalGridlines;
},
{
{
val = {};
}
if(graph)
{
}
else
{
this._verticalGridlines = val;
}
}
},
/**
* Type of chart when there is no series collection specified.
* @type String
*/
type: {
getter: function()
{
if(this.get("stacked"))
{
return "stacked" + this._type;
}
return this._type;
},
{
if(this._type == "bar")
{
if(val != "bar")
{
}
}
else
{
if(val == "bar")
{
}
}
return this._type;
}
},
/**
* Reference to the category axis used by the chart.
*/
categoryAxis:{}
}
});
/**
* @private
*/
_getSeriesCollection: function()
{
if(this._seriesCollection)
{
return this._seriesCollection;
}
sc = [],
i = 0,
l,
key,
catAxis = "categoryAxis",
catKey = "categoryKey",
valAxis = "valueAxis",
seriesKey = "valueKey";
if(axes)
{
l = seriesKeys.length;
for(; i < l; ++i)
{
}
}
this._seriesCollection = sc;
return sc;
},
/**
* @private
*/
_parseAxes: function(hash)
{
if(!this._axes)
{
this._axes = {};
}
w = this.get("width"),
h = this.get("height"),
if(!w)
{
w = this.get("width");
}
if(!h)
{
h = this.get("height");
}
for(i in hash)
{
if(hash.hasOwnProperty(i))
{
{
}
}
}
},
/**
* @private
*/
_addAxes: function()
{
i,
axis,
p;
if(!axes)
{
}
if(!this._axesCollection)
{
this._axesCollection = [];
}
for(i in axes)
{
if(axes.hasOwnProperty(i))
{
if(!this.get(p + "AxesCollection"))
{
}
else
{
}
}
}
},
/**
* @private
*/
_addSeries: function()
{
this._parseSeriesAxes(seriesCollection);
},
/**
* @private
*/
_parseSeriesAxes: function(c)
{
var i = 0,
s,
axis;
for(; i < len; ++i)
{
s = c[i];
if(s)
{
//If series is an actual series instance,
//replace axes attribute string ids with axes
if(s instanceof Y.PieSeries)
{
{
}
{
}
continue;
}
if(!s.type)
{
}
}
}
},
/**
* @private
*/
_getDefaultAxes: function()
{
seriesAxis = "numeric",
i,
{
for(i in dv)
{
if(i != catKey)
{
seriesKeys.push(i);
}
}
{
}
}
return {
values:{
},
category:{
}
};
},
_displayTooltip: function(e) {
categoryItem = {
},
valueItem = {
},
msg;
},
_sizeChanged: function(e)
{
this._redraw();
},
_redraw: function()
{
if(graph)
{
}
}
}, {
ATTRS: {
/**
* Axes to appear in the chart.
*/
axes: {
getter: function()
{
return this._axes;
},
{
this._parseAxes(val);
}
},
/**
* Collection of series to appear on the chart. This can be an array of Series instances or object literals
* used to describe a Series instance.
*/
getter: function()
{
return this._getSeriesCollection();
},
{
return this._setSeriesCollection(val);
}
},
/**
* All axes in a chart
*/
value: null
},
type: {
value: "pie"
},
/**
* Reference to graph instance
* @type Graph
*/
graph: {},
/**
* Direction of chart's category axis when there is no series collection specified. Charts can
* be horizontal or vertical. When the chart type is column, the chart is horizontal.
* When the chart type is bar, the chart is vertical.
* @type String
* @default Horizontal
*/
direction: {
getter: function()
{
if(type == "bar")
{
return "vertical";
}
else if(type == "column")
{
return "horizontal";
}
return this._direction;
},
{
this._direction = val;
}
},
/**
* Indicates whether or not to show a tooltip.
*/
showTooltip: {
value:true
},
/**
* The key value used for the chart's category axis.
* @default "category"
* @type String
*/
categoryKey: {
value: "category"
},
/**
* A collection of keys that map to the series axes. If no keys are set,
* they will be generated automatically depending on the data structure passed into
* the chart.
* @type Array
*/
seriesKeys: {
value: null
},
value:"category"
}
}
});
{
{
return new Y.CartesianChart(cfg);
}
else
{
}
}
}, '@VERSION@' ,{requires:['dom', 'datatype', 'event-custom', 'event-mouseenter', 'widget', 'widget-position', 'widget-stack']});