]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/javascript/yui3/build/charts/charts.js
Release 6.5.0
[Github/sugarcrm.git] / include / javascript / yui3 / build / charts / charts.js
1 /*
2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
5 version: 3.3.0
6 build: 3167
7 */
8 YUI.add("charts",function(b){var g=b.UA.chrome,j,d=document.createElement("canvas");if(document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")){j="svg";}else{if(d&&d.getContext&&d.getContext("2d")){j="canvas";}else{j="vml";}}var u=function(C){this.initializer.apply(this,arguments);};u.prototype={autoSize:true,initializer:function(D){D=D||{};var C=D.width||0,E=D.height||0;if(D.node){this.node=D.node;this._styleGroup(this.node);}else{this.node=this._createGraphics();this.setSize(C,E);}this._initProps();},beginBitmapFill:function(C){var D={};D.src=C.bitmap.src;D.type="tile";this._fillProps=D;if(!isNaN(C.tx)||!isNaN(C.ty)||!isNaN(C.width)||!isNaN(C.height)){this._gradientBox={tx:C.tx,ty:C.ty,width:C.width,height:C.height};}else{this._gradientBox=null;}},beginFill:function(C,D){if(C){this._fillAlpha=b.Lang.isNumber(D)?D:1;this._fillColor=C;this._fillType="solid";this._fill=1;}return this;},beginGradientFill:function(D){var C=D.alphas||[];if(!this._defs){this._defs=this._createGraphicNode("defs");this.node.appendChild(this._defs);}this._fillAlphas=C;this._fillColors=D.colors;this._fillType=D.type||"linear";this._fillRatios=D.ratios||[];this._fillRotation=D.rotation||0;this._fillWidth=D.width||null;this._fillHeight=D.height||null;this._fillX=!isNaN(D.tx)?D.tx:NaN;this._fillY=!isNaN(D.ty)?D.ty:NaN;this._gradientId="lg"+Math.round(100000*Math.random());return this;},destroy:function(){this._removeChildren(this.node);if(this.node&&this.node.parentNode){this.node.parentNode.removeChild(this.node);}},_removeChildren:function(C){if(C.hasChildNodes()){var D;while(C.firstChild){D=C.firstChild;this._removeChildren(D);C.removeChild(D);}}},toggleVisible:function(C){this._toggleVisible(this.node,C);},_toggleVisible:function(G,H){var F=b.Selector.query(">/*",G),D=H?"visible":"hidden",E=0,C;if(F){C=F.length;for(;E<C;++E){this._toggleVisible(F[E],H);}}G.style.visibility=D;},clear:function(){if(this._graphicsList){while(this._graphicsList.length>0){this.node.removeChild(this._graphicsList.shift());}}this.path="";},curveTo:function(E,D,G,F,C,H){this._shapeType="path";if(this.path.indexOf("C")<0||this._pathType!=="C"){this._pathType="C";this.path+=" C";}this.path+=Math.round(E)+", "+Math.round(D)+", "+Math.round(G)+", "+Math.round(F)+", "+C+", "+H+" ";this._trackSize(C,H);},quadraticCurveTo:function(E,D,C,F){if(this.path.indexOf("Q")<0||this._pathType!=="Q"){this._pathType="Q";this.path+=" Q";}this.path+=Math.round(E)+" "+Math.round(D)+" "+Math.round(C)+" "+Math.round(F);},drawCircle:function(C,E,D){this._shape={x:C-D,y:E-D,w:D*2,h:D*2};this._attributes={cx:C,cy:E,r:D};this._width=this._height=D*2;this._x=C-D;this._y=E-D;this._shapeType="circle";this._draw();},drawEllipse:function(C,F,D,E){this._shape={x:C,y:F,w:D,h:E};this._width=D;this._height=E;this._x=C;this._y=F;this._shapeType="ellipse";this._draw();},drawRect:function(C,F,D,E){this._shape={x:C,y:F,w:D,h:E};this._x=C;this._y=F;this._width=D;this._height=E;this.moveTo(C,F);this.lineTo(C+D,F);this.lineTo(C+D,F+E);this.lineTo(C,F+E);this.lineTo(C,F);this._draw();},drawRoundRect:function(C,H,D,F,E,G){this._shape={x:C,y:H,w:D,h:F};this._x=C;this._y=H;this._width=D;this._height=F;this.moveTo(C,H+G);this.lineTo(C,H+F-G);this.quadraticCurveTo(C,H+F,C+E,H+F);this.lineTo(C+D-E,H+F);this.quadraticCurveTo(C+D,H+F,C+D,H+F-G);this.lineTo(C+D,H+G);this.quadraticCurveTo(C+D,H,C+D-E,H);this.lineTo(C+E,H);this.quadraticCurveTo(C,H,C,H+G);this._draw();},drawWedge:function(E,H,G,F,D,C){this._drawingComplete=false;this.path=this._getWedgePath({x:E,y:H,startAngle:G,arc:F,radius:D,yRadius:C});this._width=D*2;this._height=this._width;this._shapeType="path";this._draw();},end:function(){if(this._shapeType){this._draw();}this._initProps();},lineGradientStyle:function(){},lineStyle:function(F,E,J,H,G,I,C,D){this._stroke=1;this._strokeWeight=F;if(E){this._strokeColor=E;}this._strokeAlpha=b.Lang.isNumber(J)?J:1;},lineTo:function(H,G,E){var D=arguments,F,C;if(typeof H==="string"||typeof H==="number"){D=[[H,G]];}C=D.length;this._shapeType="path";if(this.path.indexOf("L")<0||this._pathType!=="L"){this._pathType="L";this.path+=" L";}for(F=0;F<C;++F){this.path+=D[F][0]+", "+D[F][1]+" ";this._trackSize.apply(this,D[F]);}},moveTo:function(C,D){this._pathType="M";this.path+=" M"+C+", "+D;},_getWedgePath:function(V){var L=V.x,J=V.y,Q=V.startAngle,I=V.arc,E=V.radius,F=V.yRadius||E,P,N,H,U,G,M,K,T,S,D,C,R=0,O=" M"+L+", "+J;if(Math.abs(I)>360){I=360;}P=Math.ceil(Math.abs(I)/45);N=I/P;H=-(N/180)*Math.PI;U=(Q/180)*Math.PI;if(P>0){M=L+Math.cos(Q/180*Math.PI)*E;K=J+Math.sin(Q/180*Math.PI)*F;O+=" L"+Math.round(M)+", "+Math.round(K);O+=" Q";for(;R<P;++R){U+=H;G=U-(H/2);T=L+Math.cos(U)*E;S=J+Math.sin(U)*F;D=L+Math.cos(G)*(E/Math.cos(H/2));C=J+Math.sin(G)*(F/Math.cos(H/2));O+=Math.round(D)+" "+Math.round(C)+" "+Math.round(T)+" "+Math.round(S)+" ";}O+=" L"+L+", "+J;}return O;},setSize:function(C,D){if(this.autoSize){if(C>this.node.getAttribute("width")){this.node.setAttribute("width",C);}if(D>this.node.getAttribute("height")){this.node.setAttribute("height",D);}}},_trackSize:function(C,D){if(C>this._width){this._width=C;}if(D>this._height){this._height=D;}this.setSize(C,D);},setPosition:function(C,D){this.node.setAttribute("x",C);this.node.setAttribute("y",D);},render:function(C){var D=C.get("width")||C.get("offsetWidth"),E=C.get("height")||C.get("offsetHeight");C=C||b.config.doc.body;C.appendChild(this.node);this.setSize(D,E);this._initProps();return this;},_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._fillX=NaN;this._fillY=NaN;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={};},_clearPath:function(){this._shape=null;this._shapeType=null;
9 this.path="";this._width=0;this._height=0;this._x=0;this._y=0;this._pathType=null;this._attributes={};},_draw:function(){var D=this._createGraphicNode(this._shapeType),E,C;if(this.path){if(this._fill){this.path+="z";}D.setAttribute("d",this.path);}else{for(E in this._attributes){if(this._attributes.hasOwnProperty(E)){D.setAttribute(E,this._attributes[E]);}}}D.setAttribute("stroke-width",this._strokeWeight);if(this._strokeColor){D.setAttribute("stroke",this._strokeColor);D.setAttribute("stroke-opacity",this._strokeAlpha);}if(!this._fillType||this._fillType==="solid"){if(this._fillColor){D.setAttribute("fill",this._fillColor);D.setAttribute("fill-opacity",this._fillAlpha);}else{D.setAttribute("fill","none");}}else{if(this._fillType==="linear"){C=this._getFill();C.setAttribute("id",this._gradientId);this._defs.appendChild(C);D.setAttribute("fill","url(#"+this._gradientId+")");}}this.node.appendChild(D);this._clearPath();},_getFill:function(){var C=this._fillType,D;switch(C){case"linear":D=this._getLinearGradient("fill");break;case"radial":break;case"bitmap":break;}return D;},_getLinearGradient:function(H){var V=this._createGraphicNode("linearGradient"),G="_"+H,M=this[G+"Colors"],P=this[G+"Ratios"],K=this[G+"Alphas"],N=this._fillWidth||(this._shape.w),Y=this._fillHeight||(this._shape.h),R=this[G+"Rotation"],W,T,U,L,I,O,S,Z,X,F,D,E=N/2,C=Y/2,J,Q;J=Math.PI/180;Q=parseFloat(parseFloat(Math.tan(R*J)).toFixed(8));if(Math.abs(Q)*N/2>=Y/2){if(R<180){F=0;D=Y;}else{F=Y;D=0;}Z=E-((C-F)/Q);X=E-((C-D)/Q);}else{if(R>90&&R<270){Z=N;X=0;}else{Z=0;X=N;}F=((Q*(E-Z))-C)*-1;D=((Q*(E-X))-C)*-1;}V.setAttribute("gradientTransform","rotate("+R+")");V.setAttribute("width",N);V.setAttribute("height",Y);V.setAttribute("gradientUnits","userSpaceOnUse");T=M.length;O=0;for(W=0;W<T;++W){I=K[W];U=M[W];L=P[W]||W/(T-1);L=Math.round(L*100)+"%";I=b.Lang.isNumber(I)?I:"1";O=(W+1)/T;S=this._createGraphicNode("stop");S.setAttribute("offset",L);S.setAttribute("stop-color",U);S.setAttribute("stop-opacity",I);V.appendChild(S);}return V;},_createGraphics:function(){var C=this._createGraphicNode("svg");this._styleGroup(C);return C;},_styleGroup:function(C){C.style.position="absolute";C.style.top="0px";C.style.overflow="visible";C.style.left="0px";C.setAttribute("pointer-events","none");},_createGraphicNode:function(E,C){var F=document.createElementNS("http://www.w3.org/2000/svg","svg:"+E),D=C||"none";if(E!=="defs"&&E!=="stop"&&E!=="linearGradient"){F.setAttribute("pointer-events",D);}if(E!="svg"){if(!this._graphicsList){this._graphicsList=[];}this._graphicsList.push(F);}return F;},getShape:function(C){C.graphic=this;return new b.Shape(C);}};b.Graphic=u;function m(){this.initializer.apply(this,arguments);}m.prototype={initializer:function(C){this._dummy=this._createDummy();this._canvas=this._createGraphic();this._context=this._canvas.getContext("2d");this._initProps();},beginBitmapFill:function(C){var D=this._context,F=C.bitmap,E=C.repeat||"repeat";this._fillWidth=C.width||null;this._fillHeight=C.height||null;this._fillX=!isNaN(C.tx)?C.tx:NaN;this._fillY=!isNaN(C.ty)?C.ty:NaN;this._fillType="bitmap";this._bitmapFill=D.createPattern(F,E);return this;},beginFill:function(C,E){var D=this._context;D.beginPath();if(C){if(E){C=this._2RGBA(C,E);}else{C=this._2RGB(C);}this._fillColor=C;this._fillType="solid";}return this;},beginGradientFill:function(G){var F,I,H=0,E=G.colors,D=G.alphas||[],C=E.length;this._fillAlphas=D;this._fillColors=E;this._fillType=G.type||"linear";this._fillRatios=G.ratios||[];this._fillRotation=G.rotation||0;this._fillWidth=G.width||null;this._fillHeight=G.height||null;this._fillX=!isNaN(G.tx)?G.tx:NaN;this._fillY=!isNaN(G.ty)?G.ty:NaN;for(;H<C;++H){I=D[H];F=E[H];if(I){F=this._2RGBA(F,I);}else{F=this._2RGB(F);}E[H]=F;}this._context.beginPath();return this;},lineStyle:function(J,G,F,I,K,E,C,H){G=G||"#000000";var D=this._context;if(this._stroke){D.stroke();}D.lineWidth=J;if(J){this._stroke=1;}else{this._stroke=0;}if(G){this._strokeStyle=G;if(F){this._strokeStyle=this._2RGBA(this._strokeStyle,F);}}if(!this._fill){D.beginPath();}if(E==="butt"){E="none";}if(D.lineCap){}this._drawingComplete=false;return this;},lineTo:function(I,H,E){var D=arguments,G=this._context,F,C;if(typeof I==="string"||typeof I==="number"){D=[[I,H]];}for(F=0,C=D.length;F<C;++F){G.lineTo(D[F][0],D[F][1]);this._updateShapeProps.apply(this,D[F]);this._trackSize.apply(this,D[F]);}this._drawingComplete=false;return this;},moveTo:function(C,D){this._context.moveTo(C,D);this._trackPos(C,D);this._updateShapeProps(C,D);this._drawingComplete=false;return this;},clear:function(){this._initProps();this._canvas.width=this._canvas.width;this._canvas.height=this._canvas.height;return this;},curveTo:function(E,D,G,F,C,H){this._context.bezierCurveTo(E,D,G,F,C,H);this._drawingComplete=false;this._updateShapeProps(C,H);this._trackSize(C,H);this._trackPos(C,H);return this;},quadraticCurveTo:function(E,D,C,F){this._context.quadraticCurveTo(E,D,C,F);this._drawingComplete=false;this._updateShapeProps(C,F);return this;},drawCircle:function(D,H,C){var G=this._context,F=0,E=2*Math.PI;this._shape={x:D-C,y:H-C,w:C*2,h:C*2};this._drawingComplete=false;this._trackPos(D,H);this._trackSize(C*2,C*2);G.beginPath();G.arc(D,H,C,F,E,false);this._draw();return this;},drawEllipse:function(N,L,O,T){this._shape={x:N,y:L,w:O,h:T};if(this._stroke&&this._context.lineWidth>0){O-=this._context.lineWidth*2;T-=this._context.lineWidth*2;N+=this._context.lineWidth;L+=this._context.lineWidth;}var D=this._context,Q=8,I=-(45/180)*Math.PI,V=0,H,F=O/2,G=T/2,R=0,K=N+F,J=L+G,P,M,U,S,E,C;this._drawingComplete=false;this._trackPos(N,L);this._trackSize(N+O,L+T);D.beginPath();P=K+Math.cos(0)*F;M=J+Math.sin(0)*G;D.moveTo(P,M);for(;R<Q;R++){V+=I;H=V-(I/2);U=K+Math.cos(V)*F;S=J+Math.sin(V)*G;E=K+Math.cos(H)*(F/Math.cos(I/2));C=J+Math.sin(H)*(G/Math.cos(I/2));D.quadraticCurveTo(E,C,U,S);}this._draw();return this;},drawRect:function(C,G,E,F){var D=this._context;this._shape={x:C,y:G,w:E,h:F};this._drawingComplete=false;
10 D.beginPath();D.moveTo(C,G);D.lineTo(C+E,G);D.lineTo(C+E,G+F);D.lineTo(C,G+F);D.lineTo(C,G);this._trackPos(C,G);this._trackSize(E,F);this._draw();return this;},drawRoundRect:function(C,I,E,G,F,H){this._shape={x:C,y:I,w:E,h:G};var D=this._context;this._drawingComplete=false;D.beginPath();D.moveTo(C,I+H);D.lineTo(C,I+G-H);D.quadraticCurveTo(C,I+G,C+F,I+G);D.lineTo(C+E-F,I+G);D.quadraticCurveTo(C+E,I+G,C+E,I+G-H);D.lineTo(C+E,I+H);D.quadraticCurveTo(C+E,I,C+E-F,I);D.lineTo(C+F,I);D.quadraticCurveTo(C,I,C,I+H);this._trackPos(C,I);this._trackSize(E,G);this._draw();return this;},drawWedge:function(F){var M=F.x,K=F.y,Q=F.startAngle,J=F.arc,E=F.radius,G=F.yRadius,P,O,I,U,H,N,L,T,S,D,C,R=0;this._drawingComplete=false;this.moveTo(M,K);G=G||E;if(Math.abs(J)>360){J=360;}P=Math.ceil(Math.abs(J)/45);O=J/P;I=-(O/180)*Math.PI;U=(Q/180)*Math.PI;if(P>0){N=M+Math.cos(Q/180*Math.PI)*E;L=K+Math.sin(Q/180*Math.PI)*G;this.lineTo(N,L);for(;R<P;++R){U+=I;H=U-(I/2);T=M+Math.cos(U)*E;S=K+Math.sin(U)*G;D=M+Math.cos(H)*(E/Math.cos(I/2));C=K+Math.sin(H)*(G/Math.cos(I/2));this.quadraticCurveTo(D,C,T,S);}this.lineTo(M,K);}this._trackPos(M,K);this._trackSize(E,E);this._draw();},end:function(){this._draw();this._initProps();return this;},lineGradientStyle:function(){return this;},setSize:function(C,D){this._canvas.width=C;this._canvas.height=D;},_initProps:function(){var C=this._context;C.fillStyle="rgba(0, 0, 0, 1)";C.lineWidth=1;C.lineJoin="miter";C.miterLimit=3;this._strokeStyle="rgba(0, 0, 0, 1)";this._width=0;this._height=0;this._x=0;this._y=0;this._fillType=null;this._stroke=null;this._bitmapFill=null;this._drawingComplete=false;},_getFill:function(){var C=this._fillType,D;switch(C){case"linear":D=this._getLinearGradient("fill");break;case"radial":D=this._getRadialGradient("fill");break;case"bitmap":D=this._bitmapFill;break;case"solid":D=this._fillColor;break;}return D;},_getLinearGradient:function(H){var G="_"+H,M=this[G+"Colors"],Q=this[G+"Ratios"],N=!isNaN(this._fillX)?this._fillX:this._shape.x,L=!isNaN(this._fillY)?this._fillY:this._shape.y,O=this._fillWidth||(this._shape.w),Y=this._fillHeight||(this._shape.h),T=this._context,S=this[G+"Rotation"],W,U,V,K,P,J,Z,X,F,D,E=N+O/2,C=L+Y/2,I=Math.PI/180,R=parseFloat(parseFloat(Math.tan(S*I)).toFixed(8));if(Math.abs(R)*O/2>=Y/2){if(S<180){F=L;D=L+Y;}else{F=L+Y;D=L;}Z=E-((C-F)/R);X=E-((C-D)/R);}else{if(S>90&&S<270){Z=N+O;X=N;}else{Z=N;X=N+O;}F=((R*(E-Z))-C)*-1;D=((R*(E-X))-C)*-1;}J=T.createLinearGradient(Z,F,X,D);U=M.length;P=0;for(W=0;W<U;++W){V=M[W];K=Q[W]||W/(U-1);J.addColorStop(K,V);P=(W+1)/U;}return J;},_getRadialGradient:function(L){var D="_"+L,C=this[D+"Colors"],I=this[D+"Ratios"],H,F,P=this._fillWidth||this._shape.w,J=this._fillHeight||this._shape.h,N=!isNaN(this._fillX)?this._fillX:this._shape.x,M=!isNaN(this._fillY)?this._fillY:this._shape.y,G,K,E,O,Q=this._context;N+=P/2;M+=J/2;O=Q.createRadialGradient(N,M,1,N,M,P/2);F=C.length;E=0;for(H=0;H<F;++H){G=C[H];K=I[H]||H/(F-1);O.addColorStop(K,G);}return O;},_draw:function(){if(this._drawingComplete||!this._shape){return;}var C=this._context,D;if(this._fillType){D=this._getFill();if(D){C.fillStyle=D;}C.closePath();}if(this._fillType){C.fill();}if(this._stroke){C.strokeStyle=this._strokeStyle;C.stroke();}this._drawingComplete=true;},_drawingComplete:false,_reHex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,_2RGBA:function(D,C){C=(C!==undefined)?C:1;if(this._reHex.exec(D)){D="rgba("+[parseInt(RegExp.$1,16),parseInt(RegExp.$2,16),parseInt(RegExp.$3,16)].join(",")+","+C+")";}return D;},_createDummy:function(){var C=b.config.doc.createElement("div");C.style.height=0;C.style.width=0;C.style.overflow="hidden";b.config.doc.documentElement.appendChild(C);return C;},_createGraphic:function(C){var D=b.config.doc.createElement("canvas");D.width=600;D.height=600;return D;},_2RGB:function(C){this._dummy.style.background=C;return this._dummy.style.backgroundColor;},_trackSize:function(C,D){if(C>this._width){this._width=C;}if(D>this._height){this._height=D;}},_trackPos:function(C,D){if(C>this._x){this._x=C;}if(D>this._y){this._y=D;}},_updateShapeProps:function(C,F){var D,E;if(!this._shape){this._shape={};}if(!this._shape.x){this._shape.x=C;}else{this._shape.x=Math.min(this._shape.x,C);}if(!this._shape.y){this._shape.y=F;}else{this._shape.y=Math.min(this._shape.y,F);}D=Math.abs(C-this._shape.x);if(!this._shape.w){this._shape.w=D;}else{this._shape.w=Math.max(D,this._shape.w);}E=Math.abs(F-this._shape.y);if(!this._shape.h){this._shape.h=E;}else{this._shape.h=Math.max(E,this._shape.h);}},getShape:function(C){C.graphic=this;return new b.Shape(C);}};b.CanvasDrawingUtil=m;b.CanvasGraphic=b.Base.create("graphic",b.CanvasDrawingUtil,[],{autoSize:true,setSize:function(C,D){if(this.autoSize){if(C>this.node.getAttribute("width")){this.node.style.width=C+"px";this._canvas.style.width=C+"px";this._canvas.width=C;this.node.setAttribute("width",C);}if(D>this.node.getAttribute("height")){this.node.style.height=D+"px";this._canvas.style.height=D+"px";this._canvas.height=D;this.node.setAttribute("height",D);}}},_trackSize:function(C,D){if(C>this._width){this._width=C;}if(D>this._height){this._height=D;}this.setSize(C,D);},setPosition:function(C,D){this.node.style.left=C+"px";this.node.style.top=D+"px";},render:function(C){C=C||b.config.doc.body;this.node=document.createElement("div");this.node.style.width=C.offsetWidth+"px";this.node.style.height=C.offsetHeight+"px";this.node.style.display="block";this.node.style.position="absolute";this.node.style.left=C.getStyle("left");this.node.style.top=C.getStyle("top");this.node.style.pointerEvents="none";C.appendChild(this.node);this.node.appendChild(this._canvas);this._canvas.width=C.offsetWidth>0?C.offsetWidth:100;this._canvas.height=C.offsetHeight>0?C.offsetHeight:100;this._canvas.style.position="absolute";return this;},toggleVisible:function(C){this.node.style.visibility=C?"visible":"hidden";},_createGraphicNode:function(C){var D=b.config.doc.createElement("canvas");D.style.pointerEvents=C||"none";if(!this._graphicsList){this._graphicsList=[];
11 }this._graphicsList.push(D);return D;},destroy:function(){this._removeChildren(this.node);if(this.node&&this.node.parentNode){this.node.parentNode.removeChild(this.node);}},_removeChildren:function(C){if(C.hasChildNodes()){var D;while(C.firstChild){D=C.firstChild;this._removeChildren(D);C.removeChild(D);}}},node:null});if(j=="canvas"){b.Graphic=b.CanvasGraphic;}var c=function(C){this.initializer.apply(this,arguments);};c.prototype={initializer:function(D){D=D||{};var C=D.width||0,E=D.height||0;this.node=this._createGraphics();this.setSize(C,E);this._initProps();},beginBitmapFill:function(C){var D={};D.src=C.bitmap.src;D.type="tile";this._fillProps=D;if(!isNaN(C.tx)||!isNaN(C.ty)||!isNaN(C.width)||!isNaN(C.height)){this._gradientBox={tx:C.tx,ty:C.ty,width:C.width,height:C.height};}else{this._gradientBox=null;}},beginFill:function(C,D){if(C){if(b.Lang.isNumber(D)){this._fillProps={type:"solid",opacity:D};}this._fillColor=C;this._fill=1;}return this;},beginGradientFill:function(E){var J=E.type,C=E.colors,D=E.alphas||[],H=E.ratios||[],M={colors:C,ratios:H},I=D.length,G=0,F,K,L=E.rotation||0;for(;G<I;++G){F=D[G];F=b.Lang.isNumber(F)?F:1;K=G>0?G+1:"";D[G]=Math.round(F*100)+"%";M["opacity"+K]=F;}if(J==="linear"){if(E){}if(L>0&&L<=90){L=450-L;}else{if(L<=270){L=270-L;}else{if(L<=360){L=630-L;}else{L=270;}}}M.type="gradientunscaled";M.angle=L;}else{if(J==="radial"){M.alignshape=false;M.type="gradientradial";M.focus="100%";M.focusposition="50%,50%";}}M.ratios=H||[];if(!isNaN(E.tx)||!isNaN(E.ty)||!isNaN(E.width)||!isNaN(E.height)){this._gradientBox={tx:E.tx,ty:E.ty,width:E.width,height:E.height};}else{this._gradientBox=null;}this._fillProps=M;},clear:function(){this._path="";this._removeChildren(this.node);},destroy:function(){this._removeChildren(this.node);this.node.parentNode.removeChild(this.node);},_removeChildren:function(C){if(C.hasChildNodes()){var D;while(C.firstChild){D=C.firstChild;this._removeChildren(D);C.removeChild(D);}}},toggleVisible:function(C){this._toggleVisible(this.node,C);},_toggleVisible:function(G,H){var F=b.one(G).get("children"),D=H?"visible":"hidden",E=0,C;if(F){C=F.length;for(;E<C;++E){this._toggleVisible(F[E],H);}}G.style.visibility=D;},curveTo:function(E,D,G,F,C,H){this._shape="shape";this._path+=" c "+Math.round(E)+", "+Math.round(D)+", "+Math.round(G)+", "+Math.round(F)+", "+C+", "+H;this._trackSize(C,H);},quadraticCurveTo:function(E,D,C,F){this._path+=" qb "+E+", "+D+", "+C+", "+F;},drawCircle:function(C,E,D){this._width=this._height=D*2;this._x=C-D;this._y=E-D;this._shape="oval";this._draw();},drawEllipse:function(C,F,D,E){this._width=D;this._height=E;this._x=C;this._y=F;this._shape="oval";this._draw();},drawRect:function(C,F,D,E){this._x=C;this._y=F;this._width=D;this._height=E;this.moveTo(C,F);this.lineTo(C+D,F);this.lineTo(C+D,F+E);this.lineTo(C,F+E);this.lineTo(C,F);this._draw();},drawRoundRect:function(C,H,D,F,E,G){this._x=C;this._y=H;this._width=D;this._height=F;this.moveTo(C,H+G);this.lineTo(C,H+F-G);this.quadraticCurveTo(C,H+F,C+E,H+F);this.lineTo(C+D-E,H+F);this.quadraticCurveTo(C+D,H+F,C+D,H+F-G);this.lineTo(C+D,H+G);this.quadraticCurveTo(C+D,H,C+D-E,H);this.lineTo(C+E,H);this.quadraticCurveTo(C,H,C,H+G);this._draw();},drawWedge:function(E,H,G,F,D,C){this._drawingComplete=false;this._width=D;this._height=D;C=C||D;this._path+=this._getWedgePath({x:E,y:H,startAngle:G,arc:F,radius:D,yRadius:C});this._width=D*2;this._height=this._width;this._shape="shape";this._draw();},_getWedgePath:function(F){var E=F.x,J=F.y,H=F.startAngle,G=F.arc,D=F.radius,C=F.yRadius||D,I;if(Math.abs(G)>360){G=360;}H*=-65535;G*=65536;I=" m "+E+" "+J+" ae "+E+" "+J+" "+D+" "+C+" "+H+" "+G;return I;},end:function(){if(this._shape){this._draw();}this._initProps();},lineGradientStyle:function(){},lineStyle:function(F,E,J,H,G,I,C,D){this._stroke=1;this._strokeWeight=F*0.7;this._strokeColor=E;this._strokeOpacity=b.Lang.isNumber(J)?J:1;},lineTo:function(H,G,E){var D=arguments,F,C;if(typeof H==="string"||typeof H==="number"){D=[[H,G]];}C=D.length;this._shape="shape";this._path+=" l ";for(F=0;F<C;++F){this._path+=" "+Math.round(D[F][0])+", "+Math.round(D[F][1]);this._trackSize.apply(this,D[F]);}},moveTo:function(C,D){this._path+=" m "+Math.round(C)+", "+Math.round(D);},setSize:function(C,D){C=Math.round(C);D=Math.round(D);this.node.style.width=C+"px";this.node.style.height=D+"px";this.node.coordSize=C+" "+D;this._canvasWidth=C;this._canvasHeight=D;},setPosition:function(C,D){C=Math.round(C);D=Math.round(D);this.node.style.left=C+"px";this.node.style.top=D+"px";},render:function(C){var D=Math.max(C.offsetWidth||0,this._canvasWidth),E=Math.max(C.offsetHeight||0,this._canvasHeight);C=C||b.config.doc.body;C.appendChild(this.node);this.setSize(D,E);this._initProps();return this;},_shape:null,_trackSize:function(C,D){if(C>this._width){this._width=C;}if(D>this._height){this._height=D;}},_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;},_clearPath:function(){this._shape=null;this._path="";this._width=0;this._height=0;this._x=0;this._y=0;},_draw:function(){var E=this._createGraphicNode(this._shape),C=Math.round(this._width),F=Math.round(this._height),G,D=this._fillProps;this.setSize(C,F);if(this._path){if(this._fill||this._fillProps){this._path+=" x";}if(this._stroke){this._path+=" e";}E.path=this._path;E.coordSize=C+", "+F;}else{E.style.display="block";E.style.position="absolute";E.style.left=this._x+"px";E.style.top=this._y+"px";}if(this._fill){E.fillColor=this._fillColor;}else{E.filled=false;}if(this._stroke&&this._strokeWeight>0){E.strokeColor=this._strokeColor;E.strokeWeight=this._strokeWeight;if(b.Lang.isNumber(this._strokeOpacity)&&this._strokeOpacity<1){G=this._createGraphicNode("stroke");E.appendChild(G);G.opacity=this._strokeOpacity;}}else{E.stroked=false;}E.style.width=C+"px";E.style.height=F+"px";
12 if(D){E.filled=true;E.appendChild(this._getFill());}this.node.appendChild(E);this._clearPath();},_getFill:function(){var P=this._createGraphicNode("fill"),N=this._width,I=this._height,J=this._fillProps,D,O,G=0,C,M="",K,H,L=Math.sqrt(Math.pow(N,2)+Math.pow(I,2)),F=50,E=50;if(this._gradientBox){F=Math.round((this._gradientBox.width/2-((this._x-this._gradientBox.tx)*L/N))/(N*N/L)*100);E=Math.round((this._gradientBox.height/2-((this._y-this._gradientBox.ty)*L/I))/(I*I/L)*100);J.focussize=(this._gradientBox.width/N)/10+" "+(this._gradientBox.height/I)/10;}if(J.colors){C=J.colors.concat();H=J.ratios.concat();K=C.length;for(;G<K;++G){O=H[G]||G/(K-1);O=Math.round(100*O)+"%";M+=", "+O+" "+C[G];}if(parseInt(O,10)<100){M+=", 100% "+C[K-1];}}for(D in J){if(J.hasOwnProperty(D)){P.setAttribute(D,J[D]);}}P.colors=M.substr(2);if(J.type==="gradientradial"){P.focusposition=F+"%,"+E+"%";}return P;},_createGraphics:function(){var C=this._createGraphicNode("group");C.style.display="inline-block";C.style.position="absolute";return C;},_createGraphicNode:function(C){return document.createElement("<"+C+' xmlns="urn:schemas-microsft.com:vml" class="vml'+C+'"/>');},_getNodeShapeType:function(D){var C="shape";if(this._typeConversionHash.hasOwnProperty(D)){C=this._typeConversionHash[D];}return C;},_typeConversionHash:{circle:"oval",ellipse:"oval",rect:"rect"},getShape:function(C){C.graphic=this;return new b.Shape(C);},addChild:function(C){this.node.appendChild(C);}};if(j=="vml"){var i=document.createStyleSheet();i.addRule(".vmlgroup","behavior:url(#default#VML)",i.rules.length);i.addRule(".vmlgroup","display:inline-block",i.rules.length);i.addRule(".vmlgroup","zoom:1",i.rules.length);i.addRule(".vmlshape","behavior:url(#default#VML)",i.rules.length);i.addRule(".vmlshape","display:inline-block",i.rules.length);i.addRule(".vmloval","behavior:url(#default#VML)",i.rules.length);i.addRule(".vmloval","display:inline-block",i.rules.length);i.addRule(".vmlrect","behavior:url(#default#VML)",i.rules.length);i.addRule(".vmlrect","display:block",i.rules.length);i.addRule(".vmlfill","behavior:url(#default#VML)",i.rules.length);i.addRule(".vmlstroke","behavior:url(#default#VML)",i.rules.length);b.Graphic=c;}function n(C){this._initialize(C);this._draw();}b.extend(n,b.Graphic,{type:"shape",autoSize:false,pointerEvents:"visiblePainted",_initialize:function(C){if(!C.graphic){C.graphic=new b.Graphic();}this._setProps(C);},_setProps:function(C){this.autoSize=C.autoSize||this.autoSize;this.pointerEvents=C.pointerEvents||this.pointerEvents;this.width=C.width||this.width;this.height=C.height||this.height;this.border=C.border||this.border;this.graphics=C.graphic||this.graphics;this.canvas=this.graphics;this.parentNode=this.graphics.node;this.fill=C.fill||this.fill;this.type=C.shape||this.type;this.nodetype=this._getNodeShapeType(this.type);this.props=C.props||this.props;this.path=C.path||this.path;},_draw:function(){var D,J,G,F,C=this.parentNode,H=0,E=this.width||0,I=this.height||0;if(!this.node){this.node=this._createGraphicNode(this.nodetype,this.pointerEvents);C.appendChild(this.node);}if(this.type=="wedge"){this.path=this._getWedgePath(this.props);}if(this.nodetype=="path"){this._setPath();}if(this.border&&this.border.weight&&this.border.weight>0){H=this.border.weight;E-=H*2;I-=H*2;}this._addBorder();if(this.nodetype==="ellipse"){G=this.width/2;D=this.width/2;F=this.height/2;J=this.height/2;G-=H;F-=H;this.node.setAttribute("cx",D);this.node.setAttribute("cy",J);this.node.setAttribute("rx",G);this.node.setAttribute("ry",F);}else{this.node.setAttribute("width",E);this.node.setAttribute("height",I);this.node.style.width=E+"px";this.node.style.height=I+"px";}this._addFill();C.style.width=this.width+"px";C.style.height=this.height+"px";C.setAttribute("width",this.width);C.setAttribute("height",this.height);this.node.style.visibility="visible";this.node.setAttribute("x",H);this.node.setAttribute("y",H);return this;},_setPath:function(){if(this.path){this.path+=" Z";this.node.setAttribute("d",this.path);}},_addBorder:function(){if(this.border&&this.border.weight&&this.border.weight>0){var C=this.border.alpha;this.border.color=this.border.color||"#000000";this.border.weight=this.border.weight||1;this.border.alpha=b.Lang.isNumber(C)?C:1;this.border.linecap=this.border.linecap||"square";this.node.setAttribute("stroke",this.border.color);this.node.setAttribute("stroke-linecap",this.border.linecap);this.node.setAttribute("stroke-width",this.border.weight);this.node.setAttribute("stroke-opacity",this.border.alpha);}else{this.node.setAttribute("stroke","none");}},_addFill:function(){var C;if(this.fill.type==="linear"||this.fill.type==="radial"){this.beginGradientFill(this.fill);this.node.appendChild(this._getFill());}else{if(this.fill.type==="bitmap"){this.beginBitmapFill(this.fill);this.node.appendChild(this._getFill());}else{if(!this.fill.color){this.node.setAttribute("fill","none");}else{C=this.fill.alpha;this.fill.alpha=b.Lang.isNumber(C)?C:1;this.node.setAttribute("fill",this.fill.color);this.node.setAttribute("fill-opacity",C);}}}},end:function(){this._setPath();},update:function(C){this._setProps(C);this._draw();return this;},_getNodeShapeType:function(C){if(this._typeConversionHash.hasOwnProperty(C)){C=this._typeConversionHash[C];}return C;},toggleVisible:function(D){var C=D?"visible":"hidden";if(this.node){this.node.style.visibility=C;}},addClass:function(C){var D=this.node;if(D){if(D.className&&D.className.baseVal){D.className.baseVal=b.Lang.trim([D.className.baseVal,C].join(" "));}else{D.setAttribute("class",C);}}},setPosition:function(C,F){var D=b.one(this.parentNode),E=this.hotspot;D.setStyle("position","absolute");D.setStyle("left",C);D.setStyle("top",F);if(E){E.setStyle("position","absolute");E.setStyle("left",C);E.setStyle("top",F);}},_typeConversionHash:{circle:"ellipse",wedge:"path"}});b.Shape=n;function s(C){this._dummy=this._createDummy();this._canvas=this._createGraphic();this.node=this._canvas;this._context=this._canvas.getContext("2d");
13 this._initialize(C);this._validate();}b.extend(s,b.CanvasDrawingUtil,{type:"shape",autoSize:false,_initialize:function(C){this._canvas.style.position="absolute";if(C.graphic){C.graphic.node.appendChild(this._canvas);}this._setProps(C);},_setProps:function(C){this.autoSize=C.autoSize||this.autoSize;this.width=C.width||this.width;this.height=C.height||this.height;this.border=C.border||this.border;this.graphics=C.graphic||this.graphics;this.fill=C.fill||this.fill;this.type=C.shape||this.type;this.props=C.props||this.props;this.path=C.path||this.path;this.props=C.props||this.props;this.parentNode=this.graphics.node;},_validate:function(){var C=this.width,F=this.height,D=this.border,E=this.type,G=this.fill;this.clear();this.setSize(this.width,this.height);this._canvas.style.top="0px";this._canvas.style.left="0px";if(D&&D.weight&&D.weight>0){D.color=D.color||"#000";D.alpha=D.alpha||1;this.lineStyle(D.weight,D.color,D.alpha);}if(G.type==="radial"||G.type==="linear"){this.beginGradientFill(G);}else{if(G.type==="bitmap"){this.beginBitmapFill(G);}else{this.beginFill(G.color,G.alpha);}}switch(E){case"circle":this.drawEllipse(0,0,C,F);break;case"rect":this.drawRect(0,0,C,F);break;case"wedge":this.drawWedge(this.props);break;}return this;},update:function(C){this._setProps(C);this._validate();return this;},toggleVisible:function(D){var C=D?"visible":"hidden";if(this.node){this.node.style.visibility=C;}},setPosition:function(C,E){var D=b.one(this.parentNode);D.setStyle("position","absolute");D.setStyle("left",C);D.setStyle("top",E);},addClass:function(C){if(this.node){this.node.style.pointerEvents="painted";this.node.setAttribute("class",C);}}});b.CanvasShape=s;if(j=="canvas"){b.Shape=b.CanvasShape;}function B(C){this._initialize(C);this._draw();}B.prototype={type:"shape",_initialize:function(C){if(!C.graphic){C.graphic=new b.Graphic();}this._setProps(C);},width:0,height:0,_setProps:function(C){this.width=C.width&&C.width>=0?C.width:this.width;this.height=C.height&&C.height>=0?C.height:this.height;this.border=C.border||this.border;this.graphics=C.graphic||this.graphics;this.canvas=this.graphics;this.parentNode=this.graphics.node;this.fill=C.fill||this.fill;this.type=C.shape||this.type;this.props=C.props||this.props;},_draw:function(){var D,E=0,C=this.width||0,F=this.height||0;this.graphics.setSize(C,F);if(this.node){this.node.style.visible="hidden";}else{if(!this.node){this.node=this.graphics._createGraphicNode(this.graphics._getNodeShapeType(this.type));this.graphics.node.appendChild(this.node);}}if(this.type==="wedge"){D=this.graphics._getWedgePath(this.props);if(this.fill){D+=" x";}if(this.border){D+=" e";}this.node.path=D;}this._addBorder();if(this.border&&this.border.weight&&this.border.weight>0){E=this.border.weight;C-=E;F-=E;}this.node.style.width=Math.max(C,0)+"px";this.node.style.height=Math.max(F,0)+"px";this._addFill();return this;},_addBorder:function(){if(this.border&&this.border.weight&&this.border.weight>0){var C=this.border.alpha,D=this.borderWeight;C=b.Lang.isNumber(C)?C:1;D=b.Lang.isNumber(D)?D:1;this.node.strokecolor=this.border.color||"#000000";this.node.strokeweight=D;if(C<1){if(!this._strokeNode){this._strokeNode=this.graphics._createGraphicNode("stroke");this.node.appendChild(this._strokeNode);}this._strokeNode.opacity=C;}else{if(this._strokeNode){this._strokeNode.opacity=C;}}this.node.stroked=true;}else{this.node.stroked=false;}},_addFill:function(){var C;this.node.filled=true;if(this.fill.type==="linear"||this.fill.type==="radial"){this.graphics.beginGradientFill(this.fill);this.node.appendChild(this.graphics._getFill());}else{if(this.fill.type==="bitmap"){this.graphics.beginBitmapFill(this.fill);this.node.appendChild(this.graphics._getFill());}else{if(!this.fill.color){this.node.filled=false;}else{if(this.fillnode){this.graphics._removeChildren(this.fillnode);}C=this.fill.alpha;C=b.Lang.isNumber(C)?C:1;this.fill.alpha=C;this.fillnode=this.graphics._createGraphicNode("fill");this.fillnode.type="solid";this.fillnode.color=this.fill.color;this.fillnode.opacity=C;this.node.appendChild(this.fillnode);}}}},addClass:function(D){var C=this.node;if(C){b.one(C).addClass(D);}},toggleVisible:function(D){var C=D?"visible":"hidden";if(this.node){b.one(this.node).setStyle("visibility",C);}},setPosition:function(C,E){var D=b.one(this.parentNode);D.setStyle("position","absolute");D.setStyle("left",C);D.setStyle("top",E);},update:function(C){this._setProps(C);this._draw();return this;}};b.VMLShape=B;if(j=="vml"){b.Shape=B;}function v(){}v.ATTRS={styles:{getter:function(){this._styles=this._styles||this._getDefaultStyles();return this._styles;},setter:function(C){this._styles=this._setStyles(C);}},graphic:{}};v.NAME="renderer";v.prototype={_styles:null,_setStyles:function(D){var C=this.get("styles");return this._mergeStyles(D,C);},_mergeStyles:function(D,C){if(!C){C={};}var E=b.merge(C,{});b.Object.each(D,function(H,G,F){if(C.hasOwnProperty(G)&&b.Lang.isObject(H)&&!b.Lang.isArray(H)){E[G]=this._mergeStyles(H,C[G]);}else{E[G]=H;}},this);return E;},_getDefaultStyles:function(){return{padding:{top:0,right:0,bottom:0,left:0}};}};b.augment(v,b.Attribute);b.Renderer=v;b.Axis=b.Base.create("axis",b.Widget,[b.Renderer],{_dataChangeHandler:function(C){if(this.get("rendered")){this._drawAxis();}},_updateHandler:function(C){if(this.get("rendered")){this._drawAxis();}},_positionChangeHandler:function(D){var C=this.get("position");if(C=="none"){return;}this._layout=this.getLayout(this.get("position"));if(this.get("rendered")){this._drawAxis();}},renderUI:function(){var C=this.get("position");if(C&&C!="none"){this._layout=this.getLayout(C);this._setCanvas();}},syncUI:function(){this._drawAxis();},_setCanvas:function(){var C=this.get("contentBox"),H=this.get("boundingBox"),G=this.get("position"),E=this._parentNode,D=this.get("width"),F=this.get("height");H.setStyle("position","absolute");D=D?D+"px":E.getStyle("width");F=F?F+"px":E.getStyle("height");if(G==="top"||G==="bottom"){C.setStyle("width",D);}else{C.setStyle("height",F);
14 }C.setStyle("position","relative");C.setStyle("left","0px");C.setStyle("top","0px");this.set("graphic",new b.Graphic());this.get("graphic").render(C);},_getDefaultStyles:function(){var C={majorTicks:{display:"inside",length:4,color:"#dad8c9",weight:1,alpha:1},minorTicks:{display:"none",length:2,color:"#dad8c9",weight:1},line:{weight:1,color:"#dad8c9",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};return b.merge(b.Renderer.prototype._getDefaultStyles(),C);},_handleSizeChange:function(F){var E=F.attrName,H=this.get("position"),D=H=="left"||H=="right",C=this.get("contentBox"),G=H=="bottom"||H=="top";C.setStyle("width",this.get("width"));C.setStyle("height",this.get("height"));if((G&&E=="width")||(D&&E=="height")){this._drawAxis();}},_layout:null,getLayout:function(D){var C;switch(D){case"top":C=new b.TopAxisLayout({axisRenderer:this});break;case"bottom":C=new b.BottomAxisLayout({axisRenderer:this});break;case"left":C=new b.LeftAxisLayout({axisRenderer:this});break;case"right":C=new b.RightAxisLayout({axisRenderer:this});break;}return C;},drawLine:function(E,D,C){var F=this.get("graphic");F.lineStyle(C.weight,C.color,C.alpha);F.moveTo(E.x,E.y);F.lineTo(D.x,D.y);F.end();},_drawAxis:function(){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;if(this.get("position")!="none"){var S=this.get("styles"),N=S.majorTicks,O=N.display!="none",F,M=S.majorUnit,L,Q,H=0,D,I,K,R,J=this._layout,G=this.get("labelFunction"),P=this.get("labelFunctionScope"),E=this.get("labelFormat"),C=this.get("graphic");C.clear();J.setTickOffsets();D=this.getLength();K=J.getLineStart();L=this.getTotalMajorUnits(M);Q=this.getMajorUnitDistance(L,D,M);this.set("edgeOffset",this.getEdgeOffset(L,D)*0.5);F=this.getFirstPoint(K);this.drawLine(K,this.getLineEnd(F),S.line);if(O){J.drawTick(F,N);}if(L<1){this._clearLabelCache();return;}this._createLabelCache();this._tickPoints=[];J.set("maxLabelSize",0);for(;H<L;++H){if(O){J.drawTick(F,N);}I=this.getPosition(F);R=this.getLabel(F);R.innerHTML=G.apply(P,[this.getLabelByIndex(H,L),E]);F=this.getNextPoint(F,Q);}this._clearLabelCache();J.setSizeAndPosition();if(this.get("overlapGraph")){J.offsetNodeForTick(this.get("contentBox"));}J.setCalculatedSize();for(H=0;H<L;++H){J.positionLabel(this.get("labels")[H],this._tickPoints[H]);}}this._drawing=false;if(this._callLater){this._drawAxis();}else{this.fire("axisRendered");}},_labels:null,_labelCache:null,getLabel:function(H,I){var E,D,F={rotation:"rotation",margin:"margin",alpha:"alpha"},C=this._labelCache,G=this.get("styles").label;if(C.length>0){D=C.shift();}else{D=document.createElement("span");D.style.display="block";D.style.whiteSpace="nowrap";b.one(D).addClass("axisLabel");this.get("contentBox").appendChild(D);}D.style.position="absolute";this._labels.push(D);this._tickPoints.push({x:H.x,y:H.y});this._layout.updateMaxLabelSize(D);for(E in G){if(G.hasOwnProperty(E)&&!F.hasOwnProperty(E)){D.style[E]=G[E];}}return D;},_createLabelCache:function(){if(this._labels){if(this._labelCache){this._labelCache=this._labels.concat(this._labelCache);}else{this._labelCache=this._labels.concat();}}else{this._clearLabelCache();}this._labels=[];},_clearLabelCache:function(){if(this._labelCache){var C=this._labelCache.length,E=0,D,F=this._labelCache;for(;E<C;++E){D=F[E];D.parentNode.removeChild(D);}}this._labelCache=[];},_calculateSizeByTickLength:true,getLineEnd:function(E){var C=this.get("width"),D=this.get("height"),F=this.get("position");if(F==="top"||F==="bottom"){return{x:C,y:E.y};}else{return{x:E.x,y:D};}},getLength:function(){var D,F=this.get("styles"),G=F.padding,C=this.get("width"),E=this.get("height"),H=this.get("position");if(H==="top"||H==="bottom"){D=C-(G.left+G.right);}else{D=E-(G.top+G.bottom);}return D;},getFirstPoint:function(F){var C=this.get("styles"),G=this.get("position"),E=C.padding,D={x:F.x,y:F.y};if(G==="top"||G==="bottom"){D.x+=E.left+this.get("edgeOffset");}else{D.y+=this.get("height")-(E.top+this.get("edgeOffset"));}return D;},getNextPoint:function(C,D){var E=this.get("position");if(E==="top"||E==="bottom"){C.x=C.x+D;}else{C.y=C.y-D;}return C;},getLastPoint:function(){var D=this.get("styles"),E=D.padding,C=this.get("width"),F=this.get("position");if(F==="top"||F==="bottom"){return{x:C-E.right,y:E.top};}else{return{x:E.left,y:E.top};}},getPosition:function(C){var H,F=this.get("height"),E=this.get("styles"),G=E.padding,I=this.get("position"),D=this.get("dataType");if(I==="left"||I==="right"){if(D==="numeric"){H=(F-(G.top+G.bottom))-(C.y-G.top);}else{H=C.y-G.top;}}else{H=C.x-G.left;}return H;}},{ATTRS:{edgeOffset:{value:0},graphic:{},node:{},position:{lazyAdd:false,setOnce:true,setter:function(C){if(C=="none"){this.bindUI();}return C;}},topTickOffset:{value:0},bottomTickOffset:{value:0},leftTickOffset:{value:0},rightTickOffset:{value:0},labels:{readOnly:true,getter:function(){return this._labels;}},tickPoints:{readOnly:true,getter:function(){if(this.get("position")=="none"){return this.get("styles").majorUnit.count;}return this._tickPoints;}},overlapGraph:{value:true,validator:function(C){return b.Lang.isBoolean(C);}},labelFunctionScope:{}}});function p(C){p.superclass.constructor.apply(this,arguments);}p.ATTRS={axisRenderer:{value:null},maxLabelSize:{value:0}};b.extend(p,b.Base,{setTickOffsets:function(){var C=this.get("axisRenderer"),G=C.get("styles").majorTicks,E=G.length,D=E*0.5,F=G.display;C.set("topTickOffset",0);C.set("bottomTickOffset",0);switch(F){case"inside":C.set("rightTickOffset",E);C.set("leftTickOffset",0);break;case"outside":C.set("rightTickOffset",0);C.set("leftTickOffset",E);break;case"cross":C.set("rightTickOffset",D);C.set("leftTickOffset",D);break;default:C.set("rightTickOffset",0);C.set("leftTickOffset",0);break;}},drawTick:function(I,G){var D=this.get("axisRenderer"),E=D.get("styles"),H=E.padding,F=G.length,J={x:H.left,y:I.y},C={x:F+H.left,y:I.y};
15 D.drawLine(J,C,G);},getLineStart:function(){var C=this.get("axisRenderer"),D=C.get("styles"),H=D.padding,I=D.majorTicks,E=I.length,G=I.display,F={x:H.left,y:0};if(G==="outside"){F.x+=E;}else{if(G==="cross"){F.x+=E/2;}}return F;},getLabelPoint:function(C){var D=this.get("axisRenderer");return{x:C.x-D.get("leftTickOffset"),y:C.y};},updateMaxLabelSize:function(N){var H=this.get("axisRenderer"),C=H.get("styles").label,E=Math.min(90,Math.max(-90,C.rotation)),I=Math.abs(E),L=Math.PI/180,O=parseFloat(parseFloat(Math.sin(I*L)).toFixed(8)),F=parseFloat(parseFloat(Math.cos(I*L)).toFixed(8)),K=F,J=E>0?-O:O,G=-J,D=K,M;if(!document.createElementNS){N.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+K+" M12="+J+" M21="+G+" M22="+D+' sizingMethod="auto expand")';this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),N.offsetWidth));}else{N.style.msTransform="rotate(0deg)";if(E===0){M=N.offsetWidth;}else{if(I===90){M=N.offsetHeight;}else{M=(F*N.offsetWidth)+(O*N.offsetHeight);}}this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),M));}},positionLabel:function(J,R){var Q=this.get("axisRenderer"),E=Q.get("leftTickOffset"),U=Q.get("styles").label,M=U.alpha,T,P=0,L=R.x,S=R.y,K=Math.min(90,Math.max(-90,U.rotation)),D=Math.abs(K),G=Math.PI/180,O=parseFloat(parseFloat(Math.sin(D*G)).toFixed(8)),I=parseFloat(parseFloat(Math.cos(D*G)).toFixed(8)),X=I,W=K>0?-O:O,H=-W,F=X,N=this.get("maxLabelSize"),V=Math.round(J.offsetWidth),C=Math.round(J.offsetHeight);if(U.margin&&U.margin.right){P=U.margin.right;}if(!document.createElementNS){J.style.filter=null;V=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(K===0){L=V;S-=C*0.5;}else{if(D===90){L=C;S-=V*0.5;}else{if(K>0){L=(I*V)+(C*K/90);S-=(O*V)+(I*(C*0.5));}else{L=(I*V)+(D/90*C);S-=I*(C*0.5);}}}L+=E;J.style.left=((R.x+N)-L)+"px";J.style.top=S+"px";if(T){T+=" ";}if(b.Lang.isNumber(M)&&M<1&&M>-1&&!isNaN(M)){T="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(M*100)+")";}if(K!==0){if(T){T+=" ";}else{T="";}T+="progid:DXImageTransform.Microsoft.Matrix(M11="+X+" M12="+W+" M21="+H+" M22="+F+' sizingMethod="auto expand")';}if(T){J.style.filter=T;}return;}J.style.msTransform="rotate(0deg)";V=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(K===0){L-=V;S-=C*0.5;}else{if(K===90){S-=V*0.5;}else{if(K===-90){L-=C;S+=V*0.5;}else{if(K<0){L-=(I*V)+(O*C);S+=(O*V)-(I*(C*0.6));}else{L-=(I*V);S-=(O*V)+(I*(C*0.6));}}}}L-=E;J.style.left=(this.get("maxLabelSize")+L)+"px";J.style.top=S+"px";J.style.MozTransformOrigin="0 0";J.style.MozTransform="rotate("+K+"deg)";J.style.webkitTransformOrigin="0 0";J.style.webkitTransform="rotate("+K+"deg)";J.style.msTransformOrigin="0 0";J.style.msTransform="rotate("+K+"deg)";J.style.OTransformOrigin="0 0";J.style.OTransform="rotate("+K+"deg)";},setSizeAndPosition:function(){var C=this.get("maxLabelSize"),D=this.get("axisRenderer"),E=D.get("styles"),I=D.get("leftTickOffset"),G=C+I,H=D.get("graphic"),F=E.label.margin;if(F&&F.right){G+=F.right;}G=Math.round(G);D.set("width",G);D.get("contentBox").setStyle("width",G);b.one(H.node).setStyle("left",C+F.right);},offsetNodeForTick:function(C){},setCalculatedSize:function(){var E=this.get("axisRenderer"),G=E.get("styles"),F=G.label,H=E.get("leftTickOffset"),D=this.get("maxLabelSize"),C=Math.round(H+D+F.margin.right);E.get("contentBox").setStyle("width",C);E.set("width",C);}});b.LeftAxisLayout=p;function t(C){t.superclass.constructor.apply(this,arguments);}t.ATTRS={axisRenderer:{value:null}};b.extend(t,b.Base,{setTickOffsets:function(){var C=this.get("axisRenderer"),G=C.get("styles").majorTicks,E=G.length,D=E*0.5,F=G.display;C.set("topTickOffset",0);C.set("bottomTickOffset",0);switch(F){case"inside":C.set("leftTickOffset",E);C.set("rightTickOffset",0);break;case"outside":C.set("leftTickOffset",0);C.set("rightTickOffset",E);break;case"cross":C.set("rightTickOffset",D);C.set("leftTickOffset",D);break;default:C.set("leftTickOffset",0);C.set("rightTickOffset",0);break;}},drawTick:function(I,G){var D=this.get("axisRenderer"),E=D.get("styles"),H=E.padding,F=G.length,J={x:H.left,y:I.y},C={x:H.left+F,y:I.y};D.drawLine(J,C,G);},getLineStart:function(){var C=this.get("axisRenderer"),D=C.get("styles"),H=D.padding,I=D.majorTicks,E=I.length,G=I.display,F={x:H.left,y:H.top};if(G==="inside"){F.x+=E;}else{if(G==="cross"){F.x+=E/2;}}return F;},getLabelPoint:function(C){var D=this.get("axisRenderer");return{x:C.x+D.get("rightTickOffset"),y:C.y};},updateMaxLabelSize:function(N){var H=this.get("axisRenderer"),C=H.get("styles").label,E=Math.min(90,Math.max(-90,C.rotation)),I=Math.abs(E),L=Math.PI/180,O=parseFloat(parseFloat(Math.sin(I*L)).toFixed(8)),F=parseFloat(parseFloat(Math.cos(I*L)).toFixed(8)),K=F,J=E>0?-O:O,G=-J,D=K,M;if(!document.createElementNS){N.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+K+" M12="+J+" M21="+G+" M22="+D+' sizingMethod="auto expand")';this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),N.offsetWidth));}else{N.style.msTransform="rotate(0deg)";if(E===0){M=N.offsetWidth;}else{if(I===90){M=N.offsetHeight;}else{M=(F*N.offsetWidth)+(O*N.offsetHeight);}}this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),M));}},positionLabel:function(J,Q){var P=this.get("axisRenderer"),E=P.get("rightTickOffset"),T=P.get("styles").label,M=T.alpha,S,O=0,L=Q.x,R=Q.y,K=Math.min(Math.max(T.rotation,-90),90),D=Math.abs(K),G=Math.PI/180,N=parseFloat(parseFloat(Math.sin(D*G)).toFixed(8)),I=parseFloat(parseFloat(Math.cos(D*G)).toFixed(8)),W=I,V=K>0?-N:N,H=-V,F=W,U=Math.round(J.offsetWidth),C=Math.round(J.offsetHeight);if(T.margin&&T.margin.right){O=T.margin.right;}if(!document.createElementNS){J.style.filter=null;if(K===0){R-=C*0.5;}else{if(D===90){R-=U*0.5;}else{if(K>0){R-=(I*(C*0.5));}else{R-=(N*U)+(I*(C*0.5));}}}L+=O;L+=E;J.style.left=L+"px";J.style.top=R+"px";if(b.Lang.isNumber(M)&&M<1&&M>-1&&!isNaN(M)){S="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(M*100)+")";}if(K!==0){if(S){S+=" ";}else{S="";}S+="progid:DXImageTransform.Microsoft.Matrix(M11="+W+" M12="+V+" M21="+H+" M22="+F+' sizingMethod="auto expand")';
16 }if(S){J.style.filter=S;}return;}J.style.msTransform="rotate(0deg)";U=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(K===0){R-=C*0.5;}else{if(K===90){L+=C;R-=U*0.5;}else{if(K===-90){R+=U*0.5;}else{if(K<0){R-=(I*(C*0.6));}else{R-=I*(C*0.6);L+=N*C;}}}}L+=O;L+=E;J.style.left=L+"px";J.style.top=R+"px";J.style.MozTransformOrigin="0 0";J.style.MozTransform="rotate("+K+"deg)";J.style.webkitTransformOrigin="0 0";J.style.webkitTransform="rotate("+K+"deg)";J.style.msTransformOrigin="0 0";J.style.msTransform="rotate("+K+"deg)";J.style.OTransformOrigin="0 0";J.style.OTransform="rotate("+K+"deg)";},setSizeAndPosition:function(){var D=this.get("axisRenderer"),E=D.get("styles").label,C=this.get("maxLabelSize"),G=D.get("rightTickOffset"),F=G+C;if(E.margin&&E.margin.weight){F+=E.margin.weight;}D.set("width",F);D.get("contentBox").setStyle("width",F);},offsetNodeForTick:function(C){var D=this.get("axisRenderer"),F=D.get("leftTickOffset"),E=0-F;C.setStyle("left",E);},setCalculatedSize:function(){var D=this.get("axisRenderer"),E=D.get("styles").label,C=Math.round(D.get("rightTickOffset")+this.get("maxLabelSize")+E.margin.left);D.set("width",C);}});b.RightAxisLayout=t;function x(C){x.superclass.constructor.apply(this,arguments);}x.ATTRS={axisRenderer:{value:null},maxLabelSize:{value:0}};b.extend(x,b.Base,{setTickOffsets:function(){var C=this.get("axisRenderer"),G=C.get("styles").majorTicks,E=G.length,D=E*0.5,F=G.display;C.set("leftTickOffset",0);C.set("rightTickOffset",0);switch(F){case"inside":C.set("topTickOffset",E);C.set("bottomTickOffset",0);break;case"outside":C.set("topTickOffset",0);C.set("bottomTickOffset",E);break;case"cross":C.set("topTickOffset",D);C.set("bottomTickOffset",D);break;default:C.set("topTickOffset",0);C.set("bottomTickOffset",0);break;}},getLineStart:function(){var C=this.get("axisRenderer"),D=C.get("styles"),H=D.padding,I=D.majorTicks,E=I.length,G=I.display,F={x:0,y:H.top};if(G==="inside"){F.y+=E;}else{if(G==="cross"){F.y+=E/2;}}return F;},drawTick:function(I,G){var D=this.get("axisRenderer"),E=D.get("styles"),H=E.padding,F=G.length,J={x:I.x,y:H.top},C={x:I.x,y:F+H.top};D.drawLine(J,C,G);},getLabelPoint:function(C){var D=this.get("axisRenderer");return{x:C.x,y:C.y+D.get("bottomTickOffset")};},updateMaxLabelSize:function(N){var H=this.get("axisRenderer"),C=H.get("styles").label,E=Math.min(90,Math.max(-90,C.rotation)),I=Math.abs(E),L=Math.PI/180,O=parseFloat(parseFloat(Math.sin(I*L)).toFixed(8)),F=parseFloat(parseFloat(Math.cos(I*L)).toFixed(8)),K=F,J=E>0?-O:O,G=-J,D=K,M;if(!document.createElementNS){N.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+K+" M12="+J+" M21="+G+" M22="+D+' sizingMethod="auto expand")';this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),N.offsetHeight));}else{N.style.msTransform="rotate(0deg)";if(E===0){M=N.offsetHeight;}else{if(I===90){M=N.offsetWidth;}else{M=(O*N.offsetWidth)+(F*N.offsetHeight);}}this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),M));}},positionLabel:function(J,Q){var P=this.get("axisRenderer"),E=P.get("bottomTickOffset"),T=P.get("styles").label,M=T.alpha,S,O=0,L=Math.round(Q.x),R=Math.round(Q.y),K=Math.min(90,Math.max(-90,T.rotation)),D=Math.abs(K),G=Math.PI/180,N=parseFloat(parseFloat(Math.sin(D*G)).toFixed(8)),I=parseFloat(parseFloat(Math.cos(D*G)).toFixed(8)),W=I,V=K>0?-N:N,H=-V,F=W,U=Math.round(J.offsetWidth),C=Math.round(J.offsetHeight);if(T.margin&&T.margin.top){O=T.margin.top;}if(!document.createElementNS){W=I;V=K>0?-N:N;H=-V;F=W;J.style.filter=null;U=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(D===90){L-=C*0.5;}else{if(K<0){L-=I*U;L-=N*(C*0.5);}else{if(K>0){L-=N*(C*0.5);}else{L-=U*0.5;}}}R+=O;R+=E;J.style.left=Math.round(L)+"px";J.style.top=Math.round(R)+"px";if(b.Lang.isNumber(M)&&M<1&&M>-1&&!isNaN(M)){S="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(M*100)+")";}if(K!==0){if(S){S+=" ";}else{S="";}S+="progid:DXImageTransform.Microsoft.Matrix(M11="+W+" M12="+V+" M21="+H+" M22="+F+' sizingMethod="auto expand")';}if(S){J.style.filter=S;}return;}J.style.msTransform="rotate(0deg)";U=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(K===0){L-=U*0.5;}else{if(D===90){if(K===90){L+=C*0.5;}else{R+=U;L-=C*0.5;}}else{if(K<0){L-=(I*U)+(N*(C*0.6));R+=N*U;}else{L+=Math.round(N*(C*0.6));}}}R+=O;R+=E;J.style.left=Math.round(L)+"px";J.style.top=Math.round(R)+"px";J.style.MozTransformOrigin="0 0";J.style.MozTransform="rotate("+K+"deg)";J.style.webkitTransformOrigin="0 0";J.style.webkitTransform="rotate("+K+"deg)";J.style.msTransformOrigin="0 0";J.style.msTransform="rotate("+K+"deg)";J.style.OTransformOrigin="0 0";J.style.OTransform="rotate("+K+"deg)";},setSizeAndPosition:function(){var C=this.get("maxLabelSize"),D=this.get("axisRenderer"),F=D.get("bottomTickLength"),E=D.get("styles"),H=F+C,G=E.label.margin;if(G&&G.top){H+=G.top;}H=Math.round(H);D.set("height",H);},offsetNodeForTick:function(C){var D=this.get("axisRenderer");D.get("contentBox").setStyle("top",0-D.get("topTickOffset"));},setCalculatedSize:function(){var D=this.get("axisRenderer"),E=D.get("styles").label,C=Math.round(D.get("bottomTickOffset")+this.get("maxLabelSize")+E.margin.top);D.set("height",C);}});b.BottomAxisLayout=x;function a(C){a.superclass.constructor.apply(this,arguments);}a.ATTRS={axisRenderer:{value:null},maxLabelSize:{value:0}};b.extend(a,b.Base,{setTickOffsets:function(){var C=this.get("axisRenderer"),G=C.get("styles").majorTicks,E=G.length,D=E*0.5,F=G.display;C.set("leftTickOffset",0);C.set("rightTickOffset",0);switch(F){case"inside":C.set("bottomTickOffset",E);C.set("topTickOffset",0);break;case"outside":C.set("bottomTickOffset",0);C.set("topTickOffset",E);break;case"cross":C.set("topTickOffset",D);C.set("bottomTickOffset",D);break;default:C.set("topTickOffset",0);C.set("bottomTickOffset",0);break;}},getLineStart:function(){var C=this.get("axisRenderer"),D=C.get("styles"),H=D.padding,I=D.majorTicks,E=I.length,G=I.display,F={x:0,y:H.top};if(G==="outside"){F.y+=E;}else{if(G==="cross"){F.y+=E/2;}}return F;
17 },drawTick:function(I,G){var D=this.get("axisRenderer"),E=D.get("styles"),H=E.padding,F=G.length,J={x:I.x,y:H.top},C={x:I.x,y:F+H.top};D.drawLine(J,C,G);},getLabelPoint:function(D){var C=this.get("axisRenderer");return{x:D.x,y:D.y-C.get("topTickOffset")};},updateMaxLabelSize:function(N){var H=this.get("axisRenderer"),C=H.get("styles").label,E=Math.min(90,Math.max(-90,C.rotation)),I=Math.abs(E),L=Math.PI/180,O=parseFloat(parseFloat(Math.sin(I*L)).toFixed(8)),F=parseFloat(parseFloat(Math.cos(I*L)).toFixed(8)),K=F,J=E>0?-O:O,G=-J,D=K,M;if(!document.createElementNS){N.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+K+" M12="+J+" M21="+G+" M22="+D+' sizingMethod="auto expand")';this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),N.offsetHeight));}else{N.style.msTransform="rotate(0deg)";if(E===0){M=N.offsetHeight;}else{if(I===90){M=N.offsetWidth;}else{M=(O*N.offsetWidth)+(F*N.offsetHeight);}}this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),M));}},positionLabel:function(J,R){var Q=this.get("axisRenderer"),E=Q.get("topTickOffset"),U=Q.get("styles").label,M=U.alpha,T,P=0,L=R.x,S=R.y,K=Math.max(-90,Math.min(90,U.rotation)),D=Math.abs(K),G=Math.PI/180,O=parseFloat(parseFloat(Math.sin(D*G)).toFixed(8)),I=parseFloat(parseFloat(Math.cos(D*G)).toFixed(8)),X,W,H,F,N=this.get("maxLabelSize"),V=Math.round(J.offsetWidth),C=Math.round(J.offsetHeight);K=Math.min(90,K);K=Math.max(-90,K);if(U.margin&&U.margin.bottom){P=U.margin.bottom;}if(!document.createElementNS){J.style.filter=null;V=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);X=I;W=K>0?-O:O;H=-W;F=X;if(K===0){L-=V*0.5;}else{if(D===90){L-=C*0.5;}else{if(K>0){L-=(I*V)+Math.min((O*C),(K/180*C));S-=(O*V)+(I*(C));S+=N;}else{L-=O*(C*0.5);S-=(O*V)+(I*(C));S+=N;}}}S-=E;J.style.left=L;J.style.top=S;if(b.Lang.isNumber(M)&&M<1&&M>-1&&!isNaN(M)){T="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(M*100)+")";}if(K!==0){if(T){T+=" ";}else{T="";}T+="progid:DXImageTransform.Microsoft.Matrix(M11="+X+" M12="+W+" M21="+H+" M22="+F+' sizingMethod="auto expand")';}if(T){J.style.filter=T;}return;}J.style.msTransform="rotate(0deg)";V=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(K===0){L-=V*0.5;S-=C;}else{if(K===90){L+=C*0.5;S-=V;}else{if(K===-90){L-=C*0.5;S-=0;}else{if(K<0){L-=(O*(C*0.6));S-=(I*C);}else{L-=(I*V)-(O*(C*0.6));S-=(O*V)+(I*C);}}}}S-=E;J.style.left=L+"px";J.style.top=(this.get("maxLabelSize")+S)+"px";J.style.MozTransformOrigin="0 0";J.style.MozTransform="rotate("+K+"deg)";J.style.webkitTransformOrigin="0 0";J.style.webkitTransform="rotate("+K+"deg)";J.style.msTransformOrigin="0 0";J.style.msTransform="rotate("+K+"deg)";J.style.OTransformOrigin="0 0";J.style.OTransform="rotate("+K+"deg)";},setSizeAndPosition:function(){var C=this.get("maxLabelSize"),D=this.get("axisRenderer"),H=D.get("topTickOffset"),E=D.get("styles"),F=E.label.margin,I=D.get("graphic"),G=H+C;if(F&&F.bottom){G+=F.bottom;}D.set("height",G);b.one(I.node).setStyle("top",C+F.bottom);},offsetNodeForTick:function(C){},setCalculatedSize:function(){var D=this.get("axisRenderer"),E=D.get("styles").label,C=Math.round(D.get("topTickOffset")+this.get("maxLabelSize")+E.margin.bottom);D.set("height",C);}});b.TopAxisLayout=a;b.AxisType=b.Base.create("baseAxis",b.Axis,[],{bindUI:function(){this.after("dataReady",b.bind(this._dataChangeHandler,this));this.after("dataUpdate",b.bind(this._dataChangeHandler,this));this.after("minimumChange",b.bind(this._keyChangeHandler,this));this.after("maximumChange",b.bind(this._keyChangeHandler,this));this.after("keysChange",this._keyChangeHandler);this.after("dataProviderChange",this._dataProviderChangeHandler);this.after("stylesChange",this._updateHandler);this.after("positionChange",this._positionChangeHandler);this.after("overlapGraphChange",this._updateHandler);this.after("widthChange",this._handleSizeChange);this.after("heightChange",this._handleSizeChange);this.after("alwaysShowZeroChange",this._keyChangeHandler);this.after("roundingMethodChange",this._keyChangeHandler);},_dataProviderChangeHandler:function(F){var C=this.get("keyCollection").concat(),E=this.get("keys"),D;if(E){for(D in E){if(E.hasOwnProperty(D)){delete E[D];}}}if(C&&C.length){this.set("keys",C);}},GUID:"yuibaseaxis",_type:null,_setMaximum:null,_dataMaximum:null,_setMinimum:null,_data:null,_updateTotalDataFlag:true,_dataReady:false,addKey:function(C){this.set("keys",C);},_getKeyArray:function(F,G){var E=0,H,D=[],C=G.length;for(;E<C;++E){H=G[E];D[E]=H[F];}return D;},_setDataByKey:function(G,H){var F,I,D=[],E=this._dataClone.concat(),C=E.length;for(F=0;F<C;++F){I=E[F];D[F]=I[G];}this.get("keys")[G]=D;this._updateTotalDataFlag=true;},_updateTotalData:function(){var D=this.get("keys"),C;this._data=[];for(C in D){if(D.hasOwnProperty(C)){this._data=this._data.concat(D[C]);}}this._updateTotalDataFlag=false;},removeKey:function(D){var C=this.get("keys");if(C.hasOwnProperty(D)){delete C[D];this._keyChangeHandler();}},getKeyValueAt:function(D,C){var F=NaN,E=this.get("keys");if(E[D]&&E[D][C]){F=E[D][C];}return F;},getDataByKey:function(D){var C=this.get("keys");if(C[D]){return C[D];}return null;},_updateMinAndMax:function(){var H=this.get("data"),D=0,G=0,C,E,F;if(H&&H.length&&H.length>0){C=H.length;D=G=H[0];if(C>1){for(F=1;F<C;F++){E=H[F];if(isNaN(E)){continue;}D=Math.max(E,D);G=Math.min(E,G);}}}this._dataMaximum=D;this._dataMinimum=G;},getTotalMajorUnits:function(){var D,E=this.get("styles").majorUnit,C=this.get("length");if(E.determinant==="count"){D=E.count;}else{if(E.determinant==="distance"){D=(C/E.distance)+1;}}return D;},getMajorUnitDistance:function(C,F,D){var E;if(D.determinant==="count"){E=F/(C-1);}else{if(D.determinant==="distance"){E=D.distance;}}return E;},getEdgeOffset:function(D,C){return 0;},getLabelByIndex:function(G,D){var F=this.get("minimum"),C=this.get("maximum"),H=(C-F)/(D-1),E;D-=1;E=F+(G*H);return E;},_keyChangeHandler:function(C){this._updateMinAndMax();this.fire("dataUpdate");}},{ATTRS:{keys:{value:{},setter:function(G){var E={},D,C,F=this.get("dataProvider");
18 if(b.Lang.isArray(G)){C=G.length;for(D=0;D<C;++D){E[G[D]]=this._getKeyArray(G[D],F);}}else{if(b.Lang.isString(G)){E=this.get("keys");E[G]=this._getKeyArray(G,F);}else{for(D in G){if(G.hasOwnProperty(D)){E[D]=this._getKeyArray(D,F);}}}}this._updateTotalDataFlag=true;return E;}},roundingMethod:{value:"niceNumber"},type:{readOnly:true,getter:function(){return this._type;}},dataProvider:{setter:function(C){return C;}},dataMaximum:{getter:function(){if(!this._dataMaximum){this._updateMinAndMax();}return this._dataMaximum;}},maximum:{getter:function(){var C=this.get("dataMaximum");if(this.get("setMax")){C=this._setMaximum;}return C;},setter:function(C){this._setMaximum=parseFloat(C);return C;}},dataMinimum:{getter:function(){if(!this._dataMinimum){this._updateMinAndMax();}return this._dataMinimum;}},minimum:{getter:function(){var C=this.get("dataMinimum");if(this.get("setMin")){C=this._setMinimum;}return C;},setter:function(C){this._setMinimum=parseFloat(C);return C;}},setMax:{readOnly:true,getter:function(){return b.Lang.isNumber(this._setMaximum);}},setMin:{readOnly:true,getter:function(){return b.Lang.isNumber(this._setMinimum);}},data:{getter:function(){if(!this._data||this._updateTotalDataFlag){this._updateTotalData();}return this._data;}},keyCollection:{getter:function(){var E=this.get("keys"),D,C=[];for(D in E){if(E.hasOwnProperty(D)){C.push(D);}}return C;},readOnly:true},labelFunction:{value:function(D,C){return D;}}}});function q(C){q.superclass.constructor.apply(this,arguments);}q.NAME="numericAxis";q.ATTRS={alwaysShowZero:{value:true},labelFunction:{value:function(D,C){if(C){return b.DataType.Number.format(D,C);}return D;}},labelFormat:{value:{prefix:"",thousandsSeparator:"",decimalSeparator:"",decimalPlaces:"0",suffix:""}}};b.extend(q,b.AxisType,{_type:"numeric",_getMinimumUnit:function(C,E,D){return this._getNiceNumber(Math.ceil((C-E)/D));},_getNiceNumber:function(E){var G=E,C=Math.ceil(Math.log(G)*0.4342944819032518),F=Math.pow(10,C),D;if(F/2>=G){D=Math.floor((F/2-G)/(Math.pow(10,C-1)/2));G=F/2-D*Math.pow(10,C-1)/2;}else{G=F;}if(!isNaN(G)){return G;}return E;},_updateMinAndMax:function(){var D=this.get("data"),I=0,C=0,G,F,E,J,K=this.get("setMax"),H=this.get("setMin");if(!K&&!H){if(D&&D.length&&D.length>0){G=D.length;I=C=D[0];if(G>1){for(E=1;E<G;E++){F=D[E];if(isNaN(F)){if(b.Lang.isObject(F)){for(J in F){if(F.hasOwnProperty(J)){I=Math.max(F[J],I);C=Math.min(F[J],C);}}}continue;}I=K?this._setMaximum:Math.max(F,I);C=H?this._setMinimum:Math.min(F,C);}}}this._roundMinAndMax(C,I);}},_roundMinAndMax:function(G,P){var J,E,Q=G>=0,O=P>0,H,N,R,F,M,D,L,K=this.getTotalMajorUnits()-1,I=this.get("alwaysShowZero"),S=this.get("roundingMethod"),C=(P-G)/K>=1;if(S){if(S=="niceNumber"){J=this._getMinimumUnit(P,G,K);if(Q&&O){if(I||G<J){G=0;}J=this._getMinimumUnit(P,G,K);P=this._roundUpToNearest(P,J);}else{if(O&&!Q){F=Math.round(K/((-1*G)/P+1));M=K-F;D=Math.ceil(P/F);L=Math.floor(G/M)*-1;J=Math.max(D,L);J=this._getNiceNumber(J);P=J*F;G=J*M*-1;}else{if(I||P===0||P+J>0){P=0;J=this._getMinimumUnit(P,G,K);}else{P=this._roundUpToNearest(P,J);}G=P-(J*K);}}}else{if(S=="auto"){if(Q&&O){if(I||G<(P-G)/K){G=0;}J=(P-G)/K;if(C){J=Math.ceil(J);}P=G+(J*K);}else{if(O&&!Q){if(I){F=Math.round(K/((-1*G)/P+1));M=K-F;if(C){D=Math.ceil(P/F);L=Math.floor(G/M)*-1;}else{D=P/F;L=G/M*-1;}J=Math.max(D,L);P=J*F;G=J*M*-1;}else{J=(P-G)/K;if(C){J=Math.ceil(J);}G=this._roundDownToNearest(G,J);P=this._roundUpToNearest(P,J);}}else{J=(P-G)/K;if(C){J=Math.ceil(J);}if(I||P===0||P+J>0){P=0;J=(P-G)/K;if(C){Math.ceil(J);}}else{P=this._roundUpToNearest(P,J);}G=P-(J*K);}}}else{if(!isNaN(S)&&isFinite(S)){J=S;E=J*K;H=(P-G)>E;R=this._roundDownToNearest(G,J);N=this._roundUpToNearest(P,J);if(Q&&O){if(I||R<=0){G=0;}else{G=R;}if(!H){P=G+E;}else{P=N;}}else{if(O&&!Q){G=R;if(!H){P=G+E;}else{P=N;}}else{if(P===0||I){P=0;}else{P=N;}if(!H){G=P-E;}else{G=R;}}}}}}}this._dataMaximum=P;this._dataMinimum=G;},getLabelByIndex:function(G,D){var F=this.get("minimum"),C=this.get("maximum"),H=(C-F)/(D-1),E;D-=1;E=F+(G*H);if(G>0){E=this._roundToNearest(E,H);}return E;},_roundToNearest:function(E,D){D=D||1;if(D===0){return E;}var C=Math.round(this._roundToPrecision(E/D,10))*D;return this._roundToPrecision(C,10);},_roundUpToNearest:function(D,C){C=C||1;if(C===0){return D;}return Math.ceil(this._roundToPrecision(D/C,10))*C;},_roundDownToNearest:function(D,C){C=C||1;if(C===0){return D;}return Math.floor(this._roundToPrecision(D/C,10))*C;},_roundToPrecision:function(E,C){C=C||0;var D=Math.pow(10,C);return Math.round(D*E)/D;}});b.NumericAxis=q;function f(C){f.superclass.constructor.apply(this,arguments);}f.NAME="stackedAxis";b.extend(f,b.NumericAxis,{_updateMinAndMax:function(){var I=0,D=0,H=0,C=0,G=0,E=0,J,F,K=this.get("keys");for(J in K){if(K.hasOwnProperty(J)){G=Math.max(G,K[J].length);}}for(;E<G;++E){H=0;C=0;for(J in K){if(K.hasOwnProperty(J)){F=K[J][E];if(isNaN(F)){continue;}if(F>=0){H+=F;}else{C+=F;}}}if(H>0){I=Math.max(I,H);}else{I=Math.max(I,C);}if(C<0){D=Math.min(D,C);}else{D=Math.min(D,H);}}this._roundMinAndMax(D,I);}});b.StackedAxis=f;function e(C){e.superclass.constructor.apply(this,arguments);}e.NAME="timeAxis";e.ATTRS={setMax:{readOnly:true,getter:function(){var C=this._getNumber(this._setMaximum);return(b.Lang.isNumber(C));}},setMin:{readOnly:true,getter:function(){var C=this._getNumber(this._setMinimum);return(b.Lang.isNumber(C));}},maximum:{getter:function(){var C=this._getNumber(this._setMaximum);if(!b.Lang.isNumber(C)){C=this._getNumber(this.get("dataMaximum"));}return C;},setter:function(C){this._setMaximum=this._getNumber(C);return C;}},minimum:{getter:function(){var C=this._getNumber(this._setMinimum);if(!b.Lang.isNumber(C)){C=this._getNumber(this.get("dataMinimum"));}return C;},setter:function(C){this._setMinimum=this._getNumber(C);return C;}},labelFunction:{value:function(D,C){D=b.DataType.Date.parse(D);if(C){return b.DataType.Date.format(D,{format:C});}return D;}},labelFormat:{value:"%b %d, %y"}};b.extend(e,b.AxisType,{GUID:"yuitimeaxis",_dataType:"time",getLabelByIndex:function(H,E){var G=this.get("minimum"),D=this.get("maximum"),C=this.get("position"),I,F;
19 E-=1;I=((D-G)/E)*H;if(C=="bottom"||C=="top"){F=G+I;}else{F=D-I;}return F;},_getKeyArray:function(F,G){var H,D=[],E=0,I,C=G.length;for(;E<C;++E){H=G[E][F];if(b.Lang.isDate(H)){I=H.valueOf();}else{if(!b.Lang.isNumber(H)){I=new Date(H.toString()).valueOf();}else{I=H;}}D[E]=I;}return D;},_setDataByKey:function(G,H){var I,D=[],F=this._dataClone.concat(),E,J,C=F.length;for(E=0;E<C;++E){I=F[E][G];if(b.Lang.isDate(I)){J=I.valueOf();}else{if(!b.Lang.isNumber(I)){J=new Date(I.toString()).valueOf();}else{J=I;}}D[E]=J;}this.get("keys")[G]=D;this._updateTotalDataFlag=true;},_getNumber:function(C){if(b.Lang.isDate(C)){C=C.valueOf();}else{if(!b.Lang.isNumber(C)&&C){C=new Date(C.toString()).valueOf();}}return C;}});b.TimeAxis=e;function h(C){h.superclass.constructor.apply(this,arguments);}h.NAME="categoryAxis";b.extend(h,b.AxisType,{_indices:null,GUID:"yuicategoryaxis",_type:"category",_updateMinAndMax:function(){this._dataMaximum=Math.max(this.get("data").length-1,0);this._dataMinimum=0;},_getKeyArray:function(F,G){var E=0,H,D=[],I=[],C=G.length;if(!this._indices){this._indices={};}for(;E<C;++E){H=G[E];D[E]=E;I[E]=H[F];}this._indices[F]=D;return I;},_setDataByKey:function(G){var F,H,D=[],I=[],E=this._dataClone.concat(),C=E.length;if(!this._indices){this._indices={};}for(F=0;F<C;++F){H=E[F];D[F]=F;I[F]=H[G];}this._indices[G]=D;this.get("keys")[G]=I.concat();this._updateTotalDataFlag=true;},getDataByKey:function(D){if(!this._indices){this.get("keys");}var C=this._indices;if(C[D]){return C[D];}return null;},getTotalMajorUnits:function(D,C){return this.get("data").length;},getMajorUnitDistance:function(C,F,D){var E;if(D.determinant==="count"){E=F/C;}else{if(D.determinant==="distance"){E=D.distance;}}return E;},getEdgeOffset:function(D,C){return C/D;},getLabelByIndex:function(F,D){var E,G=this.get("data"),C=this.get("position");if(C=="bottom"||C=="top"){E=G[F];}else{E=G[D-(F+1)];}return E;}});b.CategoryAxis=h;function o(){}o.prototype={getCurveControlPoints:function(F,I){var G=[],E=1,D=F.length-1,C=[],H=[];if(D<1){return null;}G[0]={startx:F[0],starty:I[0],endx:F[1],endy:I[1]};if(D===1){G[0].ctrlx1=(2*F[0]+F[1])/3;G[0].ctrly2=(2*I[0]+I[1])/3;G[0].ctrlx2=2*G[0].ctrlx1-F[0];G[0].ctrly2=2*G[0].ctrly1-I[0];return G;}for(;E<D;++E){G.push({startx:Math.round(F[E]),starty:Math.round(I[E]),endx:Math.round(F[E+1]),endy:Math.round(I[E+1])});C[E]=4*F[E]+2*F[E+1];H[E]=4*I[E]+2*I[E+1];}C[0]=F[0]+(2*F[1]);C[D-1]=(8*F[D-1]+F[D])/2;C=this.getControlPoints(C.concat());H[0]=I[0]+(2*I[1]);H[D-1]=(8*I[D-1]+I[D])/2;H=this.getControlPoints(H.concat());for(E=0;E<D;++E){G[E].ctrlx1=Math.round(C[E]);G[E].ctrly1=Math.round(H[E]);if(E<D-1){G[E].ctrlx2=Math.round(2*F[E+1]-C[E+1]);G[E].ctrly2=Math.round(2*I[E+1]-H[E+1]);}else{G[E].ctrlx2=Math.round((F[D]+C[D-1])/2);G[E].ctrly2=Math.round((I[D]+H[D-1])/2);}}return G;},getControlPoints:function(H){var E=H.length,D=[],G=[],C=2,F=1;D[0]=H[0]/C;for(;F<E;++F){G[F]=1/C;C=(F<E-1?4:3.5)-G[F];D[F]=(H[F]-D[F-1])/C;}for(F=1;F<E;++F){D[E-F-1]-=G[E-F]*D[E-F];}return D;}};b.CurveUtil=o;function l(){}l.prototype={_stackCoordinates:function(){var M=this.get("direction"),E=this.get("order"),K=this.get("type"),N=this.get("graph"),H=N.get("height"),D=N.seriesTypes[K],G=0,J,L=this.get("xcoords"),F=this.get("ycoords"),I,C;if(E===0){return;}I=D[E-1].get("xcoords").concat();C=D[E-1].get("ycoords").concat();if(M==="vertical"){J=I.length;for(;G<J;++G){if(!isNaN(I[G])&&!isNaN(L[G])){L[G]+=I[G];}}}else{J=C.length;for(;G<J;++G){if(!isNaN(C[G])&&!isNaN(F[G])){F[G]=C[G]-(H-F[G]);}}}}};b.StackingUtil=l;function k(){}k.prototype={_lineDefaults:null,_getGraphic:function(){var C=this.get("graph");if(!this._lineGraphic){this._lineGraphic=new b.Graphic();this._lineGraphic.render(C.get("contentBox"));}this._lineGraphic.clear();this._lineGraphic.setSize(C.get("width"),C.get("height"));this.autoSize=false;return this._lineGraphic;},drawLines:function(){if(this.get("xcoords").length<1){return;}var K=this.get("xcoords").concat(),X=this.get("ycoords").concat(),T=this.get("direction"),P=T==="vertical"?X.length:K.length,E,D,W=E,U=D,S,Q,O,G=this.get("styles").line,R=G.lineType,M=G.color||this._getDefaultColor(this.get("graphOrder"),"line"),L=G.alpha,V=G.dashLength,I=G.gapSpace,H=G.connectDiscontinuousPoints,C=G.discontinuousType,F=G.discontinuousDashLength,N=G.discontinuousGapSpace,J=this._getGraphic();E=W=K[0];D=U=X[0];J.lineStyle(G.weight,M,L);J.moveTo(E,D);for(O=1;O<P;O=++O){S=K[O];Q=X[O];if(isNaN(Q)){W=S;U=Q;continue;}if(W==E){if(R!="dashed"){J.lineTo(S,Q);}else{this.drawDashedLine(W,U,S,Q,V,I);}}else{if(!H){J.moveTo(S,Q);}else{if(C!="solid"){this.drawDashedLine(W,U,S,Q,F,N);}else{J.lineTo(S,Q);}}}E=W=S;D=U=Q;}J.end();},drawSpline:function(){if(this.get("xcoords").length<1){return;}var N=this.get("xcoords"),H=this.get("ycoords"),P=this.getCurveControlPoints(N,H),I=P.length,K,J,E,D,O,M,G=0,Q=this.get("styles").line,C=this._getGraphic(),L=Q.alpha,F=Q.color||this._getDefaultColor(this.get("graphOrder"),"line");C.lineStyle(Q.weight,F,L);C.moveTo(N[0],H[0]);for(;G<I;G=++G){O=P[G].endx;M=P[G].endy;K=P[G].ctrlx1;J=P[G].ctrlx2;E=P[G].ctrly1;D=P[G].ctrly2;C.curveTo(K,E,J,D,O,M);}C.end();},drawDashedLine:function(N,R,D,P,F,E){F=F||10;E=E||10;var H=F+E,K=D-N,O=P-R,Q=Math.sqrt(Math.pow(K,2)+Math.pow(O,2)),I=Math.floor(Math.abs(Q/H)),G=Math.atan2(O,K),M=N,L=R,J,C=this._getGraphic();K=Math.cos(G)*H;O=Math.sin(G)*H;for(J=0;J<I;++J){C.moveTo(M,L);C.lineTo(M+Math.cos(G)*F,L+Math.sin(G)*F);M+=K;L+=O;}C.moveTo(M,L);Q=Math.sqrt((D-M)*(D-M)+(P-L)*(P-L));if(Q>F){C.lineTo(M+Math.cos(G)*F,L+Math.sin(G)*F);}else{if(Q>0){C.lineTo(M+Math.cos(G)*Q,L+Math.sin(G)*Q);}}C.moveTo(D,P);},_getLineDefaults:function(){return{alpha:1,weight:6,lineType:"solid",dashLength:10,gapSpace:10,connectDiscontinuousPoints:true,discontinuousType:"solid",discontinuousDashLength:10,discontinuousGapSpace:10};}};b.augment(k,b.Attribute);b.Lines=k;function z(C){var D={area:{getter:function(){return this._defaults||this._getAreaDefaults();},setter:function(F){var E=this._defaults||this._getAreaDefaults();
20 this._defaults=b.merge(E,F);}}};this.addAttrs(D,C);this.get("styles");}z.prototype={drawFill:function(L,H){if(L.length<1){return;}var K=L.length,E=L[0],D=H[0],J=E,I=D,O,N,G=1,M=this.get("styles").area,C=this.get("graphic"),F=M.color||this._getDefaultColor(this.get("graphOrder"),"slice");C.clear();C.beginFill(F,M.alpha);C.moveTo(E,D);for(;G<K;G=++G){O=L[G];N=H[G];if(isNaN(N)){J=O;I=N;continue;}C.lineTo(O,N);J=O;I=N;}C.end();},drawAreaSpline:function(){if(this.get("xcoords").length<1){return;}var O=this.get("xcoords"),J=this.get("ycoords"),Q=this.getCurveControlPoints(O,J),K=Q.length,M,L,G,F,P,N,I=0,E=O[0],D=J[0],R=this.get("styles").area,C=this.get("graphic"),H=R.color||this._getDefaultColor(this.get("graphOrder"),"slice");C.beginFill(H,R.alpha);C.moveTo(E,D);for(;I<K;I=++I){P=Q[I].endx;N=Q[I].endy;M=Q[I].ctrlx1;L=Q[I].ctrlx2;G=Q[I].ctrly1;F=Q[I].ctrly2;C.curveTo(M,G,L,F,P,N);}if(this.get("direction")==="vertical"){C.lineTo(this._leftOrigin,N);C.lineTo(this._leftOrigin,D);}else{C.lineTo(P,this._bottomOrigin);C.lineTo(E,this._bottomOrigin);}C.lineTo(E,D);C.end();},drawStackedAreaSpline:function(){if(this.get("xcoords").length<1){return;}var N=this.get("xcoords"),X=this.get("ycoords"),L,S=this.get("order"),E=this.get("type"),C=this.get("graph"),F=C.seriesTypes[E],D,Q,U,P,O,W,V,J,H,T=0,K,I,G=this.get("styles").area,M=this.get("graphic"),R=G.color||this._getDefaultColor(this.get("graphOrder"),"slice");K=N[0];I=X[0];L=this.getCurveControlPoints(N,X);U=L.length;M.beginFill(R,G.alpha);M.moveTo(K,I);for(;T<U;T=++T){J=L[T].endx;H=L[T].endy;P=L[T].ctrlx1;O=L[T].ctrlx2;W=L[T].ctrly1;V=L[T].ctrly2;M.curveTo(P,W,O,V,J,H);}if(S>0){D=F[S-1].get("xcoords").concat().reverse();Q=F[S-1].get("ycoords").concat().reverse();L=this.getCurveControlPoints(D,Q);T=0;U=L.length;M.lineTo(D[0],Q[0]);for(;T<U;T=++T){J=L[T].endx;H=L[T].endy;P=L[T].ctrlx1;O=L[T].ctrlx2;W=L[T].ctrly1;V=L[T].ctrly2;M.curveTo(P,W,O,V,J,H);}}else{if(this.get("direction")==="vertical"){M.lineTo(this._leftOrigin,X[X.length-1]);M.lineTo(this._leftOrigin,I);}else{M.lineTo(N[N.length-1],this._bottomOrigin);M.lineTo(K,this._bottomOrigin);}}M.lineTo(K,I);M.end();},_defaults:null,_getClosingPoints:function(){var C=this.get("xcoords").concat(),D=this.get("ycoords").concat();if(this.get("direction")==="vertical"){C.push(this._leftOrigin);C.push(this._leftOrigin);D.push(D[D.length-1]);D.push(D[0]);}else{C.push(C[C.length-1]);C.push(C[0]);D.push(this._bottomOrigin);D.push(this._bottomOrigin);}C.push(C[0]);D.push(D[0]);return[C,D];},_getStackedClosingPoints:function(){var G=this.get("order"),J=this.get("type"),M=this.get("graph"),K=this.get("direction"),E=M.seriesTypes[J],I,F,L=this.get("xcoords").concat(),H=this.get("ycoords").concat(),D=L[0],C=H[0];if(G>0){I=E[G-1].get("xcoords").concat();F=E[G-1].get("ycoords").concat();L=L.concat(I.concat().reverse());H=H.concat(F.concat().reverse());L.push(L[0]);H.push(H[0]);}else{if(K==="vertical"){L.push(this._leftOrigin);L.push(this._leftOrigin);H.push(H[H.length-1]);H.push(C);}else{L.push(L[L.length-1]);L.push(D);H.push(this._bottomOrigin);H.push(this._bottomOrigin);}}return[L,H];},_getAreaDefaults:function(){return{};}};b.augment(z,b.Attribute);b.Fills=z;function y(C){var D={markers:{getter:function(){return this._markers;}}};this.addAttrs(D,C);}y.prototype={_plotDefaults:null,drawPlots:function(){if(!this.get("xcoords")||this.get("xcoords").length<1){return;}var F=b.clone(this.get("styles").marker),S=F.width,L=F.height,R=this.get("xcoords"),J=this.get("ycoords"),K=0,M=R.length,Q=J[0],H,I,N=S/2,G=L/2,P=null,O=null,D=this.get("graphOrder"),E,C=g;if(b.Lang.isArray(F.fill.color)){P=F.fill.color.concat();}if(b.Lang.isArray(F.border.color)){O=F.border.colors.concat();}this._createMarkerCache();if(C){this._createHotspotCache();}for(;K<M;++K){Q=(J[K]-G);H=(R[K]-N);if(!Q||!H||Q===undefined||H===undefined||Q=="undefined"||H=="undefined"||isNaN(Q)||isNaN(H)){this._markers.push(null);this._graphicNodes.push(null);continue;}if(P){F.fill.color=P[K%P.length];}if(O){F.border.colors=O[K%O.length];}I=this.getMarker(F,D,K);I.setPosition(H,Q);if(C){E=this.getHotspot(F,D,K);E.setPosition(H,Q);E.parentNode.style.zIndex=5;}}this._clearMarkerCache();if(C){this._clearHotspotCache();}},_getPlotDefaults:function(){var C={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:1,alpha:1},width:10,height:10,shape:"circle"};C.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");C.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return C;},_markers:null,_markerCache:null,getMarker:function(F,C,E){var D;if(this._markerCache.length>0){while(!D){if(this._markerCache.length<1){D=this._createMarker(F,C,E);break;}D=this._markerCache.shift();}D.update(F);}else{D=this._createMarker(F,C,E);}this._markers.push(D);this._graphicNodes.push(D.parentNode);return D;},_createMarker:function(G,C,F){var H=new b.Graphic(),E,D=b.clone(G);H.render(this.get("graph").get("contentBox"));H.node.setAttribute("id","markerParent_"+C+"_"+F);D.graphic=H;E=new b.Shape(D);E.addClass("yui3-seriesmarker");E.node.setAttribute("id","series_"+C+"_"+F);return E;},_createMarkerCache:function(){if(this._markers&&this._markers.length>0){this._markerCache=this._markers.concat();}else{this._markerCache=[];}this._markers=[];this._graphicNodes=[];},_clearMarkerCache:function(){var C=this._markerCache.length,E=0,F,D;for(;E<C;++E){D=this._markerCache[E];if(D){F=D.graphics;F.destroy();}}this._markerCache=[];},updateMarkerState:function(J,G){if(this._markers[G]){var L,I,D,M=b.clone(this.get("styles").marker),C=this._getState(J),K=this.get("xcoords"),F=this.get("ycoords"),E=this._markers[G],H=E.parentNode;D=C=="off"||!M[C]?M:M[C];D.fill.color=this._getItemColor(D.fill.color,G);D.border.color=this._getItemColor(D.border.color,G);E.update(D);L=D.width;I=D.height;H.style.left=(K[G]-L/2)+"px";H.style.top=(F[G]-I/2)+"px";E.toggleVisible(this.get("visible"));}},_getItemColor:function(D,C){if(b.Lang.isArray(D)){return D[C%D.length];}return D;},_setStyles:function(C){C=this._parseMarkerStyles(C);
21 return b.Renderer.prototype._setStyles.apply(this,[C]);},_parseMarkerStyles:function(D){if(D.marker){var C=this._getPlotDefaults();D.marker=this._mergeStyles(D.marker,C);if(D.marker.over){D.marker.over=this._mergeStyles(D.marker.over,D.marker);}if(D.marker.down){D.marker.down=this._mergeStyles(D.marker.down,D.marker);}}return D;},_getState:function(C){var D;switch(C){case"mouseout":D="off";break;case"mouseover":D="over";break;case"mouseup":D="over";break;case"mousedown":D="down";break;}return D;},_stateSyles:null,_hotspots:null,_hotspotCache:null,getHotspot:function(D,C,E){var G,F=b.clone(D);F.fill={type:"solid",color:"#000",alpha:0};F.border={weight:0};if(this._hotspotCache.length>0){while(!G){if(this._hotspotCache.length<1){G=this._createHotspot(F,C,E);break;}G=this._hotspotCache.shift();}G.update(F);}else{G=this._createHotspot(F,C,E);}this._hotspots.push(G);return G;},_createHotspot:function(G,C,E){var H=new b.Graphic(),F,D=b.clone(G);H.render(this.get("graph").get("contentBox"));H.node.setAttribute("id","hotspotParent_"+C+"_"+E);D.graphic=H;F=new b.Shape(D);F.addClass("yui3-seriesmarker");F.node.setAttribute("id","hotspot_"+C+"_"+E);return F;},_createHotspotCache:function(){if(this._hotspots&&this._hotspots.length>0){this._hotspotCache=this._hotspots.concat();}else{this._hotspotCache=[];}this._hotspots=[];},_clearHotspotCache:function(){var C=this._hotspotCache.length,D=0,F,E;for(;D<C;++D){E=this._hotspotCache[D];if(E){F=E.graphics;F.destroy();}}this._hotspotCache=[];}};b.augment(y,b.Attribute);b.Plots=y;function A(){}A.prototype={drawSeries:function(){if(this.get("xcoords").length<1){return;}var aa=b.clone(this.get("styles").marker),ab,U,R=this.get("xcoords"),ad=this.get("ycoords"),X=0,Y=R.length,S=ad[0],F=this.get("type"),E=this.get("graph"),M=E.seriesTypes[F],Z=M.length,P=0,Q=0,I=0,L,V,W=this.get("order"),O=this.get("graphOrder"),H,K,T,G,ac,D=null,J=null,N,C=g;if(b.Lang.isArray(aa.fill.color)){D=aa.fill.color.concat();}if(b.Lang.isArray(aa.border.color)){J=aa.border.colors.concat();}if(this.get("direction")=="vertical"){T="height";G="width";}else{T="width";G="height";}ab=aa[T];U=aa[G];this._createMarkerCache();if(C){this._createHotspotCache();}for(;X<Z;++X){V=M[X];P+=V.get("styles").marker[T];if(W>X){I=P;}}Q=Y*P;if(Q>E.get(T)){L=E.get(T)/Q;P*=L;I*=L;ab*=L;ab=Math.max(ab,1);}I-=P/2;for(X=0;X<Y;++X){ac=this._getMarkerDimensions(R[X],ad[X],U,I);S=ac.top;U=ac.calculatedSize;H=ac.left;aa[T]=ab;aa[G]=U;if(D){aa.fill.color=D[X%D.length];}if(J){aa.border.colors=J[X%J.length];}K=this.getMarker(aa,O,X);K.setPosition(H,S);if(C){N=this.getHotspot(aa,O,X);N.setPosition(H,S);N.parentNode.style.zIndex=5;}}this._clearMarkerCache();if(C){this._clearHotspotCache();}},_defaultFillColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getPlotDefaults:function(){var C={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}};C.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");C.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return C;}};b.Histogram=A;b.CartesianSeries=b.Base.create("cartesianSeries",b.Base,[b.Renderer],{_xDisplayName:null,_yDisplayName:null,_leftOrigin:null,_bottomOrigin:null,render:function(){this._setCanvas();this.addListeners();this.set("rendered",true);this.validate();},addListeners:function(){var D=this.get("xAxis"),C=this.get("yAxis");if(D){D.after("dataReady",b.bind(this._xDataChangeHandler,this));D.after("dataUpdate",b.bind(this._xDataChangeHandler,this));}if(C){C.after("dataReady",b.bind(this._yDataChangeHandler,this));C.after("dataUpdate",b.bind(this._yDataChangeHandler,this));}this.after("xAxisChange",this._xAxisChangeHandler);this.after("yAxisChange",this._yAxisChangeHandler);this.after("stylesChange",function(F){var E=this._updateAxisData();if(E){this.draw();}});this.after("widthChange",function(F){var E=this._updateAxisData();if(E){this.draw();}});this.after("heightChange",function(F){var E=this._updateAxisData();if(E){this.draw();}});this.after("visibleChange",this._toggleVisible);},_xAxisChangeHandler:function(D){var C=this.get("xAxis");C.after("dataReady",b.bind(this._xDataChangeHandler,this));C.after("dataUpdate",b.bind(this._xDataChangeHandler,this));},_yAxisChangeHandler:function(D){var C=this.get("yAxis");C.after("dataReady",b.bind(this._yDataChangeHandler,this));C.after("dataUpdate",b.bind(this._yDataChangeHandler,this));},GUID:"yuicartesianseries",_xDataChangeHandler:function(C){var D=this._updateAxisData();if(D){this.draw();}},_yDataChangeHandler:function(C){var D=this._updateAxisData();if(D){this.draw();}},_updateAxisData:function(){var G=this.get("xAxis"),D=this.get("yAxis"),E=this.get("xKey"),C=this.get("yKey"),F,H;if(!G||!D||!E||!C){return false;}H=G.getDataByKey(E);F=D.getDataByKey(C);if(!H||!F){return false;}this.set("xData",H.concat());this.set("yData",F.concat());return true;},validate:function(){if((this.get("xData")&&this.get("yData"))||this._updateAxisData()){this.draw();}},_setCanvas:function(){this.set("graphic",new b.Graphic());this.get("graphic").render(this.get("graph").get("contentBox"));},setAreaData:function(){var ae,ac,G=this.get("graph"),P=G.get("width"),Y=G.get("height"),N=this.get("xAxis"),D=this.get("yAxis"),I=this.get("xData").concat(),aa=this.get("yData").concat(),ah=N.getEdgeOffset(I.length,P),M=D.getEdgeOffset(aa.length,Y),S=this.get("styles").padding,V=S.left,ab=S.top,K=P-(V+S.right+ah),X=Y-(ab+S.bottom+M),T=[],ag=[],af=N.get("maximum"),Z=N.get("minimum"),F=D.get("maximum"),C=D.get("minimum"),J=K/(af-Z),Q=X/(F-C),L,ad=this.get("direction"),W=0,O=[],U=[],H=this.get("xMarkerPlaneOffset"),E=this.get("yMarkerPlaneOffset"),R=this.get("graphic");L=I.length;ah*=0.5;M*=0.5;if(ad==="vertical"){aa=aa.reverse();}if(R){R.setSize(P,Y);}this._leftOrigin=Math.round(((0-Z)*J)+V+ah);this._bottomOrigin=Math.round((X+ab+M)-(0-C)*Q);for(;W<L;++W){ae=Math.round((((I[W]-Z)*J)+V+ah));
22 ac=Math.round(((X+ab+M)-(aa[W]-C)*Q));T.push(ae);ag.push(ac);O.push({start:ae-H,end:ae+H});U.push({start:ac-E,end:ac+E});}this.set("xcoords",T);this.set("ycoords",ag);this.set("xMarkerPlane",O);this.set("yMarkerPlane",U);},draw:function(){var E=this.get("graph"),C=E.get("width"),D=E.get("height");if(this.get("rendered")){if((isFinite(C)&&isFinite(D)&&C>0&&D>0)&&((this.get("xData")&&this.get("yData"))||this._updateAxisData())){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;this.setAreaData();if(this.get("xcoords")&&this.get("ycoords")){this.drawSeries();}this._drawing=false;if(this._callLater){this.draw();}else{this._toggleVisible(this.get("visible"));this.fire("drawingComplete");}}}},_defaultPlaneOffset:4,_getDefaultStyles:function(){return{padding:{top:0,left:0,right:0,bottom:0}};},_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"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(F,G){var D={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},E=D[G],C=E.length;F=F||0;if(F>=C){F=F%C;}G=G||"fill";return D[G][F];},_toggleVisible:function(F){var I=this.get("graphic"),H=this.get("markers"),E=0,C,G=this.get("visible"),D;if(I){I.toggleVisible(G);}if(H){C=H.length;for(;E<C;++E){D=H[E];if(D){D.toggleVisible(G);}}}if(this._lineGraphic){this._lineGraphic.toggleVisible(G);}}},{ATTRS:{xDisplayName:{getter:function(){return this._xDisplayName||this.get("xKey");},setter:function(C){this._xDisplayName=C;return C;}},yDisplayName:{getter:function(){return this._yDisplayName||this.get("yKey");},setter:function(C){this._yDisplayName=C;return C;}},categoryDisplayName:{readOnly:true,getter:function(){return this.get("direction")=="vertical"?this.get("yDisplayName"):this.get("xDisplayName");}},valueDisplayName:{readOnly:true,getter:function(){return this.get("direction")=="vertical"?this.get("xDisplayName"):this.get("yDisplayName");}},type:{value:"cartesian"},order:{},graphOrder:{},xcoords:{},ycoords:{},graph:{},xAxis:{},yAxis:{},xKey:{},yKey:{},xData:{},yData:{},rendered:{value:false},width:{readOnly:true,getter:function(){this.get("graph").get("width");}},height:{readOnly:true,getter:function(){this.get("graph").get("height");}},visible:{value:true},xMarkerPlane:{},yMarkerPlane:{},xMarkerPlaneOffset:{getter:function(){var C=this.get("styles").marker;if(C&&C.width&&isFinite(C.width)){return C.width*0.5;}return this._defaultPlaneOffset;}},yMarkerPlaneOffset:{getter:function(){var C=this.get("styles").marker;if(C&&C.height&&isFinite(C.height)){return C.height*0.5;}return this._defaultPlaneOffset;}},direction:{value:"horizontal"}}});b.MarkerSeries=b.Base.create("markerSeries",b.CartesianSeries,[b.Plots],{renderUI:function(){this._setNode();},drawSeries:function(){this.drawPlots();},_setStyles:function(C){if(!C.marker){C={marker:C};}C=this._parseMarkerStyles(C);return b.MarkerSeries.superclass._mergeStyles.apply(this,[C,this._getDefaultStyles()]);},_getDefaultStyles:function(){var C=this._mergeStyles({marker:this._getPlotDefaults()},b.MarkerSeries.superclass._getDefaultStyles());return C;}},{ATTRS:{type:{value:"marker"}}});b.LineSeries=b.Base.create("lineSeries",b.CartesianSeries,[b.Lines],{drawSeries:function(){this.get("graphic").clear();this.drawLines();},_setStyles:function(C){if(!C.line){C={line:C};}return b.LineSeries.superclass._setStyles.apply(this,[C]);},_getDefaultStyles:function(){var C=this._mergeStyles({line:this._getLineDefaults()},b.LineSeries.superclass._getDefaultStyles());return C;}},{ATTRS:{type:{value:"line"}}});b.SplineSeries=b.Base.create("splineSeries",b.CartesianSeries,[b.CurveUtil,b.Lines],{drawSeries:function(){this.get("graphic").clear();this.drawSpline();}},{ATTRS:{type:{value:"spline"}}});b.AreaSplineSeries=b.Base.create("areaSplineSeries",b.CartesianSeries,[b.Fills,b.CurveUtil],{drawSeries:function(){this.get("graphic").clear();this.drawAreaSpline();}},{ATTRS:{type:{value:"areaSpline"}}});b.StackedSplineSeries=b.Base.create("stackedSplineSeries",b.SplineSeries,[b.StackingUtil],{setAreaData:function(){b.StackedSplineSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);}},{ATTRS:{type:{value:"stackedSpline"}}});b.StackedMarkerSeries=b.Base.create("stackedMarkerSeries",b.MarkerSeries,[b.StackingUtil],{setAreaData:function(){b.StackedMarkerSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);}},{ATTRS:{type:{value:"stackedMarker"}}});b.ColumnSeries=b.Base.create("columnSeries",b.MarkerSeries,[b.Histogram],{_getMarkerDimensions:function(D,C,F,G){var E={top:C,left:D+G};E.calculatedSize=this._bottomOrigin-E.top;return E;},updateMarkerState:function(P,L){if(this._markers[L]){var S=b.clone(this.get("styles").marker),D,C=this._getState(P),Q=this.get("xcoords"),K=this.get("ycoords"),M=this._markers[L],R=this.get("graph"),H=R.seriesTypes[this.get("type")],J=H.length,O=0,I=0,N,E=0,G=[],F=this.get("order");D=C=="off"||!S[C]?S:S[C];D.fill.color=this._getItemColor(D.fill.color,L);D.border.color=this._getItemColor(D.border.color,L);D.height=this._bottomOrigin-K[L];M.update(D);for(;E<J;++E){N=H[E].get("markers")[L];G[E]=Q[L]+O;O+=N.width;if(F>E){I=O;}I-=O/2;}for(E=0;E<J;++E){N=b.one(H[E]._graphicNodes[L]);N.setStyle("left",(G[E]-O/2)+"px");}}}},{ATTRS:{type:{value:"column"}}});b.BarSeries=b.Base.create("barSeries",b.MarkerSeries,[b.Histogram],{renderUI:function(){this._setNode();},_getMarkerDimensions:function(D,C,F,G){var E={top:C+G,left:this._leftOrigin};E.calculatedSize=D-E.left;return E;},updateMarkerState:function(O,K){if(this._markers[K]){var S=b.clone(this.get("styles").marker),D,C=this._getState(O),P=this.get("xcoords"),J=this.get("ycoords"),L=this._markers[K],R=this.get("graph"),G=R.seriesTypes[this.get("type")],I=G.length,N=0,H=0,M,E=0,Q=[],F=this.get("order");
23 D=C=="off"||!S[C]?S:S[C];D.fill.color=this._getItemColor(D.fill.color,K);D.border.color=this._getItemColor(D.border.color,K);D.width=(P[K]-this._leftOrigin);L.update(D);for(;E<I;++E){M=G[E].get("markers")[K];Q[E]=J[K]+N;N+=M.height;if(F>E){H=N;}H-=N/2;}for(E=0;E<I;++E){M=b.one(G[E]._graphicNodes[K]);M.setStyle("top",(Q[E]-N/2));}}}},{ATTRS:{type:{value:"bar"},direction:{value:"vertical"}}});b.AreaSeries=b.Base.create("areaSeries",b.CartesianSeries,[b.Fills],{drawSeries:function(){this.get("graphic").clear();this.drawFill.apply(this,this._getClosingPoints());},_setStyles:function(C){if(!C.area){C={area:C};}return b.AreaSeries.superclass._setStyles.apply(this,[C]);},_getDefaultStyles:function(){var C=this._mergeStyles({area:this._getAreaDefaults()},b.AreaSeries.superclass._getDefaultStyles());return C;}},{ATTRS:{type:{value:"area"}}});b.StackedAreaSplineSeries=b.Base.create("stackedAreaSplineSeries",b.AreaSeries,[b.CurveUtil,b.StackingUtil],{drawSeries:function(){this.get("graphic").clear();this._stackCoordinates();this.drawStackedAreaSpline();}},{ATTRS:{type:{value:"stackedAreaSpline"}}});b.ComboSeries=b.Base.create("comboSeries",b.CartesianSeries,[b.Fills,b.Lines,b.Plots],{drawSeries:function(){this.get("graphic").clear();if(this.get("showAreaFill")){this.drawFill.apply(this,this._getClosingPoints());}if(this.get("showLines")){this.drawLines();}if(this.get("showMarkers")){this.drawPlots();}},_getDefaultStyles:function(){var C=b.ComboSeries.superclass._getDefaultStyles();C.line=this._getLineDefaults();C.marker=this._getPlotDefaults();C.area=this._getAreaDefaults();return C;}},{ATTRS:{type:{value:"combo"},showAreaFill:{value:false},showLines:{value:true},showMarkers:{value:true},marker:{lazyAdd:false,getter:function(){return this.get("styles").marker;},setter:function(C){this.set("styles",{marker:C});}},line:{lazyAdd:false,getter:function(){return this.get("styles").line;},setter:function(C){this.set("styles",{line:C});}},area:{lazyAdd:false,getter:function(){return this.get("styles").area;},setter:function(C){this.set("styles",{area:C});}}}});b.StackedComboSeries=b.Base.create("stackedComboSeries",b.ComboSeries,[b.StackingUtil],{setAreaData:function(){b.StackedComboSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);},drawSeries:function(){this.get("graphic").clear();if(this.get("showAreaFill")){this.drawFill.apply(this,this._getStackedClosingPoints());}if(this.get("showLines")){this.drawLines();}if(this.get("showMarkers")){this.drawPlots();}}},{ATTRS:{type:{value:"stackedCombo"},showAreaFill:{value:true}}});b.ComboSplineSeries=b.Base.create("comboSplineSeries",b.ComboSeries,[b.CurveUtil],{drawSeries:function(){this.get("graphic").clear();if(this.get("showAreaFill")){this.drawAreaSpline();}if(this.get("showLines")){this.drawSpline();}if(this.get("showMarkers")){this.drawPlots();}}},{ATTRS:{type:{value:"comboSpline"}}});b.StackedComboSplineSeries=b.Base.create("stackedComboSplineSeries",b.StackedComboSeries,[b.CurveUtil],{drawSeries:function(){this.get("graphic").clear();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}}});b.StackedLineSeries=b.Base.create("stackedLineSeries",b.LineSeries,[b.StackingUtil],{setAreaData:function(){b.StackedLineSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);}},{ATTRS:{type:{value:"stackedLine"}}});b.StackedAreaSeries=b.Base.create("stackedAreaSeries",b.AreaSeries,[b.StackingUtil],{setAreaData:function(){b.StackedAreaSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);},drawSeries:function(){this.get("graphic").clear();this.drawFill.apply(this,this._getStackedClosingPoints());}},{ATTRS:{type:{value:"stackedArea"}}});b.StackedColumnSeries=b.Base.create("stackedColumnSeries",b.ColumnSeries,[b.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1){return;}var X=this.get("styles").marker,P=X.width,W=X.height,Q=this.get("xcoords"),Y=this.get("ycoords"),U=0,V=Q.length,R=Y[0],G=this.get("type"),E=this.get("graph"),L=E.seriesTypes[G],J,T=this.get("order"),O=this.get("graphOrder"),H,K,I,M,S,D=T===0,F=V*P,N,C=g;this._createMarkerCache();if(C){this._createHotspotCache();}if(F>this.get("width")){J=this.width/F;P*=J;P=Math.max(P,1);}if(!D){I=L[T-1];M=I.get("negativeBaseValues");S=I.get("positiveBaseValues");}else{M=[];S=[];}this.set("negativeBaseValues",M);this.set("positiveBaseValues",S);for(U=0;U<V;++U){R=Y[U];if(D){W=this._bottomOrigin-R;if(R<this._bottomOrigin){S[U]=R;M[U]=this._bottomOrigin;}else{if(R>this._bottomOrigin){S[U]=this._bottomOrigin;M[U]=R;}else{S[U]=R;M[U]=R;}}}else{if(R>this._bottomOrigin){R+=(M[U]-this._bottomOrigin);W=M[U]-R;M[U]=R;}else{if(R<this._bottomOrigin){R=S[U]-(this._bottomOrigin-Y[U]);W=S[U]-R;S[U]=R;}}}H=Q[U]-P/2;X.width=P;X.height=W;K=this.getMarker(X,O,U);K.setPosition(H,R);if(C){N=this.getHotspot(X,O,U);N.setPosition(H,R);N.parentNode.style.zIndex=5;}}this._clearMarkerCache();if(C){this._clearHotspotCache();}},updateMarkerState:function(G,F){if(this._markers[F]){var H,D,I=this._getState(G),E=this.get("xcoords"),C=this._markers[F],J=0;H=this.get("styles").marker;D=I=="off"||!H[I]?H:H[I];D.height=C.height;C.update(D);J=H.width*0.5;if(C.parentNode){b.one(C.parentNode).setStyle("left",(E[F]-J));}}},_getPlotDefaults:function(){var C={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}};C.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");C.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return C;}},{ATTRS:{type:{value:"stackedColumn"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}});b.StackedBarSeries=b.Base.create("stackedBarSeries",b.BarSeries,[b.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1){return;}var W=this.get("styles").marker,O=W.width,V=W.height,P=this.get("xcoords"),Y=this.get("ycoords"),T=0,U=P.length,Q=Y[0],F=this.get("type"),E=this.get("graph"),K=E.seriesTypes[F],I,S=this.get("order"),N=this.get("graphOrder"),G,J,H,L,R,D=S===0,X=U*V,M,C=g;
24 this._createMarkerCache();if(C){this._createHotspotCache();}if(X>this.get("height")){I=this.height/X;V*=I;V=Math.max(V,1);}if(!D){H=K[S-1];L=H.get("negativeBaseValues");R=H.get("positiveBaseValues");}else{L=[];R=[];}this.set("negativeBaseValues",L);this.set("positiveBaseValues",R);for(T=0;T<U;++T){Q=Y[T];G=P[T];if(D){O=G-this._leftOrigin;if(G>this._leftOrigin){R[T]=G;L[T]=this._leftOrigin;}else{if(G<this._leftOrigin){R[T]=this._leftOrigin;L[T]=G;}else{R[T]=G;L[T]=this._leftOrigin;}}G-=O;}else{if(G<this._leftOrigin){G=L[T]-(this._leftOrigin-P[T]);O=L[T]-G;L[T]=G;}else{if(G>this._leftOrigin){G+=(R[T]-this._leftOrigin);O=G-R[T];R[T]=G;G-=O;}}}Q-=V/2;W.width=O;W.height=V;J=this.getMarker(W,N,T);J.setPosition(G,Q);if(C){M=this.getHotspot(W,N,T);M.setPosition(G,Q);M.parentNode.style.zIndex=5;}}this._clearMarkerCache();if(C){this._clearHotspotCache();}},updateMarkerState:function(G,E){if(this._markers[E]){var I=this._getState(G),J=this.get("ycoords"),C=this._markers[E],H=this.get("styles").marker,F=H.height,D=I=="off"||!H[I]?H:H[I];D.width=C.width;C.update(D);if(C.parentNode){b.one(C.parentNode).setStyle("top",(J[E]-F/2));}}},_getPlotDefaults:function(){var C={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}};C.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");C.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return C;}},{ATTRS:{type:{value:"stackedBar"},direction:{value:"vertical"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}});b.PieSeries=b.Base.create("pieSeries",b.MarkerSeries,[],{_map:null,_image:null,_setMap:function(){var E="pieHotSpotMapi_"+Math.round(100000*Math.random()),C=this.get("graph").get("contentBox"),D;if(this._image){C.removeChild(this._image);while(this._areaNodes&&this._areaNodes.length>0){D=this._areaNodes.shift();this._map.removeChild(D);}C.removeChild(this._map);}this._image=document.createElement("img");this._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==";C.appendChild(this._image);this._image.setAttribute("usemap","#"+E);this._image.style.zIndex=3;this._image.style.opacity=0;this._image.setAttribute("alt","imagemap");this._map=document.createElement("map");this._map.style.zIndex=5;C.appendChild(this._map);this._map.setAttribute("name",E);this._map.setAttribute("id",E);this._areaNodes=[];},_categoryDisplayName:null,_valueDisplayName:null,addListeners:function(){var C=this.get("categoryAxis"),D=this.get("valueAxis");if(C){C.after("dataReady",b.bind(this._categoryDataChangeHandler,this));C.after("dataUpdate",b.bind(this._categoryDataChangeHandler,this));}if(D){D.after("dataReady",b.bind(this._valueDataChangeHandler,this));D.after("dataUpdate",b.bind(this._valueDataChangeHandler,this));}this.after("categoryAxisChange",this.categoryAxisChangeHandler);this.after("valueAxisChange",this.valueAxisChangeHandler);this.after("stylesChange",this._updateHandler);},validate:function(){this.draw();this._renderered=true;},_categoryAxisChangeHandler:function(C){var D=this.get("categoryAxis");D.after("dataReady",b.bind(this._categoryDataChangeHandler,this));D.after("dataUpdate",b.bind(this._categoryDataChangeHandler,this));},_valueAxisChangeHandler:function(C){var D=this.get("valueAxis");D.after("dataReady",b.bind(this._valueDataChangeHandler,this));D.after("dataUpdate",b.bind(this._valueDataChangeHandler,this));},GUID:"pieseries",_categoryDataChangeHandler:function(C){if(this._rendered&&this.get("categoryKey")&&this.get("valueKey")){this.draw();}},_valueDataChangeHandler:function(C){if(this._rendered&&this.get("categoryKey")&&this.get("valueKey")){this.draw();}},draw:function(){var E=this.get("graph"),C=E.get("width"),D=E.get("height");if(isFinite(C)&&isFinite(D)&&C>0&&D>0){this._rendered=true;this.drawSeries();this.fire("drawingComplete");}},drawPlots:function(){var E=this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),F=this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),I=0,ag=E.length,P=this.get("styles").marker,C=P.fill.colors,ah=P.fill.alphas||["1"],M=P.border.colors,G=[P.border.weight],H=[P.border.alpha],ai=G.concat(),R=M.concat(),T=H.concat(),ad,af,U=P.padding,D=this.get("graph"),S=D.get("width")-(U.left+U.right),ac=D.get("height")-(U.top+U.bottom),aa=-90,N=S/2,V=ac/2,J=Math.min(N,V),ab=0,Y,ae=0,X,Z,K,Q,L,O=this.get("graphOrder"),W=j=="canvas";for(;ab<ag;++ab){Y=E[ab];E.push(Y);if(!isNaN(Y)){I+=Y;}}ad=C?C.concat():null;af=ah?ah.concat():null;this._createMarkerCache();if(W){this._setMap();this._image.width=S;this._image.height=ac;}for(ab=0;ab<ag;ab++){Y=E[ab];if(I===0){ae=360/E.length;}else{ae=360*(Y/I);}ae=Math.round(ae);if(ad&&ad.length<1){ad=C.concat();}if(af&&af.length<1){af=ah.concat();}if(ai&&ai.length<1){ai=G.concat();}if(ai&&R.length<1){R=M.concat();}if(T&&T.length<1){T=H.concat();}K=ai?ai.shift():null;X=R?R.shift():null;Z=T?T.shift():null;aa+=ae;Q={border:{color:X,weight:K,alpha:Z},fill:{color:ad?ad.shift():this._getDefaultColor(ab,"slice"),alpha:af?af.shift():null},shape:"wedge",props:{arc:ae,radius:J,startAngle:aa,x:N,y:V},width:S,height:ac};L=this.getMarker(Q,O,ab);if(W){this._addHotspot(Q.props,O,ab);}}this._clearMarkerCache();},_addHotspot:function(F,S,G){var P=document.createElement("area"),R=1,L=F.x,J=F.y,I=F.arc,Q=F.startAngle-I,O=F.startAngle,D=F.radius,M=L+Math.cos(Q/180*Math.PI)*D,K=J+Math.sin(Q/180*Math.PI)*D,U=L+Math.cos(O/180*Math.PI)*D,T=J+Math.sin(O/180*Math.PI)*D,X=Math.floor(I/10)-1,E=(I/(Math.floor(I/10))/180)*Math.PI,H=Math.atan((K-J)/(M-L)),W=L+", "+J+", "+M+", "+K,V,N,C;for(R=1;R<=X;++R){C=E*R;V=Math.cos(H+C);N=Math.sin(H+C);if(Q<=90){W+=", "+(L+(D*Math.cos(H+(E*R))));W+=", "+(J+(D*Math.sin(H+(E*R))));}else{W+=", "+(L-(D*Math.cos(H+(E*R))));W+=", "+(J-(D*Math.sin(H+(E*R))));}}W+=", "+U+", "+T;W+=", "+L+", "+J;this._map.appendChild(P);
25 P.setAttribute("class","yui3-seriesmarker");P.setAttribute("id","hotSpot_"+S+"_"+G);P.setAttribute("shape","polygon");P.setAttribute("coords",W);this._areaNodes.push(P);},updateMarkerState:function(G,E){if(this._markers[E]){var I=this._getState(G),D,F,C=this._markers[E],H=this.get("styles").marker;D=I=="off"||!H[I]?H:H[I];F=this._mergeStyles(D,{});F.fill.color=F.fill.colors[E%F.fill.colors.length];F.fill.alpha=F.fill.alphas[E%F.fill.alphas.length];C.update(F);}},_createMarker:function(G,C,F){var E=b.clone(G),D;E.graphic=this.get("graphic");D=new b.Shape(E);D.addClass("yui3-seriesmarker");D.node.setAttribute("id","series_"+C+"_"+F);return D;},_clearMarkerCache:function(){var C=this._markerCache.length,E=0,D;for(;E<C;++E){D=this._markerCache[E];if(D&&D.node&&D.parentNode){D.parentNode.removeChild(D.node);}}this._markerCache=[];},_getPlotDefaults:function(){var C={padding:{top:0,left:0,right:0,bottom:0},fill:{alphas:["1"]},border:{weight:0,alpha:1}};C.fill.colors=this._defaultSliceColors;C.border.colors=this._defaultBorderColors;return C;},_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"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(F,G){var D={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},E=D[G],C=E.length;F=F||0;if(F>=C){F=F%C;}G=G||"fill";return D[G][F];}},{ATTRS:{type:{value:"pie"},order:{},graph:{},categoryAxis:{value:null,validator:function(C){return C!==this.get("categoryAxis");}},valueAxis:{value:null,validator:function(C){return C!==this.get("valueAxis");}},categoryKey:{value:null,validator:function(C){return C!==this.get("categoryKey");}},valueKey:{value:null,validator:function(C){return C!==this.get("valueKey");}},categoryDisplayName:{setter:function(C){this._categoryDisplayName=C;return C;},getter:function(){return this._categoryDisplayName||this.get("categoryKey");}},valueDisplayName:{setter:function(C){this._valueDisplayName=C;return C;},getter:function(){return this._valueDisplayName||this.get("valueKey");}},slices:null}});b.Gridlines=b.Base.create("gridlines",b.Base,[b.Renderer],{render:function(){this._setCanvas();},remove:function(){var D=this.get("graphic"),C;if(D){C=D.node;if(C){b.one(C).remove();}}},draw:function(){if(this.get("axis")&&this.get("graph")){this._drawGridlines();}},_drawGridlines:function(){var C=this.get("graphic"),D=this.get("axis"),L=D.get("position"),O,I=0,F,M=this.get("direction"),P=this.get("graph"),N=P.get("width"),K=P.get("height"),Q=this.get("styles").line,H=Q.color,J=Q.weight,G=Q.alpha,E=M=="vertical"?this._verticalLine:this._horizontalLine;if(L=="none"){O=[];F=D.get("styles").majorUnit.count;for(;I<F;++I){O[I]={x:N*(I/(F-1)),y:K*(I/(F-1))};}I=0;}else{O=D.get("tickPoints");F=O.length;}if(!C){this._setCanvas();C=this.get("graphic");}C.clear();C.setSize(N,K);C.lineStyle(J,H,G);for(;I<F;++I){E(C,O[I],N,K);}C.end();},_horizontalLine:function(F,E,C,D){F.moveTo(0,E.y);F.lineTo(C,E.y);},_verticalLine:function(F,E,C,D){F.moveTo(E.x,0);F.lineTo(E.x,D);},_setCanvas:function(){this.set("graphic",new b.Graphic());this.get("graphic").render(this.get("graph").get("contentBox"));},_getDefaultStyles:function(){var C={line:{color:"#f0efe9",weight:1,alpha:1}};return C;}},{ATTRS:{direction:{},axis:{},graph:{}}});b.Graph=b.Base.create("graph",b.Widget,[b.Renderer],{bindUI:function(){var C=this.get("boundingBox");C.setStyle("position","absolute");this.after("widthChange",this._sizeChangeHandler);this.after("heightChange",this._sizeChangeHandler);this.after("stylesChange",this._updateStyles);},syncUI:function(){if(this.get("showBackground")){var J=new b.Graphic(),H,C=this.get("contentBox"),F=this.get("styles").background,E=F.border,I=E.weight||0,D=this.get("width"),G=this.get("height");if(D){D+=I*2;F.width=D;}if(G){G+=I*2;F.height=G;}J.render(C);this._background=J.getShape(F);H=b.one(J.node);H.setStyle("left",0-I);H.setStyle("top",0-I);H.setStyle("zIndex",-1);}},renderUI:function(){var G=this.get("seriesCollection"),F,E=0,D=G.length,C=this.get("horizontalGridlines"),H=this.get("verticalGridlines");for(;E<D;++E){F=G[E];if(F instanceof b.CartesianSeries){F.render();}}if(C&&C instanceof b.Gridlines){C.draw();}if(H&&H instanceof b.Gridlines){H.draw();}},seriesTypes:null,getSeriesByIndex:function(E){var C=this.get("seriesCollection"),D;if(C&&C.length>E){D=C[E];}return D;},getSeriesByKey:function(E){var D=this._seriesDictionary,C;if(D&&D.hasOwnProperty(E)){C=D[E];}return C;},addDispatcher:function(C){if(!this._dispatchers){this._dispatchers=[];}this._dispatchers.push(C);},_seriesCollection:null,_seriesDictionary:null,_parseSeriesCollection:function(G){if(!G){return;}var D=G.length,F=0,E,C;if(!this.get("seriesCollection")){this._seriesCollection=[];}if(!this._seriesDictionary){this._seriesDictionary={};}if(!this.seriesTypes){this.seriesTypes=[];}for(;F<D;++F){E=G[F];if(!(E instanceof b.CartesianSeries)&&!(E instanceof b.PieSeries)){this._createSeries(E);continue;}this._addSeries(E);}D=this.get("seriesCollection").length;for(F=0;F<D;++F){E=this.get("seriesCollection")[F];C=E.get("direction")=="horizontal"?"yKey":"xKey";this._seriesDictionary[E.get(C)]=E;}},_addSeries:function(E){var F=E.get("type"),H=this.get("seriesCollection"),G=H.length,D=this.seriesTypes,C;if(!E.get("graph")){E.set("graph",this);}H.push(E);if(!D.hasOwnProperty(F)){this.seriesTypes[F]=[];}C=this.seriesTypes[F];E.set("graphOrder",G);E.set("order",C.length);C.push(E);this.addDispatcher(E);E.after("drawingComplete",b.bind(this._drawingCompleteHandler,this));this.fire("seriesAdded",E);},_createSeries:function(G){var H=G.type,I=this.get("seriesCollection"),E=this.seriesTypes,D,C,F;
26 G.graph=this;if(!E.hasOwnProperty(H)){E[H]=[];}D=E[H];G.graph=this;G.order=D.length;G.graphOrder=I.length;C=this._getSeries(G.type);F=new C(G);this.addDispatcher(F);F.after("drawingComplete",b.bind(this._drawingCompleteHandler,this));D.push(F);I.push(F);},_getSeries:function(C){var D;switch(C){case"line":D=b.LineSeries;break;case"column":D=b.ColumnSeries;break;case"bar":D=b.BarSeries;break;case"area":D=b.AreaSeries;break;case"candlestick":D=b.CandlestickSeries;break;case"ohlc":D=b.OHLCSeries;break;case"stackedarea":D=b.StackedAreaSeries;break;case"stackedline":D=b.StackedLineSeries;break;case"stackedcolumn":D=b.StackedColumnSeries;break;case"stackedbar":D=b.StackedBarSeries;break;case"markerseries":D=b.MarkerSeries;break;case"spline":D=b.SplineSeries;break;case"areaspline":D=b.AreaSplineSeries;break;case"stackedspline":D=b.StackedSplineSeries;break;case"stackedareaspline":D=b.StackedAreaSplineSeries;break;case"stackedmarkerseries":D=b.StackedMarkerSeries;break;case"pie":D=b.PieSeries;break;case"combo":D=b.ComboSeries;break;case"stackedcombo":D=b.StackedComboSeries;break;case"combospline":D=b.ComboSplineSeries;break;case"stackedcombospline":D=b.StackedComboSplineSeries;break;default:D=b.CartesianSeries;break;}return D;},_markerEventHandler:function(H){var F=H.type,C=H.currentTarget,G=C.getAttribute("id").split("_"),E=this.getSeriesByIndex(G[1]),D=G[2];E.updateMarkerState(F,D);},_dispatchers:null,_updateStyles:function(){this._background.update(this.get("styles").background);this._sizeChangeHandler();},_sizeChangeHandler:function(I){var C=this.get("horizontalGridlines"),D=this.get("verticalGridlines"),L=this.get("width"),G=this.get("height"),H,K=0,J=0,E=this.get("styles").background,F;if(E&&E.border){F=E.border.weight||0;}if(this._background){H=b.one(this._background.parentNode);if(L&&G){if(F){L+=F*2;G+=F*2;K-=F;J-=F;}H.setStyle("width",L);H.setStyle("height",G);H.setStyle("left",K);H.setStyle("top",J);this._background.update({width:L,height:G});}}if(C&&C instanceof b.Gridlines){C.draw();}if(D&&D instanceof b.Gridlines){D.draw();}this._drawSeries();},_drawSeries:function(){if(this._drawing){this._callLater=true;return;}this._callLater=false;this._drawing=true;var E=this.get("seriesCollection"),D=0,C=E.length;for(;D<C;++D){E[D].draw();if(!E[D].get("xcoords")||!E[D].get("ycoords")){this._callLater=true;break;}}this._drawing=false;if(this._callLater){this._drawSeries();}},_drawingCompleteHandler:function(E){var D=E.currentTarget,C=b.Array.indexOf(this._dispatchers,D);if(C>-1){this._dispatchers.splice(C,1);}if(this._dispatchers.length<1){this.fire("chartRendered");}},_getDefaultStyles:function(){var C={background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return C;}},{ATTRS:{seriesCollection:{getter:function(){return this._seriesCollection;},setter:function(C){this._parseSeriesCollection(C);return this._seriesCollection;}},showBackground:{value:true},seriesDictionary:{readOnly:true,getter:function(){return this._seriesDictionary;}},horizontalGridlines:{value:null,setter:function(D){var C=this.get("horizontalGridlines");if(C&&C instanceof b.Gridlines){C.remove();}if(D instanceof b.Gridlines){C=D;D.set("graph",this);D.render();return D;}else{if(D&&D.axis){C=new b.Gridlines({direction:"horizontal",axis:D.axis,graph:this,styles:D.styles});C.render();return C;}}}},verticalGridlines:{value:null,setter:function(D){var C=this.get("verticalGridlines");if(C&&C instanceof b.Gridlines){C.remove();}if(D instanceof b.Gridlines){C=D;D.set("graph",this);D.render();return D;}else{if(D&&D.axis){C=new b.Gridlines({direction:"vertical",axis:D.axis,graph:this,styles:D.styles});C.render();return C;}}}}}});function r(){}r.ATTRS={tooltip:{valueFn:"_getTooltip",setter:function(C){return this._updateTooltip(C);}},categoryKey:{value:"category"},categoryType:{value:"category"},interactionType:{value:"marker"},dataProvider:{setter:function(C){return this._setDataValues(C);}},seriesKeys:{},axesCollection:{},graph:{valueFn:"_getGraph"}};r.prototype={_getGraph:function(){var C=new b.Graph();C.after("chartRendered",b.bind(function(D){this.fire("chartRendered");},this));return C;},getSeries:function(E){var C=null,D=this.get("graph");if(D){if(b.Lang.isNumber(E)){C=D.getSeriesByIndex(E);}else{C=D.getSeriesByKey(E);}}return C;},getAxisByKey:function(E){var C,D=this.get("axes");if(D.hasOwnProperty(E)){C=D[E];}return C;},getCategoryAxis:function(){var D,C=this.get("categoryKey"),E=this.get("axes");if(E.hasOwnProperty(C)){D=E[C];}return D;},_direction:"horizontal",_dataProvider:null,_setDataValues:function(H){if(b.Lang.isArray(H[0])){var G,J=[],E=H[0],F=0,D=E.length,I,C=H.length;for(;F<D;++F){G={category:E[F]};for(I=1;I<C;++I){G["series"+I]=H[I][F];}J[F]=G;}return J;}return H;},_seriesCollection:null,_setSeriesCollection:function(C){this._seriesCollection=C;},_getAxisClass:function(C){return this._axisClass[C];},_axisClass:{stacked:b.StackedAxis,numeric:b.NumericAxis,category:b.CategoryAxis,time:b.TimeAxis},_axes:null,renderUI:function(){var C=this.get("tooltip");this.get("boundingBox").setStyle("position","absolute");this.get("contentBox").setStyle("position","absolute");this._addAxes();this._addSeries();if(C&&C.show){this._addTooltip();}this._redraw();},bindUI:function(){this.after("tooltipChange",b.bind(this._tooltipChangeHandler,this));this.after("widthChange",this._sizeChanged);this.after("heightChange",this._sizeChanged);this.after("dataProviderChange",this._dataProviderChangeHandler);var G=this.get("tooltip"),I="mouseout",F="mouseover",D=this.get("contentBox"),H=this.get("interactionType"),E=0,C;if(H=="marker"){I=G.hideEvent;F=G.showEvent;b.delegate("mouseenter",b.bind(this._markerEventDispatcher,this),D,".yui3-seriesmarker");b.delegate("mousedown",b.bind(this._markerEventDispatcher,this),D,".yui3-seriesmarker");b.delegate("mouseup",b.bind(this._markerEventDispatcher,this),D,".yui3-seriesmarker");b.delegate("mouseleave",b.bind(this._markerEventDispatcher,this),D,".yui3-seriesmarker");b.delegate("click",b.bind(this._markerEventDispatcher,this),D,".yui3-seriesmarker");
27 b.delegate("mousemove",b.bind(this._positionTooltip,this),D,".yui3-seriesmarker");}else{if(H=="planar"){this._overlay.on("mousemove",b.bind(this._planarEventDispatcher,this));this.on("mouseout",this.hideTooltip);}}if(G){if(I&&F&&I==F){this.on(H+"Event:"+I,this.toggleTooltip);}else{if(F){this.on(H+"Event:"+F,G[H+"EventHandler"]);}if(I){if(b.Lang.isArray(I)){C=I.length;for(;E<C;++E){this.on(H+"Event:"+I[E],this.hideTooltip);}}this.on(H+"Event:"+I,this.hideTooltip);}}}},_markerEventDispatcher:function(G){var I=G.type,C=this.get("contentBox"),M=G.currentTarget,L=M.getAttribute("id").split("_"),D=L[1],E=this.getSeries(parseInt(D,10)),F=L[2],H=this.getSeriesItems(E,F),K=G.pageX-C.getX(),J=G.pageY-C.getY();if(I=="mouseenter"){I="mouseover";}else{if(I=="mouseleave"){I="mouseout";}}E.updateMarkerState(I,F);G.halt();this.fire("markerEvent:"+I,{categoryItem:H.category,valueItem:H.value,node:M,x:K,y:J,series:E,index:F,seriesIndex:D});},_dataProviderChangeHandler:function(G){var D=this.get("dataProvider"),F=this.get("axes"),C,E;for(C in F){if(F.hasOwnProperty(C)){E=F[C];if(E instanceof b.Axis){E.set("dataProvider",D);}}}},toggleTooltip:function(D){var C=this.get("tooltip");if(C.visible){this.hideTooltip();}else{C.markerEventHandler.apply(this,[D]);}},_showTooltip:function(F,C,G){var D=this.get("tooltip"),E=D.node;if(F){D.visible=true;E.set("innerHTML",F);E.setStyle("top",G+"px");E.setStyle("left",C+"px");E.removeClass("yui3-widget-hidden");}},_positionTooltip:function(G){var E=this.get("tooltip"),F=E.node,D=this.get("contentBox"),C=(G.pageX+10)-D.getX(),H=(G.pageY+10)-D.getY();if(F){F.setStyle("left",C+"px");F.setStyle("top",H+"px");}},hideTooltip:function(){var C=this.get("tooltip"),D=C.node;C.visible=false;D.set("innerHTML","");D.setStyle("left",-10000);D.setStyle("top",-10000);D.addClass("yui3-widget-hidden");},_addTooltip:function(){var C=this.get("tooltip");this.get("contentBox").appendChild(C.node);},_updateTooltip:function(G){var E=this._tooltip,C,F=G.styles,D={markerLabelFunction:"markerLabelFunction",planarLabelFunction:"planarLabelFunction",showEvent:"showEvent",hideEvent:"hideEvent",markerEventHandler:"markerEventHandler",planarEventHandler:"planarEventHandler"};if(F){for(C in F){if(F.hasOwnProperty(C)){E.node.setStyle(C,F[C]);}}}for(C in D){if(G.hasOwnProperty(C)){E[C]=G[C];}}return E;},_getTooltip:function(){var D=document.createElement("div"),C={markerLabelFunction:this._tooltipLabelFunction,planarLabelFunction:this._planarLabelFunction,show:true,hideEvent:"mouseout",showEvent:"mouseover",markerEventHandler:function(F){var E=this.get("tooltip"),G=E.markerLabelFunction.apply(this,[F.categoryItem,F.valueItem,F.index,F.series,F.seriesIndex]);this._showTooltip(G,F.x+10,F.y+10);},planarEventHandler:function(F){var E=this.get("tooltip"),H,G=this.get("categoryAxis");H=E.planarLabelFunction.apply(this,[G,F.valueItem,F.index,F.items,F.seriesIndex]);this._showTooltip(H,F.x+10,F.y+10);}};D.setAttribute("id",this.get("id")+"_tooltip");D=b.one(D);D.setStyle("fontSize","85%");D.setStyle("opacity","0.83");D.setStyle("position","absolute");D.setStyle("paddingTop","2px");D.setStyle("paddingRight","5px");D.setStyle("paddingBottom","4px");D.setStyle("paddingLeft","2px");D.setStyle("backgroundColor","#fff");D.setStyle("border","1px solid #dbdccc");D.setStyle("pointerEvents","none");D.setStyle("zIndex",3);D.setStyle("whiteSpace","noWrap");D.addClass("yui3-widget-hidden");C.node=b.one(D);this._tooltip=C;return C;},_planarLabelFunction:function(I,M,K,G,E){var C="",L,H=0,J=G.length,D,F;if(I){C+=I.get("labelFunction").apply(this,[I.getKeyValueAt(this.get("categoryKey"),K),I.get("labelFormat")]);}for(;H<J;++H){F=G[H];if(F.get("visible")){L=M[H];D=L.axis;C+="<br/><span>"+L.displayName+": "+D.get("labelFunction").apply(this,[D.getKeyValueAt(L.key,K),D.get("labelFormat")])+"</span>";}}return C;},_tooltipLabelFunction:function(H,C,F,E,D){var G=H.displayName+":&nbsp;"+H.axis.get("labelFunction").apply(this,[H.value,H.axis.get("labelFormat")])+"<br/>"+C.displayName+":&nbsp;"+C.axis.get("labelFunction").apply(this,[C.value,C.axis.get("labelFormat")]);return G;},_tooltipChangeHandler:function(G){if(this.get("tooltip")){var E=this.get("tooltip"),F=E.node,D=E.show,C=this.get("contentBox");if(F&&D){if(!C.containes(F)){this._addTooltip();}}}}};b.ChartBase=r;b.CartesianChart=b.Base.create("cartesianChart",b.Widget,[b.ChartBase],{renderUI:function(){var D=this.get("tooltip"),C;this.get("boundingBox").setStyle("position","absolute");this.get("contentBox").setStyle("position","absolute");this._addAxes();this._addGridlines();this._addSeries();if(D&&D.show){this._addTooltip();}this.get("styles");if(this.get("interactionType")=="planar"){C=document.createElement("div");this.get("contentBox").appendChild(C);this._overlay=b.one(C);this._overlay.setStyle("position","absolute");this._overlay.setStyle("background","#fff");this._overlay.setStyle("opacity",0);this._overlay.addClass("yui3-overlay");this._overlay.setStyle("zIndex",4);}this._redraw();},_planarEventDispatcher:function(V){var D=this.get("graph"),H=this.get("boundingBox"),Q=D.get("contentBox"),M=V.pageX,W=M-Q.getX(),K=M-H.getX(),L=V.pageY,U=L-Q.getY(),J=L-H.getY(),C=D.get("seriesCollection"),N,S=0,I,G=this._selectedIndex,X,P=[],E=[],O=[],Y=this.get("direction"),Z,R=Y=="horizontal"?W:U,F=Y=="horizontal"?C[0].get("xMarkerPlane"):C[0].get("yMarkerPlane"),T=F.length;for(;S<T;++S){if(R<=F[S].end&&R>=F[S].start){I=S;break;}}T=C.length;for(S=0;S<T;++S){N=C[S];Z=N.get("markers");if(Z&&!isNaN(G)&&G>-1){N.updateMarkerState("mouseout",G);}if(N.get("ycoords")[I]>-1){if(Z&&!isNaN(I)&&I>-1){N.updateMarkerState("mouseover",I);}X=this.getSeriesItems(N,I);E.push(X.category);O.push(X.value);P.push(N);}}this._selectedIndex=I;if(I>-1){this.fire("planarEvent:mouseover",{categoryItem:E,valueItem:O,x:K,y:J,items:P,index:I});}else{this.fire("planarEvent:mouseout");}},_type:"combo",_axesRenderQueue:null,_addToAxesRenderQueue:function(C){if(!this._axesRenderQueue){this._axesRenderQueue=[];}if(b.Array.indexOf(this._axesRenderQueue,C)<0){this._axesRenderQueue.push(C);
28 }},_getDefaultSeriesCollection:function(V){var L=this.get("direction"),C=V||[],S,P,N=[],I,H=this.get("seriesKeys").concat(),R,G,O,F=this.get("type"),T,K,U,D,E=this.get("categoryKey"),Q=this.get("showMarkers"),M=this.get("showAreaFill"),J=this.get("showLines");if(L=="vertical"){S="yAxis";K="yKey";P="xAxis";U="xKey";}else{S="xAxis";K="xKey";P="yAxis";U="yKey";}O=C.length;for(R=0;R<O;++R){T=this._getBaseAttribute(C[R],U);if(T){G=b.Array.indexOf(H,T);if(G>-1){H.splice(G,1);}N.push(T);}}if(H.length>0){N=N.concat(H);}O=N.length;for(R=0;R<O;++R){I=C[R]||{type:F};if(I instanceof b.CartesianSeries){this._parseSeriesAxes(I);continue;}I[K]=I[K]||E;I[U]=I[U]||H.shift();I[S]=this._getCategoryAxis();I[P]=this._getSeriesAxis(I[U]);I.type=I.type||F;if((I.type=="combo"||I.type=="stackedcombo"||I.type=="combospline"||I.type=="stackedcombospline")){if(M!==null){I.showAreaFill=I.showAreaFill||M;}if(Q!==null){I.showMarkers=I.showMarkers||Q;}if(J!==null){I.showLines=I.showLines||J;}}C[R]=I;}if(V){D=this.get("graph");D.set("seriesCollection",C);C=D.get("seriesCollection");}return C;},_parseSeriesAxes:function(D){var H=this.get("axes"),F=D.get("xAxis"),C=D.get("yAxis"),G=b.Axis,E;if(F&&!(F instanceof G)&&b.Lang.isString(F)&&H.hasOwnProperty(F)){E=H[F];if(E instanceof G){D.set("xAxis",E);}}if(C&&!(C instanceof G)&&b.Lang.isString(C)&&H.hasOwnProperty(C)){E=H[C];if(E instanceof G){D.set("yAxis",E);}}},_getCategoryAxis:function(){var C,D=this.get("axes"),E=this.get("categoryAxisName")||this.get("categoryKey");C=D[E];return C;},_getSeriesAxis:function(D,H){var G=this.get("axes"),C,F,E;if(G){if(H&&G.hasOwnProperty(H)){E=G[H];}else{for(C in G){if(G.hasOwnProperty(C)){F=G[C].get("keys");if(F&&F.hasOwnProperty(D)){E=G[C];break;}}}}}return E;},_getBaseAttribute:function(D,C){if(D instanceof b.Base){return D.get(C);}if(D.hasOwnProperty(C)){return D[C];}return null;},_setBaseAttribute:function(D,C,E){if(D instanceof b.Base){D.set(C,E);}else{D[C]=E;}},_parseAxes:function(D){var H=this._getDefaultAxes(D),K={},F={edgeOffset:"edgeOffset",position:"position",overlapGraph:"overlapGraph",labelFunction:"labelFunction",labelFunctionScope:"labelFunctionScope",labelFormat:"labelFormat",maximum:"maximum",minimum:"minimum",roundingMethod:"roundingMethod",alwaysShowZero:"alwaysShowZero"},G=this.get("dataProvider"),N,I,O,E,M,L,C,J;for(I in H){if(H.hasOwnProperty(I)){M=H[I];if(M instanceof b.Axis){E=M;}else{L=this._getAxisClass(M.type);C={};C.dataProvider=M.dataProvider||G;C.keys=M.keys;if(M.hasOwnProperty("roundingUnit")){C.roundingUnit=M.roundingUnit;}O=M.position;if(M.styles){C.styles=M.styles;}C.position=M.position;for(N in F){if(F.hasOwnProperty(N)&&M.hasOwnProperty(N)){C[N]=M[N];}}E=new L(C);}if(E){J=this.get(O+"AxesCollection");if(J&&b.Array.indexOf(J,E)>0){E.set("overlapGraph",false);}E.after("axisRendered",b.bind(this._axisRendered,this));K[I]=E;}}}return K;},_addAxes:function(){var H=this.get("axes"),D,F,I,C=this.get("width"),E=this.get("height"),G=b.Node.one(this._parentNode);if(!this._axesCollection){this._axesCollection=[];}for(D in H){if(H.hasOwnProperty(D)){F=H[D];if(F instanceof b.Axis){if(!C){this.set("width",G.get("offsetWidth"));C=this.get("width");}if(!E){this.set("height",G.get("offsetHeight"));E=this.get("height");}F.set("width",C);F.set("height",E);this._addToAxesRenderQueue(F);I=F.get("position");if(!this.get(I+"AxesCollection")){this.set(I+"AxesCollection",[F]);}else{this.get(I+"AxesCollection").push(F);}this._axesCollection.push(F);if(F.get("keys").hasOwnProperty(this.get("categoryKey"))){this.set("categoryAxis",F);}F.render(this.get("contentBox"));}}}},_addSeries:function(){var C=this.get("graph"),D=this.get("seriesCollection");C.render(this.get("contentBox"));},_addGridlines:function(){var M=this.get("graph"),D=this.get("horizontalGridlines"),E=this.get("verticalGridlines"),L=this.get("direction"),N=this.get("leftAxesCollection"),H=this.get("rightAxesCollection"),J=this.get("bottomAxesCollection"),F=this.get("topAxesCollection"),G,C=this.get("categoryAxis"),K,I;if(this._axesCollection){G=this._axesCollection.concat();G.splice(b.Array.indexOf(G,C),1);}if(D){if(N&&N[0]){K=N[0];}else{if(H&&H[0]){K=H[0];}else{K=L=="horizontal"?C:G[0];}}if(!this._getBaseAttribute(D,"axis")&&K){this._setBaseAttribute(D,"axis",K);}if(this._getBaseAttribute(D,"axis")){M.set("horizontalGridlines",D);}}if(E){if(J&&J[0]){I=J[0];}else{if(F&&F[0]){I=F[0];}else{I=L=="vertical"?C:G[0];}}if(!this._getBaseAttribute(E,"axis")&&I){this._setBaseAttribute(E,"axis",I);}if(this._getBaseAttribute(E,"axis")){M.set("verticalGridlines",E);}}},_getDefaultAxes:function(U){var M=this.get("categoryKey"),D,S,O,F={},Q=[],E=this.get("categoryAxisName")||this.get("categoryKey"),C=this.get("valueAxisName"),G=this.get("seriesKeys")||[],V,T,L,J,P,N,R=this.get("dataProvider"),W=this.get("direction"),K,H,I=[],X=this.get("stacked")?"stacked":"numeric";N=R[0];if(W=="vertical"){K="bottom";H="left";}else{K="left";H="bottom";}if(U){for(V in U){if(U.hasOwnProperty(V)){D=U[V];O=this._getBaseAttribute(D,"keys");S=this._getBaseAttribute(D,"type");if(S=="time"||S=="category"){E=V;this.set("categoryAxisName",V);if(b.Lang.isArray(O)&&O.length>0){M=O[0];this.set("categoryKey",M);}F[V]=D;}else{if(V==E){F[V]=D;}else{F[V]=D;if(V!=C&&O&&b.Lang.isArray(O)){J=O.length;for(L=0;L<J;++L){Q.push(O[L]);}I.push(F[V]);}if(!(this._getBaseAttribute(F[V],"type"))){this._setBaseAttribute(F[V],"type",X);}if(!(this._getBaseAttribute(F[V],"position"))){this._setBaseAttribute(F[V],"position",this._getDefaultAxisPosition(F[V],I,K));}}}}}}if(G.length<1){for(V in N){if(N.hasOwnProperty(V)&&V!=M&&b.Array.indexOf(Q,V)==-1){G.push(V);}}}P=b.Array.indexOf(G,M);if(P>-1){G.splice(P,1);}T=Q.length;for(V=0;V<T;++V){P=b.Array.indexOf(G,Q[V]);if(P>-1){G.splice(P,1);}}if(!F.hasOwnProperty(E)){F[E]={};}if(!(this._getBaseAttribute(F[E],"keys"))){this._setBaseAttribute(F[E],"keys",[M]);}if(!(this._getBaseAttribute(F[E],"position"))){this._setBaseAttribute(F[E],"position",H);}if(!(this._getBaseAttribute(F[E],"type"))){this._setBaseAttribute(F[E],"type",this.get("categoryType"));
29 }if(!F.hasOwnProperty(C)&&G&&G.length>0){F[C]={keys:G};I.push(F[C]);}if(Q.length>0){if(G.length>0){G=Q.concat(G);}else{G=Q;}}if(F.hasOwnProperty(C)){if(!(this._getBaseAttribute(F[C],"position"))){this._setBaseAttribute(F[C],"position",this._getDefaultAxisPosition(F[C],I,K));}if(!(this._getBaseAttribute(F[C],"type"))){this._setBaseAttribute(F[C],"type",X);}if(!(this._getBaseAttribute(F[C],"keys"))){this._setBaseAttribute(F[C],"keys",G);}}this.set("seriesKeys",G);return F;},_getDefaultAxisPosition:function(F,D,C){var G=this.get("direction"),E=b.Array.indexOf(D,F);if(D[E-1]&&D[E-1].position){if(G=="horizontal"){if(D[E-1].position=="left"){C="right";}else{if(D[E-1].position=="right"){C="left";}}}else{if(D[E-1].position=="bottom"){C="top";}else{C="bottom";}}}return C;},getSeriesItems:function(H,G){var I=H.get("xAxis"),E=H.get("yAxis"),F=H.get("xKey"),D=H.get("yKey"),J,C;if(this.get("direction")=="vertical"){J={axis:E,key:D,value:E.getKeyValueAt(D,G)};C={axis:I,key:F,value:I.getKeyValueAt(F,G)};}else{C={axis:E,key:D,value:E.getKeyValueAt(D,G)};J={axis:I,key:F,value:I.getKeyValueAt(F,G)};}J.displayName=H.get("categoryDisplayName");C.displayName=H.get("valueDisplayName");J.value=J.axis.getKeyValueAt(J.key,G);C.value=C.axis.getKeyValueAt(C.key,G);return{category:J,value:C};},_axisRendered:function(C){this._axesRenderQueue=this._axesRenderQueue.splice(1+b.Array.indexOf(this._axesRenderQueue,C.currentTarget),1);if(this._axesRenderQueue.length<1){this._redraw();}},_sizeChanged:function(F){if(this._axesCollection){var E=this._axesCollection,D=0,C=E.length;for(;D<C;++D){this._addToAxesRenderQueue(E[D]);}this._redraw();}},_redraw:function(){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;var Q=this.get("width"),N=this.get("height"),I=0,F=0,D=0,L=0,E=this.get("leftAxesCollection"),C=this.get("rightAxesCollection"),K=this.get("topAxesCollection"),O=this.get("bottomAxesCollection"),M=0,J,H,P,S=[],G="visible",R=this.get("graph");if(E){J=E.length;for(M=J-1;M>-1;--M){S[b.Array.indexOf(this._axesCollection,E[M])]={x:I+"px"};I+=E[M].get("width");}}if(C){J=C.length;M=0;for(M=J-1;M>-1;--M){F+=C[M].get("width");S[b.Array.indexOf(this._axesCollection,C[M])]={x:(Q-F)+"px"};}}if(K){J=K.length;for(M=J-1;M>-1;--M){S[b.Array.indexOf(this._axesCollection,K[M])]={y:D+"px"};D+=K[M].get("height");}}if(O){J=O.length;for(M=J-1;M>-1;--M){L+=O[M].get("height");S[b.Array.indexOf(this._axesCollection,O[M])]={y:(N-L)+"px"};}}J=this._axesCollection.length;M=0;for(;M<J;++M){H=this._axesCollection[M];P=H.get("position");if(P=="left"||P==="right"){H.get("boundingBox").setStyle("top",D+"px");H.get("boundingBox").setStyle("left",S[M].x);if(H.get("height")!==N-(L+D)){H.set("height",N-(L+D));}}else{if(P=="bottom"||P=="top"){if(H.get("width")!==Q-(I+F)){H.set("width",Q-(I+F));}H.get("boundingBox").setStyle("left",I+"px");H.get("boundingBox").setStyle("top",S[M].y);}}if(H.get("setMax")||H.get("setMin")){G="hidden";}}this._drawing=false;if(this._callLater){this._redraw();return;}if(R){R.get("boundingBox").setStyle("left",I+"px");R.get("boundingBox").setStyle("top",D+"px");R.set("width",Q-(I+F));R.set("height",N-(D+L));R.get("boundingBox").setStyle("overflow",G);}if(this._overlay){this._overlay.setStyle("left",I+"px");this._overlay.setStyle("top",D+"px");this._overlay.setStyle("width",(Q-(I+F))+"px");this._overlay.setStyle("height",(N-(D+L))+"px");}}},{ATTRS:{axesStyles:{getter:function(){var E=this.get("axes"),C,D=this._axesStyles;if(E){for(C in E){if(E.hasOwnProperty(C)&&E[C] instanceof b.Axis){if(!D){D={};}D[C]=E[C].get("styles");}}}return D;},setter:function(E){var D=this.get("axes"),C;for(C in E){if(E.hasOwnProperty(C)&&D.hasOwnProperty(C)){this._setBaseAttribute(D[C],"styles",E[C]);}}}},seriesStyles:{getter:function(){var D=this._seriesStyles,E=this.get("graph"),F,C;if(E){F=E.get("seriesDictionary");if(F){D={};for(C in F){if(F.hasOwnProperty(C)){D[C]=F[C].get("styles");}}}}return D;},setter:function(F){var D,C,E;if(b.Lang.isArray(F)){E=this.get("seriesCollection");D=0;C=F.length;for(;D<C;++D){this._setBaseAttribute(E[D],"styles",F[D]);}}else{for(D in F){if(F.hasOwnProperty(D)){E=this.getSeries(D);this._setBaseAttribute(E,"styles",F[D]);}}}}},graphStyles:{getter:function(){var C=this.get("graph");if(C){return(C.get("styles"));}return this._graphStyles;},setter:function(D){var C=this.get("graph");this._setBaseAttribute(C,"styles",D);}},styles:{getter:function(){var C={axes:this.get("axesStyles"),series:this.get("seriesStyles"),graph:this.get("graphStyles")};return C;},setter:function(C){if(C.hasOwnProperty("axes")){if(this.get("axesStyles")){this.set("axesStyles",C.axes);}else{this._axesStyles=C.axes;}}if(C.hasOwnProperty("series")){if(this.get("seriesStyles")){this.set("seriesStyles",C.series);}else{this._seriesStyles=C.series;}}if(C.hasOwnProperty("graph")){this.set("graphStyles",C.graph);}}},axes:{valueFn:"_parseAxes",setter:function(C){return this._parseAxes(C);}},seriesCollection:{valueFn:"_getDefaultSeriesCollection",setter:function(C){return this._getDefaultSeriesCollection(C);}},leftAxesCollection:{},bottomAxesCollection:{},rightAxesCollection:{},topAxesCollection:{},stacked:{value:false},direction:{getter:function(){var C=this.get("type");if(C=="bar"){return"vertical";}else{if(C=="column"){return"horizontal";}}return this._direction;},setter:function(C){this._direction=C;return this._direction;}},showAreaFill:{},showMarkers:{},showLines:{},categoryAxisName:{},valueAxisName:{value:"values"},horizontalGridlines:{getter:function(){var C=this.get("graph");if(C){return C.get("horizontalGridlines");}return this._horizontalGridlines;},setter:function(D){var C=this.get("graph");if(D&&!b.Lang.isObject(D)){D={};}if(C){C.set("horizontalGridlines",D);}else{this._horizontalGridlines=D;}}},verticalGridlines:{getter:function(){var C=this.get("graph");if(C){return C.get("verticalGridlines");}return this._verticalGridlines;},setter:function(D){var C=this.get("graph");if(D&&!b.Lang.isObject(D)){D={};}if(C){C.set("verticalGridlines",D);
30 }else{this._verticalGridlines=D;}}},type:{getter:function(){if(this.get("stacked")){return"stacked"+this._type;}return this._type;},setter:function(C){if(this._type=="bar"){if(C!="bar"){this.set("direction","horizontal");}}else{if(C=="bar"){this.set("direction","vertical");}}this._type=C;return this._type;}},categoryAxis:{}}});b.PieChart=b.Base.create("pieChart",b.Widget,[b.ChartBase],{_getSeriesCollection:function(){if(this._seriesCollection){return this._seriesCollection;}var H=this.get("axes"),J=[],I,F=0,E,K=this.get("type"),M,C="categoryAxis",G="categoryKey",D="valueAxis",L="valueKey";if(H){I=H.values.get("keyCollection");M=H.category.get("keyCollection")[0];E=I.length;for(;F<E;++F){J[F]={type:K};J[F][C]="category";J[F][D]="values";J[F][G]=M;J[F][L]=I[F];}}this._seriesCollection=J;return J;},_parseAxes:function(F){if(!this._axes){this._axes={};}var G,L,E,J,C,I,K=this.get("type"),M=this.get("width"),H=this.get("height"),D=b.Node.one(this._parentNode);if(!M){this.set("width",D.get("offsetWidth"));M=this.get("width");}if(!H){this.set("height",D.get("offsetHeight"));H=this.get("height");}for(G in F){if(F.hasOwnProperty(G)){J=F[G];L=K=="pie"?"none":J.position;I=this._getAxisClass(J.type);C={dataProvider:this.get("dataProvider")};if(J.hasOwnProperty("roundingUnit")){C.roundingUnit=J.roundingUnit;}C.keys=J.keys;C.width=M;C.height=H;C.position=L;C.styles=J.styles;E=new I(C);E.on("axisRendered",b.bind(this._axisRendered,this));this._axes[G]=E;}}},_addAxes:function(){var F=this.get("axes"),C,D,E;if(!F){this.set("axes",this._getDefaultAxes());F=this.get("axes");}if(!this._axesCollection){this._axesCollection=[];}for(C in F){if(F.hasOwnProperty(C)){D=F[C];E=D.get("position");if(!this.get(E+"AxesCollection")){this.set(E+"AxesCollection",[D]);}else{this.get(E+"AxesCollection").push(D);}this._axesCollection.push(D);}}},_addSeries:function(){var C=this.get("graph"),D=this.get("seriesCollection");this._parseSeriesAxes(D);C.set("showBackground",false);C.set("width",this.get("width"));C.set("height",this.get("height"));C.set("seriesCollection",D);this._seriesCollection=C.get("seriesCollection");C.render(this.get("contentBox"));},_parseSeriesAxes:function(H){var D=0,C=H.length,F,G=this.get("axes"),E;for(;D<C;++D){F=H[D];if(F){if(F instanceof b.PieSeries){E=F.get("categoryAxis");if(E&&!(E instanceof b.Axis)){F.set("categoryAxis",G[E]);}E=F.get("valueAxis");if(E&&!(E instanceof b.Axis)){F.set("valueAxis",G[E]);}continue;}F.categoryAxis=G.category;F.valueAxis=G.values;if(!F.type){F.type=this.get("type");}}}},_getDefaultAxes:function(){var G=this.get("categoryKey"),D=this.get("seriesKeys")||[],C="numeric",F,E=this.get("dataProvider")[0];if(D.length<1){for(F in E){if(F!=G){D.push(F);}}if(D.length>0){this.set("seriesKeys",D);}}return{values:{keys:D,type:C},category:{keys:[G],type:this.get("categoryType")}};},getSeriesItems:function(E,D){var F={axis:E.get("categoryAxis"),key:E.get("categoryKey"),displayName:E.get("categoryDisplayName")},C={axis:E.get("valueAxis"),key:E.get("valueKey"),displayName:E.get("valueDisplayName")};F.value=F.axis.getKeyValueAt(F.key,D);C.value=C.axis.getKeyValueAt(C.key,D);return{category:F,value:C};},_sizeChanged:function(C){this._redraw();},_redraw:function(){var C=this.get("graph");if(C){C.set("width",this.get("width"));C.set("height",this.get("height"));}}},{ATTRS:{axes:{getter:function(){return this._axes;},setter:function(C){this._parseAxes(C);}},seriesCollection:{getter:function(){return this._getSeriesCollection();},setter:function(C){return this._setSeriesCollection(C);}},type:{value:"pie"}}});function w(C){if(C.type!="pie"){return new b.CartesianChart(C);}else{return new b.PieChart(C);}}b.Chart=w;},"3.3.0",{requires:["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]});