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