/* YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("charts-base",function(e,t){function b(){}function w(e){w.superclass.constructor.apply(this,arguments)}function E(e){E.superclass.constructor.apply(this,arguments)}function S(e){S.superclass.constructor.apply(this,arguments)}function x(e){x.superclass.constructor.apply(this,arguments)}function T(){}function N(){}function C(){}function k(t){var n={area:{getter:function(){return this._defaults||this._getAreaDefaults()},setter:function(t){var n=this._defaults||this._getAreaDefaults();this._defaults=e.merge(n,t)}}};this.addAttrs(n,t),this.get("styles")}function L(e){var t={markers:{getter:function(){return this._markers}}};this.addAttrs(t,e)}function A(){}function O(){}var n=e.config,r=n.win,i=n.doc,s=e.Lang,o=s.isString,u=e.DOM,a,f,l,c,h=e.ClassNameManager.getClassName,p=h("seriesmarker"),d,v,m,g,y;d=function(e){d.superclass.constructor.apply(this,arguments)},d.NAME="shapeGroup",e.extend(d,e.Path,{_draw:function(){var e=this.get("xvalues"),t=this.get("yvalues"),n,r,i,o,u=0,a,f=[],l=this.get("dimensions"),c=l.width,h=l.height,p=l.radius,d=l.yRadius,v=this.get("id"),m=this.node.className,g=s.isArray(c),y=s.isArray(h),b=s.isArray(p),w=s.isArray(d);if(e&&t&&e.length>0){this.clear(),a=e.length;for(;u0?h-=d/2*f/90:f<0?(c-=p,h-=d/2*l/90):c-=p*.5,h+=u,h+=s,a.labelWidth=p,a.labelHeight=d,a.x=c,a.y=h,i._rotate(e,a)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=e.labelWidth,i=e.labelHeight,s,o;t>0?(s=0,o=i/2*t/90):t<0?(s=r,o=i/2*n/90):(s=r*.5,o=0),e.x-=s,e.y-=o},_getTransformOrigin:function(e){var t;return e>0?t=[0,.5]:e<0?t=[1,.5]:t=[0,0],t},offsetNodeForTick:function(e){var t=this;t.get("contentBox").setStyle("top",0-t.get("topTickOffset"))},setCalculatedSize:function(){var e=this,t=e.get("styles"),n=t.label,r=e._totalTitleSize,i=Math.round(e.get("bottomTickOffset")+e._maxLabelSize+n.margin.top+r);e._explicitHeight&&(i=e._explicitHeight),e.set("calculatedHeight",i)}},e.BottomAxisLayout=l,c=function(){},c.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:0,bottom:4}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("leftTickOffset",0),e.set("rightTickOffset",0);switch(i){case"inside":e.set("bottomTickOffset",n),e.set("topTickOffset",0);break;case"outside":e.set("bottomTickOffset",0),e.set("topTickOffset",n);break;case"cross":e.set("topTickOffset",r),e.set("bottomTickOffset",r);break;default:e.set("topTickOffset",0),e.set("bottomTickOffset",0)}},getLineStart:function(){var e=this,t=e.get("styles"),n=t.padding,r=t.majorTicks,i=r.length,s=r.display,o={x:0,y:n.top};return s==="outside"?o.y+=i:s==="cross"&&(o.y+=i/2),o},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:t.x,y:s.top},a={x:t.x,y:o+s.top};r.drawLine(e,u,a)},getLabelPoint:function(e){return{x:e.x,y:e.y-this.get("topTickOffset")}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=t:s===90?a=e:a=o*e+u*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitHeight){var t=this,n=t._explicitHeight,r=t._totalTitleSize,i=t.get("topTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=e.offsetWidth,o=e.offsetHeight,u=n.bottom-n.top,a=t.get("width")*.5-s*.5,f=u/2-o/2;i.labelWidth=s,i.labelHeight=o,r&&r.top&&(f+=r.top),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=this._totalTitleSize,o=i._maxLabelSize,u=t.x,a=t.y+s+o,f=this._labelRotationProps,l=f.rot,c=f.absRot,h=this._labelWidths[r],p=this._labelHeights[r];l===0?(u-=h*.5,a-=p):l===90?(u-=h,a-=p*.5):l===-90?a-=p*.5:l>0?(u-=h,a-=p-p*l/180):a-=p-p*c/180,f.x=Math.round(u),f.y=Math.round(a),f.labelWidth=h,f.labelHeight=p,this._rotate(e,f)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=e.labelWidth,i=e.labelHeight,s,o;t===0?(s=r*.5,o=i):t===90?(s=r,o=i*.5):t===-90?o=i*.5:t>0?(s=r,o=i-i*t/180):o=i-i*n/180,e.x-=s,e.y-=o},_getTransformOrigin:function(e){var t;return e===0?t=[0,0]:e===90?t=[1,.5]:e===-90?t=[0,.5]:e>0?t=[1,.5]:t=[0,.5],t},offsetNodeForTick:function(e){},setCalculatedSize:function(){var e=this,t=e.get("graphic"),n=e.get("styles"),r=n.label.margin,i=r.bottom+e._maxLabelSize,s=e._totalTitleSize,o=this.get("topTickOffset"),u=Math.round(o+i+s);this._explicitHeight&&(u=this._explicitWidth),e.set("calculatedHeight",u),t.set("y",u-o)}},e.TopAxisLayout=c,e.Axis=e.Base.create("axis",e.Widget,[e.Renderer],{_calculatedWidth:0,_calculatedHeight:0,_dataChangeHandler:function(e){this.get("rendered")&&this._drawAxis()},_positionChangeHandler:function(e){this._updateGraphic(e.newVal),this._updateHandler()},_updateGraphic:function(e){var t=this.get("graphic");e=="none"?t&&t.destroy():t||this._setCanvas()},_updateHandler:function(e){this.get("rendered")&&this._drawAxis()},renderUI:function(){this._updateGraphic(this.get("position"))},syncUI:function(){var e=this._layout,t,n,r,i,s;if(e){t=e._getDefaultMargins(),n=this.get("styles"),r=n.label.margin,i=n.title.margin;for(s in t)t.hasOwnProperty(s)&&(r[s]=r[s]===undefined?t[s]:r[s],i[s]=i[s]===undefined?t[s]:i[s])}this._drawAxis()},_setCanvas:function(){var t=this.get("contentBox"),n=this.get("boundingBox"),r=this.get("position"),i=this._parentNode,s=this.get("width"),o=this.get("height");n.setStyle("position","absolute"),n.setStyle("zIndex",2),s=s?s+"px":i.getStyle("width"),o=o?o+"px":i.getStyle("height"),r==="top"||r==="bottom"?t.setStyle("width",s):t.setStyle("height",o),t.setStyle("position","relative"),t.setStyle("left","0px"),t.setStyle("top","0px"),this.set("graphic",new e.Graphic),this.get("graphic").render(t)},_getDefaultStyles:function(){var t={majorTicks:{display:"inside",length:4,color:"#dad8c9",weight:1,alpha:1},minorTicks:{display:"none",length:2,color:"#dad8c9",weight:1},line:{weight:1,color:"#dad8c9",alpha:1},majorUnit:{determinant:"count",count:11,distance:75},top:"0px",left:"0px",width:"100px",height:"100px",label:{color:"#808080",alpha:1,fontSize:"85%",rotation:0,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},title:{color:"#808080",alpha:1,fontSize:"85%",rotation:undefined,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},hideOverlappingLabelTicks:!1};return e.merge(e.Renderer.prototype._getDefaultStyles(),t)},_handleSizeChange:function(e){var t=e.attrName,n=this.get("position"),r=n=="left"||n=="right",i=this.get("contentBox"),s=n=="bottom"||n=="top";i.setStyle("width",this.get("width")),i.setStyle("height",this.get("height")),(s&&t=="width"||r&&t=="height")&&this._drawAxis()},_layoutClasses:{top:c,bottom:l,left:a,right:f},drawLine:function(e,t,n){e.moveTo(t.x,t.y),e.lineTo(n.x,n.y)},_getTextRotationProps:function(e){if(e.rotation===undefined)switch(this.get("position")){case"left":e.rotation=-90;break;case"right":e.rotation=90;break;default:e.rotation=0}var t=Math.min(90,Math.max(-90,e.rotation)),n=Math.abs(t),r=Math.PI/180,i=parseFloat(parseFloat(Math.sin(n*r)).toFixed(8)),s=parseFloat(parseFloat(Math.cos(n*r)).toFixed(8));return{rot:t,absRot:n,radCon:r,sinRadians:i,cosRadians:s,textAlpha:e.alpha}},_drawAxis:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;if(this._layout){var e=this.get("styles"),t=e.line,n=e.label,r=e.majorTicks,i=r.display!="none",s,o=e.majorUnit,u,a,f=0,l=this._layout,c,h,p,d,v,m,g=this.get("labelFunction"),y=this.get("labelFunctionScope"),b=this.get("labelFormat"),w=this.get("graphic"),E=this.get("path"),S,x;this._labelWidths=[],this._labelHeights=[],w.set("autoDraw",!1),E.clear(),E.set("stroke",{weight:t.weight,color:t.color,opacity:t.alpha}),this._labelRotationProps=this._getTextRotationProps(n),this._labelRotationProps.transformOrigin=l._getTransformOrigin(this._labelRotationProps.rot),l.setTickOffsets.apply(this),c=this.getLength(),p=l.getLineStart.apply(this),u=this.getTotalMajorUnits(o),a=this.getMajorUnitDistance(u,c,o),this.set("edgeOffset",this.getEdgeOffset(u,c)*.5);if(u<1)this._clearLabelCache();else{s=this.getFirstPoint(p),this.drawLine(E,p,this.getLineEnd(s)),i&&(S=this.get("tickPath"),S.clear(),S.set("stroke",{weight:r.weight,color:r.color,opacity:r.alpha}),l.drawTick.apply(this,[S,s,r])),this._createLabelCache(),this._tickPoints=[],this._maxLabelSize=0,this._totalTitleSize=0,this._titleSize=0,this._setTitle(),x=l.getExplicitlySized.apply(this,[e]);for(;f0?s=o.shift():(s=i.createElement("span"),s.className=e.Lang.trim([s.className,"axisLabel"].join(" ")),this.get("contentBox").append(s)),i.createElementNS||s.style.filter&&(s.style.filter=null),s.style.display="block",s.style.whiteSpace="nowrap",s.style.position="absolute";for(r in n)n.hasOwnProperty(r)&&!u.hasOwnProperty(r)&&(s.style[r]=n[r]);return s},_createLabelCache:function(){if(this._labels)while(this._labels.length>0)this._labelCache.push(this._labels.shift());else this._clearLabelCache();this._labels=[]},_clearLabelCache:function(){if(this._labelCache){var t=this._labelCache.length,n=0,r;for(;n-1&&!isNaN(l)&&(f="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(l*100)+")"),r!==0?(c.rotate(r),p=c.getContentRect(n.labelWidth,n.labelHeight),c.init(),c.translate(p.left,p.top),c.translate(o,a),this._simulateRotateWithTransformOrigin(c,r,h,n.labelWidth,n.labelHeight),f?f+=" ":f="",f+=c.toFilterText(),t.style.left=c.dx+"px",t.style.top=c.dy+"px"):(t.style.left=o+"px",t.style.top=a+"px"),f&&(t.style.filter=f))},_simulateRotateWithTransformOrigin:function(e,t,n,r,i){var s=n[0]*r,o=n[1]*i;s=isNaN(s)?0:s,o=isNaN(o)?0:o,e.translate(s,o),e.rotate(t),e.translate(-s,-o)},getMaxLabelBounds:function(){return this._getLabelBounds(this.getMaximumValue())},getMinLabelBounds:function(){return this._getLabelBounds(this.getMinimumValue())},_getLabelBounds:function(t){var n=this._layout,r=this.get("styles").label,i=new e.Matrix,s,o=this._getTextRotationProps(r);return o.transformOrigin=n._getTransformOrigin(o.rot),s=this.getLabel({x:0,y:0},r),this.get("appendLabelFunction")(s,this.get("labelFunction").apply(this,[t,this.get("labelFormat")])),o.labelWidth=s.offsetWidth,o.labelHeight=s.offsetHeight,this._removeChildren(s),e.Event.purgeElement(s,!0),s.parentNode.removeChild(s),o.x=0,o.y=0,n._setRotationCoords(o),i.translate(o.x,o.y),this._simulateRotateWithTransformOrigin(i,o.rot,o.transformOrigin,o.labelWidth,o.labelHeight),i.getContentRect(o.labelWidth,o.labelHeight)},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},destructor:function(){var e=this.get("contentBox").getDOMNode(),t=this.get("labels"),n=this.get("graphic"),r,i=t?t.length:0;if(i>0)while(t.length>0)r=t.shift(),this._removeChildren(r),e.removeChild(r),r=null;n&&n.destroy()},_maxLabelSize:0,_setText:function(e,t){e.innerHTML="",s.isNumber(t)?t+="":t||(t=""),o(t)&&(t=i.createTextNode(t)),e.appendChild(t)}},{ATTRS:{width:{lazyAdd:!1,getter:function(){return this._explicitWidth?this._explicitWidth:this._calculatedWidth},setter:function(e){return this._explicitWidth=e,e}},height:{lazyAdd:!1,getter:function(){return this._explicitHeight?this._explicitHeight:this._calculatedHeight},setter:function(e){return this._explicitHeight=e,e}},calculatedWidth:{getter:function(){return this._calculatedWidth},setter:function(e){return this._calculatedWidth=e,e}},calculatedHeight:{getter:function(){return this._calculatedHeight},setter:function(e){return this._calculatedHeight=e,e}},edgeOffset:{value:0},graphic:{},path:{readOnly:!0,getter:function(){if(!this._path){var e=this.get("graphic");e&&(this._path=e.addShape({type:"path"}))}return this._path}},tickPath:{readOnly:!0,getter:function(){if(!this._tickPath){var e=this.get("graphic");e&&(this._tickPath=e.addShape({type:"path"}))}return this._tickPath}},node:{},position:{setter:function(e){var t=this._layoutClasses[e];return e&&e!="none"&&(this._layout=new t),e}},topTickOffset:{value:0},bottomTickOffset:{value:0},leftTickOffset:{value:0},rightTickOffset:{value:0},labels:{readOnly:!0,getter:function(){return this._labels}},tickPoints:{readOnly:!0,getter:function(){return this.get("position")=="none"?this.get("styles").majorUnit.count:this._tickPoints}},overlapGraph:{value:!0,validator:function(e){return s.isBoolean(e)}},labelFunctionScope:{},maxLabelSize:{getter:function(){return this._maxLabelSize},setter:function(e){return this._maxLabelSize=e,e}},title:{value:null},labelFunction:{value:function(e,t){return e}},appendLabelFunction:{valueFn:function(){return this._setText}},appendTitleFunction:{valueFn:function(){return this._setText}}}}),e.AxisType=e.Base.create("baseAxis",e.Axis,[],{initializer:function(){this.after("dataReady",e.bind(this._dataChangeHandler,this)),this.after("dataUpdate",e.bind(this._dataChangeHandler,this)),this.after("minimumChange",e.bind(this._keyChangeHandler,this)),this.after("maximumChange",e.bind(this._keyChangeHandler,this)),this.after("keysChange",this._keyChangeHandler),this.after("dataProviderChange",this._dataProviderChangeHandler),this.after("alwaysShowZeroChange",this._keyChangeHandler),this.after("roundingMethodChange",this._keyChangeHandler)},bindUI:function(){this.after("stylesChange",this._updateHandler),this.after("overlapGraphChange",this._updateHandler),this.after("positionChange",this._positionChangeHandler),this.after("widthChange",this._handleSizeChange),this.after("heightChange",this._handleSizeChange),this.after("calculatedWidthChange",this._handleSizeChange),this.after("calculatedHeightChange",this._handleSizeChange)},_dataProviderChangeHandler:function(e){var t=this.get("keyCollection").concat(),n=this.get("keys"),r;if(n)for(r in n)n.hasOwnProperty(r)&&delete n[r];t&&t.length&&this.set("keys",t)},GUID:"yuibaseaxis",_type:null,_setMaximum:null,_dataMaximum:null,_setMinimum:null,_data:null,_updateTotalDataFlag:!0,_dataReady:!1,addKey:function(e){this.set("keys",e)},_getKeyArray:function(e,t){var n=0,r,i=[],s=t.length;for(;n0){r=e.length,t=n=e[0];if(r>1)for(s=1;s=t?(i=Math.floor((r/2-t)/(Math.pow(10,n-1)/2)),t=r/2-i*Math.pow(10,n-1)/2):t=r,isNaN(t)?e:t},_updateMinAndMax:function(){var e=this.get("data"),t,n,r,i,o=0,u,a=this.get("setMax"),f=this.get("setMin");if(!a||!f){if(e&&e.length&&e.length>0){r=e.length;for(;o=0,u=t>0,a,f,l,c,h,p,d,v=this.getTotalMajorUnits()-1,m=this.get("alwaysShowZero"),g=this.get("roundingMethod"),y=(t-e)/v>=1;if(g)if(g=="niceNumber"){i=this._getMinimumUnit(t,e,v);if(o&&u)(m||e=0)h--,c++,p=Math.ceil(t/c),d=Math.floor(e/h)*-1;h>0?t=d*c:t=e+i*v}else if(r){while(p=0)h++,c--,d=Math.floor(e/h)*-1,p=Math.ceil(t/c);c>0?e=p*h*-1:e=t-i*v}else i=Math.max(p,d),i=this._getNiceNumber(i),t=i*c,e=i*h*-1}else r?e=t-i*v:n?t=e+i*v:(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i));else n?m?t=0:t=e+i*v:r?e=t-i*v:m||t===0||t+i>0?(t=0,i=this._getMinimumUnit(t,e,v),e=t-i*v):(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i))}else g=="auto"?o&&u?((m||e<(t-e)/v)&&!n&&(e=0),i=(t-e)/v,y&&(i=Math.ceil(i)),t=e+i*v):u&&!o?m?(c=Math.round(v/(-1*e/t+1)),c=Math.max(Math.min(c,v-1),1),h=v-c,y?(p=Math.ceil(t/c),d=Math.floor(e/h)*-1):(p=t/c,d=e/h*-1),i=Math.max(p,d),t=i*c,e=i*h*-1):(i=(t-e)/v,y&&(i=Math.ceil(i)),e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i)):(i=(t-e)/v,y&&(i=Math.ceil(i)),m||t===0||t+i>0?(t=0,i=(t-e)/v,y&&Math.ceil(i),e=t-i*v):(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i))):!isNaN(g)&&isFinite(g)&&(i=g,s=i*v,a=t-e>s,l=this._roundDownToNearest(e,i),f=this._roundUpToNearest(t,i),r?e=t-s:n?t=e+s:o&&u?(m||l<=0?e=0:e=l,t=e+s):u&&!o?(e=l,t=f):(m||f>=0?t=0:t=f,e=t-s));this._dataMaximum=t,this._dataMinimum=e},getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=(r-n)/(t-1),s,o=this.get("roundingMethod");return t-=1,e===0?s=n:e===t?s=r:(s=e*i,o=="niceNumber"&&(s=this._roundToNearest(s,i)),s+=n),parseFloat(s)},_roundToNearest:function(e,t){t=t||1;if(t===0)return e;var n=Math.round(this._roundToPrecision(e/t,10))*t;return this._roundToPrecision(n,10)},_roundUpToNearest:function(e,t){return t=t||1,t===0?e:Math.ceil(this._roundToPrecision(e/t,10))*t},_roundDownToNearest:function(e,t){return t=t||1,t===0?e:Math.floor(this._roundToPrecision(e/t,10))*t},_roundToPrecision:function(e,t){t=t||0;var n=Math.pow(10,t);return Math.round(n*e)/n},_hasDataOverflow:function(){var e,t,n;return this.get("setMin")||this.get("setMax")?!0:(e=this.get("roundingMethod"),t=this._actualMinimum,n=this._actualMaximum,s.isNumber(e)&&(s.isNumber(n)&&n>this._dataMaximum||s.isNumber(t)&&t=0?n+=u:r+=u}n>0?e=Math.max(e,n):e=Math.max(e,r),r<0?t=Math.min(t,r):t=Math.min(t,n)}this._actualMaximum=e,this._actualMinimum=t,l&&(e=this._setMaximum),f&&(t=this._setMinimum),this._roundMinAndMax(t,e,f,l)}}),e.StackedAxis=E,S.NAME="timeAxis",S.ATTRS={setMax:{readOnly:!0,getter:function(){var e=this._getNumber(this._setMaximum);return s.isNumber(e)}},setMin:{readOnly:!0,getter:function(){var e=this._getNumber(this._setMinimum);return s.isNumber(e)}},maximum:{getter:function(){var e=this._getNumber(this._setMaximum);return s.isNumber(e)||(e=this._getNumber(this.get("dataMaximum"))),parseFloat(e)},setter:function(e){return this._setMaximum=this._getNumber(e),e}},minimum:{getter:function(){var e=this._getNumber(this._setMinimum);return s.isNumber(e)||(e=this._getNumber(this.get("dataMinimum"))),parseFloat(e)},setter:function(e){return this._setMinimum=this._getNumber(e),e}},labelFunction:{value:function(t,n){return t=e.DataType.Date.parse(t),n?e.DataType.Date.format(t,{format:n}):t}},labelFormat:{value:"%b %d, %y"}},e.extend(S,e.AxisType,{formatLabel:function(t,n){return t=e.DataType.Date.parse(t),n?e.DataType.Date.format(t,{format:n}):t},GUID:"yuitimeaxis",_dataType:"time",getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=this.get("position"),s,o;return t-=1,s=(r-n)/t*e,i=="bottom"||i=="top"?o=n+s:o=r-s,o},_getKeyArray:function(e,t){var n,r=[],i=0,o,u=t.length;for(;i0?(p=r[e-1].get("stackedXCoords"),d=r[e-1].get("stackedYCoords"),a=p.length):a=o.length;for(;i0){l=p[i];if(!s.isNumber(l)){c=e;while(c>-1&&!s.isNumber(l))c-=1,c>-1?l=r[c].get("stackedXCoords")[i]:l=this._leftOrigin}o[i]=o[i]+l}h[i]=o[i]}else v.push(i);this._cleanXNaN(h,u),a=v.length;if(a>0)for(i=0;i0?p[m]:this._leftOrigin,h[m]=Math.max(h[m],f);this.set("stackedXCoords",h),this.set("stackedYCoords",u)},_stackYCoords:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=n.get("height"),i=n.seriesTypes[t],o=0,u=this.get("xcoords"),a=this.get("ycoords"),f,l,c,h,p=a.concat(),d,v,m=[],g;e>0?(d=i[e-1].get("stackedXCoords"),v=i[e-1].get("stackedYCoords"),f=v.length):f=a.length;for(;o0){c=v[o];if(!s.isNumber(c)){h=e;while(h>-1&&!s.isNumber(c))h-=1,h>-1?c=i[h].get("stackedYCoords")[o]:c=this._bottomOrigin}a[o]=c-(r-a[o])}p[o]=a[o]}else m.push(o);this._cleanYNaN(u,p),f=m.length;if(f>0)for(o=0;o0?v[g]:r,p[g]=Math.min(p[g],l);this.set("stackedXCoords",u),this.set("stackedYCoords",p)},_cleanXNaN:function(e,t){var n,r,i,o,u,a,f,l,c=s.isNumber,h,p=0,d=t.length;for(;p0&&pi)t-=1,n=e[t];return n},_getNextValidCoordValue:function(e,t){var n,r=s.isNumber,i=e.length;while(!r(n)&&t0&&ps?e.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s):l>0&&e.lineTo(p+Math.cos(h)*l,d+Math.sin(h)*l),e.moveTo(r,i)},_getLineDefaults:function(){return{alpha:1,weight:6,lineType:"solid",dashLength:10,gapSpace:10,connectDiscontinuousPoints:!0,discontinuousType:"solid",discontinuousDashLength:10,discontinuousGapSpace:10}}},e.augment(C,e.Attribute),e.Lines=C,k.prototype={_getPath:function(){var e=this._path;return e||(e=this.get("graph").get("graphic").addShape({type:"path"}),this._path=e),e},_toggleVisible:function(e){this._path&&this._path.set("visible",e)},drawFill:function(e,t){if(e.length<1)return;var n=s.isNumber,r=e.length,i=e[0],o=t[0],u=i,a=o,f,l,c,h=!0,p=0,d=this.get("styles").area,v=this._getPath(),m=d.color||this._getDefaultColor(this.get("graphOrder"),"slice");v.clear(),v.set("fill",{color:m,opacity:d.alpha}),v.set("stroke",{weight:0});for(;p0){u=o[r-1].get("xcoords").concat().reverse(),a=o[r-1].get("ycoords").concat().reverse(),n=this.getCurveControlPoints(u,a),m=0,f=n.length,w.lineTo(u[0],a[0]);for(;m-1)n-=1,n>-1&&(s=e[n].get(i)[t]);return n},_getCoordsByOrderAndIndex:function(e,t,n,r){var i,s;return r=="vertical"?(i=n<0?this._leftOrigin:e[n].get("stackedXCoords")[t],s=this.get("stackedYCoords")[t]):(i=this.get("stackedXCoords")[t],s=n<0?this._bottomOrigin:e[n].get("stackedYCoords")[t]),[i,s]},_getStackedClosingPoints:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=this.get("direction"),i=n.seriesTypes[t],s,o,u=this.get("stackedXCoords"),a=this.get("stackedYCoords"),f,l,c,h,p,d,v,m,g,y,b,w;if(e<1)return this._getClosingPoints();l=i[e-1],p=l.get("stackedXCoords").concat(),d=l.get("stackedYCoords").concat(),r=="vertical"?(s=this._getFirstValidIndex(u),o=this._getLastValidIndex(u),c=l._getFirstValidIndex(p),h=l._getLastValidIndex(p)):(s=this._getFirstValidIndex(a),o=this._getLastValidIndex(a),c=l._getFirstValidIndex(d),h=l._getLastValidIndex(d)),h>=s&&c<=o?(c=Math.max(s,c),h=Math.min(o,h),p=p.slice(c,h+1),d=d.slice(c,h+1),f=c):f=o,m=[u[s]],g=[a[s]],y=s;while((isNaN(b)||bw&&(v=this._getCoordsByOrderAndIndex(i,y,w,r),m.push(v[0]),g.push(v[1])),v=this._getCoordsByOrderAndIndex(i,y,b,r),m.push(v[0]),g.push(v[1]),y+=1;p&&p.length>0&&h>s&&cw?(v=this._getCoordsByOrderAndIndex(i,y,w,r),m.push(v[0]),g.push(v[1])):b0){while(!r){if(this._markerCache.length<1){r=this._createMarker(e,t,n);break}r=this._markerCache.shift()}r.set(e)}else r=this._createMarker(e,t,n);return this._markers.push(r),r},_createMarker:function(t,n,r){var i=this.get("graphic"),s,o=e.clone(t);return i.set("autoDraw",!1),o.type=o.shape,s=i.addShape(o),s.addClass(p),s},_createMarkerCache:function(){this._groupMarker&&(this._groupMarker.destroy(),this._groupMarker=null),this._markers&&this._markers.length>0?this._markerCache=this._markers.concat():this._markerCache=[],this._markers=[]},_createGroupMarker:function(e){var t,n=this.get("markers"),r=e.border,i,s,o;if(n&&n.length>0){while(n.length>0)t=n.shift(),t.destroy();this.set("markers",[])}r.opacity=r.alpha,s={id:this.get("chart").get("id")+"_"+e.graphOrder,stroke:r,fill:e.fill,dimensions:e.dimensions,xvalues:e.xvalues,yvalues:e.yvalues},s.fill.opacity=e.fill.alpha,o=this._getGroupShape(e.shape),o&&(s.type=o),e.hasOwnProperty("radius")&&!isNaN(e.radius)&&(s.dimensions.radius=e.radius),this._groupMarker&&this._groupMarker.destroy(),i=this.get("graphic"),this._groupMarker=i.addShape(s),i._redraw()},_toggleVisible:function(e){var t,n=this.get("markers"),r=0,i;if(n){i=n.length;for(;r0)e=this._markerCache.shift(),e&&e.destroy()},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r,i,s=e.clone(this.get("styles").marker),o=this._getState(t),u=this.get("xcoords"),a=this.get("ycoords"),f=this._markers[n],l=o=="off"||!s[o]?s:s[o];l.fill.color=this._getItemColor(l.fill.color,n),l.border.color=this._getItemColor(l.border.color,n),l.stroke=l.border,f.set(l),r=l.width,i=l.height,f.set("x",u[n]-r/2),f.set("y",a[n]-i/2),f.set("visible",this.get("visible"))}},_getItemColor:function(e,t){return s.isArray(e)?e[t%e.length]:e},_setStyles:function(t){return t=this._parseMarkerStyles(t),e.Renderer.prototype._setStyles.apply(this,[t])},_parseMarkerStyles:function(e){if(e.marker){var t=this._getPlotDefaults();e.marker=this._mergeStyles(e.marker,t),e.marker.over&&(e.marker.over=this._mergeStyles(e.marker.over,e.marker)),e.marker.down&&(e.marker.down=this._mergeStyles(e.marker.down,e.marker))}return e},_getState:function(e){var t;switch(e){case"mouseout":t="off";break;case"mouseover":t="over";break;case"mouseup":t="over";break;case"mousedown":t="down"}return t},_stateSyles:null},e.augment(L,e.Attribute),e.Plots=L,A.prototype={drawSeries:function(){if(this.get("xcoords").length<1)return;var t=e.clone(this.get("styles").marker),n,r,i=this.get("xcoords"),o=this.get("ycoords"),u=0,a=i.length,f=o[0],l=this.get("type"),c=this.get("graph"),h=c.seriesTypes[l],p=h.length,d=0,v=0,m=0,g,y,b=this.get("order"),w=this.get("graphOrder"),E,S,x,T,N,C=null,k=null,L=[],A=[],O,M,_,D,P={width:[],height:[]},H=[],B=[],j=this.get("groupMarkers");s.isArray(t.fill.color)&&(C=t.fill.color.concat()),s.isArray(t.border.color)&&(k=t.border.color.concat()),this.get("direction")=="vertical"?(x="height",T="width"):(x="width",T="height"),n=t[x],r=t[T],this._createMarkerCache();for(;uu&&(m=d);v=a*d,this._maxSize=c.get(x),v>this._maxSize&&(g=c.get(x)/v,d*=g,m*=g,n*=g,n=Math.max(n,1),this._maxSize=n),m-=d/2;for(u=0;u0?(f=N.top,E=N.left,j?(P[x][u]=n,P[T][u]=N.calculatedSize,H.push(E),B.push(f)):(t[x]=n,t[T]=N.calculatedSize,t.x=E,t.y=f,C&&(t.fill.color=C[u%C.length]),k&&(t.border.color=k[u%k.length]),S=this.getMarker(t,w,u))):j||this._markers.push(null)}this.set("xMarkerPlane",L),this.set("yMarkerPlane",A),j?this._createGroupMarker({fill:t.fill,border:t.border,dimensions:P,xvalues:H,yvalues:B,shape:t.shape}):this._clearMarkerCache()},_defaultFillColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getPlotDefaults:function(){var e={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}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},e.Histogram=A,e.CartesianSeries=e.Base.create("cartesianSeries",e.Base,[e.Renderer],{_xDisplayName:null,_yDisplayName:null,_leftOrigin:null,_bottomOrigin:null,render:function(){this._setCanvas(),this.addListeners(),this.set("rendered",!0),this.validate()},addListeners:function(){var t=this.get("xAxis"),n=this.get("yAxis");t&&(this._xDataReadyHandle=t.after("dataReady",e.bind(this._xDataChangeHandler,this)),this._xDataUpdateHandle=t.after("dataUpdate",e.bind(this._xDataChangeHandler,this))),n&&(this._yDataReadyHandle=n.after("dataReady",e.bind(this._yDataChangeHandler,this)),this._yDataUpdateHandle=n.after("dataUpdate",e.bind(this._yDataChangeHandler,this))),this._xAxisChangeHandle=this.after("xAxisChange",this._xAxisChangeHandler),this._yAxisChangeHandle=this.after("yAxisChange",this._yAxisChangeHandler),this._stylesChangeHandle=this.after("stylesChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._widthChangeHandle=this.after("widthChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._heightChangeHandle=this.after("heightChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._visibleChangeHandle=this.after("visibleChange",this._handleVisibleChange)},_xAxisChangeHandler:function(t){var n=this.get("xAxis");n.after("dataReady",e.bind(this._xDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._xDataChangeHandler,this))},_yAxisChangeHandler:function(t){var n=this.get("yAxis");n.after("dataReady",e.bind(this._yDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._yDataChangeHandler,this))},GUID:"yuicartesianseries",_xDataChangeHandler:function(e){var t=this._updateAxisData();t&&this.draw()},_yDataChangeHandler:function(e){var t=this._updateAxisData();t&&this.draw()},_updateAxisData:function(){var e=this.get("xAxis"),t=this.get("yAxis"),n=this.get("xKey"),r=this.get("yKey"),i,s;return!e||!t||!n||!r?!1:(s=e.getDataByKey(n),i=t.getDataByKey(r),!s||!i?!1:(this.set("xData",s.concat()),this.set("yData",i.concat()),!0))},validate:function(){this.get("xData")&&this.get("yData")||this._updateAxisData()?this.draw():this.fire("drawingComplete")},_setCanvas:function(){var e=this.get("graph"),t=e.get("graphic");this.set("graphic",t)},setAreaData:function(){var e=s.isNumber,t,n,r=this.get("graph"),i=r.get("width"),o=r.get("height"),u=this.get("xAxis"),a=this.get("yAxis"),f=this.get("xData").concat(),l=this.get("yData").concat(),c,h,p=u.getEdgeOffset(f.length,i),d=a.getEdgeOffset(l.length,o),v=this.get("styles").padding,m=v.left,g=v.top,y=i-(m+v.right+p),b=o-(g+v.bottom+d),w=[],E=[],S=u.get("maximum"),x=u.get("minimum"),T=a.get("maximum"),N=a.get("minimum"),C=y/(S-x),k=b/(T-N),L,A=this.get("direction"),O=0,M=[],_=[],D=this.get("xMarkerPlaneOffset"),P=this.get("yMarkerPlaneOffset"),H=this.get("graphic");H.set("width",i),H.set("height",o),L=f.length,p*=.5,d*=.5,A==="vertical"&&(l=l.reverse()),this._leftOrigin=Math.round((0-x)*C+m+p),this._bottomOrigin=Math.round(b+g+d),N<0&&(this._bottomOrigin=this._bottomOrigin-(0-N)*k);for(;Or)n-=1,t=e[n];return n},draw:function(){var e=this.get("graph"),t=e.get("width"),n=e.get("height");if(this.get("rendered")&&isFinite(t)&&isFinite(n)&&t>0&&n>0&&(this.get("xData")&&this.get("yData")||this._updateAxisData())){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.setAreaData(),this.get("xcoords")&&this.get("ycoords")&&this.drawSeries(),this._drawing=!1,this._callLater?this.draw():(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(e,t){var n={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},r=n[t],i=r.length;return e=e||0,e>=i&&(e%=i),t=t||"fill",n[t][e]},_handleVisibleChange:function(e){this._toggleVisible(this.get("visible"))},getTotalValues:function(){var e=this.get("valueAxis").getTotalByKey(this.get("valueKey"));return e},destructor:function(){var t,n=this.get("markers");this.get("rendered")&&(this._xDataReadyHandle&&this._xDataReadyHandle.detach(),this._xDataUpdateHandle&&this._xDataUpdateHandle.detach(),this._yDataReadyHandle&&this._yDataReadyHandle.detach(),this._yDataUpdateHandle&&this._yDataUpdateHandle.detach(),this._xAxisChangeHandle.detach(),this._yAxisChangeHandle.detach(),this._stylesChangeHandle.detach(),this._widthChangeHandle.detach(),this._heightChangeHandle.detach(),this._visibleChangeHandle.detach());while(n&&n.length>0)t=n.shift(),t&&t instanceof e.Shape&&t.destroy();this._path&&(this._path.destroy(),this._path=null),this._lineGraphic&&(this._lineGraphic.destroy(),this._lineGraphic=null),this._groupMarker&&(this._groupMarker.destroy(),this._groupMarker=null)}},{ATTRS:{xDisplayName:{getter:function(){return this._xDisplayName||this.get("xKey")},setter:function(e){return this._xDisplayName=e.toString(),e}},yDisplayName:{getter:function(){return this._yDisplayName||this.get("yKey")},setter:function(e){return this._yDisplayName=e.toString(),e}},categoryDisplayName:{lazyAdd:!1,getter:function(){return this.get("direction")=="vertical"?this.get("yDisplayName"):this.get("xDisplayName")},setter:function(e){return this.get("direction")=="vertical"?this._yDisplayName=e:this._xDisplayName=e,e}},valueDisplayName:{lazyAdd:!1,getter:function(){return this.get("direction")=="vertical"?this.get("xDisplayName"):this.get("yDisplayName")},setter:function(e){return this.get("direction")=="vertical"?this._xDisplayName=e:this._yDisplayName=e,e}},type:{value:"cartesian"},order:{},graphOrder:{},xcoords:{},ycoords:{},chart:{readOnly:!0,getter:function(){return this.get("graph").get("chart")}},graph:{},xAxis:{},yAxis:{},xKey:{setter:function(e){return e.toString()}},yKey:{setter:function(e){return e.toString()}},xData:{},yData:{},rendered:{value:!1},width:{readOnly:!0,getter:function(){this.get("graph").get("width")}},height:{readOnly:!0,getter:function(){this.get("graph").get("height")}},visible:{value:!0},xMarkerPlane:{},yMarkerPlane:{},xMarkerPlaneOffset:{getter:function(){var e=this.get("styles").marker;return e&&e.width&&isFinite(e.width)?e.width*.5:this._defaultPlaneOffset}},yMarkerPlaneOffset:{getter:function(){var e=this.get("styles").marker;return e&&e.height&&isFinite(e.height)?e.height*.5:this._defaultPlaneOffset}},direction:{value:"horizontal"},groupMarkers:{getter:function(){return this._groupMarkers===undefined?this.get("graph").get("groupMarkers"):this._groupMarkers},setter:function(e){return this._groupMarkers=e,e}}}}),e.MarkerSeries=e.Base.create("markerSeries",e.CartesianSeries,[e.Plots],{drawSeries:function(){this.drawPlots()},_setStyles:function(t){return t.marker||(t={marker:t}),t=this._parseMarkerStyles(t),e.MarkerSeries.superclass._mergeStyles.apply(this,[t,this._getDefaultStyles()])},_getDefaultStyles:function(){var t=this._mergeStyles({marker:this._getPlotDefaults()},e.MarkerSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"marker"}}}),e.LineSeries=e.Base.create("lineSeries",e.CartesianSeries,[e.Lines],{drawSeries:function(){this.drawLines()},_setStyles:function(t){return t.line||(t={line:t}),e.LineSeries.superclass._setStyles.apply(this,[t])},_getDefaultStyles:function(){var t=this._mergeStyles({line:this._getLineDefaults()},e.LineSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"line"}}}),e.SplineSeries=e.Base.create("splineSeries",e.LineSeries,[e.CurveUtil,e.Lines],{drawSeries:function(){this.drawSpline()}},{ATTRS:{type:{value:"spline"}}}),e.StackedSplineSeries=e.Base.create("stackedSplineSeries",e.SplineSeries,[e.StackingUtil],{setAreaData:function(){e.StackedSplineSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedSpline"}}}),e.StackedMarkerSeries=e.Base.create("stackedMarkerSeries",e.MarkerSeries,[e.StackingUtil],{setAreaData:function(){e.StackedMarkerSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedMarker"}}}),e.ColumnSeries=e.Base.create("columnSeries",e.MarkerSeries,[e.Histogram],{_getMarkerDimensions:function(e,t,n,r){var i={left:e+r};return this._bottomOrigin>=t?(i.top=t,i.calculatedSize=this._bottomOrigin-i.top):(i.top=this._bottomOrigin,i.calculatedSize=t-this._bottomOrigin),i},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r=e.clone(this.get("styles").marker),i,s=this._getState(t),o=this.get("xcoords"),u=this.get("ycoords"),a=this._markers[n],f,l=this.get("graph"),c,h=l.seriesTypes[this.get("type")],p=h.length,d=0,v=0,m,g=0,y=[],b=this.get("order"),w;i=s=="off"||!r[s]?e.clone(r):e.clone(r[s]),i.fill.color=this._getItemColor(i.fill.color,n),i.border.color=this._getItemColor(i.border.color,n),w=this._getMarkerDimensions(o[n],u[n],r.width,v),i.height=w.calculatedSize,i.width=Math.min(this._maxSize,i.width),a.set(i);for(;gg&&(v=d),v-=d/2;for(g=0;g=this._leftOrigin?(i.left=this._leftOrigin,i.calculatedSize=e-i.left):(i.left=e,i.calculatedSize=this._leftOrigin-e),i},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r=e.clone(this.get("styles").marker),i,s=this._getState(t),o=this.get("xcoords"),u=this.get("ycoords"),a=this._markers[n],f,l=this.get("graph"),c=l.seriesTypes[this.get("type")],h=c.length,p,d=0,v=0,m,g=0,y=[],b=this.get("order"),w;i=s=="off"||!r[s]?r:r[s],i.fill.color=this._getItemColor(i.fill.color,n),i.border.color=this._getItemColor(i.border.color,n),w=this._getMarkerDimensions(o[n],u[n],r.height,v),i.width=w.calculatedSize,i.height=Math.min(this._maxSize,i.height),a.set(i);for(;gg&&(v=d),v-=d/2;for(g=0;gthis.get("width")&&(d=this.width/N,r*=d,r=Math.max(r,1));if(!T){E=p[v-1],S=E.get("negativeBaseValues"),x=E.get("positiveBaseValues");if(!S||!x)T=!0,x=[],S=[]}else S=[],x=[];this.set("negativeBaseValues",S),this.set("positiveBaseValues",x);for(a=0;athis._bottomOrigin?(x[a]=this._bottomOrigin,S[a]=l,l-=i):(x[a]=l,S[a]=l)):l>this._bottomOrigin?(l+=S[a]-this._bottomOrigin,i=l-S[a],S[a]=l,l-=i):l<=this._bottomOrigin&&(l=x[a]-(this._bottomOrigin-l),i=x[a]-l,x[a]=l),!isNaN(i)&&i>0?(g-=r/2,A?(C.width[a]=r,C.height[a]=i,k.push(g),L.push(l)):(n.width=r,n.height=i,n.x=g,n.y=l,b&&(n.fill.color=b[a%b.length]),w&&(n.border.color=w[a%w.length]),y=this.getMarker(n,m,a))):A||this._markers.push(null)}A?this._createGroupMarker({fill:n.fill,border:n.border,dimensions:C,xvalues:k,yvalues:L,shape:n.shape}):this._clearMarkerCache()},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r,i,o=this._getState(t),u=this.get("xcoords"),a=this._markers[n],f=0,l,c;r=this.get("styles").marker,f=r.width*.5,i=o=="off"||!r[o]?e.clone(r):e.clone(r[o]),i.height=a.get("height"),i.x=u[n]-f,i.y=a.get("y"),i.id=a.get("id"),l=i.fill.color,c=i.border.color,s.isArray(l)?i.fill.color=l[n%l.length]:i.fill.color=this._getItemColor(i.fill.color,n),s.isArray(c)?i.border.color=c[n%c.length]:i.border.color=this._getItemColor(i.border.color,n),a.set(i)}},_getPlotDefaults:function(){var e={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}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},{ATTRS:{type:{value:"stackedColumn"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}}),e.StackedBarSeries=e.Base.create("stackedBarSeries",e.BarSeries,[e.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1)return;var t=s.isNumber,n=e.clone(this.get("styles").marker),r=n.width,i=n.height,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c=this.get("type"),h=this.get("graph"),p=h.seriesTypes[c],d,v=this.get("order"),m=this.get("graphOrder"),g,y,b,w,E,S,x,T=v===0,N=f*i,C={width:[],height:[]},k=[],L=[],A=this.get("groupMarkers");s.isArray(n.fill.color)&&(S=n.fill.color.concat()),s.isArray(n.border.color)&&(x=n.border.color.concat()),this._createMarkerCache(),N>this.get("height")&&(d=this.height/N,i*=d,i=Math.max(i,1));if(!T){b=p[v-1],w=b.get("negativeBaseValues"),E=b.get("positiveBaseValues");if(!w||!E)T=!0,E=[],w=[]}else w=[],E=[];this.set("negativeBaseValues",w),this.set("positiveBaseValues",E);for(a=0;athis._leftOrigin?(E[a]=g,w[a]=this._leftOrigin,g-=r):g=this._leftOrigin&&(g+=E[a]-this._leftOrigin,r=g-E[a],E[a]=g,g-=r),!isNaN(r)&&r>0?(l-=i/2,A?(C.width[a]=r,C.height[a]=i,k.push(g),L.push(l)):(n.width=r,n.height=i,n.x=g,n.y=l,S&&(n.fill.color=S[a%S.length]),x&&(n.border.color=x[a%x.length]),y=this.getMarker(n,m,a))):A||this._markers.push(null)}A?this._createGroupMarker({fill:n.fill,border:n.border,dimensions:C,xvalues:k,yvalues:L,shape:n.shape}):this._clearMarkerCache()},updateMarkerState:function(t,n){if(this._markers[n]){var r=this._getState(t),i=this.get("ycoords"),o=this._markers[n],u=this.get("styles").marker,a=u.height,f=r=="off"||!u[r]?e.clone(u):e.clone(u[r]),l,c;f.y=i[n]-a/2,f.x=o.get("x"),f.width=o.get("width"),f.id=o.get("id"),l=f.fill.color,c=f.border.color,s.isArray(l)?f.fill.color=l[n%l.length]:f.fill.color=this._getItemColor(f.fill.color,n),s.isArray(c)?f.border.color=c[n%c.length]:f.border.color=this._getItemColor(f.border.color,n),o.set(f)}},_getPlotDefaults:function(){var e={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}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},{ATTRS:{type:{value:"stackedBar"},direction:{value:"vertical"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}}),e.PieSeries=e.Base.create("pieSeries",e.MarkerSeries,[],{_map:null,_image:null,_setMap:function(){var e="pieHotSpotMapi_"+Math.round(1e5*Math.random()),t=this.get("graph").get("contentBox"),n;if(this._image){t.removeChild(this._image);while(this._areaNodes&&this._areaNodes.length>0)n=this._areaNodes.shift(),this._map.removeChild(n);t.removeChild(this._map)}this._image=i.createElement("img"),this._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==",t.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=i.createElement("map"),this._map.style.zIndex=5,t.appendChild(this._map),this._map.setAttribute("name",e),this._map.setAttribute("id",e),this._areaNodes=[]},_categoryDisplayName:null,_valueDisplayName:null,addListeners:function(){var t=this.get("categoryAxis"),n=this.get("valueAxis");t&&(t.after("dataReady",e.bind(this._categoryDataChangeHandler,this)),t.after("dataUpdate",e.bind(this._categoryDataChangeHandler,this))),n&&(n.after("dataReady",e.bind(this._valueDataChangeHandler,this)),n.after("dataUpdate",e.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=!0},_categoryAxisChangeHandler:function(t){var n=this.get("categoryAxis");n.after("dataReady",e.bind(this._categoryDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._categoryDataChangeHandler,this))},_valueAxisChangeHandler:function(t){var n=this.get("valueAxis");n.after("dataReady",e.bind(this._valueDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._valueDataChangeHandler,this))},GUID:"pieseries",_categoryDataChangeHandler:function(e){this._rendered&&this.get("categoryKey")&&this.get("valueKey")&&this.draw()},_valueDataChangeHandler:function(e){this._rendered&&this.get("categoryKey")&&this.get("valueKey")&&this.draw()},draw:function(){var e=this.get("graph"),t=e.get("width"),n=e.get("height");if(isFinite(t)&&isFinite(n)&&t>0&&n>0){this._rendered=!0;if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.drawSeries(),this._drawing=!1,this._callLater?this.draw():this.fire("drawingComplete")}},drawPlots:function(){var t=this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),n=this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),r=0,i=t.length,s=this.get("styles").marker,o=s.fill.colors,u=s.fill.alphas||["1"],a=s.border.colors,f=[s.border.weight],l=[s.border.alpha],c=f.concat(),h=a.concat(),p=l.concat(),d,v,m=s.padding,g=this.get("graph"),y=Math.min(g.get("width"),g.get("height")),b=y-(m.left+m.right),w=y-(m.top+m.bottom),E=-90,S=b/2,x=w/2,T=Math.min(S,x),N=0,C,k=0,L,A,O,M,_,D=this.get("graphOrder"),P=e.Graphic.NAME=="canvasGraphic";for(;N=i&&(e%=i),t=t||"fill",n[t][e]}},{ATTRS:{type:{value:"pie"},order:{},graph:{},categoryAxis:{value:null,validator:function(e){return e!==this.get("categoryAxis")}},valueAxis:{value:null,validator:function(e){return e!==this.get("valueAxis")}},categoryKey:{value:null,validator:function(e){return e!==this.get("categoryKey")}},valueKey:{value:null,validator:function(e){return e!==this.get("valueKey")}},categoryDisplayName:{setter:function(e){return this._categoryDisplayName=e,e},getter:function(){return this._categoryDisplayName||this.get("categoryKey")}},valueDisplayName:{setter:function(e){return this._valueDisplayName=e,e},getter:function(){return this._valueDisplayName||this.get("valueKey")}},slices:null}}),e.Gridlines=e.Base.create("gridlines",e.Base,[e.Renderer],{_path:null,remove:function(){var e=this._path;e&&e.destroy()},draw:function(){this.get("axis")&&this.get("graph")&&this._drawGridlines()},_drawGridlines:function(){var e,t=this.get("axis"),n=t.get("position"),r,i=0,s,o=this.get("direction"),u=this.get("graph"),a=u.get("width"),f=u.get("height"),l=this.get("styles").line,c=l.color,h=l.weight,p=l.alpha,d=o=="vertical"?this._verticalLine:this._horizontalLine;if(isFinite(a)&&isFinite(f)&&a>0&&f>0){if(n!="none"&&t&&t.get("tickPoints"))r=t.get("tickPoints"),s=r.length;else{r=[],s=t.get("styles").majorUnit.count;for(;ie&&(n=t[e]),n},getSeriesByKey:function(e){var t=this._seriesDictionary,n;return t&&t.hasOwnProperty(e)&&(n=t[e]),n},addDispatcher:function(e){this._dispatchers||(this._dispatchers=[]),this._dispatchers.push(e)},_seriesCollection:null,_seriesDictionary:null,_parseSeriesCollection:function(t){if(!t)return;var n=t.length,r=0,i,s;this._seriesCollection=[],this._seriesDictionary={},this.seriesTypes=[];for(;r-1&&this._dispatchers.splice(i,1),this._dispatchers.length<1&&(r=this.get("graphic"),r.get("autoDraw")||r._redraw(),this.fire("chartRendered"))},_getDefaultStyles:function(){var e={background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return e},destructor:function(){this._graphic&&(this._graphic.destroy(),this._graphic=null),this._background&&(this._background.get("graphic").destroy(),this._background=null),this._gridlines&&(this._gridlines.get("graphic").destroy(),this._gridlines=null)}},{ATTRS:{x:{setter:function(e){return this.get("boundingBox").setStyle("left",e+"px"),e}},y:{setter:function(e){return this.get("boundingBox").setStyle("top",e+"px"),e}},chart:{},seriesCollection:{getter:function(){return this._seriesCollection},setter:function(e){return this._parseSeriesCollection(e),this._seriesCollection}},showBackground:{value:!0},seriesDictionary:{readOnly:!0,getter:function(){return this._seriesDictionary}},horizontalGridlines:{value:null,setter:function(t){var n=this.get("horizontalGridlines");n&&n instanceof e.Gridlines&&n.remove();if(t instanceof e.Gridlines)return n=t,t.set("graph",this),t;if(t&&t.axis)return n=new e.Gridlines({direction:"horizontal",axis:t.axis,graph:this,styles:t.styles}),n}},verticalGridlines:{value:null,setter:function(t){var n=this.get("verticalGridlines");n&&n instanceof e.Gridlines&&n.remove();if(t instanceof e.Gridlines)return n=t,t.set("graph",this),t;if(t&&t.axis)return n=new e.Gridlines({direction:"vertical",axis:t.axis,graph:this,styles:t.styles}),n}},background:{getter:function(){return this._background||(this._backgroundGraphic=new e.Graphic({render:this.get("contentBox")}),this._backgroundGraphic.get("node").style.zIndex=0,this._background=this._backgroundGraphic.addShape({type:"rect"})),this._background}},gridlines:{readOnly:!0,getter:function(){return this._gridlines||(this._gridlinesGraphic=new e.Graphic({render:this.get("contentBox")}),this._gridlinesGraphic.get("node").style.zIndex=1,this._gridlines=this._gridlinesGraphic.addShape({type:"path"})),this._gridlines}},graphic:{readOnly:!0,getter:function(){return this._graphic||(this._graphic=new e.Graphic({render:this.get("contentBox")}),this._graphic.get("node").style.zIndex=2,this._graphic.set("autoDraw",!1)),this._graphic}},groupMarkers:{value:!1}}}),O.ATTRS={dataProvider:{lazyAdd:!1,valueFn:function(){var e=[];return this._seriesKeysExplicitlySet||(this._seriesKeys=this._buildSeriesKeys(e)),e},setter:function(e){var t=this._setDataValues(e);return this._seriesKeysExplicitlySet||(this._seriesKeys=this._buildSeriesKeys(t)),t}},seriesKeys:{getter:function(){return this._seriesKeys},setter:function(e){return this._seriesKeysExplicitlySet=!0,this._seriesKeys=e,e}},ariaLabel:{value:"Chart Application",setter:function(e){var t=this.get("contentBox");return t&&t.setAttribute("aria-label",e),e}},ariaDescription:{value:"Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",setter:function(e){return this._description&&(this._description.setContent(""),this._description.appendChild(i.createTextNode(e))),e}},tooltip:{valueFn:"_getTooltip",setter:function(e){return this._updateTooltip(e)}},categoryKey:{value:"category"},categoryType:{value:"category"},interactionType:{value:"marker"},axesCollection:{},graph:{valueFn:"_getGraph"},groupMarkers:{value:!1}},O.prototype={_groupMarkersChangeHandler:function(e){var t=this.get("graph"),n=e.newVal;t&&t.set("groupMarkers",n)},_itemRendered:function(t){this._itemRenderQueue=this._itemRenderQueue.splice(1+e.Array.indexOf(this._itemRenderQueue,t.currentTarget),1),this._itemRenderQueue.length<1&&this._redraw()},_getGraph:function(){var t=new e.Graph({chart:this,groupMarkers:this.get("groupMarkers")});return t.after("chartRendered",e.bind(function(e){this.fire("chartRendered")},this)),t},getSeries:function(e){var t=null,n=this.get("graph");return n&&(s.isNumber(e)?t=n.getSeriesByIndex(e):t=n.getSeriesByKey(e)),t},getAxisByKey:function(e){var t,n=this.get("axes");return n&&n.hasOwnProperty(e)&&(t=n[e]),t},getCategoryAxis:function(){var e,t=this.get("categoryKey"),n=this.get("axes");return n.hasOwnProperty(t)&&(e=n[t]),e},_direction:"horizontal",_dataProvider:null,_setDataValues:function(e){if(s.isArray(e[0])){var t,n=[],r=e[0],i=0,o=r.length,u,a=e.length;for(;i"),n=e.UA.ie,r=n&&n<8?"rect(1px 1px 1px 1px)":"rect(1px, 1px, 1px, 1px)";return t.setStyle("position","absolute"),t.setStyle("height","1px"),t.setStyle("width","1px"),t.setStyle("overflow","hidden"),t.setStyle("clip",r),t},syncUI:function(){this._redraw()},bindUI:function(){this.after("tooltipChange",e.bind(this._tooltipChangeHandler,this)),this.after("widthChange",this._sizeChanged),this.after("heightChange",this._sizeChanged),this.after("groupMarkersChange",this._groupMarkersChangeHandler);var t=this.get("tooltip"),n="mouseout",o="mouseover",u=this.get("contentBox"),a=this.get("interactionType"),f=0,l,c="."+p,h=r&&"ontouchstart"in r&&!(e.UA.chrome&&e.UA.chrome<6);e.on("keydown",e.bind(function(e){var t=e.keyCode,n=parseFloat(t),r;n>36&&n<41&&(e.halt(),r=this._getAriaMessage(n),this._liveRegion.setContent(""),this._liveRegion.appendChild(i.createTextNode(r)))},this),this.get("contentBox")),a=="marker"?(n=t.hideEvent,o=t.showEvent,h?(e.delegate("touchend",e.bind(this._markerEventDispatcher,this),u,c),e.on("touchend",e.bind(function(e){e.halt(!0),this._activeMarker&&(this._activeMarker=null,this.hideTooltip(e))},this))):(e.delegate("mouseenter",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mousedown",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mouseup",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mouseleave",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("click",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mousemove",e.bind(this._positionTooltip,this),u,c))):a=="planar"&&(h?this._overlay.on("touchend",e.bind(this._planarEventDispatcher,this)):(this._overlay.on("mousemove",e.bind(this._planarEventDispatcher,this)),this.on("mouseout",this.hideTooltip)));if(t){this.on("markerEvent:touchend",e.bind(function(e){var n=e.series.get("markers")[e.index];this._activeMarker&&n===this._activeMarker?(this._activeMarker=null,this.hideTooltip(e)):(this._activeMarker=n,t.markerEventHandler.apply(this,[e]))},this));if(n&&o&&n==o)this.on(a+"Event:"+n,this.toggleTooltip);else{o&&this.on(a+"Event:"+o,t[a+"EventHandler"]);if(n){if(s.isArray(n)){l=n.length;for(;f=T[h].start){p=h;break}N=l.length;for(h=0;h-1&&c.updateMarkerState("mouseout",d),C&&C[p]>-1&&(w&&!isNaN(p)&&p>-1&&c.updateMarkerState("mouseover",p),v=this.getSeriesItems(c,p),g.push(v.category),y.push(v.value),m.push(c));this._selectedIndex=p,p>-1?this.fire("planarEvent:mouseover",{categoryItem:g,valueItem:y,x:u,y:a,pageX:s,pageY:o,items:m,index:p,originEvent:e}):this.fire("planarEvent:mouseout")}},_type:"combo",_itemRenderQueue:null,_addToAxesRenderQueue:function(t){this._itemRenderQueue||(this._itemRenderQueue=[]),e.Array.indexOf(this._itemRenderQueue,t)<0&&this._itemRenderQueue.push(t)},_addToAxesCollection:function(e,t){var n=this.get(e+"AxesCollection");n||(n=[],this.set(e+"AxesCollection",n)),n.push(t)},_getDefaultSeriesCollection:function(){var e,t=this.get("dataProvider");return t&&(e=this._parseSeriesCollection()),e},_parseSeriesCollection:function(t){var n=this.get("direction"),r=[],i,s,o=[],u,a=this.get("seriesKeys").concat(),f,l,c,h=this.get("type"),p,d,v,m,g=[],y=this.get("categoryKey"),b=this.get("showMarkers"),w=this.get("showAreaFill"),E=this.get("showLines");t=t||[],n=="vertical"?(i="yAxis",d="yKey",s="xAxis",v="xKey"):(i="xAxis",d="xKey",s="yAxis",v="yKey"),c=t.length;while(t&&t.length>0)u=t.shift(),p=this._getBaseAttribute(u,v),p?(l=e.Array.indexOf(a,p),l>-1?(a.splice(l,1),o.push(p),r.push(u)):g.push(u)):g.push(u);while(g.length>0)u=g.shift(),a.length>0?(p=a.shift(),this._setBaseAttribute(u,v,p),o.push(p),r.push(u)):u instanceof e.CartesianSeries&&u.destroy(!0);a.length>0&&(o=o.concat(a)),c=o.length;for(f=0;f0&&f.set("overlapGraph",!1),r[u]=f)}return r},_addAxes:function(){var t=this.get("axes"),n,r,i,s=this.get("width"),o=this.get("height"),u=e.Node.one(this._parentNode);this._axesCollection||(this._axesCollection=[]);for(n in t)t.hasOwnProperty(n)&&(r=t[n],r instanceof e.Axis&&(s||(this.set("width",u.get("offsetWidth")),s=this.get("width")),o||(this.set("height",u.get("offsetHeight")),o=this.get("height")),this._addToAxesRenderQueue(r),i=r.get("position"),this.get(i+"AxesCollection")?this.get(i+"AxesCollection").push(r):this.set(i+"AxesCollection",[r]),this._axesCollection.push(r),r.get("keys").hasOwnProperty(this.get("categoryKey"))&&this.set("categoryAxis",r),r.render(this.get("contentBox"))))},_addSeries:function(){var e=this.get("graph"),t=this.get("seriesCollection");e.render(this.get("contentBox"))},_addGridlines:function(){var t=this.get("graph"),n=this.get("horizontalGridlines"),r=this.get("verticalGridlines"),i=this.get("direction"),s=this.get("leftAxesCollection"),o=this.get("rightAxesCollection"),u=this.get("bottomAxesCollection"),a=this.get("topAxesCollection"),f,l=this.get("categoryAxis"),c,h;this._axesCollection&&(f=this._axesCollection.concat(),f.splice(e.Array.indexOf(f,l),1)),n&&(s&&s[0]?c=s[0]:o&&o[0]?c=o[0]:c=i=="horizontal"?l:f[0],!this._getBaseAttribute(n,"axis")&&c&&this._setBaseAttribute(n,"axis",c),this._getBaseAttribute(n,"axis")&&t.set("horizontalGridlines",n)),r&&(u&&u[0]?h=u[0]:a&&a[0]?h=a[0]:h=i=="vertical"?l:f[0],!this._getBaseAttribute(r,"axis")&&h&&this._setBaseAttribute(r,"axis",h),this._getBaseAttribute(r,"axis")&&t.set("verticalGridlines",r))},_getDefaultAxes:function(){var e;return this.get("dataProvider")&&(e=this._parseAxes()),e},_parseAxes:function(t){var n=this.get("categoryKey"),r,i,o,u={},a=[],f=this.get("categoryAxisName")||this.get("categoryKey"),l=this.get("valueAxisName"),c=this.get("seriesKeys").concat(),h,p,d,v,m,g=this.get("direction"),y,b,w=[],E=this.get("stacked")?"stacked":"numeric";g=="vertical"?(y="bottom",b="left"):(y="left",b="bottom");if(t)for(h in t)if(t.hasOwnProperty(h)){r=t[h],o=this._getBaseAttribute(r,"keys"),i=this._getBaseAttribute(r,"type");if(i=="time"||i=="category")f=h,this.set("categoryAxisName",h),s.isArray(o)&&o.length>0&&(n=o[0],this.set("categoryKey",n)),u[h]=r;else if(h==f)u[h]=r;else{u[h]=r;if(h!=l&&o&&s.isArray(o)){v=o.length;for(d=0;d-1&&c.splice(m,1),p=a.length;for(h=0;h-1&&c.splice(m,1);return u.hasOwnProperty(f)||(u[f]={}),this._getBaseAttribute(u[f],"keys")||this._setBaseAttribute(u[f],"keys",[n]),this._getBaseAttribute(u[f],"position")||this._setBaseAttribute(u[f],"position",b),this._getBaseAttribute(u[f],"type")||this._setBaseAttribute(u[f],"type",this.get("categoryType")),!u.hasOwnProperty(l)&&c&&c.length>0&&(u[l]={keys:c},w.push(u[l])),a.length>0&&(c.length>0?c=a.concat(c):c=a),u.hasOwnProperty(l)&&(this._getBaseAttribute(u[l],"position")||this._setBaseAttribute(u[l],"position",this._getDefaultAxisPosition(u[l],w,y)),this._setBaseAttribute(u[l],"type",E),this._setBaseAttribute(u[l],"keys",c)),this._seriesKeysExplicitlySet||(this._seriesKeys=c),u},_getDefaultAxisPosition:function(t,n,r){var i=this.get("direction"),s=e.Array.indexOf(n,t);return n[s-1]&&n[s-1].position&&(i=="horizontal"?n[s-1].position=="left"?r="right":n[s-1].position=="right"&&(r="left"):n[s-1].position=="bottom"?r="top":r="bottom"),r},getSeriesItems:function(e,t){var n=e.get("xAxis"),r=e.get("yAxis"),i=e.get("xKey"),s=e.get("yKey"),o,u;return this.get("direction")=="vertical"?(o={axis:r,key:s,value:r.getKeyValueAt(s,t)},u={axis:n,key:i,value:n.getKeyValueAt(i,t)}):(u={axis:r,key:s,value:r.getKeyValueAt(s,t)},o={axis:n,key:i,value:n.getKeyValueAt(i,t)}),o.displayName=e.get("categoryDisplayName"),u.displayName=e.get("valueDisplayName"),o.value=o.axis.getKeyValueAt(o.key,t),u.value=u.axis.getKeyValueAt(u.key,t),{category:o,value:u}},_sizeChanged:function(e){if(this._axesCollection){var t=this._axesCollection,n=0,r=t.length;for(;n-1;--l)C.unshift(n),n+=o[l].get("width")}if(u){N=[],c=u.length,l=0;for(l=c-1;l>-1;--l)r+=u[l].get("width"),N.unshift(e-r)}if(a){k=[],c=a.length;for(l=c-1;l>-1;--l)k.unshift(i),i+=a[l].get("height")}if(f){L=[],c=f.length;for(l=c-1;l>-1;--l)s+=f[l].get("height"),L.unshift(t-s)}b=e-(n+r),w=t-(s+i),A.left=n,A.top=i,A.bottom=t-s,A.right=e-r;if(!x){v=this._getTopOverflow(o,u),m=this._getBottomOverflow(o,u),g=this._getLeftOverflow(f,a),y=this._getRightOverflow(f,a),T=v-i;if(T>0){A.top=v;if(k){l=0,c=k.length;for(;l0){A.bottom=t-m;if(L){l=0,c=L.length;for(;l0){A.left=g;if(C){l=0,c=C.length;for(;l0){A.right=e-y;if(N){l=0,c=N.length;for(;l1?(e===38?o=o<1?f-1:o-1:e===40&&(o=o>=f-1?0:o+1),this._itemIndex=-1):o=0,this._seriesIndex=o,n=this.getSeries(parseInt(o,10)),t=n.get("valueDisplayName")+" series."):(o>-1?(t="",n=this.getSeries(parseInt(o,10))):(o=0,this._seriesIndex=o,n=this.getSeries(parseInt(o,10)),t=n.get("valueDisplayName")+" series."),l=n._dataLength?n._dataLength:0,e===37?u=u>0?u-1:l-1:e===39&&(u=u>=l-1?0:u+1),this._itemIndex=u,r=this.getSeriesItems(n,u),i=r.category,s=r.value,i&&s&&i.value&&s.value?(t+=i.displayName+": "+i.axis.formatLabel.apply(this,[i.value,i.axis.get("labelFormat")])+", ",t+=s.displayName+": "+s.axis.formatLabel.apply(this,[s.value,s.axis.get("labelFormat")])+", "):t+="No data available.",t+=u+1+" of "+l+". "),t}},{ATTRS:{allowContentOverflow:{value:!1},axesStyles:{getter:function(){var t=this.get("axes"),n,r=this._axesStyles;if(t)for(n in t)t.hasOwnProperty(n)&&t[n]instanceof e.Axis&&(r||(r={}),r[n]=t[n].get("styles"));return r},setter:function(e){var t=this.get("axes"),n;for(n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)&&this._setBaseAttribute(t[n],"styles",e[n])}},seriesStyles:{getter:function(){var e=this._seriesStyles,t=this.get("graph"),n,r;if(t){n=t.get("seriesDictionary");if(n){e={};for(r in n)n.hasOwnProperty(r)&&(e[r]=n[r].get("styles"))}}return e},setter:function(e){var t,n,r;if(s.isArray(e)){r=this.get("seriesCollection"),t=0,n=e.length;for(;t0?u-1:f-1:e===39&&(u=u>=f-1?0:u+1),this._itemIndex=u,r=this.getSeriesItems(i,u),n=r.category,s=r.value,l=i.getTotalValues(),c=Math.round(s.value/l*1e4)/100,n&&s?(t+=n.displayName+": "+n.axis.formatLabel.apply(this,[n.value,n.axis.get("labelFormat")])+", ",t+=s.displayName+": "+s.axis.formatLabel.apply(this,[s.value,s.axis.get("labelFormat")])+", ",t+="Percent of total "+s.displayName+": "+c+"%,"):t+="No data available,",t+=u+1+" of "+f+". ",t}},{ATTRS:{ariaDescription:{value:"Use the left and right keys to navigate through items.",setter:function(e){return this._description&&(this._description.setContent(""),this._description.appendChild(i.createTextNode(e))),e}},axes:{getter:function(){return this._axes},setter:function(e){this._parseAxes(e)}},seriesCollection:{getter:function(){return this._getSeriesCollection()},setter:function(e){return this._setSeriesCollection(e)}},type:{value:"pie"}}})},"3.7.3",{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]});