AmCharts.AmPieChart=AmCharts.Class({inherits:AmCharts.AmSlicedChart,construct:function(e){this.type="pie";AmCharts.AmPieChart.base.construct.call(this,e);this.cname="AmPieChart";this.pieBrightnessStep=30;this.minRadius=10;this.depth3D=0;this.startAngle=90;this.angle=this.innerRadius=0;this.startRadius="500%";this.pullOutRadius="20%";this.labelRadius=20;this.labelText="[[title]]: [[percents]]%";this.balloonText="[[title]]: [[percents]]% ([[value]])\n[[description]]";this.previousScale=1;AmCharts.applyTheme(this, e,this.cname)},drawChart:function(){AmCharts.AmPieChart.base.drawChart.call(this);var e=this.chartData;if(AmCharts.ifArray(e)){if(0a&&(f=a)),h=AmCharts.toCoordinate(this.pullOutRadius,f),f=(0<=s?f-1.8*(s+h):f-1.8*h)/2);f=f&& (d=f-1);l=AmCharts.fitToBounds(this.startAngle,0,360);0=this.hideLabelsPercent){var n=l+m/2,m=s;isNaN(b.labelRadius)||(m=b.labelRadius);var z=u+r*(f+m),B=v+w*(f+m),x,t=0;if(0<=m){var y;90>=n&&0<=n?(y=0,x="start",t=8):90<=n&&180>n?(y=1,x="start",t=8):180<=n&&270>n?(y=2,x="end",t=-8):270<=n&&360>n&&(y=3,x="end",t=-8);b.labelQuarter=y}else x="middle";var n=this.formatString(this.labelText, b),A=b.labelColor;A||(A=this.color);n=AmCharts.text(c,n,A,this.fontFamily,this.fontSize,x);n.translate(z+1.5*t,B);b.tx=z+1.5*t;b.ty=B;0<=m?p.push(n):this.freeLabelsSet.push(n);b.label=n;b.tx=z;b.tx2=z+t;b.tx0=u+r*f;b.ty0=v+w*f}m=d+(f-d)/2;b.pulled&&(m+=this.pullOutRadiusReal);b.balloonX=r*m+u;b.balloonY=w*m+v;b.startX=Math.round(r*q);b.startY=Math.round(w*q);b.pullX=Math.round(r*h);b.pullY=Math.round(w*h);this.graphsSet.push(p);(0===b.alpha||0c?a.toFront():180<=c&&a.toBack()}},arrangeLabels:function(){var e=this.chartData,g=e.length,c,a;for(a=g-1;0<=a;a--)c= e[a],0!==c.labelQuarter||c.hidden||this.checkOverlapping(a,c,0,!0,0);for(a=0;ah&&(d=g.ty+3*g.iy,g.ty=d,l.translate(g.tx2,d),this.checkOverlapping(e,g,c,a,h+1))}},checkOverlappingReal:function(e,g,c){var a=!1,h=e.label,d=g.label;e.labelQuarter!=c||e.hidden||g.hidden||!d||(h=h.getBBox(),c={},c.width=h.width,c.height=h.height,c.y=e.ty,c.x=e.tx,e=d.getBBox(),d={},d.width=e.width,d.height=e.height,d.y=g.ty,d.x=g.tx,AmCharts.hitTest(c,d)&&(a=!0));return a}});