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