charts-min.js revision 45be085c4155ae7ef409ffa4d79457928742f18f
YUI.add("charts",function(b){var f=b.config.doc,j,m,p,a;function n(){}n.ATTRS={styles:{getter:function(){this._styles=this._styles||this._getDefaultStyles();return this._styles;},setter:function(t){this._styles=this._setStyles(t);}},graphic:{}};n.NAME="renderer";n.prototype={_styles:null,_setStyles:function(u){var t=this.get("styles");return this._mergeStyles(u,t);},_mergeStyles:function(u,t){if(!t){t={};}var v=b.merge(t,{});b.Object.each(u,function(y,x,w){if(t.hasOwnProperty(x)&&b.Lang.isObject(y)&&!b.Lang.isArray(y)){v[x]=this._mergeStyles(y,t[x]);}else{v[x]=y;}},this);return v;},_getDefaultStyles:function(){return{padding:{top:0,right:0,bottom:0,left:0}};}};b.augment(n,b.Attribute);b.Renderer=n;j=function(){};j.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:4,bottom:0};},setTickOffsets:function(){var v=this,x=v.get("styles").majorTicks,u=x.length,t=u*0.5,w=x.display;v.set("topTickOffset",0);v.set("bottomTickOffset",0);switch(w){case"inside":v.set("rightTickOffset",u);v.set("leftTickOffset",0);break;case"outside":v.set("rightTickOffset",0);v.set("leftTickOffset",u);break;case"cross":v.set("rightTickOffset",t);v.set("leftTickOffset",t);break;default:v.set("rightTickOffset",0);v.set("leftTickOffset",0);break;}},drawTick:function(z,x){var w=this,u=w.get("styles"),y=u.padding,v=x.length,A={x:y.left,y:z.y},t={x:v+y.left,y:z.y};w.drawLine(A,t,x);},getLineStart:function(){var t=this.get("styles"),x=t.padding,y=t.majorTicks,u=y.length,w=y.display,v={x:x.left,y:0};if(w==="outside"){v.x+=u;}else{if(w==="cross"){v.x+=u/2;}}return v;},getLabelPoint:function(t){return{x:t.x-this.get("leftTickOffset"),y:t.y};},updateMaxLabelSize:function(C){var E=this,A=this._labelRotationProps,u=A.rot,x=A.absRot,D=A.sinRadians,v=A.cosRadians,z=A.m11,y=A.m12,w=A.m21,t=A.m22,B;if(!f.createElementNS){C.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+z+" M12="+y+" M21="+w+" M22="+t+' sizingMethod="auto expand")';E.set("maxLabelSize",Math.max(E.get("maxLabelSize"),C.offsetWidth));}else{C.style.msTransform="rotate(0deg)";if(u===0){B=C.offsetWidth;}else{if(x===90){B=C.offsetHeight;}else{B=(v*C.offsetWidth)+(D*C.offsetHeight);}}E.set("maxLabelSize",Math.max(E.get("maxLabelSize"),B));}},positionTitle:function(G){var I=this,E,J=I.get("styles").title,C=this._getTextRotationProps(J),v=C.rot,z=C.absRot,H=C.sinRadians,u=C.cosRadians,F=0,D=this.get("height")/2,t=0,A=0,B=G.offsetWidth,w=G.offsetHeight;if(b.config.doc.createElementNS){if(v===0){E=B;A-=w*0.5;}else{if(z===90){E=w;if(v===90){t+=w;A-=B*0.5;}else{A+=B*0.5;}}else{E=(u*B)+(H*w);if(v>0){A-=((H*B)+(u*w))/2;t+=Math.min(w,(H*w));}else{A+=(H*B)/2-(u*w)/2;}}}}else{if(v===0){A-=w*0.5;E=B;}else{if(v===90){A-=B*0.5;E=w;}else{if(v===-90){A-=B*0.5;E=w;}else{E=(u*B)+(H*w);A-=((H*B)+(u*w))/2;}}}}D+=A;F+=t;G.style.left=F+"px";G.style.top=D+"px";this._titleSize=E;this._rotate(G,C);},positionLabel:function(E,I){var H=this,G=H.get("leftTickOffset"),u=H.get("styles").label,y=0,x=I.x+this._titleSize,B=I.y,D=this._labelRotationProps,w=D.rot,A=D.absRot,F=D.sinRadians,v=D.cosRadians,t=H.get("maxLabelSize"),C=Math.round(E.offsetWidth),z=Math.round(E.offsetHeight);if(u.margin&&u.margin.right){y=u.margin.right;}if(!f.createElementNS){E.style.filter=null;C=Math.round(E.offsetWidth);z=Math.round(E.offsetHeight);if(w===0){x=C;B-=z*0.5;}else{if(A===90){x=z;B-=C*0.5;}else{if(w>0){x=(v*C)+(z*w/90);B-=(F*C)+(v*(z*0.5));}else{x=(v*C)+(A/90*z);B-=v*(z*0.5);}}}x+=G;E.style.left=((I.x+this._titleSize+t)-x)+"px";E.style.top=B+"px";this._rotate(E,this._labelRotationProps);return;}E.style.msTransform="rotate(0deg)";C=Math.round(E.offsetWidth);z=Math.round(E.offsetHeight);if(w===0){x-=C;B-=z*0.5;}else{if(w===90){B-=C*0.5;}else{if(w===-90){x-=z;B+=C*0.5;}else{if(w<0){x-=(v*C)+(F*z);B+=(F*C)-(v*(z*0.6));}else{x-=(v*C);B-=(F*C)+(v*(z*0.6));}}}}E.style.left=(H.get("maxLabelSize")+x)+"px";E.style.top=B+"px";this._rotate(E,this._labelRotationProps);},setSizeAndPosition:function(){var v=this,t=v.get("maxLabelSize"),u=v.get("styles"),z=v.get("leftTickOffset"),x=t+z,y=v.get("graphic"),w=u.label.margin;if(w&&w.right){x+=w.right;}x+=this._titleSize;x=Math.round(x);v.set("width",x);v.get("contentBox").setStyle("width",x);y.set("x",x-z);},offsetNodeForTick:function(t){},setCalculatedSize:function(){var x=this,w=x.get("styles"),v=w.label,y=x.get("leftTickOffset"),u=x.get("maxLabelSize"),t=Math.round(this._titleSize+y+u+v.margin.right);x.get("contentBox").setStyle("width",t);x.set("width",t);}};b.LeftAxisLayout=j;m=function(){};m.prototype={_getDefaultMargins:function(){return{top:0,left:4,right:0,bottom:0};},setTickOffsets:function(){var v=this,x=v.get("styles").majorTicks,u=x.length,t=u*0.5,w=x.display;v.set("topTickOffset",0);v.set("bottomTickOffset",0);switch(w){case"inside":v.set("leftTickOffset",u);v.set("rightTickOffset",0);break;case"outside":v.set("leftTickOffset",0);v.set("rightTickOffset",u);break;case"cross":v.set("rightTickOffset",t);v.set("leftTickOffset",t);break;default:v.set("leftTickOffset",0);v.set("rightTickOffset",0);break;}},drawTick:function(z,x){var w=this,u=w.get("styles"),y=u.padding,v=x.length,A={x:y.left,y:z.y},t={x:y.left+v,y:z.y};w.drawLine(A,t,x);},getLineStart:function(){var v=this,t=v.get("styles"),y=t.padding,z=t.majorTicks,u=z.length,x=z.display,w={x:y.left,y:y.top};if(x==="inside"){w.x+=u;}else{if(x==="cross"){w.x+=u/2;}}return w;},getLabelPoint:function(t){return{x:t.x+this.get("rightTickOffset"),y:t.y};},updateMaxLabelSize:function(C){var E=this,A=this._labelRotationProps,u=A.rot,x=A.absRot,D=A.sinRadians,v=A.cosRadians,z=A.m11,y=A.m12,w=A.m21,t=A.m22,B;if(!f.createElementNS){C.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+z+" M12="+y+" M21="+w+" M22="+t+' sizingMethod="auto expand")';E.set("maxLabelSize",Math.max(E.get("maxLabelSize"),C.offsetWidth));}else{C.style.msTransform="rotate(0deg)";if(u===0){B=C.offsetWidth;}else{if(x===90){B=C.offsetHeight;}else{B=(v*C.offsetWidth)+(D*C.offsetHeight);}}E.set("maxLabelSize",Math.max(E.get("maxLabelSize"),B));
}},positionTitle:function(H){var J=this,F,K=J.get("styles").title,w=K.margin,D=this._getTextRotationProps(K),v=D.rot,A=D.absRot,I=D.sinRadians,u=D.cosRadians,G=0,E=this.get("height")/2,t=this.get("maxLabelSize")+w.left+this.get("rightTickOffset")+this.get("styles").label.margin.left,B=0,C=H.offsetWidth,z=H.offsetHeight;if(b.config.doc.createElementNS){if(v===0){F=C;B-=z*0.5;}else{if(A===90){F=z;if(v===90){B-=C*0.5;t+=z;}else{B+=C*0.5;}}else{F=(u*C)+(I*z);if(v>0){B-=((I*C)+(u*z))/2;t+=Math.min(z,(I*z));}else{B+=(I*C)/2-(u*z)/2;}}}}else{if(v===0){B-=z*0.5;F=C;}else{if(v===90){B-=C*0.5;F=z;}else{if(v===-90){B-=C*0.5;F=z;}else{F=(u*C)+(I*z);B-=((I*C)+(u*z))/2;}}}}E+=B;G+=t;H.style.left=G+"px";H.style.top=E+"px";this._titleSize=F;this._rotate(H,D);},positionLabel:function(D,H){var G=this,F=G.get("rightTickOffset"),t=G.get("styles").label,x=0,w=H.x,A=H.y,C=this._labelRotationProps,v=C.rot,z=C.absRot,E=C.sinRadians,u=C.cosRadians,B=Math.round(D.offsetWidth),y=Math.round(D.offsetHeight);if(t.margin&&t.margin.left){x=t.margin.left;}if(!f.createElementNS){D.style.filter=null;if(v===0){A-=y*0.5;}else{if(z===90){A-=B*0.5;}else{if(v>0){A-=(u*(y*0.5));}else{A-=(E*B)+(u*(y*0.5));}}}w+=x;w+=F;D.style.left=w+"px";D.style.top=A+"px";this._rotate(D,C);return;}D.style.msTransform="rotate(0deg)";B=Math.round(D.offsetWidth);y=Math.round(D.offsetHeight);if(v===0){A-=y*0.5;}else{if(v===90){w+=y;A-=B*0.5;}else{if(v===-90){A+=B*0.5;}else{if(v<0){A-=(u*(y*0.6));}else{A-=u*(y*0.6);w+=E*y;}}}}w+=x;w+=F;D.style.left=w+"px";D.style.top=A+"px";this._rotate(D,C);},setSizeAndPosition:function(){var v=this,u=v.get("styles").label,t=v.get("maxLabelSize"),x=v.get("rightTickOffset"),w=x+t;if(u.margin&&u.margin.left){w+=u.margin.left;}w+=this._titleSize;v.set("width",w);v.get("contentBox").setStyle("width",w);},offsetNodeForTick:function(t){var u=this,w=u.get("leftTickOffset"),v=0-w;t.setStyle("left",v);},setCalculatedSize:function(){var v=this,u=v.get("styles").label,t=Math.round(v.get("rightTickOffset")+v.get("maxLabelSize")+this._titleSize+v.get("styles").title.margin.left+u.margin.left);v.set("width",t);}};b.RightAxisLayout=m;p=function(){};p.prototype={_getDefaultMargins:function(){return{top:4,left:0,right:0,bottom:0};},setTickOffsets:function(){var v=this,x=v.get("styles").majorTicks,u=x.length,t=u*0.5,w=x.display;v.set("leftTickOffset",0);v.set("rightTickOffset",0);switch(w){case"inside":v.set("topTickOffset",u);v.set("bottomTickOffset",0);break;case"outside":v.set("topTickOffset",0);v.set("bottomTickOffset",u);break;case"cross":v.set("topTickOffset",t);v.set("bottomTickOffset",t);break;default:v.set("topTickOffset",0);v.set("bottomTickOffset",0);break;}},getLineStart:function(){var t=this.get("styles"),x=t.padding,y=t.majorTicks,u=y.length,w=y.display,v={x:0,y:x.top};if(w==="inside"){v.y+=u;}else{if(w==="cross"){v.y+=u/2;}}return v;},drawTick:function(z,x){var w=this,u=w.get("styles"),y=u.padding,v=x.length,A={x:z.x,y:y.top},t={x:z.x,y:v+y.top};w.drawLine(A,t,x);},getLabelPoint:function(t){return{x:t.x,y:t.y+this.get("bottomTickOffset")};},updateMaxLabelSize:function(C){var E=this,A=this._labelRotationProps,u=A.rot,x=A.absRot,D=A.sinRadians,v=A.cosRadians,z=A.m11,y=A.m12,w=A.m21,t=A.m22,B;if(!f.createElementNS){C.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+z+" M12="+y+" M21="+w+" M22="+t+' sizingMethod="auto expand")';E.set("maxLabelSize",Math.max(E.get("maxLabelSize"),C.offsetHeight));}else{C.style.msTransform="rotate(0deg)";if(u===0){B=C.offsetHeight;}else{if(x===90){B=C.offsetWidth;}else{B=(D*C.offsetWidth)+(v*C.offsetHeight);}}E.set("maxLabelSize",Math.max(E.get("maxLabelSize"),B));}},positionTitle:function(G){var I=this,E,J=I.get("styles").title,C=this._getTextRotationProps(J),v=C.rot,z=C.absRot,H=C.sinRadians,u=C.cosRadians,F=this.get("width")/2,D=this.get("maxLabelSize")+this.get("styles").label.margin.top+J.margin.top+this.get("bottomTickOffset"),t=0,A=0,B=G.offsetWidth,w=G.offsetHeight;if(b.config.doc.createElementNS){if(v===0){E=w;t-=B*0.5;}else{if(z===90){E=B;if(v===-90){A+=B;t-=w;}}else{E=(H*B)+(u*w);if(v>0){t-=(u*B)/2-(H*w)/2;}else{A+=(H*B)-(u*w)/2;t-=(u*B)/2+(H*w)/2;}}}}else{if(v===0){t-=B*0.5;E=w;}else{if(v===90){t-=w*0.5;E=B;}else{if(v===-90){t-=w*0.5;E=B;}else{E=(H*B)+(u*w);t-=((u*B)+(H*w))/2;}}}}F+=t;D+=A;G.style.left=F+"px";G.style.top=D+"px";this._titleSize=E;this._rotate(G,C);},positionLabel:function(D,H){var G=this,F=G.get("bottomTickOffset"),t=G.get("styles").label,x=0,C=this._labelRotationProps,w=C.rot,z=C.absRot,E=C.sinRadians,v=C.cosRadians,u=Math.round(H.x),A=Math.round(H.y),B=Math.round(D.offsetWidth),y=Math.round(D.offsetHeight);if(t.margin&&t.margin.top){x=t.margin.top;}if(!f.createElementNS){D.style.filter=null;B=Math.round(D.offsetWidth);y=Math.round(D.offsetHeight);if(z===90){u-=y*0.5;}else{if(w<0){u-=v*B;u-=E*(y*0.5);}else{if(w>0){u-=E*(y*0.5);}else{u-=B*0.5;}}}A+=x;A+=F;D.style.left=Math.round(u)+"px";D.style.top=Math.round(A)+"px";this._rotate(D,C);return;}D.style.msTransform="rotate(0deg)";B=Math.round(D.offsetWidth);y=Math.round(D.offsetHeight);if(w===0){u-=B*0.5;}else{if(z===90){if(w===90){u+=y*0.5;}else{A+=B;u-=y*0.5;}}else{if(w<0){u-=(v*B)+(E*(y*0.6));A+=E*B;}else{u+=Math.round(E*(y*0.6));}}}A+=x;A+=F;D.style.left=Math.round(u)+"px";D.style.top=Math.round(A)+"px";this._rotate(D,C);},setSizeAndPosition:function(){var w=this,t=w.get("maxLabelSize"),v=w.get("bottomTickLength"),u=w.get("styles"),y=v+t,x=u.label.margin;if(x&&x.top){y+=x.top;}y=Math.round(y);w.set("height",y);},offsetNodeForTick:function(t){var u=this;u.get("contentBox").setStyle("top",0-u.get("topTickOffset"));},setCalculatedSize:function(){var v=this,u=v.get("styles").label,t=Math.round(v.get("bottomTickOffset")+v.get("maxLabelSize")+u.margin.top+this.get("styles").title.margin.top+this._titleSize);v.set("height",t);}};b.BottomAxisLayout=p;a=function(){};a.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:0,bottom:4};},setTickOffsets:function(){var v=this,x=v.get("styles").majorTicks,u=x.length,t=u*0.5,w=x.display;
v.set("leftTickOffset",0);v.set("rightTickOffset",0);switch(w){case"inside":v.set("bottomTickOffset",u);v.set("topTickOffset",0);break;case"outside":v.set("bottomTickOffset",0);v.set("topTickOffset",u);break;case"cross":v.set("topTickOffset",t);v.set("bottomTickOffset",t);break;default:v.set("topTickOffset",0);v.set("bottomTickOffset",0);break;}},getLineStart:function(){var v=this,t=v.get("styles"),y=t.padding,z=t.majorTicks,u=z.length,x=z.display,w={x:0,y:y.top};if(x==="outside"){w.y+=u;}else{if(x==="cross"){w.y+=u/2;}}return w;},drawTick:function(z,x){var w=this,u=w.get("styles"),y=u.padding,v=x.length,A={x:z.x,y:y.top},t={x:z.x,y:v+y.top};w.drawLine(A,t,x);},getLabelPoint:function(t){return{x:t.x,y:t.y-this.get("topTickOffset")};},updateMaxLabelSize:function(C){var E=this,A=this._labelRotationProps,u=A.rot,x=A.absRot,D=A.sinRadians,v=A.cosRadians,z=A.m11,y=A.m12,w=A.m21,t=A.m22,B;if(!f.createElementNS){C.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+z+" M12="+y+" M21="+w+" M22="+t+' sizingMethod="auto expand")';E.set("maxLabelSize",Math.max(E.get("maxLabelSize"),C.offsetHeight));}else{C.style.msTransform="rotate(0deg)";if(u===0){B=C.offsetHeight;}else{if(x===90){B=C.offsetWidth;}else{B=(D*C.offsetWidth)+(v*C.offsetHeight);}}E.set("maxLabelSize",Math.max(E.get("maxLabelSize"),B));}},positionTitle:function(G){var I=this,E,J=I.get("styles").title,C=this._getTextRotationProps(J),v=C.rot,z=C.absRot,H=C.sinRadians,u=C.cosRadians,F=this.get("width")/2,D=J.margin.top,t=0,A=0,B=G.offsetWidth,w=G.offsetHeight;if(b.config.doc.createElementNS){if(v===0){E=w;t-=B*0.5;}else{if(z===90){E=B;if(v===90){t+=w/2;}else{A+=B;t-=w/2;}}else{E=(H*B)+(u*w);if(v>0){t-=(u*B)/2-(H*w)/2;}else{A+=(H*B);t-=(u*B)/2+(H*w)/2;}}}}else{if(v===0){t-=B*0.5;E=w;}else{if(v===90){t-=w*0.5;E=B;}else{if(v===-90){t-=w*0.5;E=B;}else{E=(H*B)+(u*w);t-=((u*B)+(H*w))/2;}}}}F+=t;D+=A;G.style.left=F+"px";G.style.top=D+"px";this._titleSize=E;this._rotate(G,C);},positionLabel:function(z,G){var E=this,x=E.get("topTickOffset"),I=E.get("styles").label,w=E.get("styles").title,K=this.get("title")?this._titleSize+w.margin.top+w.margin.bottom:0,F=0,B=G.x,H=G.y+K,v=this._labelRotationProps,A=v.rot,u=v.absRot,D=v.sinRadians,y=v.cosRadians,C=E.get("maxLabelSize"),J=Math.round(z.offsetWidth),t=Math.round(z.offsetHeight);if(I.margin&&I.margin.bottom){F=I.margin.bottom;}if(!f.createElementNS){z.style.filter=null;J=Math.round(z.offsetWidth);t=Math.round(z.offsetHeight);if(A===0){B-=J*0.5;}else{if(u===90){B-=t*0.5;}else{if(A>0){B-=(y*J)+Math.min((D*t),(A/180*t));H-=(D*J)+(y*(t));H+=C;}else{B-=D*(t*0.5);H-=(D*J)+(y*(t));H+=C;}}}H-=x;z.style.left=B;z.style.top=H;this._rotate(z,v);return;}z.style.msTransform="rotate(0deg)";J=Math.round(z.offsetWidth);t=Math.round(z.offsetHeight);if(A===0){B-=J*0.5;H-=t;}else{if(A===90){B+=t*0.5;H-=J;}else{if(A===-90){B-=t*0.5;H-=0;}else{if(A<0){B-=(D*(t*0.6));H-=(y*t);}else{B-=(y*J)-(D*(t*0.6));H-=(D*J)+(y*t);}}}}H-=x;z.style.left=B+"px";z.style.top=(E.get("maxLabelSize")+H)+"px";this._rotate(z,v);},setSizeAndPosition:function(){var w=this,t=w.get("maxLabelSize"),z=w.get("topTickOffset"),v=w.get("styles"),x=v.label.margin,A=w.get("graphic"),y=z+t,u=v.title.margin;if(x&&x.bottom){y+=x.bottom;}if(this.get("title")){y+=this._titleSize+u.top+u.bottom;}w.set("height",y);A.set("y",y-z);},offsetNodeForTick:function(t){},setCalculatedSize:function(){var y=this,x=y.get("styles"),w=x.label.margin,v=x.title.margin,z=w.top+w.bottom+y.get("maxLabelSize"),u=y.get("title")?v.top+v.bottom+y._titleSize:0,t=Math.round(y.get("topTickOffset")+z+u);y.set("height",t);}};b.TopAxisLayout=a;b.Axis=b.Base.create("axis",b.Widget,[b.Renderer],{_dataChangeHandler:function(t){if(this.get("rendered")){this._drawAxis();}},_updateHandler:function(t){if(this.get("rendered")){this._drawAxis();}},renderUI:function(){var u=this.get("position"),t=this._layoutClasses[u];if(u&&u!="none"){this._layout=new t();if(this._layout){this._setCanvas();}}},syncUI:function(){var x=this._layout,w,v,t,y,u;if(x){w=x._getDefaultMargins();v=this.get("styles");t=v.label.margin;y=v.title.margin;for(u in w){if(w.hasOwnProperty(u)){t[u]=t[u]===undefined?w[u]:t[u];y[u]=y[u]===undefined?w[u]:y[u];}}}this._drawAxis();},_setCanvas:function(){var t=this.get("contentBox"),z=this.get("boundingBox"),y=this.get("position"),v=this._parentNode,u=this.get("width"),x=this.get("height");z.setStyle("position","absolute");u=u?u+"px":v.getStyle("width");x=x?x+"px":v.getStyle("height");if(y==="top"||y==="bottom"){t.setStyle("width",u);}else{t.setStyle("height",x);}t.setStyle("position","relative");t.setStyle("left","0px");t.setStyle("top","0px");this.set("graphic",new b.Graphic());this.get("graphic").render(t);},_getDefaultStyles:function(){var t={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:undefined,right:undefined,bottom:undefined,left:undefined}},title:{color:"#808080",alpha:1,fontSize:"85%",rotation:undefined,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},hideOverlappingLabelTicks:false};return b.merge(b.Renderer.prototype._getDefaultStyles(),t);},_handleSizeChange:function(w){var v=w.attrName,y=this.get("position"),u=y=="left"||y=="right",t=this.get("contentBox"),x=y=="bottom"||y=="top";t.setStyle("width",this.get("width"));t.setStyle("height",this.get("height"));if((x&&v=="width")||(u&&v=="height")){this._drawAxis();}},_layoutClasses:{top:a,bottom:p,left:j,right:m},drawLine:function(v,u,t){var w=this.get("path");w.set("stroke",{weight:t.weight,color:t.color,opacity:t.alpha});w.moveTo(v.x,v.y);w.lineTo(u.x,u.y);},_getTextRotationProps:function(C){if(C.rotation===undefined){switch(this.get("position")){case"left":C.rotation=-90;break;case"right":C.rotation=90;
break;default:C.rotation=0;break;}}var u=Math.min(90,Math.max(-90,C.rotation)),x=Math.abs(u),A=Math.PI/180,B=parseFloat(parseFloat(Math.sin(x*A)).toFixed(8)),v=parseFloat(parseFloat(Math.cos(x*A)).toFixed(8)),z=v,y=u>0?-B:B,w=-y,t=z;return{rot:u,absRot:x,radCon:A,sinRadians:B,cosRadians:v,m11:z,m12:y,m21:w,m22:t,textAlpha:C.alpha};},_drawAxis:function(){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;if(this._layout){var A=this.get("styles"),x=A.label,K=A.majorTicks,t=K.display!="none",B,v=A.majorUnit,I,G,H=0,J=this._layout,F,L,D,z,y=this.get("labelFunction"),u=this.get("labelFunctionScope"),w=this.get("labelFormat"),C=this.get("graphic"),E=this.get("path");C.set("autoDraw",false);E.clear();this._labelRotationProps=this._getTextRotationProps(x);J.setTickOffsets.apply(this);F=this.getLength();D=J.getLineStart.apply(this);I=this.getTotalMajorUnits(v);G=this.getMajorUnitDistance(I,F,v);this.set("edgeOffset",this.getEdgeOffset(I,F)*0.5);B=this.getFirstPoint(D);this.drawLine(D,this.getLineEnd(B),A.line);if(t){J.drawTick.apply(this,[B,K]);}if(I<1){this._clearLabelCache();return;}this._createLabelCache();this._tickPoints=[];this.set("maxLabelSize",0);this._titleSize=0;for(;H<I;++H){if(t){J.drawTick.apply(this,[B,K]);}L=this.getPosition(B);z=this.getLabel(B,x);z.innerHTML=y.apply(u,[this.getLabelByIndex(H,I),w]);B=this.getNextPoint(B,G);}this._clearLabelCache();this._updateTitle();J.setSizeAndPosition.apply(this);if(this.get("overlapGraph")){J.offsetNodeForTick.apply(this,[this.get("contentBox")]);}J.setCalculatedSize.apply(this);for(H=0;H<I;++H){J.positionLabel.apply(this,[this.get("labels")[H],this._tickPoints[H]]);}}this._drawing=false;if(this._callLater){this._drawAxis();}else{this._updatePathElement();this.fire("axisRendered");}},_updatePathElement:function(){var t=this.get("path"),u=this.get("graphic");if(t){t.end();u._redraw();}},_updateTitle:function(){var v,x,w,y=this.get("title"),u=this._titleTextField,t;if(y!==null&&y!==undefined){w={rotation:"rotation",margin:"margin",alpha:"alpha"};x=this.get("styles").title;if(!u){u=b.config.doc.createElement("span");u.setAttribute("class","axisTitle");this.get("contentBox").appendChild(u);}u.setAttribute("style","display:block;white-space:nowrap;position:absolute;");for(v in x){if(x.hasOwnProperty(v)&&!w.hasOwnProperty(v)){u.style[v]=x[v];}}u.innerHTML=y;this._titleTextField=u;this._layout.positionTitle.apply(this,[u]);}else{if(u){t=u.parentNode;if(t){t.removeChild(u);}this._titleTextField=null;}}},getLabel:function(y,x){var v,u,w={rotation:"rotation",margin:"margin",alpha:"alpha"},t=this._labelCache;if(t.length>0){u=t.shift();}else{u=f.createElement("span");u.style.display="block";u.style.whiteSpace="nowrap";b.one(u).addClass("axisLabel");this.get("contentBox").appendChild(u);}u.style.position="absolute";this._labels.push(u);this._tickPoints.push({x:y.x,y:y.y});this._layout.updateMaxLabelSize.apply(this,[u]);for(v in x){if(x.hasOwnProperty(v)&&!w.hasOwnProperty(v)){u.style[v]=x[v];}}return u;},_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 t=this._labelCache.length,v=0,u,w=this._labelCache;for(;v<t;++v){u=w[v];u.parentNode.removeChild(u);}}this._labelCache=[];},getLineEnd:function(v){var t=this.get("width"),u=this.get("height"),x=this.get("position");if(x==="top"||x==="bottom"){return{x:t,y:v.y};}else{return{x:v.x,y:u};}},getLength:function(){var u,x=this.get("styles"),y=x.padding,t=this.get("width"),v=this.get("height"),z=this.get("position");if(z==="top"||z==="bottom"){u=t-(y.left+y.right);}else{u=v-(y.top+y.bottom);}return u;},getFirstPoint:function(w){var t=this.get("styles"),x=this.get("position"),v=t.padding,u={x:w.x,y:w.y};if(x==="top"||x==="bottom"){u.x+=v.left+this.get("edgeOffset");}else{u.y+=this.get("height")-(v.top+this.get("edgeOffset"));}return u;},getNextPoint:function(t,u){var v=this.get("position");if(v==="top"||v==="bottom"){t.x=t.x+u;}else{t.y=t.y-u;}return t;},getLastPoint:function(){var u=this.get("styles"),v=u.padding,t=this.get("width"),x=this.get("position");if(x==="top"||x==="bottom"){return{x:t-v.right,y:v.top};}else{return{x:v.left,y:v.top};}},getPosition:function(t){var y,w=this.get("height"),v=this.get("styles"),x=v.padding,z=this.get("position"),u=this.get("dataType");if(z==="left"||z==="right"){if(u==="numeric"){y=(w-(x.top+x.bottom))-(t.y-x.top);}else{y=t.y-x.top;}}else{y=t.x-x.left;}return y;},_rotate:function(D,C){var u=C.rot,x,A,F,v,z,y,w,t,B,E;if(b.config.doc.createElementNS){D.style.MozTransformOrigin="0 0";D.style.MozTransform="rotate("+u+"deg)";D.style.webkitTransformOrigin="0 0";D.style.webkitTransform="rotate("+u+"deg)";D.style.msTransformOrigin="0 0";D.style.msTransform="rotate("+u+"deg)";D.style.OTransformOrigin="0 0";D.style.OTransform="rotate("+u+"deg)";}else{E=C.textAlpha;x=C.absRot;A=C.radCon;F=C.sinRadians;v=C.cosRadians;z=C.m11;y=C.m12;w=C.m21;t=C.m22;if(b.Lang.isNumber(E)&&E<1&&E>-1&&!isNaN(E)){B="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(E*100)+")";}if(u!==0){if(B){B+=" ";}else{B="";}B+="progid:DXImageTransform.Microsoft.Matrix(M11="+z+" M12="+y+" M21="+w+" M22="+t+' sizingMethod="auto expand")';}if(B){D.style.filter=B;}}}},{ATTRS:{edgeOffset:{value:0},graphic:{},path:{readOnly:true,getter:function(){if(!this._path){var t=this.get("graphic");if(t){this._path=t.getShape({type:"path"});}}return this._path;}},node:{},position:{setOnce:true,setter:function(t){if(t=="none"){this.bindUI();}return t;}},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(t){return b.Lang.isBoolean(t);
}},labelFunctionScope:{},maxLabelSize:{value:0},title:{}}});b.AxisType=b.Base.create("baseAxis",b.Axis,[],{bindUI:function(){this.after("dataReady",b.bind(this._dataChangeHandler,this));this.after("dataUpdate",b.bind(this._dataChangeHandler,this));this.after("minimumChange",b.bind(this._keyChangeHandler,this));this.after("maximumChange",b.bind(this._keyChangeHandler,this));this.after("keysChange",this._keyChangeHandler);this.after("dataProviderChange",this._dataProviderChangeHandler);this.after("stylesChange",this._updateHandler);this.after("positionChange",this._positionChangeHandler);this.after("overlapGraphChange",this._updateHandler);this.after("widthChange",this._handleSizeChange);this.after("heightChange",this._handleSizeChange);this.after("alwaysShowZeroChange",this._keyChangeHandler);this.after("roundingMethodChange",this._keyChangeHandler);},_dataProviderChangeHandler:function(w){var t=this.get("keyCollection").concat(),v=this.get("keys"),u;if(v){for(u in v){if(v.hasOwnProperty(u)){delete v[u];}}}if(t&&t.length){this.set("keys",t);}},GUID:"yuibaseaxis",_type:null,_setMaximum:null,_dataMaximum:null,_setMinimum:null,_data:null,_updateTotalDataFlag:true,_dataReady:false,addKey:function(t){this.set("keys",t);},_getKeyArray:function(w,x){var v=0,y,u=[],t=x.length;for(;v<t;++v){y=x[v];u[v]=y[w];}return u;},_setDataByKey:function(x,y){var w,z,u=[],v=this._dataClone.concat(),t=v.length;for(w=0;w<t;++w){z=v[w];u[w]=z[x];}this.get("keys")[x]=u;this._updateTotalDataFlag=true;},_updateTotalData:function(){var u=this.get("keys"),t;this._data=[];for(t in u){if(u.hasOwnProperty(t)){this._data=this._data.concat(u[t]);}}this._updateTotalDataFlag=false;},removeKey:function(u){var t=this.get("keys");if(t.hasOwnProperty(u)){delete t[u];this._keyChangeHandler();}},getKeyValueAt:function(u,t){var w=NaN,v=this.get("keys");if(v[u]&&v[u][t]){w=v[u][t];}return w;},getDataByKey:function(u){var t=this.get("keys");if(t[u]){return t[u];}return null;},_updateMinAndMax:function(){var y=this.get("data"),u=0,x=0,t,v,w;if(y&&y.length&&y.length>0){t=y.length;u=x=y[0];if(t>1){for(w=1;w<t;w++){v=y[w];if(isNaN(v)){continue;}u=Math.max(v,u);x=Math.min(v,x);}}}this._dataMaximum=u;this._dataMinimum=x;},getTotalMajorUnits:function(){var u,v=this.get("styles").majorUnit,t=this.get("length");if(v.determinant==="count"){u=v.count;}else{if(v.determinant==="distance"){u=(t/v.distance)+1;}}return u;},getMajorUnitDistance:function(t,w,u){var v;if(u.determinant==="count"){v=w/(t-1);}else{if(u.determinant==="distance"){v=u.distance;}}return v;},getEdgeOffset:function(u,t){return 0;},getLabelByIndex:function(x,u){var w=this.get("minimum"),t=this.get("maximum"),y=(t-w)/(u-1),v;u-=1;v=w+(x*y);return v;},_keyChangeHandler:function(t){this._updateMinAndMax();this.fire("dataUpdate");}},{ATTRS:{keys:{value:{},setter:function(x){var v={},u,t,w=this.get("dataProvider");if(b.Lang.isArray(x)){t=x.length;for(u=0;u<t;++u){v[x[u]]=this._getKeyArray(x[u],w);}}else{if(b.Lang.isString(x)){v=this.get("keys");v[x]=this._getKeyArray(x,w);}else{for(u in x){if(x.hasOwnProperty(u)){v[u]=this._getKeyArray(u,w);}}}}this._updateTotalDataFlag=true;return v;}},roundingMethod:{value:"niceNumber"},type:{readOnly:true,getter:function(){return this._type;}},dataProvider:{setter:function(t){return t;}},dataMaximum:{getter:function(){if(!this._dataMaximum){this._updateMinAndMax();}return this._dataMaximum;}},maximum:{getter:function(){var t=this.get("dataMaximum"),u=this.get("minimum");if(u===0&&t===0){t=10;}if(this.get("setMax")){t=this._setMaximum;}return t;},setter:function(t){this._setMaximum=parseFloat(t);return t;}},dataMinimum:{getter:function(){if(!this._dataMinimum){this._updateMinAndMax();}return this._dataMinimum;}},minimum:{getter:function(){var t=this.get("dataMinimum");if(this.get("setMin")){t=this._setMinimum;}return t;},setter:function(t){this._setMinimum=parseFloat(t);return t;}},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 v=this.get("keys"),u,t=[];for(u in v){if(v.hasOwnProperty(u)){t.push(u);}}return t;},readOnly:true},labelFunction:{value:function(u,t){return u;}}}});function k(t){k.superclass.constructor.apply(this,arguments);}k.NAME="numericAxis";k.ATTRS={alwaysShowZero:{value:true},labelFunction:{value:function(u,t){if(t){return b.DataType.Number.format(u,t);}return u;}},labelFormat:{value:{prefix:"",thousandsSeparator:"",decimalSeparator:"",decimalPlaces:"0",suffix:""}}};b.extend(k,b.AxisType,{_type:"numeric",getKeyValueAt:function(u,t){var w=NaN,v=this.get("keys");if(v[u]&&b.Lang.isNumber(parseFloat(v[u][t]))){w=v[u][t];}return w;},_getMinimumUnit:function(t,v,u){return this._getNiceNumber(Math.ceil((t-v)/u));},_getNiceNumber:function(v){var x=v,t=Math.ceil(Math.log(x)*0.4342944819032518),w=Math.pow(10,t),u;if(w/2>=x){u=Math.floor((w/2-x)/(Math.pow(10,t-1)/2));x=w/2-u*Math.pow(10,t-1)/2;}else{x=w;}if(!isNaN(x)){return x;}return v;},_updateMinAndMax:function(){var u=this.get("data"),z=0,t=0,x,w,v,A,B=this.get("setMax"),y=this.get("setMin");if(!B&&!y){if(u&&u.length&&u.length>0){x=u.length;z=t=u[0];if(x>1){for(v=1;v<x;v++){w=u[v];if(isNaN(w)){if(b.Lang.isObject(w)){t=z=0;for(A in w){if(w.hasOwnProperty(A)){z=Math.max(w[A],z);t=Math.min(w[A],t);}}}z=B?this._setMaximum:z;t=y?this._setMinimum:t;continue;}z=B?this._setMaximum:Math.max(w,z);t=y?this._setMinimum:Math.min(w,t);}}}this._roundMinAndMax(t,z);}},_roundMinAndMax:function(x,G){var A,v,H=x>=0,F=G>0,y,E,I,w,D,u,C,B=this.getTotalMajorUnits()-1,z=this.get("alwaysShowZero"),J=this.get("roundingMethod"),t=(G-x)/B>=1;if(J){if(J=="niceNumber"){A=this._getMinimumUnit(G,x,B);if(H&&F){if(z||x<A){x=0;}A=this._getMinimumUnit(G,x,B);G=this._roundUpToNearest(G,A);}else{if(F&&!H){w=Math.round(B/((-1*x)/G+1));w=Math.max(Math.min(w,B-1),1);
D=B-w;u=Math.ceil(G/w);C=Math.floor(x/D)*-1;A=Math.max(u,C);A=this._getNiceNumber(A);G=A*w;x=A*D*-1;}else{if(z||G===0||G+A>0){G=0;A=this._getMinimumUnit(G,x,B);}else{G=this._roundUpToNearest(G,A);}x=G-(A*B);}}}else{if(J=="auto"){if(H&&F){if(z||x<(G-x)/B){x=0;}A=(G-x)/B;if(t){A=Math.ceil(A);}G=x+(A*B);}else{if(F&&!H){if(z){w=Math.round(B/((-1*x)/G+1));w=Math.max(Math.min(w,B-1),1);D=B-w;if(t){u=Math.ceil(G/w);C=Math.floor(x/D)*-1;}else{u=G/w;C=x/D*-1;}A=Math.max(u,C);G=A*w;x=A*D*-1;}else{A=(G-x)/B;if(t){A=Math.ceil(A);}x=this._roundDownToNearest(x,A);G=this._roundUpToNearest(G,A);}}else{A=(G-x)/B;if(t){A=Math.ceil(A);}if(z||G===0||G+A>0){G=0;A=(G-x)/B;if(t){Math.ceil(A);}}else{G=this._roundUpToNearest(G,A);}x=G-(A*B);}}}else{if(!isNaN(J)&&isFinite(J)){A=J;v=A*B;y=(G-x)>v;I=this._roundDownToNearest(x,A);E=this._roundUpToNearest(G,A);if(H&&F){if(z||I<=0){x=0;}else{x=I;}if(!y){G=x+v;}else{G=E;}}else{if(F&&!H){x=I;if(!y){G=x+v;}else{G=E;}}else{if(G===0||z){G=0;}else{G=E;}if(!y){x=G-v;}else{x=I;}}}}}}}this._dataMaximum=G;this._dataMinimum=x;},getLabelByIndex:function(x,u){var w=this.get("minimum"),t=this.get("maximum"),y=(t-w)/(u-1),v;u-=1;v=w+(x*y);if(x>0){v=this._roundToNearest(v,y);}return v;},_roundToNearest:function(v,u){u=u||1;if(u===0){return v;}var t=Math.round(this._roundToPrecision(v/u,10))*u;return this._roundToPrecision(t,10);},_roundUpToNearest:function(u,t){t=t||1;if(t===0){return u;}return Math.ceil(this._roundToPrecision(u/t,10))*t;},_roundDownToNearest:function(u,t){t=t||1;if(t===0){return u;}return Math.floor(this._roundToPrecision(u/t,10))*t;},_roundToPrecision:function(v,t){t=t||0;var u=Math.pow(10,t);return Math.round(u*v)/u;}});b.NumericAxis=k;function d(t){d.superclass.constructor.apply(this,arguments);}d.NAME="stackedAxis";b.extend(d,b.NumericAxis,{_updateMinAndMax:function(){var z=0,u=0,y=0,t=0,x=0,v=0,A,w,B=this.get("keys");for(A in B){if(B.hasOwnProperty(A)){x=Math.max(x,B[A].length);}}for(;v<x;++v){y=0;t=0;for(A in B){if(B.hasOwnProperty(A)){w=B[A][v];if(isNaN(w)){continue;}if(w>=0){y+=w;}else{t+=w;}}}if(y>0){z=Math.max(z,y);}else{z=Math.max(z,t);}if(t<0){u=Math.min(u,t);}else{u=Math.min(u,y);}}this._roundMinAndMax(u,z);}});b.StackedAxis=d;function c(t){c.superclass.constructor.apply(this,arguments);}c.NAME="timeAxis";c.ATTRS={setMax:{readOnly:true,getter:function(){var t=this._getNumber(this._setMaximum);return(b.Lang.isNumber(t));}},setMin:{readOnly:true,getter:function(){var t=this._getNumber(this._setMinimum);return(b.Lang.isNumber(t));}},maximum:{getter:function(){var t=this._getNumber(this._setMaximum);if(!b.Lang.isNumber(t)){t=this._getNumber(this.get("dataMaximum"));}return t;},setter:function(t){this._setMaximum=this._getNumber(t);return t;}},minimum:{getter:function(){var t=this._getNumber(this._setMinimum);if(!b.Lang.isNumber(t)){t=this._getNumber(this.get("dataMinimum"));}return t;},setter:function(t){this._setMinimum=this._getNumber(t);return t;}},labelFunction:{value:function(u,t){u=b.DataType.Date.parse(u);if(t){return b.DataType.Date.format(u,{format:t});}return u;}},labelFormat:{value:"%b %d, %y"}};b.extend(c,b.AxisType,{GUID:"yuitimeaxis",_dataType:"time",getLabelByIndex:function(y,v){var x=this.get("minimum"),u=this.get("maximum"),t=this.get("position"),z,w;v-=1;z=((u-x)/v)*y;if(t=="bottom"||t=="top"){w=x+z;}else{w=u-z;}return w;},_getKeyArray:function(w,x){var y,u=[],v=0,z,t=x.length;for(;v<t;++v){y=x[v][w];if(b.Lang.isDate(y)){z=y.valueOf();}else{z=new Date(y);if(b.Lang.isDate(z)){z=z.valueOf();}else{if(!b.Lang.isNumber(y)){if(b.Lang.isNumber(parseFloat(y))){z=parseFloat(y);}else{if(typeof y!="string"){y=y.toString();}z=new Date(y).valueOf();}}else{z=y;}}}u[v]=z;}return u;},_setDataByKey:function(x,y){var z,u=[],w=this._dataClone.concat(),v,A,t=w.length;for(v=0;v<t;++v){z=w[v][x];if(b.Lang.isDate(z)){A=z.valueOf();}else{A=new Date(z);if(b.Lang.isDate(A)){A=A.valueOf();}else{if(!b.Lang.isNumber(z)){if(b.Lang.isNumber(parseFloat(z))){A=parseFloat(z);}else{if(typeof z!="string"){z=z.toString();}A=new Date(z).valueOf();}}else{A=z;}}}u[v]=A;}this.get("keys")[x]=u;this._updateTotalDataFlag=true;},_getNumber:function(t){if(b.Lang.isDate(t)){t=t.valueOf();}else{if(!b.Lang.isNumber(t)&&t){t=new Date(t).valueOf();}}return t;}});b.TimeAxis=c;function e(t){e.superclass.constructor.apply(this,arguments);}e.NAME="categoryAxis";b.extend(e,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(w,x){var v=0,y,u=[],z=[],t=x.length;if(!this._indices){this._indices={};}for(;v<t;++v){y=x[v];u[v]=v;z[v]=y[w];}this._indices[w]=u;return z;},_setDataByKey:function(x){var w,y,u=[],z=[],v=this._dataClone.concat(),t=v.length;if(!this._indices){this._indices={};}for(w=0;w<t;++w){y=v[w];u[w]=w;z[w]=y[x];}this._indices[x]=u;this.get("keys")[x]=z.concat();this._updateTotalDataFlag=true;},getDataByKey:function(u){if(!this._indices){this.get("keys");}var t=this._indices;if(t[u]){return t[u];}return null;},getTotalMajorUnits:function(u,t){return this.get("data").length;},getMajorUnitDistance:function(t,w,u){var v;if(u.determinant==="count"){v=w/t;}else{if(u.determinant==="distance"){v=u.distance;}}return v;},getEdgeOffset:function(u,t){return t/u;},getLabelByIndex:function(w,u){var v,x=this.get("data"),t=this.get("position");if(t=="bottom"||t=="top"){v=x[w];}else{v=x[u-(w+1)];}return v;}});b.CategoryAxis=e;function i(){}i.prototype={getCurveControlPoints:function(w,z){var x=[],v=1,u=w.length-1,t=[],y=[];if(u<1){return null;}x[0]={startx:w[0],starty:z[0],endx:w[1],endy:z[1]};if(u===1){x[0].ctrlx1=(2*w[0]+w[1])/3;x[0].ctrly2=(2*z[0]+z[1])/3;x[0].ctrlx2=2*x[0].ctrlx1-w[0];x[0].ctrly2=2*x[0].ctrly1-z[0];return x;}for(;v<u;++v){x.push({startx:Math.round(w[v]),starty:Math.round(z[v]),endx:Math.round(w[v+1]),endy:Math.round(z[v+1])});t[v]=4*w[v]+2*w[v+1];y[v]=4*z[v]+2*z[v+1];}t[0]=w[0]+(2*w[1]);t[u-1]=(8*w[u-1]+w[u])/2;t=this.getControlPoints(t.concat());
y[0]=z[0]+(2*z[1]);y[u-1]=(8*z[u-1]+z[u])/2;y=this.getControlPoints(y.concat());for(v=0;v<u;++v){x[v].ctrlx1=Math.round(t[v]);x[v].ctrly1=Math.round(y[v]);if(v<u-1){x[v].ctrlx2=Math.round(2*w[v+1]-t[v+1]);x[v].ctrly2=Math.round(2*z[v+1]-y[v+1]);}else{x[v].ctrlx2=Math.round((w[u]+t[u-1])/2);x[v].ctrly2=Math.round((z[u]+y[u-1])/2);}}return x;},getControlPoints:function(z){var v=z.length,u=[],y=[],t=2,w=1;u[0]=z[0]/t;for(;w<v;++w){y[w]=1/t;t=(w<v-1?4:3.5)-y[w];u[w]=(z[w]-u[w-1])/t;}for(w=1;w<v;++w){u[v-w-1]-=y[v-w]*u[v-w];}return u;}};b.CurveUtil=i;function h(){}h.prototype={_stackCoordinates:function(){var D=this.get("direction"),v=this.get("order"),B=this.get("type"),E=this.get("graph"),y=E.get("height"),u=E.seriesTypes[B],x=0,A,C=this.get("xcoords"),w=this.get("ycoords"),z,t;if(v===0){return;}z=u[v-1].get("xcoords").concat();t=u[v-1].get("ycoords").concat();if(D==="vertical"){A=z.length;for(;x<A;++x){if(!isNaN(z[x])&&!isNaN(C[x])){C[x]+=z[x];}}}else{A=t.length;for(;x<A;++x){if(!isNaN(t[x])&&!isNaN(w[x])){w[x]=t[x]-(y-w[x]);}}}}};b.StackingUtil=h;function g(){}g.prototype={_lineDefaults:null,_getGraphic:function(){var t=this.get("graphic")||this.get("graph").get("graphic");if(!this._lineGraphic){this._lineGraphic=t.getShape({type:"path"});}this._lineGraphic.clear();return this._lineGraphic;},_toggleVisible:function(t){if(this._lineGraphic){this._lineGraphic.set("visible",t);}},drawLines:function(){if(this.get("xcoords").length<1){return;}var A=b.Lang.isNumber,B=this.get("xcoords").concat(),Q=this.get("ycoords").concat(),M=this.get("direction"),H=M==="vertical"?Q.length:B.length,O,t,w=true,P,N,L,I,G,x=this.get("styles").line,J=x.lineType,E=x.color||this._getDefaultColor(this.get("graphOrder"),"line"),C=x.alpha,K=x.dashLength,z=x.gapSpace,y=x.connectDiscontinuousPoints,u=x.discontinuousType,v=x.discontinuousDashLength,F=x.discontinuousGapSpace,D=this._getGraphic();D.set("stroke",{weight:x.weight,color:E,opacity:C});for(G=0;G<H;G=++G){L=B[G];I=Q[G];t=A(L)&&A(I);if(!t){O=t;continue;}if(w){w=false;D.moveTo(L,I);}else{if(O){if(J!="dashed"){D.lineTo(L,I);}else{this.drawDashedLine(P,N,L,I,K,z);}}else{if(!y){D.moveTo(L,I);}else{if(u!="solid"){this.drawDashedLine(P,N,L,I,v,F);}else{D.lineTo(L,I);}}}}P=L;N=I;O=true;}D.end();},drawSpline:function(){if(this.get("xcoords").length<1){return;}var F=this.get("xcoords"),z=this.get("ycoords"),H=this.getCurveControlPoints(F,z),A=H.length,C,B,u,t,G,E,w=0,I=this.get("styles").line,J=this._getGraphic(),D=I.alpha,v=I.color||this._getDefaultColor(this.get("graphOrder"),"line");J.set("stroke",{weight:I.weight,color:v,opacity:D});J.moveTo(F[0],z[0]);for(;w<A;w=++w){G=H[w].endx;E=H[w].endy;C=H[w].ctrlx1;B=H[w].ctrlx2;u=H[w].ctrly1;t=H[w].ctrly2;J.curveTo(C,u,B,t,G,E);}J.end();},drawDashedLine:function(D,I,t,F,v,u){v=v||10;u=u||10;var x=v+u,A=t-D,E=F-I,G=Math.sqrt(Math.pow(A,2)+Math.pow(E,2)),y=Math.floor(Math.abs(G/x)),w=Math.atan2(E,A),C=D,B=I,z,H=this._getGraphic();A=Math.cos(w)*x;E=Math.sin(w)*x;for(z=0;z<y;++z){H.moveTo(C,B);H.lineTo(C+Math.cos(w)*v,B+Math.sin(w)*v);C+=A;B+=E;}H.moveTo(C,B);G=Math.sqrt((t-C)*(t-C)+(F-B)*(F-B));if(G>v){H.lineTo(C+Math.cos(w)*v,B+Math.sin(w)*v);}else{if(G>0){H.lineTo(C+Math.cos(w)*G,B+Math.sin(w)*G);}}H.moveTo(t,F);},_getLineDefaults:function(){return{alpha:1,weight:6,lineType:"solid",dashLength:10,gapSpace:10,connectDiscontinuousPoints:true,discontinuousType:"solid",discontinuousDashLength:10,discontinuousGapSpace:10};}};b.augment(g,b.Attribute);b.Lines=g;function r(t){var u={area:{getter:function(){return this._defaults||this._getAreaDefaults();},setter:function(w){var v=this._defaults||this._getAreaDefaults();this._defaults=b.merge(v,w);}}};this.addAttrs(u,t);this.get("styles");}r.prototype={_getPath:function(){var t=this._path;if(!t){t=this.get("graph").get("graphic").getShape({type:"path"});this._path=t;}return t;},_toggleVisible:function(t){if(this._path){this._path.set("visible",t);}},drawFill:function(B,x){if(B.length<1){return;}var A=B.length,u=B[0],t=x[0],z=u,y=t,F,D,w=1,C=this.get("styles").area,E=this._getPath(),v=C.color||this._getDefaultColor(this.get("graphOrder"),"slice");E.clear();E.set("fill",{color:v,opacity:C.alpha});E.set("stroke",{weight:0});E.moveTo(u,t);for(;w<A;w=++w){F=B[w];D=x[w];if(isNaN(D)){z=F;y=D;continue;}E.lineTo(F,D);z=F;y=D;}E.end();},drawAreaSpline:function(){if(this.get("xcoords").length<1){return;}var G=this.get("xcoords"),B=this.get("ycoords"),I=this.getCurveControlPoints(G,B),C=I.length,E,D,w,v,H,F,A=0,u=G[0],t=B[0],J=this.get("styles").area,K=this._getPath(),z=J.color||this._getDefaultColor(this.get("graphOrder"),"slice");K.set("fill",{color:z,opacity:J.alpha});K.set("stroke",{weight:0});K.moveTo(u,t);for(;A<C;A=++A){H=I[A].endx;F=I[A].endy;E=I[A].ctrlx1;D=I[A].ctrlx2;w=I[A].ctrly1;v=I[A].ctrly2;K.curveTo(E,w,D,v,H,F);}if(this.get("direction")==="vertical"){K.lineTo(this._leftOrigin,F);K.lineTo(this._leftOrigin,t);}else{K.lineTo(H,this._bottomOrigin);K.lineTo(u,this._bottomOrigin);}K.lineTo(u,t);K.end();},drawStackedAreaSpline:function(){if(this.get("xcoords").length<1){return;}var F=this.get("xcoords"),Q=this.get("ycoords"),E,L=this.get("order"),v=this.get("type"),t=this.get("graph"),w=t.seriesTypes[v],u,I,N,H,G,P,O,C,A,M=0,D,B,z=this.get("styles").area,J=this._getPath(),K=z.color||this._getDefaultColor(this.get("graphOrder"),"slice");D=F[0];B=Q[0];E=this.getCurveControlPoints(F,Q);N=E.length;J.set("fill",{color:K,opacity:z.alpha});J.set("stroke",{weight:0});J.moveTo(D,B);for(;M<N;M=++M){C=E[M].endx;A=E[M].endy;H=E[M].ctrlx1;G=E[M].ctrlx2;P=E[M].ctrly1;O=E[M].ctrly2;J.curveTo(H,P,G,O,C,A);}if(L>0){u=w[L-1].get("xcoords").concat().reverse();I=w[L-1].get("ycoords").concat().reverse();E=this.getCurveControlPoints(u,I);M=0;N=E.length;J.lineTo(u[0],I[0]);for(;M<N;M=++M){C=E[M].endx;A=E[M].endy;H=E[M].ctrlx1;G=E[M].ctrlx2;P=E[M].ctrly1;O=E[M].ctrly2;J.curveTo(H,P,G,O,C,A);}}else{if(this.get("direction")==="vertical"){J.lineTo(this._leftOrigin,Q[Q.length-1]);J.lineTo(this._leftOrigin,B);}else{J.lineTo(F[F.length-1],this._bottomOrigin);
J.lineTo(D,this._bottomOrigin);}}J.lineTo(D,B);J.end();},_defaults:null,_getClosingPoints:function(){var t=this.get("xcoords").concat(),u=this.get("ycoords").concat();if(this.get("direction")==="vertical"){t.push(this._leftOrigin);t.push(this._leftOrigin);u.push(u[u.length-1]);u.push(u[0]);}else{t.push(t[t.length-1]);t.push(t[0]);u.push(this._bottomOrigin);u.push(this._bottomOrigin);}t.push(t[0]);u.push(u[0]);return[t,u];},_getStackedClosingPoints:function(){var x=this.get("order"),A=this.get("type"),D=this.get("graph"),B=this.get("direction"),v=D.seriesTypes[A],z,w,C=this.get("xcoords").concat(),y=this.get("ycoords").concat(),u=C[0],t=y[0];if(x>0){z=v[x-1].get("xcoords").concat();w=v[x-1].get("ycoords").concat();C=C.concat(z.concat().reverse());y=y.concat(w.concat().reverse());C.push(C[0]);y.push(y[0]);}else{if(B==="vertical"){C.push(this._leftOrigin);C.push(this._leftOrigin);y.push(y[y.length-1]);y.push(t);}else{C.push(C[C.length-1]);C.push(u);y.push(this._bottomOrigin);y.push(this._bottomOrigin);}}return[C,y];},_getAreaDefaults:function(){return{};}};b.augment(r,b.Attribute);b.Fills=r;function q(t){var u={markers:{getter:function(){return this._markers;}}};this.addAttrs(u,t);}q.prototype={_plotDefaults:null,drawPlots:function(){if(!this.get("xcoords")||this.get("xcoords").length<1){return;}var J=b.Lang.isNumber,u=b.clone(this.get("styles").marker),I=u.width,B=u.height,H=this.get("xcoords"),z=this.get("ycoords"),A=0,C=H.length,G=z[0],x,y,D=I/2,v=B/2,F=null,E=null,t=this.get("graphOrder");if(b.Lang.isArray(u.fill.color)){F=u.fill.color.concat();}if(b.Lang.isArray(u.border.color)){E=u.border.colors.concat();}this._createMarkerCache();for(;A<C;++A){G=parseFloat(z[A]-v);x=parseFloat(H[A]-D);if(!J(x)||!J(G)){this._markers.push(null);continue;}if(F){u.fill.color=F[A%F.length];}if(E){u.border.colors=E[A%E.length];}u.x=x;u.y=G;y=this.getMarker(u,t,A);}this._clearMarkerCache();},_getPlotDefaults:function(){var t={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:1,alpha:1},width:10,height:10,shape:"circle"};t.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");t.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return t;},_markers:null,_markerCache:null,getMarker:function(x,t,w){var u,v=x.border;x.id="series_"+t+"_"+w;v.opacity=v.alpha;x.stroke=v;x.fill.opacity=x.fill.alpha;if(this._markerCache.length>0){while(!u){if(this._markerCache.length<1){u=this._createMarker(x,t,w);break;}u=this._markerCache.shift();}u.set(x);}else{u=this._createMarker(x,t,w);}this._markers.push(u);return u;},_createMarker:function(x,t,w){var y=this.get("graphic"),v,u=b.clone(x);y.set("autoDraw",false);u.type=u.shape;v=y.getShape(u);v.addClass("yui3-seriesmarker");return v;},_createMarkerCache:function(){if(this._markers&&this._markers.length>0){this._markerCache=this._markers.concat();}else{this._markerCache=[];}this._markers=[];},_toggleVisible:function(x){var u,w=this.get("markers"),v=0,t;if(w){t=w.length;for(;v<t;++v){u=w[v];if(u){u.set("visible",x);}}}},_clearMarkerCache:function(){var t=this._markerCache.length,v=0,u;while(this._markerCache.length>0){u=this._markerCache.shift();if(u){u.destroy();}}},updateMarkerState:function(A,y){if(this._markers[y]){var C,z,D=b.clone(this.get("styles").marker),t=this._getState(A),B=this.get("xcoords"),x=this.get("ycoords"),v=this._markers[y],u=t=="off"||!D[t]?D:D[t];u.fill.color=this._getItemColor(u.fill.color,y);u.border.color=this._getItemColor(u.border.color,y);u.stroke=u.border;v.set(u);C=u.width;z=u.height;v.set("x",(B[y]-C/2));v.set("y",(x[y]-z/2));v.set("visible",this.get("visible"));}},_getItemColor:function(u,t){if(b.Lang.isArray(u)){return u[t%u.length];}return u;},_setStyles:function(t){t=this._parseMarkerStyles(t);return b.Renderer.prototype._setStyles.apply(this,[t]);},_parseMarkerStyles:function(u){if(u.marker){var t=this._getPlotDefaults();u.marker=this._mergeStyles(u.marker,t);if(u.marker.over){u.marker.over=this._mergeStyles(u.marker.over,u.marker);}if(u.marker.down){u.marker.down=this._mergeStyles(u.marker.down,u.marker);}}return u;},_getState:function(t){var u;switch(t){case"mouseout":u="off";break;case"mouseover":u="over";break;case"mouseup":u="over";break;case"mousedown":u="down";break;}return u;},_stateSyles:null};b.augment(q,b.Attribute);b.Plots=q;function s(){}s.prototype={drawSeries:function(){if(this.get("xcoords").length<1){return;}var P=b.clone(this.get("styles").marker),Q,J,G=this.get("xcoords"),S=this.get("ycoords"),M=0,N=G.length,H=S[0],v=this.get("type"),u=this.get("graph"),C=u.seriesTypes[v],O=C.length,E=0,F=0,y=0,B,K,L=this.get("order"),D=this.get("graphOrder"),x,A,I,w,R,t=null,z=null;if(b.Lang.isArray(P.fill.color)){t=P.fill.color.concat();}if(b.Lang.isArray(P.border.color)){z=P.border.colors.concat();}if(this.get("direction")=="vertical"){I="height";w="width";}else{I="width";w="height";}Q=P[I];J=P[w];this._createMarkerCache();for(;M<O;++M){K=C[M];E+=K.get("styles").marker[I];if(L>M){y=E;}}F=N*E;if(F>u.get(I)){B=u.get(I)/F;E*=B;y*=B;Q*=B;Q=Math.max(Q,1);}y-=E/2;for(M=0;M<N;++M){if(isNaN(G[M])||isNaN(S[M])){continue;}R=this._getMarkerDimensions(G[M],S[M],J,y);H=R.top;x=R.left;P[I]=Q;P[w]=R.calculatedSize;P.x=x;P.y=H;if(t){P.fill.color=t[M%t.length];}if(z){P.border.colors=z[M%z.length];}A=this.getMarker(P,D,M);}this._clearMarkerCache();},_defaultFillColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getPlotDefaults:function(){var t={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}};t.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");t.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return t;}};b.Histogram=s;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 u=this.get("xAxis"),t=this.get("yAxis");if(u){u.after("dataReady",b.bind(this._xDataChangeHandler,this));u.after("dataUpdate",b.bind(this._xDataChangeHandler,this));}if(t){t.after("dataReady",b.bind(this._yDataChangeHandler,this));t.after("dataUpdate",b.bind(this._yDataChangeHandler,this));}this.after("xAxisChange",this._xAxisChangeHandler);this.after("yAxisChange",this._yAxisChangeHandler);this.after("stylesChange",function(w){var v=this._updateAxisData();if(v){this.draw();}});this.after("widthChange",function(w){var v=this._updateAxisData();if(v){this.draw();}});this.after("heightChange",function(w){var v=this._updateAxisData();if(v){this.draw();}});this.after("visibleChange",this._handleVisibleChange);},_xAxisChangeHandler:function(u){var t=this.get("xAxis");t.after("dataReady",b.bind(this._xDataChangeHandler,this));t.after("dataUpdate",b.bind(this._xDataChangeHandler,this));},_yAxisChangeHandler:function(u){var t=this.get("yAxis");t.after("dataReady",b.bind(this._yDataChangeHandler,this));t.after("dataUpdate",b.bind(this._yDataChangeHandler,this));},GUID:"yuicartesianseries",_xDataChangeHandler:function(t){var u=this._updateAxisData();if(u){this.draw();}},_yDataChangeHandler:function(t){var u=this._updateAxisData();if(u){this.draw();}},_updateAxisData:function(){var x=this.get("xAxis"),u=this.get("yAxis"),v=this.get("xKey"),t=this.get("yKey"),w,y;if(!x||!u||!v||!t){return false;}y=x.getDataByKey(v);w=u.getDataByKey(t);if(!y||!w){return false;}this.set("xData",y.concat());this.set("yData",w.concat());return true;},validate:function(){if((this.get("xData")&&this.get("yData"))||this._updateAxisData()){this.draw();}},_setCanvas:function(){var t=this.get("graph"),u=t.get("graphic");this.set("graphic",u);},setAreaData:function(){var L=b.Lang.isNumber,Z,X,y=this.get("graph"),H=y.get("width"),S=y.get("height"),F=this.get("xAxis"),u=this.get("yAxis"),A=this.get("xData").concat(),V=this.get("yData").concat(),P,T,ac=F.getEdgeOffset(A.length,H),E=u.getEdgeOffset(V.length,S),M=this.get("styles").padding,O=M.left,W=M.top,C=H-(O+M.right+ac),R=S-(W+M.bottom+E),K=[],ab=[],aa=F.get("maximum"),U=F.get("minimum"),x=u.get("maximum"),t=u.get("minimum"),B=C/(aa-U),I=R/(x-t),D,Y=this.get("direction"),Q=0,G=[],N=[],z=this.get("xMarkerPlaneOffset"),v=this.get("yMarkerPlaneOffset"),J=this.get("graphic");J.set("width",H);J.set("height",S);D=A.length;ac*=0.5;E*=0.5;if(Y==="vertical"){V=V.reverse();}this._leftOrigin=Math.round(((0-U)*B)+O+ac);this._bottomOrigin=Math.round((R+W+E)-(0-t)*I);for(;Q<D;++Q){P=parseFloat(A[Q]);T=parseFloat(V[Q]);if(L(P)){Z=Math.round((((P-U)*B)+O+ac));}else{Z=NaN;}if(L(T)){X=Math.round(((R+W+E)-(T-t)*I));}else{X=NaN;}K.push(Z);ab.push(X);G.push({start:Z-z,end:Z+z});N.push({start:X-v,end:X+v});}this.set("xcoords",K);this.set("ycoords",ab);this.set("xMarkerPlane",G);this.set("yMarkerPlane",N);},draw:function(){var v=this.get("graph"),t=v.get("width"),u=v.get("height");if(this.get("rendered")){if((isFinite(t)&&isFinite(u)&&t>0&&u>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(w,x){var u={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},v=u[x],t=v.length;w=w||0;if(w>=t){w=w%t;}x=x||"fill";return u[x][w];},_handleVisibleChange:function(t){this._toggleVisible(this.get("visible"));}},{ATTRS:{xDisplayName:{getter:function(){return this._xDisplayName||this.get("xKey");},setter:function(t){this._xDisplayName=t;return t;}},yDisplayName:{getter:function(){return this._yDisplayName||this.get("yKey");},setter:function(t){this._yDisplayName=t;return t;}},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 t=this.get("styles").marker;if(t&&t.width&&isFinite(t.width)){return t.width*0.5;}return this._defaultPlaneOffset;}},yMarkerPlaneOffset:{getter:function(){var t=this.get("styles").marker;if(t&&t.height&&isFinite(t.height)){return t.height*0.5;}return this._defaultPlaneOffset;}},direction:{value:"horizontal"}}});b.MarkerSeries=b.Base.create("markerSeries",b.CartesianSeries,[b.Plots],{drawSeries:function(){this.drawPlots();},_setStyles:function(t){if(!t.marker){t={marker:t};}t=this._parseMarkerStyles(t);return b.MarkerSeries.superclass._mergeStyles.apply(this,[t,this._getDefaultStyles()]);},_getDefaultStyles:function(){var t=this._mergeStyles({marker:this._getPlotDefaults()},b.MarkerSeries.superclass._getDefaultStyles());
return t;}},{ATTRS:{type:{value:"marker"}}});b.LineSeries=b.Base.create("lineSeries",b.CartesianSeries,[b.Lines],{drawSeries:function(){this.drawLines();},_setStyles:function(t){if(!t.line){t={line:t};}return b.LineSeries.superclass._setStyles.apply(this,[t]);},_getDefaultStyles:function(){var t=this._mergeStyles({line:this._getLineDefaults()},b.LineSeries.superclass._getDefaultStyles());return t;}},{ATTRS:{type:{value:"line"}}});b.SplineSeries=b.Base.create("splineSeries",b.LineSeries,[b.CurveUtil,b.Lines],{drawSeries:function(){this.drawSpline();}},{ATTRS:{type:{value:"spline"}}});b.AreaSplineSeries=b.Base.create("areaSplineSeries",b.CartesianSeries,[b.Fills,b.CurveUtil],{drawSeries:function(){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(u,t,w,x){var v={left:u+x};if(this._bottomOrigin>=t){v.top=t;v.calculatedSize=this._bottomOrigin-v.top;}else{v.top=this._bottomOrigin;v.calculatedSize=t-this._bottomOrigin;}return v;},updateMarkerState:function(v,H){if(this._markers[H]){var A=b.clone(this.get("styles").marker),K,w=this._getState(v),D=this.get("xcoords"),L=this.get("ycoords"),y=this._markers[H],t=this.get("graph"),u,z=t.seriesTypes[this.get("type")],I=z.length,C=0,x=0,F,E=0,B=[],G=this.get("order"),J;K=w=="off"||!A[w]?A:A[w];K.fill.color=this._getItemColor(K.fill.color,H);K.border.color=this._getItemColor(K.border.color,H);J=this._getMarkerDimensions(D[H],L[H],A.width,x);K.height=J.calculatedSize;y.set(K);for(;E<I;++E){B[E]=D[H]+C;u=z[E].get("styles").marker;C+=u.width;if(G>E){x=C;}x-=C/2;}for(E=0;E<I;++E){F=z[E].get("markers")[H];if(F&&F!==undefined){F.set("x",(B[E]-C/2));}}}}},{ATTRS:{type:{value:"column"}}});b.BarSeries=b.Base.create("barSeries",b.MarkerSeries,[b.Histogram],{_getMarkerDimensions:function(u,t,w,x){var v={top:t+x};if(u>=this._leftOrigin){v.left=this._leftOrigin;v.calculatedSize=u-v.left;}else{v.left=u;v.calculatedSize=this._leftOrigin-u;}return v;},updateMarkerState:function(v,H){if(this._markers[H]){var A=b.clone(this.get("styles").marker),K,w=this._getState(v),C=this.get("xcoords"),L=this.get("ycoords"),y=this._markers[H],t=this.get("graph"),z=t.seriesTypes[this.get("type")],I=z.length,u,B=0,x=0,E,D=0,G=[],F=this.get("order"),J;K=w=="off"||!A[w]?A:A[w];K.fill.color=this._getItemColor(K.fill.color,H);K.border.color=this._getItemColor(K.border.color,H);J=this._getMarkerDimensions(C[H],L[H],A.height,x);K.width=J.calculatedSize;y.set(K);for(;D<I;++D){G[D]=L[H]+B;u=z[D].get("styles").marker;B+=u.height;if(F>D){x=B;}x-=B/2;}for(D=0;D<I;++D){E=z[D].get("markers")[H];if(E&&E!==undefined){E.set("y",(G[D]-B/2));}}}}},{ATTRS:{type:{value:"bar"},direction:{value:"vertical"}}});b.AreaSeries=b.Base.create("areaSeries",b.CartesianSeries,[b.Fills],{drawSeries:function(){this.drawFill.apply(this,this._getClosingPoints());},_setStyles:function(t){if(!t.area){t={area:t};}return b.AreaSeries.superclass._setStyles.apply(this,[t]);},_getDefaultStyles:function(){var t=this._mergeStyles({area:this._getAreaDefaults()},b.AreaSeries.superclass._getDefaultStyles());return t;}},{ATTRS:{type:{value:"area"}}});b.StackedAreaSplineSeries=b.Base.create("stackedAreaSplineSeries",b.AreaSeries,[b.CurveUtil,b.StackingUtil],{drawSeries:function(){this._stackCoordinates();this.drawStackedAreaSpline();}},{ATTRS:{type:{value:"stackedAreaSpline"}}});b.ComboSeries=b.Base.create("comboSeries",b.CartesianSeries,[b.Fills,b.Lines,b.Plots],{drawSeries:function(){if(this.get("showAreaFill")){this.drawFill.apply(this,this._getClosingPoints());}if(this.get("showLines")){this.drawLines();}if(this.get("showMarkers")){this.drawPlots();}},_toggleVisible:function(x){var w,u,t,v;if(this.get("showAreaFill")&&this._path){this._path.set("visible",x);}if(this.get("showLines")){this._lineGraphic.set("visible",x);}if(this.get("showMarkers")){w=this.get("markers");if(w){v=0;t=w.length;for(;v<t;++v){u=w[v];if(u){u.set("visible",x);}}}}},_getDefaultStyles:function(){var t=b.ComboSeries.superclass._getDefaultStyles();t.line=this._getLineDefaults();t.marker=this._getPlotDefaults();t.area=this._getAreaDefaults();return t;}},{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(t){this.set("styles",{marker:t});}},line:{lazyAdd:false,getter:function(){return this.get("styles").line;},setter:function(t){this.set("styles",{line:t});}},area:{lazyAdd:false,getter:function(){return this.get("styles").area;},setter:function(t){this.set("styles",{area:t});}}}});b.StackedComboSeries=b.Base.create("stackedComboSeries",b.ComboSeries,[b.StackingUtil],{setAreaData:function(){b.StackedComboSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);},drawSeries:function(){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(){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(){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.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 G=b.Lang.isNumber,O=this.get("styles").marker,F=O.width,N=O.height,H=this.get("xcoords"),P=this.get("ycoords"),L=0,M=H.length,I=P[0],x=this.get("type"),u=this.get("graph"),C=u.seriesTypes[x],A,K=this.get("order"),E=this.get("graphOrder"),y,B,z,D,J,t=K===0,v=M*F;this._createMarkerCache();if(v>this.get("width")){A=this.width/v;F*=A;F=Math.max(F,1);}if(!t){z=C[K-1];D=z.get("negativeBaseValues");J=z.get("positiveBaseValues");}else{D=[];J=[];}this.set("negativeBaseValues",D);this.set("positiveBaseValues",J);for(L=0;L<M;++L){y=H[L];I=P[L];if(!G(I)||!G(y)){continue;}if(t){N=Math.abs(this._bottomOrigin-I);if(I<this._bottomOrigin){J[L]=I;D[L]=this._bottomOrigin;}else{if(I>this._bottomOrigin){J[L]=this._bottomOrigin;D[L]=I;I-=N;}else{J[L]=I;D[L]=I;}}}else{if(I>this._bottomOrigin){I+=(D[L]-this._bottomOrigin);N=I-D[L];D[L]=I;I-=N;}else{if(I<=this._bottomOrigin){I=J[L]-(this._bottomOrigin-P[L]);N=J[L]-I;J[L]=I;}}}y-=F/2;O.width=F;O.height=N;O.x=y;O.y=I;B=this.getMarker(O,E,L);}this._clearMarkerCache();},updateMarkerState:function(x,w){if(this._markers[w]){var y,u,z=this._getState(x),v=this.get("xcoords"),t=this._markers[w],A=0;y=this.get("styles").marker;A=y.width*0.5;u=z=="off"||!y[z]?y:y[z];u.height=t.get("height");u.x=(v[w]-A);u.y=t.get("y");t.set(u);}},_getPlotDefaults:function(){var t={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}};t.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");t.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return t;}},{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 F=b.Lang.isNumber,N=this.get("styles").marker,E=N.width,M=N.height,G=this.get("xcoords"),P=this.get("ycoords"),K=0,L=G.length,H=P[0],v=this.get("type"),u=this.get("graph"),B=u.seriesTypes[v],z,J=this.get("order"),D=this.get("graphOrder"),x,A,y,C,I,t=J===0,O=L*M;this._createMarkerCache();if(O>this.get("height")){z=this.height/O;M*=z;M=Math.max(M,1);}if(!t){y=B[J-1];C=y.get("negativeBaseValues");I=y.get("positiveBaseValues");}else{C=[];I=[];}this.set("negativeBaseValues",C);this.set("positiveBaseValues",I);for(K=0;K<L;++K){H=P[K];x=G[K];if(!F(H)||!F(x)){continue;}if(t){E=Math.abs(x-this._leftOrigin);if(x>this._leftOrigin){I[K]=x;C[K]=this._leftOrigin;x-=E;}else{if(x<this._leftOrigin){I[K]=this._leftOrigin;C[K]=x;}else{I[K]=x;C[K]=this._leftOrigin;}}}else{if(x<this._leftOrigin){x=C[K]-(this._leftOrigin-G[K]);E=C[K]-x;C[K]=x;}else{if(x>=this._leftOrigin){x+=(I[K]-this._leftOrigin);E=x-I[K];I[K]=x;x-=E;}}}H-=M/2;N.width=E;N.height=M;N.x=x;N.y=H;A=this.getMarker(N,D,K);}this._clearMarkerCache();},updateMarkerState:function(x,v){if(this._markers[v]){var z=this._getState(x),A=this.get("ycoords"),t=this._markers[v],y=this.get("styles").marker,w=y.height,u=z=="off"||!y[z]?y:y[z];u.y=(A[v]-w/2);u.x=t.get("x");u.width=t.get("width");t.set(u);}},_getPlotDefaults:function(){var t={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}};t.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");t.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return t;}},{ATTRS:{type:{value:"stackedBar"},direction:{value:"vertical"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}});b.PieSeries=b.Base.create("pieSeries",b.MarkerSeries,[],{_map:null,_image:null,_setMap:function(){var v="pieHotSpotMapi_"+Math.round(100000*Math.random()),t=this.get("graph").get("contentBox"),u;if(this._image){t.removeChild(this._image);while(this._areaNodes&&this._areaNodes.length>0){u=this._areaNodes.shift();this._map.removeChild(u);}t.removeChild(this._map);}this._image=f.createElement("img");this._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==";t.appendChild(this._image);this._image.setAttribute("usemap","#"+v);this._image.style.zIndex=3;this._image.style.opacity=0;this._image.setAttribute("alt","imagemap");this._map=f.createElement("map");this._map.style.zIndex=5;t.appendChild(this._map);this._map.setAttribute("name",v);this._map.setAttribute("id",v);this._areaNodes=[];},_categoryDisplayName:null,_valueDisplayName:null,addListeners:function(){var t=this.get("categoryAxis"),u=this.get("valueAxis");if(t){t.after("dataReady",b.bind(this._categoryDataChangeHandler,this));t.after("dataUpdate",b.bind(this._categoryDataChangeHandler,this));}if(u){u.after("dataReady",b.bind(this._valueDataChangeHandler,this));u.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(t){var u=this.get("categoryAxis");u.after("dataReady",b.bind(this._categoryDataChangeHandler,this));u.after("dataUpdate",b.bind(this._categoryDataChangeHandler,this));},_valueAxisChangeHandler:function(t){var u=this.get("valueAxis");u.after("dataReady",b.bind(this._valueDataChangeHandler,this));u.after("dataUpdate",b.bind(this._valueDataChangeHandler,this));},GUID:"pieseries",_categoryDataChangeHandler:function(t){if(this._rendered&&this.get("categoryKey")&&this.get("valueKey")){this.draw();}},_valueDataChangeHandler:function(t){if(this._rendered&&this.get("categoryKey")&&this.get("valueKey")){this.draw();}},draw:function(){var v=this.get("graph"),t=v.get("width"),u=v.get("height");if(isFinite(t)&&isFinite(u)&&t>0&&u>0){this._rendered=true;this.drawSeries();this.fire("drawingComplete");}},drawPlots:function(){var v=this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),x=this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),A=0,Y=v.length,H=this.get("styles").marker,t=H.fill.colors,Z=H.fill.alphas||["1"],E=H.border.colors,y=[H.border.weight],z=[H.border.alpha],aa=y.concat(),J=E.concat(),L=z.concat(),V,X,M=H.padding,u=this.get("graph"),K=u.get("width")-(M.left+M.right),U=u.get("height")-(M.top+M.bottom),S=-90,F=K/2,N=U/2,B=Math.min(F,N),T=0,Q,W=0,P,R,C,I,D,G=this.get("graphOrder"),O=b.Graphic.NAME=="canvasGraphic";for(;T<Y;++T){Q=v[T];v.push(Q);if(!isNaN(Q)){A+=Q;}}V=t?t.concat():null;X=Z?Z.concat():null;this._createMarkerCache();if(O){this._setMap();this._image.width=K;this._image.height=U;}for(T=0;T<Y;T++){Q=v[T];if(A===0){W=360/v.length;}else{W=360*(Q/A);}W=Math.round(W);if(V&&V.length<1){V=t.concat();}if(X&&X.length<1){X=Z.concat();}if(aa&&aa.length<1){aa=y.concat();}if(aa&&J.length<1){J=E.concat();}if(L&&L.length<1){L=z.concat();}C=aa?aa.shift():null;P=J?J.shift():null;R=L?L.shift():null;S+=W;I={border:{color:P,weight:C,alpha:R},fill:{color:V?V.shift():this._getDefaultColor(T,"slice"),alpha:X?X.shift():null},type:"pieslice",arc:W,radius:B,startAngle:S,cx:F,cy:N,width:K,height:U};D=this.getMarker(I,G,T);if(O){this._addHotspot(I,G,T);}}this._clearMarkerCache();},_addHotspot:function(w,L,z){var I=f.createElement("area"),K=1,E=w.cx,C=w.cy,B=w.arc,J=w.startAngle-B,H=w.startAngle,u=w.radius,F=E+Math.cos(J/180*Math.PI)*u,D=C+Math.sin(J/180*Math.PI)*u,N=E+Math.cos(H/180*Math.PI)*u,M=C+Math.sin(H/180*Math.PI)*u,Q=Math.floor(B/10)-1,v=(B/(Math.floor(B/10))/180)*Math.PI,A=Math.atan((D-C)/(F-E)),P=E+", "+C+", "+F+", "+D,O,G,t;for(K=1;K<=Q;++K){t=v*K;O=Math.cos(A+t);G=Math.sin(A+t);if(J<=90){P+=", "+(E+(u*Math.cos(A+(v*K))));P+=", "+(C+(u*Math.sin(A+(v*K))));}else{P+=", "+(E-(u*Math.cos(A+(v*K))));P+=", "+(C-(u*Math.sin(A+(v*K))));}}P+=", "+N+", "+M;P+=", "+E+", "+C;this._map.appendChild(I);I.setAttribute("class","yui3-seriesmarker");I.setAttribute("id","hotSpot_"+L+"_"+z);I.setAttribute("shape","polygon");I.setAttribute("coords",P);this._areaNodes.push(I);},updateMarkerState:function(x,v){if(this._markers[v]){var z=this._getState(x),u,w,t=this._markers[v],y=this.get("styles").marker;u=z=="off"||!y[z]?y:y[z];w=this._mergeStyles(u,{});w.fill.color=w.fill.colors[v%w.fill.colors.length];w.fill.alpha=w.fill.alphas[v%w.fill.alphas.length];t.set(w);}},_createMarker:function(x,t,w){var y=this.get("graphic"),v,u=b.clone(x);y.set("autoDraw",false);v=y.getShape(u);v.addClass("yui3-seriesmarker");return v;},_clearMarkerCache:function(){var t=this._markerCache.length,v=0,u;for(;v<t;++v){u=this._markerCache[v];if(u){u.destroy();}}this._markerCache=[];},_getPlotDefaults:function(){var t={padding:{top:0,left:0,right:0,bottom:0},fill:{alphas:["1"]},border:{weight:0,alpha:1}};t.fill.colors=this._defaultSliceColors;t.border.colors=this._defaultBorderColors;return t;},_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(w,x){var u={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},v=u[x],t=v.length;w=w||0;if(w>=t){w=w%t;}x=x||"fill";return u[x][w];}},{ATTRS:{type:{value:"pie"},order:{},graph:{},categoryAxis:{value:null,validator:function(t){return t!==this.get("categoryAxis");}},valueAxis:{value:null,validator:function(t){return t!==this.get("valueAxis");}},categoryKey:{value:null,validator:function(t){return t!==this.get("categoryKey");}},valueKey:{value:null,validator:function(t){return t!==this.get("valueKey");}},categoryDisplayName:{setter:function(t){this._categoryDisplayName=t;return t;},getter:function(){return this._categoryDisplayName||this.get("categoryKey");}},valueDisplayName:{setter:function(t){this._valueDisplayName=t;return t;},getter:function(){return this._valueDisplayName||this.get("valueKey");}},slices:null}});b.Gridlines=b.Base.create("gridlines",b.Base,[b.Renderer],{_path:null,remove:function(){var t=this._path;if(t){t.destroy();}},draw:function(){if(this.get("axis")&&this.get("graph")){this._drawGridlines();}},_drawGridlines:function(){var I,t=this.get("axis"),C=t.get("position"),F,z=0,v,D=this.get("direction"),G=this.get("graph"),E=G.get("width"),B=G.get("height"),H=this.get("styles").line,y=H.color,A=H.weight,x=H.alpha,u=D=="vertical"?this._verticalLine:this._horizontalLine;if(C=="none"){F=[];v=t.get("styles").majorUnit.count;for(;z<v;++z){F[z]={x:E*(z/(v-1)),y:B*(z/(v-1))};}z=0;}else{F=t.get("tickPoints");v=F.length;}I=G.get("gridlines");I.set("width",E);I.set("height",B);I.set("stroke",{weight:A,color:y,opacity:x});for(;z<v;++z){u(I,F[z],E,B);}I.end();},_horizontalLine:function(x,v,t,u){x.moveTo(0,v.y);
x.lineTo(t,v.y);},_verticalLine:function(x,v,t,u){x.moveTo(v.x,0);x.lineTo(v.x,u);},_getDefaultStyles:function(){var t={line:{color:"#f0efe9",weight:1,alpha:1}};return t;}},{ATTRS:{direction:{},axis:{},graph:{}}});b.Graph=b.Base.create("graph",b.Widget,[b.Renderer],{bindUI:function(){var t=this.get("boundingBox");t.setStyle("position","absolute");this.after("widthChange",this._sizeChangeHandler);this.after("heightChange",this._sizeChangeHandler);this.after("stylesChange",this._updateStyles);},syncUI:function(){var t,w,x,B=this.get("seriesCollection"),y,z=0,A=B.length,u=this.get("horizontalGridlines"),v=this.get("verticalGridlines");if(this.get("showBackground")){t=this.get("background");w=this.get("contentBox");x=this.get("styles").background;x.stroke=x.border;x.stroke.opacity=x.stroke.alpha;x.fill.opacity=x.fill.alpha;x.width=this.get("width");x.height=this.get("height");x.type=x.shape;t.set(x);}for(;z<A;++z){y=B[z];if(y instanceof b.CartesianSeries){y.render();}}if(u&&u instanceof b.Gridlines){u.draw();}if(v&&v instanceof b.Gridlines){v.draw();}},seriesTypes:null,getSeriesByIndex:function(v){var t=this.get("seriesCollection"),u;if(t&&t.length>v){u=t[v];}return u;},getSeriesByKey:function(v){var u=this._seriesDictionary,t;if(u&&u.hasOwnProperty(v)){t=u[v];}return t;},addDispatcher:function(t){if(!this._dispatchers){this._dispatchers=[];}this._dispatchers.push(t);},_seriesCollection:null,_seriesDictionary:null,_parseSeriesCollection:function(x){if(!x){return;}var u=x.length,w=0,v,t;if(!this.get("seriesCollection")){this._seriesCollection=[];}if(!this._seriesDictionary){this._seriesDictionary={};}if(!this.seriesTypes){this.seriesTypes=[];}for(;w<u;++w){v=x[w];if(!(v instanceof b.CartesianSeries)&&!(v instanceof b.PieSeries)){this._createSeries(v);continue;}this._addSeries(v);}u=this.get("seriesCollection").length;for(w=0;w<u;++w){v=this.get("seriesCollection")[w];t=v.get("direction")=="horizontal"?"yKey":"xKey";this._seriesDictionary[v.get(t)]=v;}},_addSeries:function(v){var w=v.get("type"),y=this.get("seriesCollection"),x=y.length,u=this.seriesTypes,t;if(!v.get("graph")){v.set("graph",this);}y.push(v);if(!u.hasOwnProperty(w)){this.seriesTypes[w]=[];}t=this.seriesTypes[w];v.set("graphOrder",x);v.set("order",t.length);t.push(v);this.addDispatcher(v);v.after("drawingComplete",b.bind(this._drawingCompleteHandler,this));this.fire("seriesAdded",v);},_createSeries:function(x){var y=x.type,z=this.get("seriesCollection"),v=this.seriesTypes,u,t,w;x.graph=this;if(!v.hasOwnProperty(y)){v[y]=[];}u=v[y];x.graph=this;x.order=u.length;x.graphOrder=z.length;t=this._getSeries(x.type);w=new t(x);this.addDispatcher(w);w.after("drawingComplete",b.bind(this._drawingCompleteHandler,this));u.push(w);z.push(w);},_getSeries:function(t){var u;switch(t){case"line":u=b.LineSeries;break;case"column":u=b.ColumnSeries;break;case"bar":u=b.BarSeries;break;case"area":u=b.AreaSeries;break;case"candlestick":u=b.CandlestickSeries;break;case"ohlc":u=b.OHLCSeries;break;case"stackedarea":u=b.StackedAreaSeries;break;case"stackedline":u=b.StackedLineSeries;break;case"stackedcolumn":u=b.StackedColumnSeries;break;case"stackedbar":u=b.StackedBarSeries;break;case"markerseries":u=b.MarkerSeries;break;case"spline":u=b.SplineSeries;break;case"areaspline":u=b.AreaSplineSeries;break;case"stackedspline":u=b.StackedSplineSeries;break;case"stackedareaspline":u=b.StackedAreaSplineSeries;break;case"stackedmarkerseries":u=b.StackedMarkerSeries;break;case"pie":u=b.PieSeries;break;case"combo":u=b.ComboSeries;break;case"stackedcombo":u=b.StackedComboSeries;break;case"combospline":u=b.ComboSplineSeries;break;case"stackedcombospline":u=b.StackedComboSplineSeries;break;default:u=b.CartesianSeries;break;}return u;},_markerEventHandler:function(y){var w=y.type,t=y.currentTarget,x=t.getAttribute("id").split("_"),v=this.getSeriesByIndex(x[1]),u=x[2];v.updateMarkerState(w,u);},_dispatchers:null,_updateStyles:function(){var u=this.get("styles").background,t=u.border;t.opacity=t.alpha;u.stroke=t;u.fill.opacity=u.fill.alpha;this.get("background").set(u);this._sizeChangeHandler();},_sizeChangeHandler:function(A){var t=this.get("horizontalGridlines"),B=this.get("verticalGridlines"),u=this.get("width"),y=this.get("height"),x=this.get("styles").background,z,v;if(x&&x.border){z=x.border.weight||0;}if(this.get("showBackground")){v=this.get("background");if(u&&y){v.set("width",u);v.set("height",y);}}if(this._gridlines){this._gridlines.clear();}if(t&&t instanceof b.Gridlines){t.draw();}if(B&&B instanceof b.Gridlines){B.draw();}this._drawSeries();},_drawSeries:function(){if(this._drawing){this._callLater=true;return;}var v,u,t,w=this.get("graphic");w.set("autoDraw",false);this._callLater=false;this._drawing=true;v=this.get("seriesCollection");u=0;t=v.length;for(;u<t;++u){v[u].draw();if(!v[u].get("xcoords")||!v[u].get("ycoords")){this._callLater=true;break;}}this._drawing=false;if(this._callLater){this._drawSeries();}},_drawingCompleteHandler:function(v){var u=v.currentTarget,w,t=b.Array.indexOf(this._dispatchers,u);if(t>-1){this._dispatchers.splice(t,1);}if(this._dispatchers.length<1){w=this.get("graphic");if(!w.get("autoDraw")){w._redraw();}this.fire("chartRendered");}},_getDefaultStyles:function(){var t={background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return t;}},{ATTRS:{seriesCollection:{getter:function(){return this._seriesCollection;},setter:function(t){this._parseSeriesCollection(t);return this._seriesCollection;}},showBackground:{value:true},seriesDictionary:{readOnly:true,getter:function(){return this._seriesDictionary;}},horizontalGridlines:{value:null,setter:function(u){var t=this.get("horizontalGridlines");if(t&&t instanceof b.Gridlines){t.remove();}if(u instanceof b.Gridlines){t=u;u.set("graph",this);return u;}else{if(u&&u.axis){t=new b.Gridlines({direction:"horizontal",axis:u.axis,graph:this,styles:u.styles});return t;}}}},verticalGridlines:{value:null,setter:function(u){var t=this.get("verticalGridlines");if(t&&t instanceof b.Gridlines){t.remove();
}if(u instanceof b.Gridlines){t=u;u.set("graph",this);return u;}else{if(u&&u.axis){t=new b.Gridlines({direction:"vertical",axis:u.axis,graph:this,styles:u.styles});return t;}}}},background:{getter:function(){if(!this._background){this._backgroundGraphic=new b.Graphic({render:this.get("contentBox")});this._backgroundGraphic.get("node").style.zIndex=-2;this._background=this._backgroundGraphic.getShape({type:"rect"});}return this._background;}},gridlines:{readOnly:true,getter:function(){if(!this._gridlines){this._gridlinesGraphic=new b.Graphic({render:this.get("contentBox")});this._gridlinesGraphic.get("node").style.zIndex=-1;this._gridlines=this._gridlinesGraphic.getShape({type:"path"});}return this._gridlines;}},graphic:{readOnly:true,getter:function(){if(!this._graphic){this._graphic=new b.Graphic({render:this.get("contentBox")});this._graphic.set("autoDraw",false);}return this._graphic;}}}});function l(){}l.ATTRS={tooltip:{valueFn:"_getTooltip",setter:function(t){return this._updateTooltip(t);}},categoryKey:{value:"category"},categoryType:{value:"category"},interactionType:{value:"marker"},dataProvider:{setter:function(t){return this._setDataValues(t);}},seriesKeys:{},axesCollection:{},graph:{valueFn:"_getGraph"}};l.prototype={_getGraph:function(){var t=new b.Graph();t.after("chartRendered",b.bind(function(u){this.fire("chartRendered");},this));return t;},getSeries:function(v){var t=null,u=this.get("graph");if(u){if(b.Lang.isNumber(v)){t=u.getSeriesByIndex(v);}else{t=u.getSeriesByKey(v);}}return t;},getAxisByKey:function(v){var t,u=this.get("axes");if(u.hasOwnProperty(v)){t=u[v];}return t;},getCategoryAxis:function(){var u,t=this.get("categoryKey"),v=this.get("axes");if(v.hasOwnProperty(t)){u=v[t];}return u;},_direction:"horizontal",_dataProvider:null,_setDataValues:function(y){if(b.Lang.isArray(y[0])){var x,A=[],v=y[0],w=0,u=v.length,z,t=y.length;for(;w<u;++w){x={category:v[w]};for(z=1;z<t;++z){x["series"+z]=y[z][w];}A[w]=x;}return A;}return y;},_seriesCollection:null,_setSeriesCollection:function(t){this._seriesCollection=t;},_getAxisClass:function(u){return this._axisClass[u];},_axisClass:{stacked:b.StackedAxis,numeric:b.NumericAxis,category:b.CategoryAxis,time:b.TimeAxis},_axes:null,renderUI:function(){var t=this.get("tooltip");this.get("boundingBox").setStyle("position","absolute");this.get("contentBox").setStyle("position","absolute");this._addAxes();this._addSeries();if(t&&t.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 x=this.get("tooltip"),z="mouseout",w="mouseover",u=this.get("contentBox"),y=this.get("interactionType"),v=0,t;if(y=="marker"){z=x.hideEvent;w=x.showEvent;b.delegate("mouseenter",b.bind(this._markerEventDispatcher,this),u,".yui3-seriesmarker");b.delegate("mousedown",b.bind(this._markerEventDispatcher,this),u,".yui3-seriesmarker");b.delegate("mouseup",b.bind(this._markerEventDispatcher,this),u,".yui3-seriesmarker");b.delegate("mouseleave",b.bind(this._markerEventDispatcher,this),u,".yui3-seriesmarker");b.delegate("click",b.bind(this._markerEventDispatcher,this),u,".yui3-seriesmarker");b.delegate("mousemove",b.bind(this._positionTooltip,this),u,".yui3-seriesmarker");}else{if(y=="planar"){this._overlay.on("mousemove",b.bind(this._planarEventDispatcher,this));this.on("mouseout",this.hideTooltip);}}if(x){if(z&&w&&z==w){this.on(y+"Event:"+z,this.toggleTooltip);}else{if(w){this.on(y+"Event:"+w,x[y+"EventHandler"]);}if(z){if(b.Lang.isArray(z)){t=z.length;for(;v<t;++v){this.on(y+"Event:"+z[v],this.hideTooltip);}}this.on(y+"Event:"+z,this.hideTooltip);}}}},_markerEventDispatcher:function(z){var B=z.type,t=this.get("contentBox"),F=z.currentTarget,E=F.getAttribute("id").split("_"),u=E[1],v=this.getSeries(parseInt(u,10)),w=E[2],A=this.getSeriesItems(v,w),D=z.pageX-t.getX(),C=z.pageY-t.getY();if(B=="mouseenter"){B="mouseover";}else{if(B=="mouseleave"){B="mouseout";}}v.updateMarkerState(B,w);z.halt();this.fire("markerEvent:"+B,{categoryItem:A.category,valueItem:A.value,node:F,x:D,y:C,series:v,index:w,seriesIndex:u});},_dataProviderChangeHandler:function(x){var u=this.get("dataProvider"),w=this.get("axes"),t,v;for(t in w){if(w.hasOwnProperty(t)){v=w[t];if(v instanceof b.Axis){v.set("dataProvider",u);}}}},toggleTooltip:function(u){var t=this.get("tooltip");if(t.visible){this.hideTooltip();}else{t.markerEventHandler.apply(this,[u]);}},_showTooltip:function(w,t,z){var u=this.get("tooltip"),v=u.node;if(w){u.visible=true;v.set("innerHTML",w);v.setStyle("top",z+"px");v.setStyle("left",t+"px");v.setStyle("visibility","visible");}},_positionTooltip:function(z){var v=this.get("tooltip"),w=v.node,u=this.get("contentBox"),t=(z.pageX+10)-u.getX(),A=(z.pageY+10)-u.getY();if(w){w.setStyle("left",t+"px");w.setStyle("top",A+"px");}},hideTooltip:function(){var t=this.get("tooltip"),u=t.node;t.visible=false;u.set("innerHTML","");u.setStyle("left",-10000);u.setStyle("top",-10000);u.setStyle("visibility","hidden");},_addTooltip:function(){var u=this.get("tooltip"),w=this.get("id")+"_tooltip",t=this.get("contentBox"),v=f.getElementById(w);if(v){t.removeChild(v);}u.node.setAttribute("id",w);u.node.setStyle("visibility","hidden");t.appendChild(u.node);},_updateTooltip:function(y){var v=this._tooltip,t,x,w,u={markerLabelFunction:"markerLabelFunction",planarLabelFunction:"planarLabelFunction",showEvent:"showEvent",hideEvent:"hideEvent",markerEventHandler:"markerEventHandler",planarEventHandler:"planarEventHandler",show:"show"};if(b.Lang.isObject(y)){x=y.styles;w=b.one(y.node)||v.node;if(x){for(t in x){if(x.hasOwnProperty(t)){w.setStyle(t,x[t]);}}}for(t in u){if(y.hasOwnProperty(t)){v[t]=y[t];}}v.node=w;}return v;},_getTooltip:function(){var u=f.createElement("div"),t={markerLabelFunction:this._tooltipLabelFunction,planarLabelFunction:this._planarLabelFunction,show:true,hideEvent:"mouseout",showEvent:"mouseover",markerEventHandler:function(w){var v=this.get("tooltip"),x=v.markerLabelFunction.apply(this,[w.categoryItem,w.valueItem,w.index,w.series,w.seriesIndex]);
this._showTooltip(x,w.x+10,w.y+10);},planarEventHandler:function(w){var v=this.get("tooltip"),y,x=this.get("categoryAxis");y=v.planarLabelFunction.apply(this,[x,w.valueItem,w.index,w.items,w.seriesIndex]);this._showTooltip(y,w.x+10,w.y+10);}};u.setAttribute("id",this.get("id")+"_tooltip");u=b.one(u);u.setStyle("fontSize","85%");u.setStyle("opacity","0.83");u.setStyle("position","absolute");u.setStyle("paddingTop","2px");u.setStyle("paddingRight","5px");u.setStyle("paddingBottom","4px");u.setStyle("paddingLeft","2px");u.setStyle("backgroundColor","#fff");u.setStyle("border","1px solid #dbdccc");u.setStyle("pointerEvents","none");u.setStyle("zIndex",3);u.setStyle("whiteSpace","noWrap");u.setStyle("visibility","hidden");t.node=b.one(u);this._tooltip=t;return t;},_planarLabelFunction:function(z,D,B,x,v){var t="",C,y=0,A=x.length,u,w;if(z){t+=z.get("labelFunction").apply(this,[z.getKeyValueAt(this.get("categoryKey"),B),z.get("labelFormat")]);}for(;y<A;++y){w=x[y];if(w.get("visible")){C=D[y];u=C.axis;t+="<br/><span>"+C.displayName+": "+u.get("labelFunction").apply(this,[u.getKeyValueAt(C.key,B),u.get("labelFormat")])+"</span>";}}return t;},_tooltipLabelFunction:function(y,t,w,v,u){var x=y.displayName+": "+y.axis.get("labelFunction").apply(this,[y.value,y.axis.get("labelFormat")])+"<br/>"+t.displayName+": "+t.axis.get("labelFunction").apply(this,[t.value,t.axis.get("labelFormat")]);return x;},_tooltipChangeHandler:function(x){if(this.get("tooltip")){var v=this.get("tooltip"),w=v.node,u=v.show,t=this.get("contentBox");if(w&&u){if(!t.contains(w)){this._addTooltip();}}}}};b.ChartBase=l;b.CartesianChart=b.Base.create("cartesianChart",b.Widget,[b.ChartBase],{renderUI:function(){var u=this.get("tooltip"),t;this.get("boundingBox").setStyle("position","absolute");this.get("contentBox").setStyle("position","absolute");this._addAxes();this._addGridlines();this._addSeries();if(u&&u.show){this._addTooltip();}this.get("styles");if(this.get("interactionType")=="planar"){t=f.createElement("div");this.get("contentBox").appendChild(t);this._overlay=b.one(t);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(O){var u=this.get("graph"),A=this.get("boundingBox"),J=u.get("contentBox"),F=O.pageX,P=F-J.getX(),D=F-A.getX(),E=O.pageY,N=E-J.getY(),C=E-A.getY(),t=u.get("seriesCollection"),G,L=0,B,z=this._selectedIndex,Q,I=[],v=[],H=[],R=this.get("direction"),S,K=R=="horizontal"?P:N,w=R=="horizontal"?t[0].get("xMarkerPlane"):t[0].get("yMarkerPlane"),M=w.length;for(;L<M;++L){if(K<=w[L].end&&K>=w[L].start){B=L;break;}}M=t.length;for(L=0;L<M;++L){G=t[L];S=G.get("markers");if(S&&!isNaN(z)&&z>-1){G.updateMarkerState("mouseout",z);}if(G.get("ycoords")[B]>-1){if(S&&!isNaN(B)&&B>-1){G.updateMarkerState("mouseover",B);}Q=this.getSeriesItems(G,B);v.push(Q.category);H.push(Q.value);I.push(G);}}this._selectedIndex=B;if(B>-1){this.fire("planarEvent:mouseover",{categoryItem:v,valueItem:H,x:D,y:C,items:I,index:B});}else{this.fire("planarEvent:mouseout");}},_type:"combo",_axesRenderQueue:null,_addToAxesRenderQueue:function(t){if(!this._axesRenderQueue){this._axesRenderQueue=[];}if(b.Array.indexOf(this._axesRenderQueue,t)<0){this._axesRenderQueue.push(t);}},_getDefaultSeriesCollection:function(M){var C=this.get("direction"),t=M||[],J,G,E=[],z,y=this.get("seriesKeys").concat(),I,x,F,w=this.get("type"),K,B,L,u,v=this.get("categoryKey"),H=this.get("showMarkers"),D=this.get("showAreaFill"),A=this.get("showLines");if(C=="vertical"){J="yAxis";B="yKey";G="xAxis";L="xKey";}else{J="xAxis";B="xKey";G="yAxis";L="yKey";}F=t.length;for(I=0;I<F;++I){K=this._getBaseAttribute(t[I],L);if(K){x=b.Array.indexOf(y,K);if(x>-1){y.splice(x,1);}E.push(K);}}if(y.length>0){E=E.concat(y);}F=E.length;for(I=0;I<F;++I){z=t[I]||{type:w};if(z instanceof b.CartesianSeries){this._parseSeriesAxes(z);continue;}z[B]=z[B]||v;z[L]=z[L]||y.shift();z[J]=this._getCategoryAxis();z[G]=this._getSeriesAxis(z[L]);z.type=z.type||w;if((z.type=="combo"||z.type=="stackedcombo"||z.type=="combospline"||z.type=="stackedcombospline")){if(D!==null){z.showAreaFill=(z.showAreaFill!==null&&z.showAreaFill!==undefined)?z.showAreaFill:D;}if(H!==null){z.showMarkers=(z.showMarkers!==null&&z.showMarkers!==undefined)?z.showMarkers:H;}if(A!==null){z.showLines=(z.showLines!==null&&z.showLines!==undefined)?z.showLines:A;}}t[I]=z;}if(M){u=this.get("graph");u.set("seriesCollection",t);t=u.get("seriesCollection");}return t;},_parseSeriesAxes:function(u){var y=this.get("axes"),w=u.get("xAxis"),t=u.get("yAxis"),x=b.Axis,v;if(w&&!(w instanceof x)&&b.Lang.isString(w)&&y.hasOwnProperty(w)){v=y[w];if(v instanceof x){u.set("xAxis",v);}}if(t&&!(t instanceof x)&&b.Lang.isString(t)&&y.hasOwnProperty(t)){v=y[t];if(v instanceof x){u.set("yAxis",v);}}},_getCategoryAxis:function(){var t,u=this.get("axes"),v=this.get("categoryAxisName")||this.get("categoryKey");t=u[v];return t;},_getSeriesAxis:function(u,y){var x=this.get("axes"),t,w,v;if(x){if(y&&x.hasOwnProperty(y)){v=x[y];}else{for(t in x){if(x.hasOwnProperty(t)){w=x[t].get("keys");if(w&&w.hasOwnProperty(u)){v=x[t];break;}}}}}return v;},_getBaseAttribute:function(u,t){if(u instanceof b.Base){return u.get(t);}if(u.hasOwnProperty(t)){return u[t];}return null;},_setBaseAttribute:function(u,t,v){if(u instanceof b.Base){u.set(t,v);}else{u[t]=v;}},_parseAxes:function(u){var y=this._getDefaultAxes(u),B={},w={edgeOffset:"edgeOffset",position:"position",overlapGraph:"overlapGraph",labelFunction:"labelFunction",labelFunctionScope:"labelFunctionScope",labelFormat:"labelFormat",maximum:"maximum",minimum:"minimum",roundingMethod:"roundingMethod",alwaysShowZero:"alwaysShowZero",title:"title"},x=this.get("dataProvider"),E,z,F,v,D,C,t,A;for(z in y){if(y.hasOwnProperty(z)){D=y[z];if(D instanceof b.Axis){v=D;}else{C=this._getAxisClass(D.type);t={};t.dataProvider=D.dataProvider||x;t.keys=D.keys;
if(D.hasOwnProperty("roundingUnit")){t.roundingUnit=D.roundingUnit;}F=D.position;if(D.styles){t.styles=D.styles;}t.position=D.position;for(E in w){if(w.hasOwnProperty(E)&&D.hasOwnProperty(E)){t[E]=D[E];}}v=new C(t);}if(v){A=this.get(F+"AxesCollection");if(A&&b.Array.indexOf(A,v)>0){v.set("overlapGraph",false);}v.after("axisRendered",b.bind(this._axisRendered,this));B[z]=v;}}}return B;},_addAxes:function(){var z=this.get("axes"),u,x,A,t=this.get("width"),v=this.get("height"),y=b.Node.one(this._parentNode);if(!this._axesCollection){this._axesCollection=[];}for(u in z){if(z.hasOwnProperty(u)){x=z[u];if(x instanceof b.Axis){if(!t){this.set("width",y.get("offsetWidth"));t=this.get("width");}if(!v){this.set("height",y.get("offsetHeight"));v=this.get("height");}x.set("width",t);x.set("height",v);this._addToAxesRenderQueue(x);A=x.get("position");if(!this.get(A+"AxesCollection")){this.set(A+"AxesCollection",[x]);}else{this.get(A+"AxesCollection").push(x);}this._axesCollection.push(x);if(x.get("keys").hasOwnProperty(this.get("categoryKey"))){this.set("categoryAxis",x);}x.render(this.get("contentBox"));}}}},_addSeries:function(){var t=this.get("graph"),u=this.get("seriesCollection");t.render(this.get("contentBox"));},_addGridlines:function(){var D=this.get("graph"),u=this.get("horizontalGridlines"),v=this.get("verticalGridlines"),C=this.get("direction"),E=this.get("leftAxesCollection"),y=this.get("rightAxesCollection"),A=this.get("bottomAxesCollection"),w=this.get("topAxesCollection"),x,t=this.get("categoryAxis"),B,z;if(this._axesCollection){x=this._axesCollection.concat();x.splice(b.Array.indexOf(x,t),1);}if(u){if(E&&E[0]){B=E[0];}else{if(y&&y[0]){B=y[0];}else{B=C=="horizontal"?t:x[0];}}if(!this._getBaseAttribute(u,"axis")&&B){this._setBaseAttribute(u,"axis",B);}if(this._getBaseAttribute(u,"axis")){D.set("horizontalGridlines",u);}}if(v){if(A&&A[0]){z=A[0];}else{if(w&&w[0]){z=w[0];}else{z=C=="vertical"?t:x[0];}}if(!this._getBaseAttribute(v,"axis")&&z){this._setBaseAttribute(v,"axis",z);}if(this._getBaseAttribute(v,"axis")){D.set("verticalGridlines",v);}}},_getDefaultAxes:function(L){var D=this.get("categoryKey"),u,J,F,w={},H=[],v=this.get("categoryAxisName")||this.get("categoryKey"),t=this.get("valueAxisName"),x=this.get("seriesKeys")||[],M,K,C,A,G,E,I=this.get("dataProvider"),N=this.get("direction"),B,y,z=[],O=this.get("stacked")?"stacked":"numeric";E=I[0];if(N=="vertical"){B="bottom";y="left";}else{B="left";y="bottom";}if(L){for(M in L){if(L.hasOwnProperty(M)){u=L[M];F=this._getBaseAttribute(u,"keys");J=this._getBaseAttribute(u,"type");if(J=="time"||J=="category"){v=M;this.set("categoryAxisName",M);if(b.Lang.isArray(F)&&F.length>0){D=F[0];this.set("categoryKey",D);}w[M]=u;}else{if(M==v){w[M]=u;}else{w[M]=u;if(M!=t&&F&&b.Lang.isArray(F)){A=F.length;for(C=0;C<A;++C){H.push(F[C]);}z.push(w[M]);}if(!(this._getBaseAttribute(w[M],"type"))){this._setBaseAttribute(w[M],"type",O);}if(!(this._getBaseAttribute(w[M],"position"))){this._setBaseAttribute(w[M],"position",this._getDefaultAxisPosition(w[M],z,B));}}}}}}if(x.length<1){for(M in E){if(E.hasOwnProperty(M)&&M!=D&&b.Array.indexOf(H,M)==-1){x.push(M);}}}G=b.Array.indexOf(x,D);if(G>-1){x.splice(G,1);}K=H.length;for(M=0;M<K;++M){G=b.Array.indexOf(x,H[M]);if(G>-1){x.splice(G,1);}}if(!w.hasOwnProperty(v)){w[v]={};}if(!(this._getBaseAttribute(w[v],"keys"))){this._setBaseAttribute(w[v],"keys",[D]);}if(!(this._getBaseAttribute(w[v],"position"))){this._setBaseAttribute(w[v],"position",y);}if(!(this._getBaseAttribute(w[v],"type"))){this._setBaseAttribute(w[v],"type",this.get("categoryType"));}if(!w.hasOwnProperty(t)&&x&&x.length>0){w[t]={keys:x};z.push(w[t]);}if(H.length>0){if(x.length>0){x=H.concat(x);}else{x=H;}}if(w.hasOwnProperty(t)){if(!(this._getBaseAttribute(w[t],"position"))){this._setBaseAttribute(w[t],"position",this._getDefaultAxisPosition(w[t],z,B));}if(!(this._getBaseAttribute(w[t],"type"))){this._setBaseAttribute(w[t],"type",O);}if(!(this._getBaseAttribute(w[t],"keys"))){this._setBaseAttribute(w[t],"keys",x);}}this.set("seriesKeys",x);return w;},_getDefaultAxisPosition:function(w,u,t){var x=this.get("direction"),v=b.Array.indexOf(u,w);if(u[v-1]&&u[v-1].position){if(x=="horizontal"){if(u[v-1].position=="left"){t="right";}else{if(u[v-1].position=="right"){t="left";}}}else{if(u[v-1].position=="bottom"){t="top";}else{t="bottom";}}}return t;},getSeriesItems:function(y,x){var z=y.get("xAxis"),v=y.get("yAxis"),w=y.get("xKey"),u=y.get("yKey"),A,t;if(this.get("direction")=="vertical"){A={axis:v,key:u,value:v.getKeyValueAt(u,x)};t={axis:z,key:w,value:z.getKeyValueAt(w,x)};}else{t={axis:v,key:u,value:v.getKeyValueAt(u,x)};A={axis:z,key:w,value:z.getKeyValueAt(w,x)};}A.displayName=y.get("categoryDisplayName");t.displayName=y.get("valueDisplayName");A.value=A.axis.getKeyValueAt(A.key,x);t.value=t.axis.getKeyValueAt(t.key,x);return{category:A,value:t};},_axisRendered:function(t){this._axesRenderQueue=this._axesRenderQueue.splice(1+b.Array.indexOf(this._axesRenderQueue,t.currentTarget),1);if(this._axesRenderQueue.length<1){this._redraw();}},_sizeChanged:function(w){if(this._axesCollection){var v=this._axesCollection,u=0,t=v.length;for(;u<t;++u){this._addToAxesRenderQueue(v[u]);}this._redraw();}},_redraw:function(){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;var I=this.get("width"),F=this.get("height"),A=0,x=0,u=0,D=0,v=this.get("leftAxesCollection"),t=this.get("rightAxesCollection"),C=this.get("topAxesCollection"),G=this.get("bottomAxesCollection"),E=0,B,z,H,K=[],y="visible",J=this.get("graph");if(v){B=v.length;for(E=B-1;E>-1;--E){K[b.Array.indexOf(this._axesCollection,v[E])]={x:A+"px"};A+=v[E].get("width");}}if(t){B=t.length;E=0;for(E=B-1;E>-1;--E){x+=t[E].get("width");K[b.Array.indexOf(this._axesCollection,t[E])]={x:(I-x)+"px"};}}if(C){B=C.length;for(E=B-1;E>-1;--E){K[b.Array.indexOf(this._axesCollection,C[E])]={y:u+"px"};u+=C[E].get("height");}}if(G){B=G.length;for(E=B-1;E>-1;--E){D+=G[E].get("height");K[b.Array.indexOf(this._axesCollection,G[E])]={y:(F-D)+"px"};
}}B=this._axesCollection.length;E=0;for(;E<B;++E){z=this._axesCollection[E];H=z.get("position");if(H=="left"||H==="right"){z.get("boundingBox").setStyle("top",u+"px");z.get("boundingBox").setStyle("left",K[E].x);if(z.get("height")!==F-(D+u)){z.set("height",F-(D+u));}}else{if(H=="bottom"||H=="top"){if(z.get("width")!==I-(A+x)){z.set("width",I-(A+x));}z.get("boundingBox").setStyle("left",A+"px");z.get("boundingBox").setStyle("top",K[E].y);}}if(z.get("setMax")||z.get("setMin")){y="hidden";}}this._drawing=false;if(this._callLater){this._redraw();return;}if(J){J.get("boundingBox").setStyle("left",A+"px");J.get("boundingBox").setStyle("top",u+"px");J.set("width",I-(A+x));J.set("height",F-(u+D));J.get("boundingBox").setStyle("overflow",y);}if(this._overlay){this._overlay.setStyle("left",A+"px");this._overlay.setStyle("top",u+"px");this._overlay.setStyle("width",(I-(A+x))+"px");this._overlay.setStyle("height",(F-(u+D))+"px");}}},{ATTRS:{axesStyles:{getter:function(){var v=this.get("axes"),t,u=this._axesStyles;if(v){for(t in v){if(v.hasOwnProperty(t)&&v[t] instanceof b.Axis){if(!u){u={};}u[t]=v[t].get("styles");}}}return u;},setter:function(v){var u=this.get("axes"),t;for(t in v){if(v.hasOwnProperty(t)&&u.hasOwnProperty(t)){this._setBaseAttribute(u[t],"styles",v[t]);}}}},seriesStyles:{getter:function(){var u=this._seriesStyles,v=this.get("graph"),w,t;if(v){w=v.get("seriesDictionary");if(w){u={};for(t in w){if(w.hasOwnProperty(t)){u[t]=w[t].get("styles");}}}}return u;},setter:function(w){var u,t,v;if(b.Lang.isArray(w)){v=this.get("seriesCollection");u=0;t=w.length;for(;u<t;++u){this._setBaseAttribute(v[u],"styles",w[u]);}}else{for(u in w){if(w.hasOwnProperty(u)){v=this.getSeries(u);this._setBaseAttribute(v,"styles",w[u]);}}}}},graphStyles:{getter:function(){var t=this.get("graph");if(t){return(t.get("styles"));}return this._graphStyles;},setter:function(u){var t=this.get("graph");this._setBaseAttribute(t,"styles",u);}},styles:{getter:function(){var t={axes:this.get("axesStyles"),series:this.get("seriesStyles"),graph:this.get("graphStyles")};return t;},setter:function(t){if(t.hasOwnProperty("axes")){if(this.get("axesStyles")){this.set("axesStyles",t.axes);}else{this._axesStyles=t.axes;}}if(t.hasOwnProperty("series")){if(this.get("seriesStyles")){this.set("seriesStyles",t.series);}else{this._seriesStyles=t.series;}}if(t.hasOwnProperty("graph")){this.set("graphStyles",t.graph);}}},axes:{valueFn:"_parseAxes",setter:function(t){return this._parseAxes(t);}},seriesCollection:{valueFn:"_getDefaultSeriesCollection",setter:function(t){return this._getDefaultSeriesCollection(t);}},leftAxesCollection:{},bottomAxesCollection:{},rightAxesCollection:{},topAxesCollection:{},stacked:{value:false},direction:{getter:function(){var t=this.get("type");if(t=="bar"){return"vertical";}else{if(t=="column"){return"horizontal";}}return this._direction;},setter:function(t){this._direction=t;return this._direction;}},showAreaFill:{},showMarkers:{},showLines:{},categoryAxisName:{},valueAxisName:{value:"values"},horizontalGridlines:{getter:function(){var t=this.get("graph");if(t){return t.get("horizontalGridlines");}return this._horizontalGridlines;},setter:function(u){var t=this.get("graph");if(u&&!b.Lang.isObject(u)){u={};}if(t){t.set("horizontalGridlines",u);}else{this._horizontalGridlines=u;}}},verticalGridlines:{getter:function(){var t=this.get("graph");if(t){return t.get("verticalGridlines");}return this._verticalGridlines;},setter:function(u){var t=this.get("graph");if(u&&!b.Lang.isObject(u)){u={};}if(t){t.set("verticalGridlines",u);}else{this._verticalGridlines=u;}}},type:{getter:function(){if(this.get("stacked")){return"stacked"+this._type;}return this._type;},setter:function(t){if(this._type=="bar"){if(t!="bar"){this.set("direction","horizontal");}}else{if(t=="bar"){this.set("direction","vertical");}}this._type=t;return this._type;}},categoryAxis:{}}});b.PieChart=b.Base.create("pieChart",b.Widget,[b.ChartBase],{_getSeriesCollection:function(){if(this._seriesCollection){return this._seriesCollection;}var y=this.get("axes"),A=[],z,w=0,v,B=this.get("type"),D,t="categoryAxis",x="categoryKey",u="valueAxis",C="valueKey";if(y){z=y.values.get("keyCollection");D=y.category.get("keyCollection")[0];v=z.length;for(;w<v;++w){A[w]={type:B};A[w][t]="category";A[w][u]="values";A[w][x]=D;A[w][C]=z[w];}}this._seriesCollection=A;return A;},_parseAxes:function(x){if(!this._axes){this._axes={};}var y,D,v,B,t,A,C=this.get("type"),E=this.get("width"),z=this.get("height"),u=b.Node.one(this._parentNode);if(!E){this.set("width",u.get("offsetWidth"));E=this.get("width");}if(!z){this.set("height",u.get("offsetHeight"));z=this.get("height");}for(y in x){if(x.hasOwnProperty(y)){B=x[y];D=C=="pie"?"none":B.position;A=this._getAxisClass(B.type);t={dataProvider:this.get("dataProvider")};if(B.hasOwnProperty("roundingUnit")){t.roundingUnit=B.roundingUnit;}t.keys=B.keys;t.width=E;t.height=z;t.position=D;t.styles=B.styles;v=new A(t);v.on("axisRendered",b.bind(this._axisRendered,this));this._axes[y]=v;}}},_addAxes:function(){var w=this.get("axes"),t,u,v;if(!w){this.set("axes",this._getDefaultAxes());w=this.get("axes");}if(!this._axesCollection){this._axesCollection=[];}for(t in w){if(w.hasOwnProperty(t)){u=w[t];v=u.get("position");if(!this.get(v+"AxesCollection")){this.set(v+"AxesCollection",[u]);}else{this.get(v+"AxesCollection").push(u);}this._axesCollection.push(u);}}},_addSeries:function(){var t=this.get("graph"),u=this.get("seriesCollection");this._parseSeriesAxes(u);t.set("showBackground",false);t.set("width",this.get("width"));t.set("height",this.get("height"));t.set("seriesCollection",u);this._seriesCollection=t.get("seriesCollection");t.render(this.get("contentBox"));},_parseSeriesAxes:function(y){var u=0,t=y.length,w,x=this.get("axes"),v;for(;u<t;++u){w=y[u];if(w){if(w instanceof b.PieSeries){v=w.get("categoryAxis");if(v&&!(v instanceof b.Axis)){w.set("categoryAxis",x[v]);}v=w.get("valueAxis");if(v&&!(v instanceof b.Axis)){w.set("valueAxis",x[v]);
}continue;}w.categoryAxis=x.category;w.valueAxis=x.values;if(!w.type){w.type=this.get("type");}}}},_getDefaultAxes:function(){var x=this.get("categoryKey"),u=this.get("seriesKeys")||[],t="numeric",w,v=this.get("dataProvider")[0];if(u.length<1){for(w in v){if(w!=x){u.push(w);}}if(u.length>0){this.set("seriesKeys",u);}}return{values:{keys:u,type:t},category:{keys:[x],type:this.get("categoryType")}};},getSeriesItems:function(v,u){var w={axis:v.get("categoryAxis"),key:v.get("categoryKey"),displayName:v.get("categoryDisplayName")},t={axis:v.get("valueAxis"),key:v.get("valueKey"),displayName:v.get("valueDisplayName")};w.value=w.axis.getKeyValueAt(w.key,u);t.value=t.axis.getKeyValueAt(t.key,u);return{category:w,value:t};},_sizeChanged:function(t){this._redraw();},_redraw:function(){var t=this.get("graph");if(t){t.set("width",this.get("width"));t.set("height",this.get("height"));}}},{ATTRS:{axes:{getter:function(){return this._axes;},setter:function(t){this._parseAxes(t);}},seriesCollection:{getter:function(){return this._getSeriesCollection();},setter:function(t){return this._setSeriesCollection(t);}},type:{value:"pie"}}});function o(t){if(t.type!="pie"){return new b.CartesianChart(t);}else{return new b.PieChart(t);}}b.Chart=o;},"@VERSION@",{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","widget","widget-position","widget-stack","graphics"]});