/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 3.3.0 build: 3167 */ YUI.add("charts",function(b){var g=b.UA.chrome,j,d=document.createElement("canvas");if(document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")){j="svg";}else{if(d&&d.getContext&&d.getContext("2d")){j="canvas";}else{j="vml";}}var u=function(C){this.initializer.apply(this,arguments);};u.prototype={autoSize:true,initializer:function(D){D=D||{};var C=D.width||0,E=D.height||0;if(D.node){this.node=D.node;this._styleGroup(this.node);}else{this.node=this._createGraphics();this.setSize(C,E);}this._initProps();},beginBitmapFill:function(C){var D={};D.src=C.bitmap.src;D.type="tile";this._fillProps=D;if(!isNaN(C.tx)||!isNaN(C.ty)||!isNaN(C.width)||!isNaN(C.height)){this._gradientBox={tx:C.tx,ty:C.ty,width:C.width,height:C.height};}else{this._gradientBox=null;}},beginFill:function(C,D){if(C){this._fillAlpha=b.Lang.isNumber(D)?D:1;this._fillColor=C;this._fillType="solid";this._fill=1;}return this;},beginGradientFill:function(D){var C=D.alphas||[];if(!this._defs){this._defs=this._createGraphicNode("defs");this.node.appendChild(this._defs);}this._fillAlphas=C;this._fillColors=D.colors;this._fillType=D.type||"linear";this._fillRatios=D.ratios||[];this._fillRotation=D.rotation||0;this._fillWidth=D.width||null;this._fillHeight=D.height||null;this._fillX=!isNaN(D.tx)?D.tx:NaN;this._fillY=!isNaN(D.ty)?D.ty:NaN;this._gradientId="lg"+Math.round(100000*Math.random());return this;},destroy:function(){this._removeChildren(this.node);if(this.node&&this.node.parentNode){this.node.parentNode.removeChild(this.node);}},_removeChildren:function(C){if(C.hasChildNodes()){var D;while(C.firstChild){D=C.firstChild;this._removeChildren(D);C.removeChild(D);}}},toggleVisible:function(C){this._toggleVisible(this.node,C);},_toggleVisible:function(G,H){var F=b.Selector.query(">/*",G),D=H?"visible":"hidden",E=0,C;if(F){C=F.length;for(;E0){this.node.removeChild(this._graphicsList.shift());}}this.path="";},curveTo:function(E,D,G,F,C,H){this._shapeType="path";if(this.path.indexOf("C")<0||this._pathType!=="C"){this._pathType="C";this.path+=" C";}this.path+=Math.round(E)+", "+Math.round(D)+", "+Math.round(G)+", "+Math.round(F)+", "+C+", "+H+" ";this._trackSize(C,H);},quadraticCurveTo:function(E,D,C,F){if(this.path.indexOf("Q")<0||this._pathType!=="Q"){this._pathType="Q";this.path+=" Q";}this.path+=Math.round(E)+" "+Math.round(D)+" "+Math.round(C)+" "+Math.round(F);},drawCircle:function(C,E,D){this._shape={x:C-D,y:E-D,w:D*2,h:D*2};this._attributes={cx:C,cy:E,r:D};this._width=this._height=D*2;this._x=C-D;this._y=E-D;this._shapeType="circle";this._draw();},drawEllipse:function(C,F,D,E){this._shape={x:C,y:F,w:D,h:E};this._width=D;this._height=E;this._x=C;this._y=F;this._shapeType="ellipse";this._draw();},drawRect:function(C,F,D,E){this._shape={x:C,y:F,w:D,h:E};this._x=C;this._y=F;this._width=D;this._height=E;this.moveTo(C,F);this.lineTo(C+D,F);this.lineTo(C+D,F+E);this.lineTo(C,F+E);this.lineTo(C,F);this._draw();},drawRoundRect:function(C,H,D,F,E,G){this._shape={x:C,y:H,w:D,h:F};this._x=C;this._y=H;this._width=D;this._height=F;this.moveTo(C,H+G);this.lineTo(C,H+F-G);this.quadraticCurveTo(C,H+F,C+E,H+F);this.lineTo(C+D-E,H+F);this.quadraticCurveTo(C+D,H+F,C+D,H+F-G);this.lineTo(C+D,H+G);this.quadraticCurveTo(C+D,H,C+D-E,H);this.lineTo(C+E,H);this.quadraticCurveTo(C,H,C,H+G);this._draw();},drawWedge:function(E,H,G,F,D,C){this._drawingComplete=false;this.path=this._getWedgePath({x:E,y:H,startAngle:G,arc:F,radius:D,yRadius:C});this._width=D*2;this._height=this._width;this._shapeType="path";this._draw();},end:function(){if(this._shapeType){this._draw();}this._initProps();},lineGradientStyle:function(){},lineStyle:function(F,E,J,H,G,I,C,D){this._stroke=1;this._strokeWeight=F;if(E){this._strokeColor=E;}this._strokeAlpha=b.Lang.isNumber(J)?J:1;},lineTo:function(H,G,E){var D=arguments,F,C;if(typeof H==="string"||typeof H==="number"){D=[[H,G]];}C=D.length;this._shapeType="path";if(this.path.indexOf("L")<0||this._pathType!=="L"){this._pathType="L";this.path+=" L";}for(F=0;F360){I=360;}P=Math.ceil(Math.abs(I)/45);N=I/P;H=-(N/180)*Math.PI;U=(Q/180)*Math.PI;if(P>0){M=L+Math.cos(Q/180*Math.PI)*E;K=J+Math.sin(Q/180*Math.PI)*F;O+=" L"+Math.round(M)+", "+Math.round(K);O+=" Q";for(;Rthis.node.getAttribute("width")){this.node.setAttribute("width",C);}if(D>this.node.getAttribute("height")){this.node.setAttribute("height",D);}}},_trackSize:function(C,D){if(C>this._width){this._width=C;}if(D>this._height){this._height=D;}this.setSize(C,D);},setPosition:function(C,D){this.node.setAttribute("x",C);this.node.setAttribute("y",D);},render:function(C){var D=C.get("width")||C.get("offsetWidth"),E=C.get("height")||C.get("offsetHeight");C=C||b.config.doc.body;C.appendChild(this.node);this.setSize(D,E);this._initProps();return this;},_initProps:function(){this._shape=null;this._fillColor=null;this._strokeColor=null;this._strokeWeight=0;this._fillProps=null;this._fillAlphas=null;this._fillColors=null;this._fillType=null;this._fillRatios=null;this._fillRotation=null;this._fillWidth=null;this._fillHeight=null;this._fillX=NaN;this._fillY=NaN;this.path="";this._width=0;this._height=0;this._x=0;this._y=0;this._fill=null;this._stroke=0;this._stroked=false;this._pathType=null;this._attributes={};},_clearPath:function(){this._shape=null;this._shapeType=null; this.path="";this._width=0;this._height=0;this._x=0;this._y=0;this._pathType=null;this._attributes={};},_draw:function(){var D=this._createGraphicNode(this._shapeType),E,C;if(this.path){if(this._fill){this.path+="z";}D.setAttribute("d",this.path);}else{for(E in this._attributes){if(this._attributes.hasOwnProperty(E)){D.setAttribute(E,this._attributes[E]);}}}D.setAttribute("stroke-width",this._strokeWeight);if(this._strokeColor){D.setAttribute("stroke",this._strokeColor);D.setAttribute("stroke-opacity",this._strokeAlpha);}if(!this._fillType||this._fillType==="solid"){if(this._fillColor){D.setAttribute("fill",this._fillColor);D.setAttribute("fill-opacity",this._fillAlpha);}else{D.setAttribute("fill","none");}}else{if(this._fillType==="linear"){C=this._getFill();C.setAttribute("id",this._gradientId);this._defs.appendChild(C);D.setAttribute("fill","url(#"+this._gradientId+")");}}this.node.appendChild(D);this._clearPath();},_getFill:function(){var C=this._fillType,D;switch(C){case"linear":D=this._getLinearGradient("fill");break;case"radial":break;case"bitmap":break;}return D;},_getLinearGradient:function(H){var V=this._createGraphicNode("linearGradient"),G="_"+H,M=this[G+"Colors"],P=this[G+"Ratios"],K=this[G+"Alphas"],N=this._fillWidth||(this._shape.w),Y=this._fillHeight||(this._shape.h),R=this[G+"Rotation"],W,T,U,L,I,O,S,Z,X,F,D,E=N/2,C=Y/2,J,Q;J=Math.PI/180;Q=parseFloat(parseFloat(Math.tan(R*J)).toFixed(8));if(Math.abs(Q)*N/2>=Y/2){if(R<180){F=0;D=Y;}else{F=Y;D=0;}Z=E-((C-F)/Q);X=E-((C-D)/Q);}else{if(R>90&&R<270){Z=N;X=0;}else{Z=0;X=N;}F=((Q*(E-Z))-C)*-1;D=((Q*(E-X))-C)*-1;}V.setAttribute("gradientTransform","rotate("+R+")");V.setAttribute("width",N);V.setAttribute("height",Y);V.setAttribute("gradientUnits","userSpaceOnUse");T=M.length;O=0;for(W=0;W0){O-=this._context.lineWidth*2;T-=this._context.lineWidth*2;N+=this._context.lineWidth;L+=this._context.lineWidth;}var D=this._context,Q=8,I=-(45/180)*Math.PI,V=0,H,F=O/2,G=T/2,R=0,K=N+F,J=L+G,P,M,U,S,E,C;this._drawingComplete=false;this._trackPos(N,L);this._trackSize(N+O,L+T);D.beginPath();P=K+Math.cos(0)*F;M=J+Math.sin(0)*G;D.moveTo(P,M);for(;R360){J=360;}P=Math.ceil(Math.abs(J)/45);O=J/P;I=-(O/180)*Math.PI;U=(Q/180)*Math.PI;if(P>0){N=M+Math.cos(Q/180*Math.PI)*E;L=K+Math.sin(Q/180*Math.PI)*G;this.lineTo(N,L);for(;R=Y/2){if(S<180){F=L;D=L+Y;}else{F=L+Y;D=L;}Z=E-((C-F)/R);X=E-((C-D)/R);}else{if(S>90&&S<270){Z=N+O;X=N;}else{Z=N;X=N+O;}F=((R*(E-Z))-C)*-1;D=((R*(E-X))-C)*-1;}J=T.createLinearGradient(Z,F,X,D);U=M.length;P=0;for(W=0;Wthis._width){this._width=C;}if(D>this._height){this._height=D;}},_trackPos:function(C,D){if(C>this._x){this._x=C;}if(D>this._y){this._y=D;}},_updateShapeProps:function(C,F){var D,E;if(!this._shape){this._shape={};}if(!this._shape.x){this._shape.x=C;}else{this._shape.x=Math.min(this._shape.x,C);}if(!this._shape.y){this._shape.y=F;}else{this._shape.y=Math.min(this._shape.y,F);}D=Math.abs(C-this._shape.x);if(!this._shape.w){this._shape.w=D;}else{this._shape.w=Math.max(D,this._shape.w);}E=Math.abs(F-this._shape.y);if(!this._shape.h){this._shape.h=E;}else{this._shape.h=Math.max(E,this._shape.h);}},getShape:function(C){C.graphic=this;return new b.Shape(C);}};b.CanvasDrawingUtil=m;b.CanvasGraphic=b.Base.create("graphic",b.CanvasDrawingUtil,[],{autoSize:true,setSize:function(C,D){if(this.autoSize){if(C>this.node.getAttribute("width")){this.node.style.width=C+"px";this._canvas.style.width=C+"px";this._canvas.width=C;this.node.setAttribute("width",C);}if(D>this.node.getAttribute("height")){this.node.style.height=D+"px";this._canvas.style.height=D+"px";this._canvas.height=D;this.node.setAttribute("height",D);}}},_trackSize:function(C,D){if(C>this._width){this._width=C;}if(D>this._height){this._height=D;}this.setSize(C,D);},setPosition:function(C,D){this.node.style.left=C+"px";this.node.style.top=D+"px";},render:function(C){C=C||b.config.doc.body;this.node=document.createElement("div");this.node.style.width=C.offsetWidth+"px";this.node.style.height=C.offsetHeight+"px";this.node.style.display="block";this.node.style.position="absolute";this.node.style.left=C.getStyle("left");this.node.style.top=C.getStyle("top");this.node.style.pointerEvents="none";C.appendChild(this.node);this.node.appendChild(this._canvas);this._canvas.width=C.offsetWidth>0?C.offsetWidth:100;this._canvas.height=C.offsetHeight>0?C.offsetHeight:100;this._canvas.style.position="absolute";return this;},toggleVisible:function(C){this.node.style.visibility=C?"visible":"hidden";},_createGraphicNode:function(C){var D=b.config.doc.createElement("canvas");D.style.pointerEvents=C||"none";if(!this._graphicsList){this._graphicsList=[]; }this._graphicsList.push(D);return D;},destroy:function(){this._removeChildren(this.node);if(this.node&&this.node.parentNode){this.node.parentNode.removeChild(this.node);}},_removeChildren:function(C){if(C.hasChildNodes()){var D;while(C.firstChild){D=C.firstChild;this._removeChildren(D);C.removeChild(D);}}},node:null});if(j=="canvas"){b.Graphic=b.CanvasGraphic;}var c=function(C){this.initializer.apply(this,arguments);};c.prototype={initializer:function(D){D=D||{};var C=D.width||0,E=D.height||0;this.node=this._createGraphics();this.setSize(C,E);this._initProps();},beginBitmapFill:function(C){var D={};D.src=C.bitmap.src;D.type="tile";this._fillProps=D;if(!isNaN(C.tx)||!isNaN(C.ty)||!isNaN(C.width)||!isNaN(C.height)){this._gradientBox={tx:C.tx,ty:C.ty,width:C.width,height:C.height};}else{this._gradientBox=null;}},beginFill:function(C,D){if(C){if(b.Lang.isNumber(D)){this._fillProps={type:"solid",opacity:D};}this._fillColor=C;this._fill=1;}return this;},beginGradientFill:function(E){var J=E.type,C=E.colors,D=E.alphas||[],H=E.ratios||[],M={colors:C,ratios:H},I=D.length,G=0,F,K,L=E.rotation||0;for(;G0?G+1:"";D[G]=Math.round(F*100)+"%";M["opacity"+K]=F;}if(J==="linear"){if(E){}if(L>0&&L<=90){L=450-L;}else{if(L<=270){L=270-L;}else{if(L<=360){L=630-L;}else{L=270;}}}M.type="gradientunscaled";M.angle=L;}else{if(J==="radial"){M.alignshape=false;M.type="gradientradial";M.focus="100%";M.focusposition="50%,50%";}}M.ratios=H||[];if(!isNaN(E.tx)||!isNaN(E.ty)||!isNaN(E.width)||!isNaN(E.height)){this._gradientBox={tx:E.tx,ty:E.ty,width:E.width,height:E.height};}else{this._gradientBox=null;}this._fillProps=M;},clear:function(){this._path="";this._removeChildren(this.node);},destroy:function(){this._removeChildren(this.node);this.node.parentNode.removeChild(this.node);},_removeChildren:function(C){if(C.hasChildNodes()){var D;while(C.firstChild){D=C.firstChild;this._removeChildren(D);C.removeChild(D);}}},toggleVisible:function(C){this._toggleVisible(this.node,C);},_toggleVisible:function(G,H){var F=b.one(G).get("children"),D=H?"visible":"hidden",E=0,C;if(F){C=F.length;for(;E360){G=360;}H*=-65535;G*=65536;I=" m "+E+" "+J+" ae "+E+" "+J+" "+D+" "+C+" "+H+" "+G;return I;},end:function(){if(this._shape){this._draw();}this._initProps();},lineGradientStyle:function(){},lineStyle:function(F,E,J,H,G,I,C,D){this._stroke=1;this._strokeWeight=F*0.7;this._strokeColor=E;this._strokeOpacity=b.Lang.isNumber(J)?J:1;},lineTo:function(H,G,E){var D=arguments,F,C;if(typeof H==="string"||typeof H==="number"){D=[[H,G]];}C=D.length;this._shape="shape";this._path+=" l ";for(F=0;Fthis._width){this._width=C;}if(D>this._height){this._height=D;}},_initProps:function(){this._fillColor=null;this._strokeColor=null;this._strokeOpacity=null;this._strokeWeight=0;this._fillProps=null;this._path="";this._width=0;this._height=0;this._x=0;this._y=0;this._fill=null;this._stroke=0;this._stroked=false;},_clearPath:function(){this._shape=null;this._path="";this._width=0;this._height=0;this._x=0;this._y=0;},_draw:function(){var E=this._createGraphicNode(this._shape),C=Math.round(this._width),F=Math.round(this._height),G,D=this._fillProps;this.setSize(C,F);if(this._path){if(this._fill||this._fillProps){this._path+=" x";}if(this._stroke){this._path+=" e";}E.path=this._path;E.coordSize=C+", "+F;}else{E.style.display="block";E.style.position="absolute";E.style.left=this._x+"px";E.style.top=this._y+"px";}if(this._fill){E.fillColor=this._fillColor;}else{E.filled=false;}if(this._stroke&&this._strokeWeight>0){E.strokeColor=this._strokeColor;E.strokeWeight=this._strokeWeight;if(b.Lang.isNumber(this._strokeOpacity)&&this._strokeOpacity<1){G=this._createGraphicNode("stroke");E.appendChild(G);G.opacity=this._strokeOpacity;}}else{E.stroked=false;}E.style.width=C+"px";E.style.height=F+"px"; if(D){E.filled=true;E.appendChild(this._getFill());}this.node.appendChild(E);this._clearPath();},_getFill:function(){var P=this._createGraphicNode("fill"),N=this._width,I=this._height,J=this._fillProps,D,O,G=0,C,M="",K,H,L=Math.sqrt(Math.pow(N,2)+Math.pow(I,2)),F=50,E=50;if(this._gradientBox){F=Math.round((this._gradientBox.width/2-((this._x-this._gradientBox.tx)*L/N))/(N*N/L)*100);E=Math.round((this._gradientBox.height/2-((this._y-this._gradientBox.ty)*L/I))/(I*I/L)*100);J.focussize=(this._gradientBox.width/N)/10+" "+(this._gradientBox.height/I)/10;}if(J.colors){C=J.colors.concat();H=J.ratios.concat();K=C.length;for(;G');},_getNodeShapeType:function(D){var C="shape";if(this._typeConversionHash.hasOwnProperty(D)){C=this._typeConversionHash[D];}return C;},_typeConversionHash:{circle:"oval",ellipse:"oval",rect:"rect"},getShape:function(C){C.graphic=this;return new b.Shape(C);},addChild:function(C){this.node.appendChild(C);}};if(j=="vml"){var i=document.createStyleSheet();i.addRule(".vmlgroup","behavior:url(#default#VML)",i.rules.length);i.addRule(".vmlgroup","display:inline-block",i.rules.length);i.addRule(".vmlgroup","zoom:1",i.rules.length);i.addRule(".vmlshape","behavior:url(#default#VML)",i.rules.length);i.addRule(".vmlshape","display:inline-block",i.rules.length);i.addRule(".vmloval","behavior:url(#default#VML)",i.rules.length);i.addRule(".vmloval","display:inline-block",i.rules.length);i.addRule(".vmlrect","behavior:url(#default#VML)",i.rules.length);i.addRule(".vmlrect","display:block",i.rules.length);i.addRule(".vmlfill","behavior:url(#default#VML)",i.rules.length);i.addRule(".vmlstroke","behavior:url(#default#VML)",i.rules.length);b.Graphic=c;}function n(C){this._initialize(C);this._draw();}b.extend(n,b.Graphic,{type:"shape",autoSize:false,pointerEvents:"visiblePainted",_initialize:function(C){if(!C.graphic){C.graphic=new b.Graphic();}this._setProps(C);},_setProps:function(C){this.autoSize=C.autoSize||this.autoSize;this.pointerEvents=C.pointerEvents||this.pointerEvents;this.width=C.width||this.width;this.height=C.height||this.height;this.border=C.border||this.border;this.graphics=C.graphic||this.graphics;this.canvas=this.graphics;this.parentNode=this.graphics.node;this.fill=C.fill||this.fill;this.type=C.shape||this.type;this.nodetype=this._getNodeShapeType(this.type);this.props=C.props||this.props;this.path=C.path||this.path;},_draw:function(){var D,J,G,F,C=this.parentNode,H=0,E=this.width||0,I=this.height||0;if(!this.node){this.node=this._createGraphicNode(this.nodetype,this.pointerEvents);C.appendChild(this.node);}if(this.type=="wedge"){this.path=this._getWedgePath(this.props);}if(this.nodetype=="path"){this._setPath();}if(this.border&&this.border.weight&&this.border.weight>0){H=this.border.weight;E-=H*2;I-=H*2;}this._addBorder();if(this.nodetype==="ellipse"){G=this.width/2;D=this.width/2;F=this.height/2;J=this.height/2;G-=H;F-=H;this.node.setAttribute("cx",D);this.node.setAttribute("cy",J);this.node.setAttribute("rx",G);this.node.setAttribute("ry",F);}else{this.node.setAttribute("width",E);this.node.setAttribute("height",I);this.node.style.width=E+"px";this.node.style.height=I+"px";}this._addFill();C.style.width=this.width+"px";C.style.height=this.height+"px";C.setAttribute("width",this.width);C.setAttribute("height",this.height);this.node.style.visibility="visible";this.node.setAttribute("x",H);this.node.setAttribute("y",H);return this;},_setPath:function(){if(this.path){this.path+=" Z";this.node.setAttribute("d",this.path);}},_addBorder:function(){if(this.border&&this.border.weight&&this.border.weight>0){var C=this.border.alpha;this.border.color=this.border.color||"#000000";this.border.weight=this.border.weight||1;this.border.alpha=b.Lang.isNumber(C)?C:1;this.border.linecap=this.border.linecap||"square";this.node.setAttribute("stroke",this.border.color);this.node.setAttribute("stroke-linecap",this.border.linecap);this.node.setAttribute("stroke-width",this.border.weight);this.node.setAttribute("stroke-opacity",this.border.alpha);}else{this.node.setAttribute("stroke","none");}},_addFill:function(){var C;if(this.fill.type==="linear"||this.fill.type==="radial"){this.beginGradientFill(this.fill);this.node.appendChild(this._getFill());}else{if(this.fill.type==="bitmap"){this.beginBitmapFill(this.fill);this.node.appendChild(this._getFill());}else{if(!this.fill.color){this.node.setAttribute("fill","none");}else{C=this.fill.alpha;this.fill.alpha=b.Lang.isNumber(C)?C:1;this.node.setAttribute("fill",this.fill.color);this.node.setAttribute("fill-opacity",C);}}}},end:function(){this._setPath();},update:function(C){this._setProps(C);this._draw();return this;},_getNodeShapeType:function(C){if(this._typeConversionHash.hasOwnProperty(C)){C=this._typeConversionHash[C];}return C;},toggleVisible:function(D){var C=D?"visible":"hidden";if(this.node){this.node.style.visibility=C;}},addClass:function(C){var D=this.node;if(D){if(D.className&&D.className.baseVal){D.className.baseVal=b.Lang.trim([D.className.baseVal,C].join(" "));}else{D.setAttribute("class",C);}}},setPosition:function(C,F){var D=b.one(this.parentNode),E=this.hotspot;D.setStyle("position","absolute");D.setStyle("left",C);D.setStyle("top",F);if(E){E.setStyle("position","absolute");E.setStyle("left",C);E.setStyle("top",F);}},_typeConversionHash:{circle:"ellipse",wedge:"path"}});b.Shape=n;function s(C){this._dummy=this._createDummy();this._canvas=this._createGraphic();this.node=this._canvas;this._context=this._canvas.getContext("2d"); this._initialize(C);this._validate();}b.extend(s,b.CanvasDrawingUtil,{type:"shape",autoSize:false,_initialize:function(C){this._canvas.style.position="absolute";if(C.graphic){C.graphic.node.appendChild(this._canvas);}this._setProps(C);},_setProps:function(C){this.autoSize=C.autoSize||this.autoSize;this.width=C.width||this.width;this.height=C.height||this.height;this.border=C.border||this.border;this.graphics=C.graphic||this.graphics;this.fill=C.fill||this.fill;this.type=C.shape||this.type;this.props=C.props||this.props;this.path=C.path||this.path;this.props=C.props||this.props;this.parentNode=this.graphics.node;},_validate:function(){var C=this.width,F=this.height,D=this.border,E=this.type,G=this.fill;this.clear();this.setSize(this.width,this.height);this._canvas.style.top="0px";this._canvas.style.left="0px";if(D&&D.weight&&D.weight>0){D.color=D.color||"#000";D.alpha=D.alpha||1;this.lineStyle(D.weight,D.color,D.alpha);}if(G.type==="radial"||G.type==="linear"){this.beginGradientFill(G);}else{if(G.type==="bitmap"){this.beginBitmapFill(G);}else{this.beginFill(G.color,G.alpha);}}switch(E){case"circle":this.drawEllipse(0,0,C,F);break;case"rect":this.drawRect(0,0,C,F);break;case"wedge":this.drawWedge(this.props);break;}return this;},update:function(C){this._setProps(C);this._validate();return this;},toggleVisible:function(D){var C=D?"visible":"hidden";if(this.node){this.node.style.visibility=C;}},setPosition:function(C,E){var D=b.one(this.parentNode);D.setStyle("position","absolute");D.setStyle("left",C);D.setStyle("top",E);},addClass:function(C){if(this.node){this.node.style.pointerEvents="painted";this.node.setAttribute("class",C);}}});b.CanvasShape=s;if(j=="canvas"){b.Shape=b.CanvasShape;}function B(C){this._initialize(C);this._draw();}B.prototype={type:"shape",_initialize:function(C){if(!C.graphic){C.graphic=new b.Graphic();}this._setProps(C);},width:0,height:0,_setProps:function(C){this.width=C.width&&C.width>=0?C.width:this.width;this.height=C.height&&C.height>=0?C.height:this.height;this.border=C.border||this.border;this.graphics=C.graphic||this.graphics;this.canvas=this.graphics;this.parentNode=this.graphics.node;this.fill=C.fill||this.fill;this.type=C.shape||this.type;this.props=C.props||this.props;},_draw:function(){var D,E=0,C=this.width||0,F=this.height||0;this.graphics.setSize(C,F);if(this.node){this.node.style.visible="hidden";}else{if(!this.node){this.node=this.graphics._createGraphicNode(this.graphics._getNodeShapeType(this.type));this.graphics.node.appendChild(this.node);}}if(this.type==="wedge"){D=this.graphics._getWedgePath(this.props);if(this.fill){D+=" x";}if(this.border){D+=" e";}this.node.path=D;}this._addBorder();if(this.border&&this.border.weight&&this.border.weight>0){E=this.border.weight;C-=E;F-=E;}this.node.style.width=Math.max(C,0)+"px";this.node.style.height=Math.max(F,0)+"px";this._addFill();return this;},_addBorder:function(){if(this.border&&this.border.weight&&this.border.weight>0){var C=this.border.alpha,D=this.borderWeight;C=b.Lang.isNumber(C)?C:1;D=b.Lang.isNumber(D)?D:1;this.node.strokecolor=this.border.color||"#000000";this.node.strokeweight=D;if(C<1){if(!this._strokeNode){this._strokeNode=this.graphics._createGraphicNode("stroke");this.node.appendChild(this._strokeNode);}this._strokeNode.opacity=C;}else{if(this._strokeNode){this._strokeNode.opacity=C;}}this.node.stroked=true;}else{this.node.stroked=false;}},_addFill:function(){var C;this.node.filled=true;if(this.fill.type==="linear"||this.fill.type==="radial"){this.graphics.beginGradientFill(this.fill);this.node.appendChild(this.graphics._getFill());}else{if(this.fill.type==="bitmap"){this.graphics.beginBitmapFill(this.fill);this.node.appendChild(this.graphics._getFill());}else{if(!this.fill.color){this.node.filled=false;}else{if(this.fillnode){this.graphics._removeChildren(this.fillnode);}C=this.fill.alpha;C=b.Lang.isNumber(C)?C:1;this.fill.alpha=C;this.fillnode=this.graphics._createGraphicNode("fill");this.fillnode.type="solid";this.fillnode.color=this.fill.color;this.fillnode.opacity=C;this.node.appendChild(this.fillnode);}}}},addClass:function(D){var C=this.node;if(C){b.one(C).addClass(D);}},toggleVisible:function(D){var C=D?"visible":"hidden";if(this.node){b.one(this.node).setStyle("visibility",C);}},setPosition:function(C,E){var D=b.one(this.parentNode);D.setStyle("position","absolute");D.setStyle("left",C);D.setStyle("top",E);},update:function(C){this._setProps(C);this._draw();return this;}};b.VMLShape=B;if(j=="vml"){b.Shape=B;}function v(){}v.ATTRS={styles:{getter:function(){this._styles=this._styles||this._getDefaultStyles();return this._styles;},setter:function(C){this._styles=this._setStyles(C);}},graphic:{}};v.NAME="renderer";v.prototype={_styles:null,_setStyles:function(D){var C=this.get("styles");return this._mergeStyles(D,C);},_mergeStyles:function(D,C){if(!C){C={};}var E=b.merge(C,{});b.Object.each(D,function(H,G,F){if(C.hasOwnProperty(G)&&b.Lang.isObject(H)&&!b.Lang.isArray(H)){E[G]=this._mergeStyles(H,C[G]);}else{E[G]=H;}},this);return E;},_getDefaultStyles:function(){return{padding:{top:0,right:0,bottom:0,left:0}};}};b.augment(v,b.Attribute);b.Renderer=v;b.Axis=b.Base.create("axis",b.Widget,[b.Renderer],{_dataChangeHandler:function(C){if(this.get("rendered")){this._drawAxis();}},_updateHandler:function(C){if(this.get("rendered")){this._drawAxis();}},_positionChangeHandler:function(D){var C=this.get("position");if(C=="none"){return;}this._layout=this.getLayout(this.get("position"));if(this.get("rendered")){this._drawAxis();}},renderUI:function(){var C=this.get("position");if(C&&C!="none"){this._layout=this.getLayout(C);this._setCanvas();}},syncUI:function(){this._drawAxis();},_setCanvas:function(){var C=this.get("contentBox"),H=this.get("boundingBox"),G=this.get("position"),E=this._parentNode,D=this.get("width"),F=this.get("height");H.setStyle("position","absolute");D=D?D+"px":E.getStyle("width");F=F?F+"px":E.getStyle("height");if(G==="top"||G==="bottom"){C.setStyle("width",D);}else{C.setStyle("height",F); }C.setStyle("position","relative");C.setStyle("left","0px");C.setStyle("top","0px");this.set("graphic",new b.Graphic());this.get("graphic").render(C);},_getDefaultStyles:function(){var C={majorTicks:{display:"inside",length:4,color:"#dad8c9",weight:1,alpha:1},minorTicks:{display:"none",length:2,color:"#dad8c9",weight:1},line:{weight:1,color:"#dad8c9",alpha:1},majorUnit:{determinant:"count",count:11,distance:75},top:"0px",left:"0px",width:"100px",height:"100px",label:{color:"#808080",alpha:1,fontSize:"85%",rotation:0,margin:{top:4,right:4,bottom:4,left:4}},hideOverlappingLabelTicks:false};return b.merge(b.Renderer.prototype._getDefaultStyles(),C);},_handleSizeChange:function(F){var E=F.attrName,H=this.get("position"),D=H=="left"||H=="right",C=this.get("contentBox"),G=H=="bottom"||H=="top";C.setStyle("width",this.get("width"));C.setStyle("height",this.get("height"));if((G&&E=="width")||(D&&E=="height")){this._drawAxis();}},_layout:null,getLayout:function(D){var C;switch(D){case"top":C=new b.TopAxisLayout({axisRenderer:this});break;case"bottom":C=new b.BottomAxisLayout({axisRenderer:this});break;case"left":C=new b.LeftAxisLayout({axisRenderer:this});break;case"right":C=new b.RightAxisLayout({axisRenderer:this});break;}return C;},drawLine:function(E,D,C){var F=this.get("graphic");F.lineStyle(C.weight,C.color,C.alpha);F.moveTo(E.x,E.y);F.lineTo(D.x,D.y);F.end();},_drawAxis:function(){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;if(this.get("position")!="none"){var S=this.get("styles"),N=S.majorTicks,O=N.display!="none",F,M=S.majorUnit,L,Q,H=0,D,I,K,R,J=this._layout,G=this.get("labelFunction"),P=this.get("labelFunctionScope"),E=this.get("labelFormat"),C=this.get("graphic");C.clear();J.setTickOffsets();D=this.getLength();K=J.getLineStart();L=this.getTotalMajorUnits(M);Q=this.getMajorUnitDistance(L,D,M);this.set("edgeOffset",this.getEdgeOffset(L,D)*0.5);F=this.getFirstPoint(K);this.drawLine(K,this.getLineEnd(F),S.line);if(O){J.drawTick(F,N);}if(L<1){this._clearLabelCache();return;}this._createLabelCache();this._tickPoints=[];J.set("maxLabelSize",0);for(;H0){D=C.shift();}else{D=document.createElement("span");D.style.display="block";D.style.whiteSpace="nowrap";b.one(D).addClass("axisLabel");this.get("contentBox").appendChild(D);}D.style.position="absolute";this._labels.push(D);this._tickPoints.push({x:H.x,y:H.y});this._layout.updateMaxLabelSize(D);for(E in G){if(G.hasOwnProperty(E)&&!F.hasOwnProperty(E)){D.style[E]=G[E];}}return D;},_createLabelCache:function(){if(this._labels){if(this._labelCache){this._labelCache=this._labels.concat(this._labelCache);}else{this._labelCache=this._labels.concat();}}else{this._clearLabelCache();}this._labels=[];},_clearLabelCache:function(){if(this._labelCache){var C=this._labelCache.length,E=0,D,F=this._labelCache;for(;E0?-O:O,G=-J,D=K,M;if(!document.createElementNS){N.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+K+" M12="+J+" M21="+G+" M22="+D+' sizingMethod="auto expand")';this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),N.offsetWidth));}else{N.style.msTransform="rotate(0deg)";if(E===0){M=N.offsetWidth;}else{if(I===90){M=N.offsetHeight;}else{M=(F*N.offsetWidth)+(O*N.offsetHeight);}}this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),M));}},positionLabel:function(J,R){var Q=this.get("axisRenderer"),E=Q.get("leftTickOffset"),U=Q.get("styles").label,M=U.alpha,T,P=0,L=R.x,S=R.y,K=Math.min(90,Math.max(-90,U.rotation)),D=Math.abs(K),G=Math.PI/180,O=parseFloat(parseFloat(Math.sin(D*G)).toFixed(8)),I=parseFloat(parseFloat(Math.cos(D*G)).toFixed(8)),X=I,W=K>0?-O:O,H=-W,F=X,N=this.get("maxLabelSize"),V=Math.round(J.offsetWidth),C=Math.round(J.offsetHeight);if(U.margin&&U.margin.right){P=U.margin.right;}if(!document.createElementNS){J.style.filter=null;V=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(K===0){L=V;S-=C*0.5;}else{if(D===90){L=C;S-=V*0.5;}else{if(K>0){L=(I*V)+(C*K/90);S-=(O*V)+(I*(C*0.5));}else{L=(I*V)+(D/90*C);S-=I*(C*0.5);}}}L+=E;J.style.left=((R.x+N)-L)+"px";J.style.top=S+"px";if(T){T+=" ";}if(b.Lang.isNumber(M)&&M<1&&M>-1&&!isNaN(M)){T="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(M*100)+")";}if(K!==0){if(T){T+=" ";}else{T="";}T+="progid:DXImageTransform.Microsoft.Matrix(M11="+X+" M12="+W+" M21="+H+" M22="+F+' sizingMethod="auto expand")';}if(T){J.style.filter=T;}return;}J.style.msTransform="rotate(0deg)";V=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(K===0){L-=V;S-=C*0.5;}else{if(K===90){S-=V*0.5;}else{if(K===-90){L-=C;S+=V*0.5;}else{if(K<0){L-=(I*V)+(O*C);S+=(O*V)-(I*(C*0.6));}else{L-=(I*V);S-=(O*V)+(I*(C*0.6));}}}}L-=E;J.style.left=(this.get("maxLabelSize")+L)+"px";J.style.top=S+"px";J.style.MozTransformOrigin="0 0";J.style.MozTransform="rotate("+K+"deg)";J.style.webkitTransformOrigin="0 0";J.style.webkitTransform="rotate("+K+"deg)";J.style.msTransformOrigin="0 0";J.style.msTransform="rotate("+K+"deg)";J.style.OTransformOrigin="0 0";J.style.OTransform="rotate("+K+"deg)";},setSizeAndPosition:function(){var C=this.get("maxLabelSize"),D=this.get("axisRenderer"),E=D.get("styles"),I=D.get("leftTickOffset"),G=C+I,H=D.get("graphic"),F=E.label.margin;if(F&&F.right){G+=F.right;}G=Math.round(G);D.set("width",G);D.get("contentBox").setStyle("width",G);b.one(H.node).setStyle("left",C+F.right);},offsetNodeForTick:function(C){},setCalculatedSize:function(){var E=this.get("axisRenderer"),G=E.get("styles"),F=G.label,H=E.get("leftTickOffset"),D=this.get("maxLabelSize"),C=Math.round(H+D+F.margin.right);E.get("contentBox").setStyle("width",C);E.set("width",C);}});b.LeftAxisLayout=p;function t(C){t.superclass.constructor.apply(this,arguments);}t.ATTRS={axisRenderer:{value:null}};b.extend(t,b.Base,{setTickOffsets:function(){var C=this.get("axisRenderer"),G=C.get("styles").majorTicks,E=G.length,D=E*0.5,F=G.display;C.set("topTickOffset",0);C.set("bottomTickOffset",0);switch(F){case"inside":C.set("leftTickOffset",E);C.set("rightTickOffset",0);break;case"outside":C.set("leftTickOffset",0);C.set("rightTickOffset",E);break;case"cross":C.set("rightTickOffset",D);C.set("leftTickOffset",D);break;default:C.set("leftTickOffset",0);C.set("rightTickOffset",0);break;}},drawTick:function(I,G){var D=this.get("axisRenderer"),E=D.get("styles"),H=E.padding,F=G.length,J={x:H.left,y:I.y},C={x:H.left+F,y:I.y};D.drawLine(J,C,G);},getLineStart:function(){var C=this.get("axisRenderer"),D=C.get("styles"),H=D.padding,I=D.majorTicks,E=I.length,G=I.display,F={x:H.left,y:H.top};if(G==="inside"){F.x+=E;}else{if(G==="cross"){F.x+=E/2;}}return F;},getLabelPoint:function(C){var D=this.get("axisRenderer");return{x:C.x+D.get("rightTickOffset"),y:C.y};},updateMaxLabelSize:function(N){var H=this.get("axisRenderer"),C=H.get("styles").label,E=Math.min(90,Math.max(-90,C.rotation)),I=Math.abs(E),L=Math.PI/180,O=parseFloat(parseFloat(Math.sin(I*L)).toFixed(8)),F=parseFloat(parseFloat(Math.cos(I*L)).toFixed(8)),K=F,J=E>0?-O:O,G=-J,D=K,M;if(!document.createElementNS){N.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+K+" M12="+J+" M21="+G+" M22="+D+' sizingMethod="auto expand")';this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),N.offsetWidth));}else{N.style.msTransform="rotate(0deg)";if(E===0){M=N.offsetWidth;}else{if(I===90){M=N.offsetHeight;}else{M=(F*N.offsetWidth)+(O*N.offsetHeight);}}this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),M));}},positionLabel:function(J,Q){var P=this.get("axisRenderer"),E=P.get("rightTickOffset"),T=P.get("styles").label,M=T.alpha,S,O=0,L=Q.x,R=Q.y,K=Math.min(Math.max(T.rotation,-90),90),D=Math.abs(K),G=Math.PI/180,N=parseFloat(parseFloat(Math.sin(D*G)).toFixed(8)),I=parseFloat(parseFloat(Math.cos(D*G)).toFixed(8)),W=I,V=K>0?-N:N,H=-V,F=W,U=Math.round(J.offsetWidth),C=Math.round(J.offsetHeight);if(T.margin&&T.margin.right){O=T.margin.right;}if(!document.createElementNS){J.style.filter=null;if(K===0){R-=C*0.5;}else{if(D===90){R-=U*0.5;}else{if(K>0){R-=(I*(C*0.5));}else{R-=(N*U)+(I*(C*0.5));}}}L+=O;L+=E;J.style.left=L+"px";J.style.top=R+"px";if(b.Lang.isNumber(M)&&M<1&&M>-1&&!isNaN(M)){S="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(M*100)+")";}if(K!==0){if(S){S+=" ";}else{S="";}S+="progid:DXImageTransform.Microsoft.Matrix(M11="+W+" M12="+V+" M21="+H+" M22="+F+' sizingMethod="auto expand")'; }if(S){J.style.filter=S;}return;}J.style.msTransform="rotate(0deg)";U=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(K===0){R-=C*0.5;}else{if(K===90){L+=C;R-=U*0.5;}else{if(K===-90){R+=U*0.5;}else{if(K<0){R-=(I*(C*0.6));}else{R-=I*(C*0.6);L+=N*C;}}}}L+=O;L+=E;J.style.left=L+"px";J.style.top=R+"px";J.style.MozTransformOrigin="0 0";J.style.MozTransform="rotate("+K+"deg)";J.style.webkitTransformOrigin="0 0";J.style.webkitTransform="rotate("+K+"deg)";J.style.msTransformOrigin="0 0";J.style.msTransform="rotate("+K+"deg)";J.style.OTransformOrigin="0 0";J.style.OTransform="rotate("+K+"deg)";},setSizeAndPosition:function(){var D=this.get("axisRenderer"),E=D.get("styles").label,C=this.get("maxLabelSize"),G=D.get("rightTickOffset"),F=G+C;if(E.margin&&E.margin.weight){F+=E.margin.weight;}D.set("width",F);D.get("contentBox").setStyle("width",F);},offsetNodeForTick:function(C){var D=this.get("axisRenderer"),F=D.get("leftTickOffset"),E=0-F;C.setStyle("left",E);},setCalculatedSize:function(){var D=this.get("axisRenderer"),E=D.get("styles").label,C=Math.round(D.get("rightTickOffset")+this.get("maxLabelSize")+E.margin.left);D.set("width",C);}});b.RightAxisLayout=t;function x(C){x.superclass.constructor.apply(this,arguments);}x.ATTRS={axisRenderer:{value:null},maxLabelSize:{value:0}};b.extend(x,b.Base,{setTickOffsets:function(){var C=this.get("axisRenderer"),G=C.get("styles").majorTicks,E=G.length,D=E*0.5,F=G.display;C.set("leftTickOffset",0);C.set("rightTickOffset",0);switch(F){case"inside":C.set("topTickOffset",E);C.set("bottomTickOffset",0);break;case"outside":C.set("topTickOffset",0);C.set("bottomTickOffset",E);break;case"cross":C.set("topTickOffset",D);C.set("bottomTickOffset",D);break;default:C.set("topTickOffset",0);C.set("bottomTickOffset",0);break;}},getLineStart:function(){var C=this.get("axisRenderer"),D=C.get("styles"),H=D.padding,I=D.majorTicks,E=I.length,G=I.display,F={x:0,y:H.top};if(G==="inside"){F.y+=E;}else{if(G==="cross"){F.y+=E/2;}}return F;},drawTick:function(I,G){var D=this.get("axisRenderer"),E=D.get("styles"),H=E.padding,F=G.length,J={x:I.x,y:H.top},C={x:I.x,y:F+H.top};D.drawLine(J,C,G);},getLabelPoint:function(C){var D=this.get("axisRenderer");return{x:C.x,y:C.y+D.get("bottomTickOffset")};},updateMaxLabelSize:function(N){var H=this.get("axisRenderer"),C=H.get("styles").label,E=Math.min(90,Math.max(-90,C.rotation)),I=Math.abs(E),L=Math.PI/180,O=parseFloat(parseFloat(Math.sin(I*L)).toFixed(8)),F=parseFloat(parseFloat(Math.cos(I*L)).toFixed(8)),K=F,J=E>0?-O:O,G=-J,D=K,M;if(!document.createElementNS){N.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+K+" M12="+J+" M21="+G+" M22="+D+' sizingMethod="auto expand")';this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),N.offsetHeight));}else{N.style.msTransform="rotate(0deg)";if(E===0){M=N.offsetHeight;}else{if(I===90){M=N.offsetWidth;}else{M=(O*N.offsetWidth)+(F*N.offsetHeight);}}this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),M));}},positionLabel:function(J,Q){var P=this.get("axisRenderer"),E=P.get("bottomTickOffset"),T=P.get("styles").label,M=T.alpha,S,O=0,L=Math.round(Q.x),R=Math.round(Q.y),K=Math.min(90,Math.max(-90,T.rotation)),D=Math.abs(K),G=Math.PI/180,N=parseFloat(parseFloat(Math.sin(D*G)).toFixed(8)),I=parseFloat(parseFloat(Math.cos(D*G)).toFixed(8)),W=I,V=K>0?-N:N,H=-V,F=W,U=Math.round(J.offsetWidth),C=Math.round(J.offsetHeight);if(T.margin&&T.margin.top){O=T.margin.top;}if(!document.createElementNS){W=I;V=K>0?-N:N;H=-V;F=W;J.style.filter=null;U=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(D===90){L-=C*0.5;}else{if(K<0){L-=I*U;L-=N*(C*0.5);}else{if(K>0){L-=N*(C*0.5);}else{L-=U*0.5;}}}R+=O;R+=E;J.style.left=Math.round(L)+"px";J.style.top=Math.round(R)+"px";if(b.Lang.isNumber(M)&&M<1&&M>-1&&!isNaN(M)){S="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(M*100)+")";}if(K!==0){if(S){S+=" ";}else{S="";}S+="progid:DXImageTransform.Microsoft.Matrix(M11="+W+" M12="+V+" M21="+H+" M22="+F+' sizingMethod="auto expand")';}if(S){J.style.filter=S;}return;}J.style.msTransform="rotate(0deg)";U=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(K===0){L-=U*0.5;}else{if(D===90){if(K===90){L+=C*0.5;}else{R+=U;L-=C*0.5;}}else{if(K<0){L-=(I*U)+(N*(C*0.6));R+=N*U;}else{L+=Math.round(N*(C*0.6));}}}R+=O;R+=E;J.style.left=Math.round(L)+"px";J.style.top=Math.round(R)+"px";J.style.MozTransformOrigin="0 0";J.style.MozTransform="rotate("+K+"deg)";J.style.webkitTransformOrigin="0 0";J.style.webkitTransform="rotate("+K+"deg)";J.style.msTransformOrigin="0 0";J.style.msTransform="rotate("+K+"deg)";J.style.OTransformOrigin="0 0";J.style.OTransform="rotate("+K+"deg)";},setSizeAndPosition:function(){var C=this.get("maxLabelSize"),D=this.get("axisRenderer"),F=D.get("bottomTickLength"),E=D.get("styles"),H=F+C,G=E.label.margin;if(G&&G.top){H+=G.top;}H=Math.round(H);D.set("height",H);},offsetNodeForTick:function(C){var D=this.get("axisRenderer");D.get("contentBox").setStyle("top",0-D.get("topTickOffset"));},setCalculatedSize:function(){var D=this.get("axisRenderer"),E=D.get("styles").label,C=Math.round(D.get("bottomTickOffset")+this.get("maxLabelSize")+E.margin.top);D.set("height",C);}});b.BottomAxisLayout=x;function a(C){a.superclass.constructor.apply(this,arguments);}a.ATTRS={axisRenderer:{value:null},maxLabelSize:{value:0}};b.extend(a,b.Base,{setTickOffsets:function(){var C=this.get("axisRenderer"),G=C.get("styles").majorTicks,E=G.length,D=E*0.5,F=G.display;C.set("leftTickOffset",0);C.set("rightTickOffset",0);switch(F){case"inside":C.set("bottomTickOffset",E);C.set("topTickOffset",0);break;case"outside":C.set("bottomTickOffset",0);C.set("topTickOffset",E);break;case"cross":C.set("topTickOffset",D);C.set("bottomTickOffset",D);break;default:C.set("topTickOffset",0);C.set("bottomTickOffset",0);break;}},getLineStart:function(){var C=this.get("axisRenderer"),D=C.get("styles"),H=D.padding,I=D.majorTicks,E=I.length,G=I.display,F={x:0,y:H.top};if(G==="outside"){F.y+=E;}else{if(G==="cross"){F.y+=E/2;}}return F; },drawTick:function(I,G){var D=this.get("axisRenderer"),E=D.get("styles"),H=E.padding,F=G.length,J={x:I.x,y:H.top},C={x:I.x,y:F+H.top};D.drawLine(J,C,G);},getLabelPoint:function(D){var C=this.get("axisRenderer");return{x:D.x,y:D.y-C.get("topTickOffset")};},updateMaxLabelSize:function(N){var H=this.get("axisRenderer"),C=H.get("styles").label,E=Math.min(90,Math.max(-90,C.rotation)),I=Math.abs(E),L=Math.PI/180,O=parseFloat(parseFloat(Math.sin(I*L)).toFixed(8)),F=parseFloat(parseFloat(Math.cos(I*L)).toFixed(8)),K=F,J=E>0?-O:O,G=-J,D=K,M;if(!document.createElementNS){N.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+K+" M12="+J+" M21="+G+" M22="+D+' sizingMethod="auto expand")';this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),N.offsetHeight));}else{N.style.msTransform="rotate(0deg)";if(E===0){M=N.offsetHeight;}else{if(I===90){M=N.offsetWidth;}else{M=(O*N.offsetWidth)+(F*N.offsetHeight);}}this.set("maxLabelSize",Math.max(this.get("maxLabelSize"),M));}},positionLabel:function(J,R){var Q=this.get("axisRenderer"),E=Q.get("topTickOffset"),U=Q.get("styles").label,M=U.alpha,T,P=0,L=R.x,S=R.y,K=Math.max(-90,Math.min(90,U.rotation)),D=Math.abs(K),G=Math.PI/180,O=parseFloat(parseFloat(Math.sin(D*G)).toFixed(8)),I=parseFloat(parseFloat(Math.cos(D*G)).toFixed(8)),X,W,H,F,N=this.get("maxLabelSize"),V=Math.round(J.offsetWidth),C=Math.round(J.offsetHeight);K=Math.min(90,K);K=Math.max(-90,K);if(U.margin&&U.margin.bottom){P=U.margin.bottom;}if(!document.createElementNS){J.style.filter=null;V=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);X=I;W=K>0?-O:O;H=-W;F=X;if(K===0){L-=V*0.5;}else{if(D===90){L-=C*0.5;}else{if(K>0){L-=(I*V)+Math.min((O*C),(K/180*C));S-=(O*V)+(I*(C));S+=N;}else{L-=O*(C*0.5);S-=(O*V)+(I*(C));S+=N;}}}S-=E;J.style.left=L;J.style.top=S;if(b.Lang.isNumber(M)&&M<1&&M>-1&&!isNaN(M)){T="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(M*100)+")";}if(K!==0){if(T){T+=" ";}else{T="";}T+="progid:DXImageTransform.Microsoft.Matrix(M11="+X+" M12="+W+" M21="+H+" M22="+F+' sizingMethod="auto expand")';}if(T){J.style.filter=T;}return;}J.style.msTransform="rotate(0deg)";V=Math.round(J.offsetWidth);C=Math.round(J.offsetHeight);if(K===0){L-=V*0.5;S-=C;}else{if(K===90){L+=C*0.5;S-=V;}else{if(K===-90){L-=C*0.5;S-=0;}else{if(K<0){L-=(O*(C*0.6));S-=(I*C);}else{L-=(I*V)-(O*(C*0.6));S-=(O*V)+(I*C);}}}}S-=E;J.style.left=L+"px";J.style.top=(this.get("maxLabelSize")+S)+"px";J.style.MozTransformOrigin="0 0";J.style.MozTransform="rotate("+K+"deg)";J.style.webkitTransformOrigin="0 0";J.style.webkitTransform="rotate("+K+"deg)";J.style.msTransformOrigin="0 0";J.style.msTransform="rotate("+K+"deg)";J.style.OTransformOrigin="0 0";J.style.OTransform="rotate("+K+"deg)";},setSizeAndPosition:function(){var C=this.get("maxLabelSize"),D=this.get("axisRenderer"),H=D.get("topTickOffset"),E=D.get("styles"),F=E.label.margin,I=D.get("graphic"),G=H+C;if(F&&F.bottom){G+=F.bottom;}D.set("height",G);b.one(I.node).setStyle("top",C+F.bottom);},offsetNodeForTick:function(C){},setCalculatedSize:function(){var D=this.get("axisRenderer"),E=D.get("styles").label,C=Math.round(D.get("topTickOffset")+this.get("maxLabelSize")+E.margin.bottom);D.set("height",C);}});b.TopAxisLayout=a;b.AxisType=b.Base.create("baseAxis",b.Axis,[],{bindUI:function(){this.after("dataReady",b.bind(this._dataChangeHandler,this));this.after("dataUpdate",b.bind(this._dataChangeHandler,this));this.after("minimumChange",b.bind(this._keyChangeHandler,this));this.after("maximumChange",b.bind(this._keyChangeHandler,this));this.after("keysChange",this._keyChangeHandler);this.after("dataProviderChange",this._dataProviderChangeHandler);this.after("stylesChange",this._updateHandler);this.after("positionChange",this._positionChangeHandler);this.after("overlapGraphChange",this._updateHandler);this.after("widthChange",this._handleSizeChange);this.after("heightChange",this._handleSizeChange);this.after("alwaysShowZeroChange",this._keyChangeHandler);this.after("roundingMethodChange",this._keyChangeHandler);},_dataProviderChangeHandler:function(F){var C=this.get("keyCollection").concat(),E=this.get("keys"),D;if(E){for(D in E){if(E.hasOwnProperty(D)){delete E[D];}}}if(C&&C.length){this.set("keys",C);}},GUID:"yuibaseaxis",_type:null,_setMaximum:null,_dataMaximum:null,_setMinimum:null,_data:null,_updateTotalDataFlag:true,_dataReady:false,addKey:function(C){this.set("keys",C);},_getKeyArray:function(F,G){var E=0,H,D=[],C=G.length;for(;E0){C=H.length;D=G=H[0];if(C>1){for(F=1;F=G){D=Math.floor((F/2-G)/(Math.pow(10,C-1)/2));G=F/2-D*Math.pow(10,C-1)/2;}else{G=F;}if(!isNaN(G)){return G;}return E;},_updateMinAndMax:function(){var D=this.get("data"),I=0,C=0,G,F,E,J,K=this.get("setMax"),H=this.get("setMin");if(!K&&!H){if(D&&D.length&&D.length>0){G=D.length;I=C=D[0];if(G>1){for(E=1;E=0,O=P>0,H,N,R,F,M,D,L,K=this.getTotalMajorUnits()-1,I=this.get("alwaysShowZero"),S=this.get("roundingMethod"),C=(P-G)/K>=1;if(S){if(S=="niceNumber"){J=this._getMinimumUnit(P,G,K);if(Q&&O){if(I||G0){P=0;J=this._getMinimumUnit(P,G,K);}else{P=this._roundUpToNearest(P,J);}G=P-(J*K);}}}else{if(S=="auto"){if(Q&&O){if(I||G<(P-G)/K){G=0;}J=(P-G)/K;if(C){J=Math.ceil(J);}P=G+(J*K);}else{if(O&&!Q){if(I){F=Math.round(K/((-1*G)/P+1));M=K-F;if(C){D=Math.ceil(P/F);L=Math.floor(G/M)*-1;}else{D=P/F;L=G/M*-1;}J=Math.max(D,L);P=J*F;G=J*M*-1;}else{J=(P-G)/K;if(C){J=Math.ceil(J);}G=this._roundDownToNearest(G,J);P=this._roundUpToNearest(P,J);}}else{J=(P-G)/K;if(C){J=Math.ceil(J);}if(I||P===0||P+J>0){P=0;J=(P-G)/K;if(C){Math.ceil(J);}}else{P=this._roundUpToNearest(P,J);}G=P-(J*K);}}}else{if(!isNaN(S)&&isFinite(S)){J=S;E=J*K;H=(P-G)>E;R=this._roundDownToNearest(G,J);N=this._roundUpToNearest(P,J);if(Q&&O){if(I||R<=0){G=0;}else{G=R;}if(!H){P=G+E;}else{P=N;}}else{if(O&&!Q){G=R;if(!H){P=G+E;}else{P=N;}}else{if(P===0||I){P=0;}else{P=N;}if(!H){G=P-E;}else{G=R;}}}}}}}this._dataMaximum=P;this._dataMinimum=G;},getLabelByIndex:function(G,D){var F=this.get("minimum"),C=this.get("maximum"),H=(C-F)/(D-1),E;D-=1;E=F+(G*H);if(G>0){E=this._roundToNearest(E,H);}return E;},_roundToNearest:function(E,D){D=D||1;if(D===0){return E;}var C=Math.round(this._roundToPrecision(E/D,10))*D;return this._roundToPrecision(C,10);},_roundUpToNearest:function(D,C){C=C||1;if(C===0){return D;}return Math.ceil(this._roundToPrecision(D/C,10))*C;},_roundDownToNearest:function(D,C){C=C||1;if(C===0){return D;}return Math.floor(this._roundToPrecision(D/C,10))*C;},_roundToPrecision:function(E,C){C=C||0;var D=Math.pow(10,C);return Math.round(D*E)/D;}});b.NumericAxis=q;function f(C){f.superclass.constructor.apply(this,arguments);}f.NAME="stackedAxis";b.extend(f,b.NumericAxis,{_updateMinAndMax:function(){var I=0,D=0,H=0,C=0,G=0,E=0,J,F,K=this.get("keys");for(J in K){if(K.hasOwnProperty(J)){G=Math.max(G,K[J].length);}}for(;E=0){H+=F;}else{C+=F;}}}if(H>0){I=Math.max(I,H);}else{I=Math.max(I,C);}if(C<0){D=Math.min(D,C);}else{D=Math.min(D,H);}}this._roundMinAndMax(D,I);}});b.StackedAxis=f;function e(C){e.superclass.constructor.apply(this,arguments);}e.NAME="timeAxis";e.ATTRS={setMax:{readOnly:true,getter:function(){var C=this._getNumber(this._setMaximum);return(b.Lang.isNumber(C));}},setMin:{readOnly:true,getter:function(){var C=this._getNumber(this._setMinimum);return(b.Lang.isNumber(C));}},maximum:{getter:function(){var C=this._getNumber(this._setMaximum);if(!b.Lang.isNumber(C)){C=this._getNumber(this.get("dataMaximum"));}return C;},setter:function(C){this._setMaximum=this._getNumber(C);return C;}},minimum:{getter:function(){var C=this._getNumber(this._setMinimum);if(!b.Lang.isNumber(C)){C=this._getNumber(this.get("dataMinimum"));}return C;},setter:function(C){this._setMinimum=this._getNumber(C);return C;}},labelFunction:{value:function(D,C){D=b.DataType.Date.parse(D);if(C){return b.DataType.Date.format(D,{format:C});}return D;}},labelFormat:{value:"%b %d, %y"}};b.extend(e,b.AxisType,{GUID:"yuitimeaxis",_dataType:"time",getLabelByIndex:function(H,E){var G=this.get("minimum"),D=this.get("maximum"),C=this.get("position"),I,F; E-=1;I=((D-G)/E)*H;if(C=="bottom"||C=="top"){F=G+I;}else{F=D-I;}return F;},_getKeyArray:function(F,G){var H,D=[],E=0,I,C=G.length;for(;EF){C.lineTo(M+Math.cos(G)*F,L+Math.sin(G)*F);}else{if(Q>0){C.lineTo(M+Math.cos(G)*Q,L+Math.sin(G)*Q);}}C.moveTo(D,P);},_getLineDefaults:function(){return{alpha:1,weight:6,lineType:"solid",dashLength:10,gapSpace:10,connectDiscontinuousPoints:true,discontinuousType:"solid",discontinuousDashLength:10,discontinuousGapSpace:10};}};b.augment(k,b.Attribute);b.Lines=k;function z(C){var D={area:{getter:function(){return this._defaults||this._getAreaDefaults();},setter:function(F){var E=this._defaults||this._getAreaDefaults(); this._defaults=b.merge(E,F);}}};this.addAttrs(D,C);this.get("styles");}z.prototype={drawFill:function(L,H){if(L.length<1){return;}var K=L.length,E=L[0],D=H[0],J=E,I=D,O,N,G=1,M=this.get("styles").area,C=this.get("graphic"),F=M.color||this._getDefaultColor(this.get("graphOrder"),"slice");C.clear();C.beginFill(F,M.alpha);C.moveTo(E,D);for(;G0){D=F[S-1].get("xcoords").concat().reverse();Q=F[S-1].get("ycoords").concat().reverse();L=this.getCurveControlPoints(D,Q);T=0;U=L.length;M.lineTo(D[0],Q[0]);for(;T0){I=E[G-1].get("xcoords").concat();F=E[G-1].get("ycoords").concat();L=L.concat(I.concat().reverse());H=H.concat(F.concat().reverse());L.push(L[0]);H.push(H[0]);}else{if(K==="vertical"){L.push(this._leftOrigin);L.push(this._leftOrigin);H.push(H[H.length-1]);H.push(C);}else{L.push(L[L.length-1]);L.push(D);H.push(this._bottomOrigin);H.push(this._bottomOrigin);}}return[L,H];},_getAreaDefaults:function(){return{};}};b.augment(z,b.Attribute);b.Fills=z;function y(C){var D={markers:{getter:function(){return this._markers;}}};this.addAttrs(D,C);}y.prototype={_plotDefaults:null,drawPlots:function(){if(!this.get("xcoords")||this.get("xcoords").length<1){return;}var F=b.clone(this.get("styles").marker),S=F.width,L=F.height,R=this.get("xcoords"),J=this.get("ycoords"),K=0,M=R.length,Q=J[0],H,I,N=S/2,G=L/2,P=null,O=null,D=this.get("graphOrder"),E,C=g;if(b.Lang.isArray(F.fill.color)){P=F.fill.color.concat();}if(b.Lang.isArray(F.border.color)){O=F.border.colors.concat();}this._createMarkerCache();if(C){this._createHotspotCache();}for(;K0){while(!D){if(this._markerCache.length<1){D=this._createMarker(F,C,E);break;}D=this._markerCache.shift();}D.update(F);}else{D=this._createMarker(F,C,E);}this._markers.push(D);this._graphicNodes.push(D.parentNode);return D;},_createMarker:function(G,C,F){var H=new b.Graphic(),E,D=b.clone(G);H.render(this.get("graph").get("contentBox"));H.node.setAttribute("id","markerParent_"+C+"_"+F);D.graphic=H;E=new b.Shape(D);E.addClass("yui3-seriesmarker");E.node.setAttribute("id","series_"+C+"_"+F);return E;},_createMarkerCache:function(){if(this._markers&&this._markers.length>0){this._markerCache=this._markers.concat();}else{this._markerCache=[];}this._markers=[];this._graphicNodes=[];},_clearMarkerCache:function(){var C=this._markerCache.length,E=0,F,D;for(;E0){while(!G){if(this._hotspotCache.length<1){G=this._createHotspot(F,C,E);break;}G=this._hotspotCache.shift();}G.update(F);}else{G=this._createHotspot(F,C,E);}this._hotspots.push(G);return G;},_createHotspot:function(G,C,E){var H=new b.Graphic(),F,D=b.clone(G);H.render(this.get("graph").get("contentBox"));H.node.setAttribute("id","hotspotParent_"+C+"_"+E);D.graphic=H;F=new b.Shape(D);F.addClass("yui3-seriesmarker");F.node.setAttribute("id","hotspot_"+C+"_"+E);return F;},_createHotspotCache:function(){if(this._hotspots&&this._hotspots.length>0){this._hotspotCache=this._hotspots.concat();}else{this._hotspotCache=[];}this._hotspots=[];},_clearHotspotCache:function(){var C=this._hotspotCache.length,D=0,F,E;for(;DX){I=P;}}Q=Y*P;if(Q>E.get(T)){L=E.get(T)/Q;P*=L;I*=L;ab*=L;ab=Math.max(ab,1);}I-=P/2;for(X=0;X0&&D>0)&&((this.get("xData")&&this.get("yData"))||this._updateAxisData())){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;this.setAreaData();if(this.get("xcoords")&&this.get("ycoords")){this.drawSeries();}this._drawing=false;if(this._callLater){this.draw();}else{this._toggleVisible(this.get("visible"));this.fire("drawingComplete");}}}},_defaultPlaneOffset:4,_getDefaultStyles:function(){return{padding:{top:0,left:0,right:0,bottom:0}};},_defaultLineColors:["#426ab3","#d09b2c","#000000","#b82837","#b384b5","#ff7200","#779de3","#cbc8ba","#7ed7a6","#007a6c"],_defaultFillColors:["#6084d0","#eeb647","#6c6b5f","#d6484f","#ce9ed1","#ff9f3b","#93b7ff","#e0ddd0","#94ecba","#309687"],_defaultBorderColors:["#205096","#b38206","#000000","#94001e","#9d6fa0","#e55b00","#5e85c9","#adab9e","#6ac291","#006457"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(F,G){var D={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},E=D[G],C=E.length;F=F||0;if(F>=C){F=F%C;}G=G||"fill";return D[G][F];},_toggleVisible:function(F){var I=this.get("graphic"),H=this.get("markers"),E=0,C,G=this.get("visible"),D;if(I){I.toggleVisible(G);}if(H){C=H.length;for(;EE){I=O;}I-=O/2;}for(E=0;EE){H=N;}H-=N/2;}for(E=0;Ethis.get("width")){J=this.width/F;P*=J;P=Math.max(P,1);}if(!D){I=L[T-1];M=I.get("negativeBaseValues");S=I.get("positiveBaseValues");}else{M=[];S=[];}this.set("negativeBaseValues",M);this.set("positiveBaseValues",S);for(U=0;Uthis._bottomOrigin){S[U]=this._bottomOrigin;M[U]=R;}else{S[U]=R;M[U]=R;}}}else{if(R>this._bottomOrigin){R+=(M[U]-this._bottomOrigin);W=M[U]-R;M[U]=R;}else{if(Rthis.get("height")){I=this.height/X;V*=I;V=Math.max(V,1);}if(!D){H=K[S-1];L=H.get("negativeBaseValues");R=H.get("positiveBaseValues");}else{L=[];R=[];}this.set("negativeBaseValues",L);this.set("positiveBaseValues",R);for(T=0;Tthis._leftOrigin){R[T]=G;L[T]=this._leftOrigin;}else{if(Gthis._leftOrigin){G+=(R[T]-this._leftOrigin);O=G-R[T];R[T]=G;G-=O;}}}Q-=V/2;W.width=O;W.height=V;J=this.getMarker(W,N,T);J.setPosition(G,Q);if(C){M=this.getHotspot(W,N,T);M.setPosition(G,Q);M.parentNode.style.zIndex=5;}}this._clearMarkerCache();if(C){this._clearHotspotCache();}},updateMarkerState:function(G,E){if(this._markers[E]){var I=this._getState(G),J=this.get("ycoords"),C=this._markers[E],H=this.get("styles").marker,F=H.height,D=I=="off"||!H[I]?H:H[I];D.width=C.width;C.update(D);if(C.parentNode){b.one(C.parentNode).setStyle("top",(J[E]-F/2));}}},_getPlotDefaults:function(){var C={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:24,height:24,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};C.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");C.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return C;}},{ATTRS:{type:{value:"stackedBar"},direction:{value:"vertical"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}});b.PieSeries=b.Base.create("pieSeries",b.MarkerSeries,[],{_map:null,_image:null,_setMap:function(){var E="pieHotSpotMapi_"+Math.round(100000*Math.random()),C=this.get("graph").get("contentBox"),D;if(this._image){C.removeChild(this._image);while(this._areaNodes&&this._areaNodes.length>0){D=this._areaNodes.shift();this._map.removeChild(D);}C.removeChild(this._map);}this._image=document.createElement("img");this._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==";C.appendChild(this._image);this._image.setAttribute("usemap","#"+E);this._image.style.zIndex=3;this._image.style.opacity=0;this._image.setAttribute("alt","imagemap");this._map=document.createElement("map");this._map.style.zIndex=5;C.appendChild(this._map);this._map.setAttribute("name",E);this._map.setAttribute("id",E);this._areaNodes=[];},_categoryDisplayName:null,_valueDisplayName:null,addListeners:function(){var C=this.get("categoryAxis"),D=this.get("valueAxis");if(C){C.after("dataReady",b.bind(this._categoryDataChangeHandler,this));C.after("dataUpdate",b.bind(this._categoryDataChangeHandler,this));}if(D){D.after("dataReady",b.bind(this._valueDataChangeHandler,this));D.after("dataUpdate",b.bind(this._valueDataChangeHandler,this));}this.after("categoryAxisChange",this.categoryAxisChangeHandler);this.after("valueAxisChange",this.valueAxisChangeHandler);this.after("stylesChange",this._updateHandler);},validate:function(){this.draw();this._renderered=true;},_categoryAxisChangeHandler:function(C){var D=this.get("categoryAxis");D.after("dataReady",b.bind(this._categoryDataChangeHandler,this));D.after("dataUpdate",b.bind(this._categoryDataChangeHandler,this));},_valueAxisChangeHandler:function(C){var D=this.get("valueAxis");D.after("dataReady",b.bind(this._valueDataChangeHandler,this));D.after("dataUpdate",b.bind(this._valueDataChangeHandler,this));},GUID:"pieseries",_categoryDataChangeHandler:function(C){if(this._rendered&&this.get("categoryKey")&&this.get("valueKey")){this.draw();}},_valueDataChangeHandler:function(C){if(this._rendered&&this.get("categoryKey")&&this.get("valueKey")){this.draw();}},draw:function(){var E=this.get("graph"),C=E.get("width"),D=E.get("height");if(isFinite(C)&&isFinite(D)&&C>0&&D>0){this._rendered=true;this.drawSeries();this.fire("drawingComplete");}},drawPlots:function(){var E=this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),F=this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),I=0,ag=E.length,P=this.get("styles").marker,C=P.fill.colors,ah=P.fill.alphas||["1"],M=P.border.colors,G=[P.border.weight],H=[P.border.alpha],ai=G.concat(),R=M.concat(),T=H.concat(),ad,af,U=P.padding,D=this.get("graph"),S=D.get("width")-(U.left+U.right),ac=D.get("height")-(U.top+U.bottom),aa=-90,N=S/2,V=ac/2,J=Math.min(N,V),ab=0,Y,ae=0,X,Z,K,Q,L,O=this.get("graphOrder"),W=j=="canvas";for(;ab=C){F=F%C;}G=G||"fill";return D[G][F];}},{ATTRS:{type:{value:"pie"},order:{},graph:{},categoryAxis:{value:null,validator:function(C){return C!==this.get("categoryAxis");}},valueAxis:{value:null,validator:function(C){return C!==this.get("valueAxis");}},categoryKey:{value:null,validator:function(C){return C!==this.get("categoryKey");}},valueKey:{value:null,validator:function(C){return C!==this.get("valueKey");}},categoryDisplayName:{setter:function(C){this._categoryDisplayName=C;return C;},getter:function(){return this._categoryDisplayName||this.get("categoryKey");}},valueDisplayName:{setter:function(C){this._valueDisplayName=C;return C;},getter:function(){return this._valueDisplayName||this.get("valueKey");}},slices:null}});b.Gridlines=b.Base.create("gridlines",b.Base,[b.Renderer],{render:function(){this._setCanvas();},remove:function(){var D=this.get("graphic"),C;if(D){C=D.node;if(C){b.one(C).remove();}}},draw:function(){if(this.get("axis")&&this.get("graph")){this._drawGridlines();}},_drawGridlines:function(){var C=this.get("graphic"),D=this.get("axis"),L=D.get("position"),O,I=0,F,M=this.get("direction"),P=this.get("graph"),N=P.get("width"),K=P.get("height"),Q=this.get("styles").line,H=Q.color,J=Q.weight,G=Q.alpha,E=M=="vertical"?this._verticalLine:this._horizontalLine;if(L=="none"){O=[];F=D.get("styles").majorUnit.count;for(;IE){D=C[E];}return D;},getSeriesByKey:function(E){var D=this._seriesDictionary,C;if(D&&D.hasOwnProperty(E)){C=D[E];}return C;},addDispatcher:function(C){if(!this._dispatchers){this._dispatchers=[];}this._dispatchers.push(C);},_seriesCollection:null,_seriesDictionary:null,_parseSeriesCollection:function(G){if(!G){return;}var D=G.length,F=0,E,C;if(!this.get("seriesCollection")){this._seriesCollection=[];}if(!this._seriesDictionary){this._seriesDictionary={};}if(!this.seriesTypes){this.seriesTypes=[];}for(;F-1){this._dispatchers.splice(C,1);}if(this._dispatchers.length<1){this.fire("chartRendered");}},_getDefaultStyles:function(){var C={background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return C;}},{ATTRS:{seriesCollection:{getter:function(){return this._seriesCollection;},setter:function(C){this._parseSeriesCollection(C);return this._seriesCollection;}},showBackground:{value:true},seriesDictionary:{readOnly:true,getter:function(){return this._seriesDictionary;}},horizontalGridlines:{value:null,setter:function(D){var C=this.get("horizontalGridlines");if(C&&C instanceof b.Gridlines){C.remove();}if(D instanceof b.Gridlines){C=D;D.set("graph",this);D.render();return D;}else{if(D&&D.axis){C=new b.Gridlines({direction:"horizontal",axis:D.axis,graph:this,styles:D.styles});C.render();return C;}}}},verticalGridlines:{value:null,setter:function(D){var C=this.get("verticalGridlines");if(C&&C instanceof b.Gridlines){C.remove();}if(D instanceof b.Gridlines){C=D;D.set("graph",this);D.render();return D;}else{if(D&&D.axis){C=new b.Gridlines({direction:"vertical",axis:D.axis,graph:this,styles:D.styles});C.render();return C;}}}}}});function r(){}r.ATTRS={tooltip:{valueFn:"_getTooltip",setter:function(C){return this._updateTooltip(C);}},categoryKey:{value:"category"},categoryType:{value:"category"},interactionType:{value:"marker"},dataProvider:{setter:function(C){return this._setDataValues(C);}},seriesKeys:{},axesCollection:{},graph:{valueFn:"_getGraph"}};r.prototype={_getGraph:function(){var C=new b.Graph();C.after("chartRendered",b.bind(function(D){this.fire("chartRendered");},this));return C;},getSeries:function(E){var C=null,D=this.get("graph");if(D){if(b.Lang.isNumber(E)){C=D.getSeriesByIndex(E);}else{C=D.getSeriesByKey(E);}}return C;},getAxisByKey:function(E){var C,D=this.get("axes");if(D.hasOwnProperty(E)){C=D[E];}return C;},getCategoryAxis:function(){var D,C=this.get("categoryKey"),E=this.get("axes");if(E.hasOwnProperty(C)){D=E[C];}return D;},_direction:"horizontal",_dataProvider:null,_setDataValues:function(H){if(b.Lang.isArray(H[0])){var G,J=[],E=H[0],F=0,D=E.length,I,C=H.length;for(;F"+L.displayName+": "+D.get("labelFunction").apply(this,[D.getKeyValueAt(L.key,K),D.get("labelFormat")])+"";}}return C;},_tooltipLabelFunction:function(H,C,F,E,D){var G=H.displayName+": "+H.axis.get("labelFunction").apply(this,[H.value,H.axis.get("labelFormat")])+"
"+C.displayName+": "+C.axis.get("labelFunction").apply(this,[C.value,C.axis.get("labelFormat")]);return G;},_tooltipChangeHandler:function(G){if(this.get("tooltip")){var E=this.get("tooltip"),F=E.node,D=E.show,C=this.get("contentBox");if(F&&D){if(!C.containes(F)){this._addTooltip();}}}}};b.ChartBase=r;b.CartesianChart=b.Base.create("cartesianChart",b.Widget,[b.ChartBase],{renderUI:function(){var D=this.get("tooltip"),C;this.get("boundingBox").setStyle("position","absolute");this.get("contentBox").setStyle("position","absolute");this._addAxes();this._addGridlines();this._addSeries();if(D&&D.show){this._addTooltip();}this.get("styles");if(this.get("interactionType")=="planar"){C=document.createElement("div");this.get("contentBox").appendChild(C);this._overlay=b.one(C);this._overlay.setStyle("position","absolute");this._overlay.setStyle("background","#fff");this._overlay.setStyle("opacity",0);this._overlay.addClass("yui3-overlay");this._overlay.setStyle("zIndex",4);}this._redraw();},_planarEventDispatcher:function(V){var D=this.get("graph"),H=this.get("boundingBox"),Q=D.get("contentBox"),M=V.pageX,W=M-Q.getX(),K=M-H.getX(),L=V.pageY,U=L-Q.getY(),J=L-H.getY(),C=D.get("seriesCollection"),N,S=0,I,G=this._selectedIndex,X,P=[],E=[],O=[],Y=this.get("direction"),Z,R=Y=="horizontal"?W:U,F=Y=="horizontal"?C[0].get("xMarkerPlane"):C[0].get("yMarkerPlane"),T=F.length;for(;S=F[S].start){I=S;break;}}T=C.length;for(S=0;S-1){N.updateMarkerState("mouseout",G);}if(N.get("ycoords")[I]>-1){if(Z&&!isNaN(I)&&I>-1){N.updateMarkerState("mouseover",I);}X=this.getSeriesItems(N,I);E.push(X.category);O.push(X.value);P.push(N);}}this._selectedIndex=I;if(I>-1){this.fire("planarEvent:mouseover",{categoryItem:E,valueItem:O,x:K,y:J,items:P,index:I});}else{this.fire("planarEvent:mouseout");}},_type:"combo",_axesRenderQueue:null,_addToAxesRenderQueue:function(C){if(!this._axesRenderQueue){this._axesRenderQueue=[];}if(b.Array.indexOf(this._axesRenderQueue,C)<0){this._axesRenderQueue.push(C); }},_getDefaultSeriesCollection:function(V){var L=this.get("direction"),C=V||[],S,P,N=[],I,H=this.get("seriesKeys").concat(),R,G,O,F=this.get("type"),T,K,U,D,E=this.get("categoryKey"),Q=this.get("showMarkers"),M=this.get("showAreaFill"),J=this.get("showLines");if(L=="vertical"){S="yAxis";K="yKey";P="xAxis";U="xKey";}else{S="xAxis";K="xKey";P="yAxis";U="yKey";}O=C.length;for(R=0;R-1){H.splice(G,1);}N.push(T);}}if(H.length>0){N=N.concat(H);}O=N.length;for(R=0;R0){E.set("overlapGraph",false);}E.after("axisRendered",b.bind(this._axisRendered,this));K[I]=E;}}}return K;},_addAxes:function(){var H=this.get("axes"),D,F,I,C=this.get("width"),E=this.get("height"),G=b.Node.one(this._parentNode);if(!this._axesCollection){this._axesCollection=[];}for(D in H){if(H.hasOwnProperty(D)){F=H[D];if(F instanceof b.Axis){if(!C){this.set("width",G.get("offsetWidth"));C=this.get("width");}if(!E){this.set("height",G.get("offsetHeight"));E=this.get("height");}F.set("width",C);F.set("height",E);this._addToAxesRenderQueue(F);I=F.get("position");if(!this.get(I+"AxesCollection")){this.set(I+"AxesCollection",[F]);}else{this.get(I+"AxesCollection").push(F);}this._axesCollection.push(F);if(F.get("keys").hasOwnProperty(this.get("categoryKey"))){this.set("categoryAxis",F);}F.render(this.get("contentBox"));}}}},_addSeries:function(){var C=this.get("graph"),D=this.get("seriesCollection");C.render(this.get("contentBox"));},_addGridlines:function(){var M=this.get("graph"),D=this.get("horizontalGridlines"),E=this.get("verticalGridlines"),L=this.get("direction"),N=this.get("leftAxesCollection"),H=this.get("rightAxesCollection"),J=this.get("bottomAxesCollection"),F=this.get("topAxesCollection"),G,C=this.get("categoryAxis"),K,I;if(this._axesCollection){G=this._axesCollection.concat();G.splice(b.Array.indexOf(G,C),1);}if(D){if(N&&N[0]){K=N[0];}else{if(H&&H[0]){K=H[0];}else{K=L=="horizontal"?C:G[0];}}if(!this._getBaseAttribute(D,"axis")&&K){this._setBaseAttribute(D,"axis",K);}if(this._getBaseAttribute(D,"axis")){M.set("horizontalGridlines",D);}}if(E){if(J&&J[0]){I=J[0];}else{if(F&&F[0]){I=F[0];}else{I=L=="vertical"?C:G[0];}}if(!this._getBaseAttribute(E,"axis")&&I){this._setBaseAttribute(E,"axis",I);}if(this._getBaseAttribute(E,"axis")){M.set("verticalGridlines",E);}}},_getDefaultAxes:function(U){var M=this.get("categoryKey"),D,S,O,F={},Q=[],E=this.get("categoryAxisName")||this.get("categoryKey"),C=this.get("valueAxisName"),G=this.get("seriesKeys")||[],V,T,L,J,P,N,R=this.get("dataProvider"),W=this.get("direction"),K,H,I=[],X=this.get("stacked")?"stacked":"numeric";N=R[0];if(W=="vertical"){K="bottom";H="left";}else{K="left";H="bottom";}if(U){for(V in U){if(U.hasOwnProperty(V)){D=U[V];O=this._getBaseAttribute(D,"keys");S=this._getBaseAttribute(D,"type");if(S=="time"||S=="category"){E=V;this.set("categoryAxisName",V);if(b.Lang.isArray(O)&&O.length>0){M=O[0];this.set("categoryKey",M);}F[V]=D;}else{if(V==E){F[V]=D;}else{F[V]=D;if(V!=C&&O&&b.Lang.isArray(O)){J=O.length;for(L=0;L-1){G.splice(P,1);}T=Q.length;for(V=0;V-1){G.splice(P,1);}}if(!F.hasOwnProperty(E)){F[E]={};}if(!(this._getBaseAttribute(F[E],"keys"))){this._setBaseAttribute(F[E],"keys",[M]);}if(!(this._getBaseAttribute(F[E],"position"))){this._setBaseAttribute(F[E],"position",H);}if(!(this._getBaseAttribute(F[E],"type"))){this._setBaseAttribute(F[E],"type",this.get("categoryType")); }if(!F.hasOwnProperty(C)&&G&&G.length>0){F[C]={keys:G};I.push(F[C]);}if(Q.length>0){if(G.length>0){G=Q.concat(G);}else{G=Q;}}if(F.hasOwnProperty(C)){if(!(this._getBaseAttribute(F[C],"position"))){this._setBaseAttribute(F[C],"position",this._getDefaultAxisPosition(F[C],I,K));}if(!(this._getBaseAttribute(F[C],"type"))){this._setBaseAttribute(F[C],"type",X);}if(!(this._getBaseAttribute(F[C],"keys"))){this._setBaseAttribute(F[C],"keys",G);}}this.set("seriesKeys",G);return F;},_getDefaultAxisPosition:function(F,D,C){var G=this.get("direction"),E=b.Array.indexOf(D,F);if(D[E-1]&&D[E-1].position){if(G=="horizontal"){if(D[E-1].position=="left"){C="right";}else{if(D[E-1].position=="right"){C="left";}}}else{if(D[E-1].position=="bottom"){C="top";}else{C="bottom";}}}return C;},getSeriesItems:function(H,G){var I=H.get("xAxis"),E=H.get("yAxis"),F=H.get("xKey"),D=H.get("yKey"),J,C;if(this.get("direction")=="vertical"){J={axis:E,key:D,value:E.getKeyValueAt(D,G)};C={axis:I,key:F,value:I.getKeyValueAt(F,G)};}else{C={axis:E,key:D,value:E.getKeyValueAt(D,G)};J={axis:I,key:F,value:I.getKeyValueAt(F,G)};}J.displayName=H.get("categoryDisplayName");C.displayName=H.get("valueDisplayName");J.value=J.axis.getKeyValueAt(J.key,G);C.value=C.axis.getKeyValueAt(C.key,G);return{category:J,value:C};},_axisRendered:function(C){this._axesRenderQueue=this._axesRenderQueue.splice(1+b.Array.indexOf(this._axesRenderQueue,C.currentTarget),1);if(this._axesRenderQueue.length<1){this._redraw();}},_sizeChanged:function(F){if(this._axesCollection){var E=this._axesCollection,D=0,C=E.length;for(;D-1;--M){S[b.Array.indexOf(this._axesCollection,E[M])]={x:I+"px"};I+=E[M].get("width");}}if(C){J=C.length;M=0;for(M=J-1;M>-1;--M){F+=C[M].get("width");S[b.Array.indexOf(this._axesCollection,C[M])]={x:(Q-F)+"px"};}}if(K){J=K.length;for(M=J-1;M>-1;--M){S[b.Array.indexOf(this._axesCollection,K[M])]={y:D+"px"};D+=K[M].get("height");}}if(O){J=O.length;for(M=J-1;M>-1;--M){L+=O[M].get("height");S[b.Array.indexOf(this._axesCollection,O[M])]={y:(N-L)+"px"};}}J=this._axesCollection.length;M=0;for(;M0){this.set("seriesKeys",D);}}return{values:{keys:D,type:C},category:{keys:[G],type:this.get("categoryType")}};},getSeriesItems:function(E,D){var F={axis:E.get("categoryAxis"),key:E.get("categoryKey"),displayName:E.get("categoryDisplayName")},C={axis:E.get("valueAxis"),key:E.get("valueKey"),displayName:E.get("valueDisplayName")};F.value=F.axis.getKeyValueAt(F.key,D);C.value=C.axis.getKeyValueAt(C.key,D);return{category:F,value:C};},_sizeChanged:function(C){this._redraw();},_redraw:function(){var C=this.get("graph");if(C){C.set("width",this.get("width"));C.set("height",this.get("height"));}}},{ATTRS:{axes:{getter:function(){return this._axes;},setter:function(C){this._parseAxes(C);}},seriesCollection:{getter:function(){return this._getSeriesCollection();},setter:function(C){return this._setSeriesCollection(C);}},type:{value:"pie"}}});function w(C){if(C.type!="pie"){return new b.CartesianChart(C);}else{return new b.PieChart(C);}}b.Chart=w;},"3.3.0",{requires:["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]});