text: //>>built
  define("dojox/charting/plot2d/Pie","dojo/_base/lang dojo/_base/array dojo/_base/declare ./Base ./_PlotEvents ./common dojox/gfx dojox/gfx/matrix dojox/lang/functional dojox/lang/utils dojo/has".split(" "),function(D,n,E,H,N,O,v,K,k,F,L){return E("dojox.charting.plot2d.Pie",[H,N],{defaultParams:{labels:!0,ticks:!1,fixed:!0,precision:1,labelOffset:20,labelStyle:"default",htmlLabels:!0,radGrad:"native",fanSize:5,startAngle:0},optionalParams:{radius:0,omitLabels:!1,stroke:{},outline:{},shadow:{},fill:{},
  filter:{},styleFunc:null,font:"",fontColor:"",labelWiring:{}},constructor:function(h,b){this.opt=D.clone(this.defaultParams);F.updateWithObject(this.opt,b);F.updateWithPattern(this.opt,b,this.optionalParams);this.axes=[];this.run=null;this.dyn=[];this.runFilter=[]},clear:function(){this.inherited(arguments);this.dyn=[];this.run=null;return this},setAxis:function(h){return this},addSeries:function(h){this.run=h;return this},getSeriesStats:function(){return D.delegate(O.defaultStats)},getRequiredColors:function(){return this.run?
  this.run.data.length:0},render:function(h,b){if(!this.dirty)return this;this.resetEvents();this.dirty=!1;this._eventSeries={};this.cleanGroup();var q=this.group,c=this.chart.theme;if(!this.run||!this.run.data.length)return this;var d=(h.width-b.l-b.r)/2,e=(h.height-b.t-b.b)/2,g=Math.min(d,e),x="font"in this.opt?this.opt.font:c.series.font,w,B=K._degToRad(this.opt.startAngle),m=B,l,t,u,C,F=this.events(),y=n.map(this.run.data,function(a,b){"number"!=typeof a&&a.hidden&&(this.runFilter.push(b),a.hidden=
  !1);return n.some(this.runFilter,function(a){return a==b})?"number"==typeof a?0:{y:0,text:a.text}:a},this);this.dyn=[];"radius"in this.opt&&(g=this.opt.radius,C=g-this.opt.labelOffset);var a={cx:b.l+d,cy:b.t+e,r:g};if(this.opt.shadow||c.shadow){l=this.opt.shadow||c.shadow;var z=D.clone(a);z.cx+=l.dx;z.cy+=l.dy;q.createCircle(z).setFill(l.color).setStroke(l)}if(q.setFilter&&(this.opt.filter||c.filter))q.createCircle(a).setFill(c.series.stroke).setFilter(this.opt.filter||c.filter);if("number"==typeof y[0]){l=
  k.map(y,"x ? Math.max(x, 0) : 0");if(k.every(l,"\x3c\x3d 0"))return q.createCircle(a).setStroke(c.series.stroke),this.dyn=n.map(l,function(){return{}}),this;t=k.map(l,"/this",k.foldl(l,"+",0));this.opt.labels&&(u=n.map(t,function(a){return 0<a?this._getLabel(100*a)+"%":""},this))}else{l=k.map(y,"x ? Math.max(x.y, 0) : 0");if(k.every(l,"\x3c\x3d 0"))return q.createCircle(a).setStroke(c.series.stroke),this.dyn=n.map(l,function(){return{}}),this;t=k.map(l,"/this",k.foldl(l,"+",0));this.opt.labels&&(u=
  n.map(t,function(a,b){if(0>a)return"";var c=y[b];return"text"in c?c.text:this._getLabel(100*a)+"%"},this))}var G=k.map(y,function(a,b){var p=[this.opt,this.run];null!==a&&"number"!=typeof a&&p.push(a);this.opt.styleFunc&&p.push(this.opt.styleFunc(a));return c.next("slice",p,!0)},this);this.opt.labels&&(w=x?v.normalizedLength(v.splitFontString(x).size):0,l=k.foldl1(k.map(u,function(a,b){return v._base._getTextBox(a,{font:G[b].series.font}).w},this),"Math.max(a, b)")/2,0>this.opt.labelOffset&&(g=Math.min(d-
  2*l,e-w)+this.opt.labelOffset),C=g-this.opt.labelOffset);var I=Array(t.length);n.some(t,function(c,d){if(0>c)return!1;var p=y[d],r=G[d],f;if(0==c)return this.dyn.push({fill:r.series.fill,stroke:r.series.stroke}),!1;if(1<=c){f=this._plotFill(r.series.fill,h,b);f=this._shapeFill(f,{x:a.cx-a.r,y:a.cy-a.r,width:2*a.r,height:2*a.r});f=this._pseudoRadialFill(f,{x:a.cx,y:a.cy},a.r);var e=q.createCircle(a).setFill(f).setStroke(r.series.stroke);this.dyn.push({fill:f,stroke:r.series.stroke});F&&(p={element:"slice",
  index:d,run:this.run,shape:e,x:d,y:"number"==typeof p?p:p.y,cx:a.cx,cy:a.cy,cr:g},this._connectEvents(p),I[d]=p);return!1}var l=m+2*c*Math.PI;d+1==t.length&&(l=B+2*Math.PI);var e=l-m,k=a.cx+g*Math.cos(m),n=a.cy+g*Math.sin(m),x=a.cx+g*Math.cos(l),w=a.cy+g*Math.sin(l);f=K._degToRad(this.opt.fanSize);if(r.series.fill&&"radial"===r.series.fill.type&&"fan"===this.opt.radGrad&&e>f){var u=q.createGroup(),v=Math.ceil(e/f),A=e/v;f=this._shapeFill(r.series.fill,{x:a.cx-a.r,y:a.cy-a.r,width:2*a.r,height:2*a.r});
  for(var s=0;s<v;++s){var z=0==s?k:a.cx+g*Math.cos(m+(s-0.2)*A),C=0==s?n:a.cy+g*Math.sin(m+(s-0.2)*A),D=s==v-1?x:a.cx+g*Math.cos(m+(s+1+0.2)*A),E=s==v-1?w:a.cy+g*Math.sin(m+(s+1+0.2)*A);u.createPath().moveTo(a.cx,a.cy).lineTo(z,C).arcTo(g,g,0,A>Math.PI,!0,D,E).lineTo(a.cx,a.cy).closePath().setFill(this._pseudoRadialFill(f,{x:a.cx,y:a.cy},g,m+(s+0.5)*A,m+(s+0.5)*A))}u.createPath().moveTo(a.cx,a.cy).lineTo(k,n).arcTo(g,g,0,e>Math.PI,!0,x,w).lineTo(a.cx,a.cy).closePath().setStroke(r.series.stroke);e=
  u}else e=q.createPath().moveTo(a.cx,a.cy).lineTo(k,n).arcTo(g,g,0,e>Math.PI,!0,x,w).lineTo(a.cx,a.cy).closePath().setStroke(r.series.stroke),(f=r.series.fill)&&"radial"===f.type?(f=this._shapeFill(f,{x:a.cx-a.r,y:a.cy-a.r,width:2*a.r,height:2*a.r}),"linear"===this.opt.radGrad&&(f=this._pseudoRadialFill(f,{x:a.cx,y:a.cy},g,m,l))):f&&"linear"===f.type&&(f=this._plotFill(f,h,b),f=this._shapeFill(f,e.getBoundingBox())),e.setFill(f);this.dyn.push({fill:f,stroke:r.series.stroke});F&&(p={element:"slice",
  index:d,run:this.run,shape:e,x:d,y:"number"==typeof p?p:p.y,cx:a.cx,cy:a.cy,cr:g},this._connectEvents(p),I[d]=p);m=l;return!1},this);if(this.opt.labels){var M=L("dojo-bidi")&&this.chart.isRightToLeft();if("default"==this.opt.labelStyle)m=B,n.some(t,function(b,c){if(0>=b)return!1;var d=G[c];if(1<=b)return this.renderLabel(q,a.cx,a.cy+w/2,u[c],d,0<this.opt.labelOffset),!0;var e=m+2*b*Math.PI;c+1==t.length&&(e=B+2*Math.PI);if(this.opt.omitLabels&&0.001>e-m)return!1;var f=(m+e)/2,g=a.cx+C*Math.cos(f),
  f=a.cy+C*Math.sin(f)+w/2;this.renderLabel(q,M?h.width-g:g,f,u[c],d,0<this.opt.labelOffset);m=e;return!1},this);else if("columns"==this.opt.labelStyle){var m=B,E=this.opt.omitLabels,J=[];n.forEach(t,function(a,c){var b=m+2*a*Math.PI;c+1==t.length&&(b=B+2*Math.PI);var d=(m+b)/2;J.push({angle:d,left:0>Math.cos(d),theme:G[c],index:c,omit:E?0.001>b-m:!1});m=b});d=v._base._getTextBox("a",{font:x}).h;this._getProperLabelRadius(J,d,1.1*a.r);n.forEach(J,function(b,c){if(!b.omit){var d=a.cx-2*a.r,e=a.cx+2*
  a.r,f=v._base._getTextBox(u[c],{font:b.theme.series.font}).w,g=a.cx+b.labelR*Math.cos(b.angle),l=a.cy+b.labelR*Math.sin(b.angle),e=b.left?d+f:e-f,d=b.left?d:e,m=q.createPath().moveTo(a.cx+a.r*Math.cos(b.angle),a.cy+a.r*Math.sin(b.angle));Math.abs(b.labelR*Math.cos(b.angle))<2*a.r-f&&m.lineTo(g,l);m.lineTo(e,l).setStroke(b.theme.series.labelWiring);this.renderLabel(q,M?h.width-f-d:d,l,u[c],b.theme,!1,"left")}},this)}}var H=0;this._eventSeries[this.run.name]=k.map(y,function(a){return 0>=a?null:I[H++]});
  L("dojo-bidi")&&this._checkOrientation(this.group,h,b);return this},_getProperLabelRadius:function(h,b,q){var c,d,e=1,g=1;if(1==h.length)h[0].labelR=q;else{for(var k=0;k<h.length;k++){var n=Math.abs(Math.sin(h[k].angle));h[k].left?e>=n&&(e=n,c=h[k]):g>=n&&(g=n,d=h[k])}c.labelR=d.labelR=q;this._calculateLabelR(c,h,b);this._calculateLabelR(d,h,b)}},_calculateLabelR:function(h,b,k){for(var c=h.index,d=b.length,e=h.labelR;!(b[c%d].left^b[(c+1)%d].left);)b[(c+1)%d].omit||(e=(Math.sin(b[c%d].angle)*e+(b[c%
  d].left?-k:k))/Math.sin(b[(c+1)%d].angle),e=e<h.labelR?h.labelR:e,b[(c+1)%d].labelR=e),c++;c=h.index;for(d=0==c?d-1:c-1;!(b[c].left^b[d].left);)b[d].omit||(e=(Math.sin(b[c].angle)*e+(b[c].left?k:-k))/Math.sin(b[d].angle),e=e<h.labelR?h.labelR:e,b[d].labelR=e),c--,d--,c=0>c?c+b.length:c,d=0>d?d+b.length:d}})});
  //# sourceMappingURL=Pie.js.map