!function(e){function t(e,t,i,s,r){var n=0,a=t-e,h=Math.abs(a),l=i;return 0==s&&(l+=r),l>0&&h>.01&&h<6.282&&(n=parseFloat(l)/2/function(e){return Math.sin((e-(e-Math.PI)/8/Math.PI)/2)}(a)),n}function i(t,i,s){for(var r=0;r570?.8*c[f]:c[f]+.3*(255-c[f]),c[f]=parseInt(c[f],10);this.highlightColors.push("rgb("+c[0]+","+c[1]+","+c[2]+")")}this.highlightColorGenerator=new e.jqplot.ColorGenerator(this.highlightColors),r.postParseOptionsHooks.addOnce(s),r.postInitHooks.addOnce(i),r.eventListenerHooks.addOnce("jqplotMouseMove",a),r.eventListenerHooks.addOnce("jqplotMouseDown",h),r.eventListenerHooks.addOnce("jqplotMouseUp",l),r.eventListenerHooks.addOnce("jqplotClick",o),r.eventListenerHooks.addOnce("jqplotRightClick",d),r.postDrawHooks.addOnce(g)},e.jqplot.PieRenderer.prototype.setGridData=function(e){var t=[],i=[],s=(this.startAngle,Math.PI,0);this._drawData=!1;for(var r=0;r0&&(t[r]+=t[r-1]),s+=this.data[r][1];var n=2*Math.PI/t[t.length-1];for(r=0;r0&&(i[n]+=i[n-1]),r+=e[n][1];var a=2*Math.PI/i[i.length-1];for(n=0;n6.282+this.startAngle&&(s=6.282+this.startAngle,i>s&&(i=6.281+this.startAngle)),i>=s||(e.beginPath(),e.fillStyle=r,e.strokeStyle=r,e.lineWidth=l,e.arc(0,0,t,i,s,!1),e.lineTo(0,0),e.closePath(),h?e.fill():e.stroke())}},e.jqplot.PieRenderer.prototype.draw=function(i,s,r,n){var a,h=null!=r?r:{},l=0,o=0,d=1,g=new e.jqplot.ColorGenerator(this.seriesColors);if(r.legendInfo&&"insideGrid"==r.legendInfo.placement){var p=r.legendInfo;switch(p.location){case"nw":case"w":case"sw":l=p.width+p.xoffset;break;case"ne":case"e":case"se":l=p.width+p.xoffset,d=-1;break;case"n":o=p.height+p.yoffset;break;case"s":o=p.height+p.yoffset,d=-1}}null!=h.shadow?h.shadow:this.shadow,null!=h.fill?h.fill:this.fill;var c=parseInt(i.canvas.style.width),u=parseInt(i.canvas.style.height),f=c-l-2*this.padding,v=u-o-2*this.padding,j=Math.min(f,v);this._sliceAngles=[];var m;this.sliceMargin;0==this.fill&&this.lineWidth;for(var w,q,R,b=0,_=this.startAngle/180*Math.PI,M=0,P=s.length;MMath.PI&&(b=Math.max(m,b));if(null!=this.diameter&&this.diameter>0?this._diameter=this.diameter-2*b:this._diameter=j-2*b,this._diameter<6)e.jqplot.log("Diameter of pie too small, not rendering.");else{this._radius=this._diameter/2;if(this._center=[(c-d*l)/2+d*l+b*Math.cos(_),(u-d*o)/2+d*o+b*Math.sin(_)],this.shadow)for(M=0,P=s.length;M=this.dataLabelThreshold)){var C,x,L=(this._sliceAngles[M][0]+this._sliceAngles[M][1])/2;"label"==this.dataLabels?(C=this.dataLabelFormatString||"%s",x=e.jqplot.sprintf(C,s[M][0])):"value"==this.dataLabels?(C=this.dataLabelFormatString||"%d",x=e.jqplot.sprintf(C,this.data[M][1])):"percent"==this.dataLabels?(C=this.dataLabelFormatString||"%d%%",x=e.jqplot.sprintf(C,100*s[M][2])):this.dataLabels.constructor==Array&&(C=this.dataLabelFormatString||"%s",x=e.jqplot.sprintf(C,this.dataLabels[M]));var D=this._radius*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge,I=this._center[0]+Math.cos(L)*D+this.canvas._offsets.left,k=this._center[1]+Math.sin(L)*D+this.canvas._offsets.top,y=e('
'+x+"
").insertBefore(n.eventCanvas._elem);this.dataLabelCenterOn?(I-=y.width()/2,k-=y.height()/2):(I-=y.width()*Math.sin(L/2),k-=y.height()/2),I=Math.round(I),k=Math.round(k),y.css({left:I,top:k})}}},e.jqplot.PieAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)},e.jqplot.PieAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer,e.jqplot.PieAxisRenderer.prototype.constructor=e.jqplot.PieAxisRenderer,e.jqplot.PieAxisRenderer.prototype.init=function(t){this.tickRenderer=e.jqplot.PieTickRenderer,e.extend(!0,this,t),this._dataBounds={min:0,max:100},this.min=0,this.max=100,this.showTicks=!1,this.ticks=[],this.showMark=!1,this.show=!1},e.jqplot.PieLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)},e.jqplot.PieLegendRenderer.prototype=new e.jqplot.TableLegendRenderer,e.jqplot.PieLegendRenderer.prototype.constructor=e.jqplot.PieLegendRenderer,e.jqplot.PieLegendRenderer.prototype.init=function(t){this.numberRows=null,this.numberColumns=null,this.width=null,e.extend(!0,this,t)},e.jqplot.PieLegendRenderer.prototype.draw=function(){if(this.show){var t=this._series;this._elem=e(document.createElement("table")),this._elem.addClass("jqplot-table-legend");var i={position:"absolute"};this.background&&(i.background=this.background),this.border&&(i.border=this.border),this.fontSize&&(i.fontSize=this.fontSize),this.fontFamily&&(i.fontFamily=this.fontFamily),this.textColor&&(i.textColor=this.textColor),null!=this.marginTop&&(i.marginTop=this.marginTop),null!=this.marginBottom&&(i.marginBottom=this.marginBottom),null!=this.marginLeft&&(i.marginLeft=this.marginLeft),null!=this.marginRight&&(i.marginRight=this.marginRight),this._elem.css(i);var s,r,n=t[0],a=new e.jqplot.ColorGenerator(n.seriesColors);if(n.show){var h,l,o,d,g,p,c,u,f,v=n.data;this.numberRows?(s=this.numberRows,r=this.numberColumns?this.numberColumns:Math.ceil(v.length/s)):this.numberColumns?(r=this.numberColumns,s=Math.ceil(v.length/this.numberColumns)):(s=v.length,r=1);var j,m,w=0;for(h=0;h0?this.rowSpacing:"0",(d=e(document.createElement("td"))).addClass("jqplot-table-legend jqplot-table-legend-swatch"),d.css({textAlign:"center",paddingTop:u}),(j=e(document.createElement("div"))).addClass("jqplot-table-legend-swatch-outline"),""!==c&&j.attr("title",c),(m=e(document.createElement("div"))).addClass("jqplot-table-legend-swatch"),m.css({backgroundColor:f,borderColor:f}),d.append(j.append(m)),(g=e(document.createElement("td"))).addClass("jqplot-table-legend jqplot-table-legend-label"),g.css("paddingTop",u),this.escapeHtml?g.text(p):g.html(''+p+""),d.appendTo(o),g.appendTo(o),!0),w++}}return this._elem},e.jqplot.PieRenderer.prototype.handleMove=function(e,t,i,s,a){if(s){var h=[s.seriesIndex,s.pointIndex,s.data];a.target.trigger("jqplotDataMouseOver",h),!a.series[h[0]].highlightMouseOver||h[0]==a.plugins.pieRenderer.highlightedSeriesIndex&&h[1]==a.series[h[0]]._highlightedPoint||(a.target.trigger("jqplotDataHighlight",h),r(a,h[0],h[1]))}else null==s&&n(a)},e.jqplot.preInitHooks.push(function(t,i,s){(s=s||{}).axesDefaults=s.axesDefaults||{},s.legend=s.legend||{},s.seriesDefaults=s.seriesDefaults||{};var r=!1;if(s.seriesDefaults.renderer==e.jqplot.PieRenderer)r=!0;else if(s.series)for(var n=0;n