(function(r){var c={series:{pie:{show:!1,radius:"auto",innerRadius:0,startAngle:1.5,tilt:1,offset:{top:0,left:"auto"},stroke:{color:"#FFF",width:1},label:{show:"auto",formatter:function(c,r){return'
'+c+"
"+Math.round(r.percent)+"%
"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:0.5}}}};r.plot.plugins.push({init:function(s){function F(a){A|| (A=!0,k=a.getCanvas(),t=r(k).parent(),c=a.getOptions(),a.setData(G(a.getData())))}function G(a){for(var b=0;b=k.width/2-5||a*c.series.pie.tilt>=k.height/2-15||10>=a)){ctx.save();ctx.translate(5,15);ctx.globalAlpha=0.02;ctx.fillStyle="#000";ctx.translate(l,v);ctx.scale(1,c.series.pie.tilt);for(var b=1;10>=b;b++)ctx.beginPath(),ctx.arc(0,0,a,0,2*Math.PI,!1),ctx.fill(),a-=b;ctx.restore()}}function e(){function a(b,c,d){0>=b||(d?ctx.fillStyle=c:(ctx.strokeStyle=c,ctx.lineJoin="round"),ctx.beginPath(),1.0E-9=100*c.series.pie.label.threshold){var f=d[e],g=a,q=e;if(0!=f.data[0][1]){var o=c.legend.labelFormatter,j=void 0,p=c.series.pie.label.formatter,j=o?o(f.label,f):f.label;p&&(j=p(j,f));o=(g+f.angle+g)/2;g=l+Math.round(Math.cos(o)* h);o=v+Math.round(Math.sin(o)*h)*c.series.pie.tilt;t.append(''+j+"");q=t.children("#pieLabel"+q);j=o-q.height()/2;o=g-q.width()/2;q.css("top",j);q.css("left",o);if(0<0-j||0<0-o||0>k.height-(j+q.height())||0>k.width-(o+q.width()))w=!0;0!=c.series.pie.label.background.opacity&&(g=c.series.pie.label.background.color,null==g&&(g=f.color),f="top:"+j+"px;left:"+o+"px;",r('
').insertBefore(q).css("opacity",c.series.pie.label.background.opacity))}}a+=d[e].angle}}startAngle=Math.PI*c.series.pie.startAngle;var h=1k.width-n&&(l=k.width-n);var d=a.getData(),j=0;for(w=!0;w&&j=c.series.pie.tilt&&f(),e();j>=C&&(h(),t.prepend('
Could not draw pie with labels contained inside canvas
'));a.setSeries&&a.insertLegend&&(a.setSeries(d),a.insertLegend())}}function B(a){0e.angle||(b.fillStyle="rgba(255, 255, 255, "+c.series.pie.highlight.opacity+")",b.beginPath(),1.0E-9b.series.pie.tilt&&(b.series.pie.tilt=0),a.hooks.processDatapoints.push(F),a.hooks.drawOverlay.push(L),a.hooks.draw.push(H))});s.hooks.bindEvents.push(function(a, b){var c=a.getOptions();c.series.pie.show&&c.grid.hoverable&&b.unbind("mousemove").mousemove(J);c.series.pie.show&&c.grid.clickable&&b.unbind("click").click(K)})},options:c,name:"pie",version:"1.0"})})(jQuery);