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