AmCharts.AmPieChart=AmCharts.Class({inherits:AmCharts.AmSlicedChart,construct:function(){AmCharts.AmPieChart.base.construct.call(this);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=30;this.labelText="[[title]]: [[percents]]%";this.balloonText="[[title]]: [[percents]]% ([[value]])\n[[description]]";this.previousScale=1},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 m=l+n/2,n=s;isNaN(b.labelRadius)||(n=b.labelRadius);var t=w+r*(f+n),u=x+y*(f+n),z,v=0;if(0<=n){var A;90>=m&&0<=m?(A=0,z="start",v=8):90<=m&&180>m?(A=1,z="start",v=8):180<=m&&270>m?(A=2,z="end",v=-8):270<=m&&360>m&&(A=3,z="end",v=-8);b.labelQuarter=A}else z="middle";var m=this.formatString(this.labelText,b),B=b.labelColor;B||(B=this.color); m=AmCharts.text(c,m,B,this.fontFamily,this.fontSize,z);m.translate(t+1.5*v,u);b.tx=t+1.5*v;b.ty=u;u=d+(f-d)/2;b.pulled&&(u+=this.pullOutRadiusReal);b.balloonX=r*u+w;b.balloonY=y*u+x;0<=n?p.push(m):this.freeLabelsSet.push(m);b.label=m;b.tx=t;b.tx2=t+v;b.tx0=w+r*f;b.ty0=x+y*f}b.startX=Math.round(r*q);b.startY=Math.round(y*q);b.pullX=Math.round(r*h);b.pullY=Math.round(y*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}});