1/*!
2* easyPieChart
3* Lightweight plugin to render simple, animated and retina optimized pie charts
4*
5* @author Robert Fleischmann <rendro87@gmail.com> (http://robert-fleischmann.de)
6* @version 2.1.5
7*
8* Modified to adapt the latest jQuery version (v3 above) included on WordPress 5.6:
9* - (2020-12-15) - jQuery isFunction method is deprecated.
10*/(function(root,factory){if(typeof exports==='object'){module.exports=factory(require('jquery'));}
11
12else if(typeof define==='function'&&define.amd){define(['jquery'],factory);}
13
14else{factory(root.jQuery);}
15}
16(this,function($){var CanvasRenderer=function(el,options){var cachedBackground;var canvas=document.createElement('canvas');el.appendChild(canvas);if(typeof(G_vmlCanvasManager)!=='undefined'){G_vmlCanvasManager.initElement(canvas);}
17
18var ctx=canvas.getContext('2d');canvas.width=canvas.height=options.size;var scaleBy=1;if(window.devicePixelRatio>1){scaleBy=window.devicePixelRatio;canvas.style.width=canvas.style.height=[options.size,'px'].join('');canvas.width=canvas.height=options.size*scaleBy;ctx.scale(scaleBy,scaleBy);}
19
20ctx.translate(options.size/2,options.size/2);ctx.rotate((-1/2+options.rotate/180)*Math.PI);var radius=(options.size-options.lineWidth)/2;if(options.scaleColor&&options.scaleLength){radius-=options.scaleLength+2;}
21
22Date.now=Date.now||function(){return+(new Date());}
23;var drawCircle=function(color,lineWidth,percent,alpha){percent=Math.min(Math.max(-1,percent||0),1);var isNegative=percent<=0?true:false;ctx.beginPath();ctx.arc(0,0,radius,0,Math.PI*2*percent,isNegative);ctx.strokeStyle=color;ctx.globalAlpha=alpha;ctx.lineWidth=lineWidth;ctx.stroke();}
24;var drawScale=function(){var offset;var length;ctx.lineWidth=1;ctx.fillStyle=options.scaleColor;ctx.save();for(var i=24;i>0;--i){if(i%6===0){length=options.scaleLength;offset=0;}
25else{length=options.scaleLength*0.6;offset=options.scaleLength-length;}
26
27ctx.fillRect(-options.size/2+offset,0,length,1);ctx.rotate(Math.PI/12);}
28
29ctx.restore();}
30;var reqAnimationFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(callback){window.setTimeout(callback,1000/60);}
31;}
32());var drawBackground=function(){if(options.scaleColor)drawScale();if(options.trackColor)drawCircle(options.trackColor,options.lineWidth,1,options.trackAlpha);}
33;this.getCanvas=function(){return canvas;}
34;this.getCtx=function(){return ctx;}
35;this.clear=function(){ctx.clearRect(options.size/-2,options.size/-2,options.size,options.size);}
36;this.draw=function(percent){if(!!options.scaleColor||!!options.trackColor){if(ctx.getImageData&&ctx.putImageData){if(!cachedBackground){drawBackground();cachedBackground=ctx.getImageData(0,0,options.size*scaleBy,options.size*scaleBy);}
37else{ctx.putImageData(cachedBackground,0,0);}
38}
39else{this.clear();drawBackground();}
40}
...
</html>