Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/main/amcharts/3.3/ |
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/main/amcharts/3.3/pie.min.js |
AmCharts.AmPieChart=AmCharts.Class({inherits:AmCharts.AmSlicedChart,construct:function(t){this.className="AmPieChart";this.chartType="pie";AmCharts.AmPieChart.base.construct.call(this,t);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;AmCharts.applyTheme(this,t,"AmPieChart")},drawChart:function(){AmCharts.AmPieChart.base.drawChart.call(this);var t=this.chartData;if(AmCharts.ifArray(t)){if(0<this.realWidth&&0<this.realHeight){AmCharts.VML&&(this.startAlpha=1);var i=this.startDuration,e=this.container,a=this.updateWidth();this.realWidth=a;var h=this.updateHeight();this.realHeight=h;var s=AmCharts.toCoordinate,r=s(this.marginLeft,a),l=s(this.marginRight,a),n=s(this.marginTop,h)+this.getTitleHeight(),d=s(this.marginBottom,h),o,p,u,c=AmCharts.toNumber(this.labelRadius),g=this.measureMaxLabel();this.labelText&&this.labelsEnabled||(c=g=0);o=void 0===this.pieX?(a-r-l)/2+r:s(this.pieX,this.realWidth);p=void 0===this.pieY?(h-n-d)/2+n:s(this.pieY,h);u=s(this.radius,a,h);u||(a=0<=c?a-r-l-2*g:a-r-l,h=h-n-d,u=Math.min(a,h),h<a&&(u/=1-this.angle/90,u>a&&(u=a)),h=AmCharts.toCoordinate(this.pullOutRadius,u),u=(0<=c?u-1.8*(c+h):u-1.8*h)/2);u<this.minRadius&&(u=this.minRadius);h=s(this.pullOutRadius,u);n=AmCharts.toCoordinate(this.startRadius,u);s=s(this.innerRadius,u);s>=u&&(s=u-1);d=AmCharts.fitToBounds(this.startAngle,0,360);0<this.depth3D&&(d=270<=d?270:90);d-=90;a=u-u*this.angle/90;for(r=0;r<t.length;r++)if(l=t[r],!0!==l.hidden&&0<l.percents){var m=360*l.percents/100,g=Math.sin((d+m/2)/180*Math.PI),b=-Math.cos((d+m/2)/180*Math.PI)*(a/u),C=this.outlineColor;C||(C=l.color);C={fill:l.color,stroke:C,"stroke-width":this.outlineThickness,"stroke-opacity":this.outlineAlpha,"fill-opacity":this.alpha};l.url&&(C.cursor="pointer");C=AmCharts.wedge(e,o,p,d,m,u,a,s,this.depth3D,C,this.gradientRatio,l.pattern);this.addEventListeners(C,l);l.startAngle=d;t[r].wedge=C;l.ix=g;l.iy=b;l.wedge=C;l.index=r;if(this.labelsEnabled&&this.labelText&&l.percents>=this.hideLabelsPercent){var f=d+m/2,m=c;isNaN(l.labelRadius)||(m=l.labelRadius);var v=o+g*(u+m),A=p+b*(u+m),R,x=0;if(0<=m){var y;90>=f&&0<=f?(y=0,R="start",x=8):90<=f&&180>f?(y=1,R="start",x=8):180<=f&&270>f?(y=2,R="end",x=-8):270<=f&&360>f&&(y=3,R="end",x=-8);l.labelQuarter=y}else R="middle";var f=this.formatString(this.labelText,l),k=l.labelColor;k||(k=this.color);f=AmCharts.text(e,f,k,this.fontFamily,this.fontSize,R);f.translate(v+1.5*x,A);l.tx=v+1.5*x;l.ty=A;A=s+(u-s)/2;l.pulled&&(A+=this.pullOutRadiusReal);l.balloonX=g*A+o;l.balloonY=b*A+p;0<=m?C.push(f):this.freeLabelsSet.push(f);l.label=f;l.tx=v;l.tx2=v+x;l.tx0=o+g*u;l.ty0=p+b*u}l.startX=Math.round(g*n);l.startY=Math.round(b*n);l.pullX=Math.round(g*h);l.pullY=Math.round(b*h);this.graphsSet.push(C);(0===l.alpha||0<i&&!this.chartCreated)&&C.hide();d+=360*l.percents/100}0<c&&!this.labelRadiusField&&this.arrangeLabels();this.pieXReal=o;this.pieYReal=p;this.radiusReal=u;this.innerRadiusReal=s;0<c&&this.drawTicks();this.initialStart();this.setDepths()}(t=this.legend)&&t.invalidateSize()}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},setDepths:function(){var t=this.chartData,i;for(i=0;i<t.length;i++){var e=t[i],a=e.wedge,e=e.startAngle;0<=e&&180>e?a.toFront():180<=e&&a.toBack()}},arrangeLabels:function(){var t=this.chartData,i=t.length,e,a;for(a=i-1;0<=a;a--)e=t[a],0!==e.labelQuarter||e.hidden||this.checkOverlapping(a,e,0,!0,0);for(a=0;a<i;a++)e=t[a],1!=e.labelQuarter||e.hidden||this.checkOverlapping(a,e,1,!1,0);for(a=i-1;0<=a;a--)e=t[a],2!=e.labelQuarter||e.hidden||this.checkOverlapping(a,e,2,!0,0);for(a=0;a<i;a++)e=t[a],3!=e.labelQuarter||e.hidden||this.checkOverlapping(a,e,3,!1,0)},checkOverlapping:function(t,i,e,a,h){var s,r,l=this.chartData,n=l.length,d=i.label;if(d){if(!0===a)for(r=t+1;r<n;r++)l[r].labelQuarter==e&&(s=this.checkOverlappingReal(i,l[r],e))&&(r=n);else for(r=t-1;0<=r;r--)l[r].labelQuarter==e&&(s=this.checkOverlappingReal(i,l[r],e))&&(r=0);!0===s&&100>h&&(s=i.ty+3*i.iy,i.ty=s,d.translate(i.tx2,s),this.checkOverlapping(t,i,e,a,h+1))}},checkOverlappingReal:function(t,i,e){var a=!1,h=t.label,s=i.label;t.labelQuarter!=e||t.hidden||i.hidden||!s||(h=h.getBBox(),e={},e.width=h.width,e.height=h.height,e.y=t.ty,e.x=t.tx,t=s.getBBox(),s={},s.width=t.width,s.height=t.height,s.y=i.ty,s.x=i.tx,AmCharts.hitTest(e,s)&&(a=!0));return a}}); //# sourceMappingURL=pie.map.js