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(0b&&(f=b)),h=AmCharts.toCoordinate(this.pullOutRadius,f),f=(0<=s?f-1.8*(s+h):f-1.8*h)/2);f=f&& (d=f-1);m=AmCharts.fitToBounds(this.startAngle,0,360);0=this.hideLabelsPercent){var l=m+n/2;360=l&&0<=l?(z=0,y="start",u=8):90<=l&&180>l?(z=1,y="start",u=8):180<=l&&270>l?(z=2,y="end",u= -8):270<=l&&360>l&&(z=3,y="end",u=-8);a.labelQuarter=z}else y="middle";var l=this.formatString(this.labelText,a),A=a.labelColor;A||(A=this.color);l=AmCharts.text(c,l,A,this.fontFamily,this.fontSize,y);l.translate(t+1.5*u,B);a.tx=t+1.5*u;a.ty=B;0<=n?p.push(l):this.freeLabelsSet.push(l);a.label=l;a.tx=t;a.tx2=t+u;a.tx0=v+r*f;a.ty0=w+x*f}n=d+(f-d)/2;a.pulled&&(n+=this.pullOutRadiusReal);a.balloonX=r*n+v;a.balloonY=x*n+w;a.startX=Math.round(r*q);a.startY=Math.round(x*q);a.pullX=Math.round(r*h);a.pullY= Math.round(x*h);this.graphsSet.push(p);(0===a.alpha||0 c?b.toFront():180<=c&&b.toBack()}},arrangeLabels:function(){var e=this.chartData,g=e.length,c,b;for(b=g-1;0<=b;b--)c=e[b],0!==c.labelQuarter||c.hidden||this.checkOverlapping(b,c,0,!0,0);for(b=0;bh&&(d=g.ty+3*g.iy,g.ty=d,m.translate(g.tx2,d),this.checkOverlapping(e,g,c,b,h+1))}},checkOverlappingReal:function(e,g,c){var b=!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)&&(b=!0));return b}});