"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){var t=function(t,i){var n=i.getElementsByClassName(t)[0];if(!n&&((n=document.createElement("canvas")).className=t,n.style.direction="ltr",n.style.position="absolute",n.style.left="0px",n.style.top="0px",i.appendChild(n),!n.getContext))throw new Error("Canvas is not available.");this.element=n;var o=this.context=n.getContext("2d");this.pixelRatio=e.plot.browser.getPixelRatio(o);var a=e(i).width(),r=e(i).height();this.resize(a,r),this.SVGContainer=null,this.SVG={},this._textCache={}};function i(e,t){e.transform.baseVal.clear(),t&&t.forEach((function(t){e.transform.baseVal.appendItem(t)}))}t.prototype.resize=function(e,t){e=e<10?10:e,t=t<10?10:t;var i=this.element,n=this.context,o=this.pixelRatio;this.width!==e&&(i.width=e*o,i.style.width=e+"px",this.width=e),this.height!==t&&(i.height=t*o,i.style.height=t+"px",this.height=t),n.restore(),n.save(),n.scale(o,o)},t.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},t.prototype.render=function(){var e=this._textCache;for(var t in e)if(hasOwnProperty.call(e,t)){var i=this.getSVGLayer(t),n=e[t],o=i.style.display;for(var a in i.style.display="none",n)if(hasOwnProperty.call(n,a)){var r=n[a];for(var s in r)if(hasOwnProperty.call(r,s)){for(var l,c=r[s],u=c.positions,h=0;u[h];h++)if((l=u[h]).active)l.rendered||(i.appendChild(l.element),l.rendered=!0);else if(u.splice(h--,1),l.rendered){for(;l.element.firstChild;)l.element.removeChild(l.element.firstChild);l.element.parentNode.removeChild(l.element)}0===u.length&&(c.measured?c.measured=!1:delete r[s])}}i.style.display=o}},t.prototype.getSVGLayer=function(e){var t,i=this.SVG[e];return i||(this.SVGContainer?t=this.SVGContainer.firstChild:(this.SVGContainer=document.createElement("div"),this.SVGContainer.className="flot-svg",this.SVGContainer.style.position="absolute",this.SVGContainer.style.top="0px",this.SVGContainer.style.left="0px",this.SVGContainer.style.height="100%",this.SVGContainer.style.width="100%",this.SVGContainer.style.pointerEvents="none",this.element.parentNode.appendChild(this.SVGContainer),(t=document.createElementNS("http://www.w3.org/2000/svg","svg")).style.width="100%",t.style.height="100%",this.SVGContainer.appendChild(t)),(i=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("class",e),i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.bottom="0px",i.style.right="0px",t.appendChild(i),this.SVG[e]=i),i},t.prototype.getTextInfo=function(e,t,i,o,a){var r,s,l,c;t=""+t,r="object"===_typeof(i)?i.style+" "+i.variant+" "+i.weight+" "+i.size+"px/"+i.lineHeight+"px "+i.family:i,null==(s=this._textCache[e])&&(s=this._textCache[e]={}),null==(l=s[r])&&(l=s[r]={});var u=t.replace(/0|1|2|3|4|5|6|7|8|9/g,"0");if(!(c=l[u])){var h=document.createElementNS("http://www.w3.org/2000/svg","text");if(-1!==t.indexOf("
"))n(t,h,-9999);else{var p=document.createTextNode(t);h.appendChild(p)}h.style.position="absolute",h.style.maxWidth=a,h.setAttributeNS(null,"x",-9999),h.setAttributeNS(null,"y",-9999),"object"===_typeof(i)?(h.style.font=r,h.style.fill=i.fill):"string"==typeof i&&h.setAttribute("class",i),this.getSVGLayer(e).appendChild(h);var d=h.getBBox();for(c=l[u]={width:d.width,height:d.height,measured:!0,element:h,positions:[]};h.firstChild;)h.removeChild(h.firstChild);h.parentNode.removeChild(h)}return c.measured=!0,c},t.prototype.addText=function(e,t,o,a,r,s,l,c,u,h){var p=this.getTextInfo(e,a,r,s,l),d=p.positions;"center"===c?t-=p.width/2:"right"===c&&(t-=p.width),"middle"===u?o-=p.height/2:"bottom"===u&&(o-=p.height),o+=.75*p.height;for(var f,g=0;d[g];g++){if((f=d[g]).x===t&&f.y===o&&f.text===a)return f.active=!0,void i(f.element,h);if(!1===f.active)return f.active=!0,-1!==(f.text=a).indexOf("
")?(o-=.25*p.height,n(a,f.element,t)):f.element.textContent=a,f.element.setAttributeNS(null,"x",t),f.element.setAttributeNS(null,"y",o),f.x=t,f.y=o,void i(f.element,h)}f={active:!0,rendered:!1,element:d.length?p.element.cloneNode():p.element,text:a,x:t,y:o},d.push(f),-1!==a.indexOf("
")?(o-=.25*p.height,n(a,f.element,t)):f.element.textContent=a,f.element.setAttributeNS(null,"x",t),f.element.setAttributeNS(null,"y",o),f.element.style.textAlign=c,i(f.element,h)};var n=function(e,t,i){var n,o,a,r=e.split("
");for(o=0;ol.xmax&&(l.xmax=h)),!0===p.y&&(hl.ymax&&(l.ymax=h)))}return l},w.adjustSeriesDataRange=function(e,t){if(e.bars.show){var i,n=e.bars.barWidth[1];e.datapoints&&e.datapoints.points&&!n&&function(e){var t=[],i=e.datapoints.pointsize,n=Number.MAX_VALUE;e.datapoints.points.length<=i&&(n=1);for(var o=e.bars.horizontal?1:0;oe.datamax&&i!==1/0&&(e.datamax=i)}function x(e,t){return e&&e[t]&&e[t].datapoints&&e[t].datapoints.points?e[t].datapoints.points:[]}for(e.each(L(),(function(e,t){!0!==t.options.growOnly?(t.datamin=g,t.datamax=m):(void 0===t.datamin&&(t.datamin=g),void 0===t.datamax&&(t.datamax=m)),t.used=!1})),i=0;it.max?f:(s=u.getTextInfo(p,e.label,d),"x"===t.direction?(a="center",n=v.left+t.p2c(e.v),"bottom"===t.position?o=c.top+c.padding-t.boxPosition.centerY:(o=c.top+c.height-c.padding+t.boxPosition.centerY,r="bottom")):(r="middle",o=v.top+t.p2c(e.v),"left"===t.position?(n=c.left+c.width-c.padding-t.boxPosition.centerX,a="right"):n=c.left+c.padding+t.boxPosition.centerX),l={x:n-s.width/2-3,y:o-3,width:s.width+6,height:s.height+6},h=l,i.some((function(e){return function(e,t,i,n,o,a,r,s){return(e<=o&&o<=i||o<=e&&e<=r)&&(t<=a&&a<=n||a<=t&&t<=s)}(h.x,h.y,h.x+h.width,h.y+h.height,e.x,e.y,e.x+e.width,e.y+e.height)}))?f:(u.addText(p,n,o,e.label,d,null,null,a,r),l));var h};if(u.removeText(p),P(y.drawAxis,[t,u]),t.show)switch(t.options.showTickLabels){case"none":break;case"endpoints":g.push(m(t.ticks[0],g)),g.push(m(t.ticks[t.ticks.length-1],g));break;case"major":for(g.push(m(t.ticks[0],g)),g.push(m(t.ticks[t.ticks.length-1],g)),i=1;i=e.min&&c<=e.max&&("x"===e.direction?(a=e.p2c(c),h=t,"top"===e.position&&(h=-h)):(r=e.p2c(c),u=t,"left"===e.position&&(u=-u)),"x"===e.direction?a=q(d.lineWidth,a):r=q(d.lineWidth,r),d.moveTo(a,r),d.lineTo(a+u,r+h)),!0===i&&se.max||(i=o,n=c.grid.borderWidth,(!("object"===_typeof(n)&&0a.axis.max||r.tor.axis.max)){a.from=Math.max(a.from,a.axis.min),a.to=Math.min(a.to,a.axis.max),r.from=Math.max(r.from,r.axis.min),r.to=Math.min(r.to,r.axis.max);var s=a.from===a.to,l=r.from===r.to;if(!s||!l)if(a.from=Math.floor(a.axis.p2c(a.from)),a.to=Math.floor(a.axis.p2c(a.to)),r.from=Math.floor(r.axis.p2c(r.from)),r.to=Math.floor(r.axis.p2c(r.to)),s||l){var u=o.lineWidth||c.grid.markingsLineWidth,h=u%2?.5:0;d.beginPath(),d.strokeStyle=o.color||c.grid.markingsColor,d.lineWidth=u,s?(d.moveTo(a.to+h,r.from),d.lineTo(a.to+h,r.to)):(d.moveTo(a.from,r.to+h),d.lineTo(a.to,r.to+h)),d.stroke()}else d.fillStyle=o.color||c.grid.markingsColor,d.fillRect(a.from,r.to,a.to-a.from,r.from-r.to)}}}(),t=L(),i=c.grid.borderWidth;for(var a=0;ae.yaxis.min?Math.min(e.yaxis.max,u):e.yaxis.min,p=-1,d=0;d=Math.min(m,f)&&g+n<=s&&s<=g+o:f+n<=r&&r<=f+o&&s>=Math.min(m,g)&&s<=Math.max(m,g))&&(p=d/c)}}return p}function $(){var e=c.interaction.redrawOverlayInterval;-1!==e?T||(T=setTimeout((function(){ee(w)}),e)):ee()}function ee(e){if(T=null,f){h.clear(),P(y.drawOverlay,[f,h]);var t=new CustomEvent("onDrawingDone");e.getEventHolder().dispatchEvent(t),e.getPlaceholder().trigger("drawingdone")}}function te(t,i,n,o){if("string"==typeof t)return t;for(var a=d.createLinearGradient(0,n,0,i),r=0,s=t.colors.length;rr.max||xs.max||(gr.max&&(m=r.max,p=!1),vs.max&&(x=s.max,d=!1),g=r.p2c(g),v=s.p2c(v),m=r.p2c(m),x=s.p2c(x),a&&(l.fillStyle=a(v,x),l.fillRect(g,x,m-g,v-x)),0i.min?Math.min(i.max,n):i.min,c=0,u=1,h=!1,p=0,d=0,f=null,g=null;!(0r.length+s);){var m=r[(c+=s)-s],v=r[c-s+u],x=r[c],b=r[c+u];if(-2===s&&(v=b=l),h){if(0t.max){if(x>t.max)continue;v=(t.max-m)/(x-m)*(b-v)+v,m=t.max}else if(m<=x&&x>t.max){if(m>t.max)continue;b=(t.max-m)/(x-m)*(b-v)+v,x=t.max}if(h||(o.beginPath(),o.moveTo(t.p2c(m),i.p2c(l)),h=!0),v>=i.max&&b>=i.max)o.lineTo(t.p2c(m),i.p2c(i.max)),o.lineTo(t.p2c(x),i.p2c(i.max));else if(v<=i.min&&b<=i.min)o.lineTo(t.p2c(m),i.p2c(i.min)),o.lineTo(t.p2c(x),i.p2c(i.min));else{var y=m,w=x;v<=b&&v=i.min?(m=(i.min-v)/(b-v)*(x-m)+m,v=i.min):b<=v&&b=i.min&&(x=(i.min-v)/(b-v)*(x-m)+m,b=i.min),b<=v&&v>i.max&&b<=i.max?(m=(i.max-v)/(b-v)*(x-m)+m,v=i.max):v<=b&&b>i.max&&v<=i.max&&(x=(i.max-v)/(b-v)*(x-m)+m,b=i.max),m!==y&&o.lineTo(t.p2c(y),i.p2c(v)),o.lineTo(t.p2c(m),i.p2c(v)),o.lineTo(t.p2c(x),i.p2c(b)),x!==w&&(o.lineTo(t.p2c(x),i.p2c(b)),o.lineTo(t.p2c(w),i.p2c(b)))}}else g=f=null}}(l,e.xaxis,e.yaxis,e.lines.fillTowards||0,t,e.lines.steps)),0o.max){if(f>o.max)continue;h=(o.max-p)/(f-p)*(d-h)+h,p=o.max}else if(p<=f&&f>o.max){if(p>o.max)continue;d=(o.max-p)/(f-p)*(d-h)+h,f=o.max}if(h<=d&&hn.max){if(d>n.max)continue;p=(n.max-h)/(d-h)*(f-p)+p,h=n.max}else if(h<=d&&d>n.max){if(h>n.max)continue;f=(n.max-h)/(d-h)*(f-p)+p,d=n.max}h===c&&p===u||a.moveTo(n.p2c(h)+0,o.p2c(p)+0),c=d,u=f,a.lineTo(n.p2c(d)+0,o.p2c(f)+0)}else m=g=null;a.stroke()}(l,0,0,e.xaxis,e.yaxis,t,e.lines.steps),t.restore()},this.drawSeriesPoints=function(e,t,n,o,a,r,s){function l(e,t,i,n,o,a){e.moveTo(t+n,i),e.arc(t,i,n,0,o?Math.PI:2*Math.PI,!1)}l.fill=!0,t.save(),t.translate(n.left,n.top);var c={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimatePoints&&(c.points=e.decimatePoints(e,e.xaxis.min,e.xaxis.max,o,e.yaxis.min,e.yaxis.max,a));var u,h=e.points.lineWidth,p=e.points.radius,d=e.points.symbol;"circle"===d?u=l:"string"==typeof d&&r&&r[d]?u=r[d]:"function"==typeof r&&(u=r),0===h&&(h=1e-4),t.lineWidth=h,t.fillStyle=i(e.points,e.color,null,null,s),t.strokeStyle=e.color,function(e,i,n,o,a,r,s,l){var c=e.points,u=e.pointsize;t.beginPath();for(var h=0;hr.max||ds.max||(p=r.p2c(p),d=s.p2c(d)+0,l(t,p,d,i,false,true))}l.fill&&t.fill(),t.stroke()}(c,p,0,0,0,e.xaxis,e.yaxis,u),t.restore()},this.drawSeriesBars=function(e,n,o,a,r,s,l){n.save(),n.translate(o.left,o.top);var c,u={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimate&&(u.points=e.decimate(e,e.xaxis.min,e.xaxis.max,a)),n.lineWidth=e.bars.lineWidth,n.strokeStyle=e.color;var h=e.bars.barWidth[0]||e.bars.barWidth;switch(e.bars.align){case"left":c=0;break;case"right":c=-h;break;default:c=-h/2}!function(i,o,a,r,s,l){for(var c=i.points,u=i.pointsize,h=e.bars.fillTowards||0,p=h>l.min?Math.min(l.max,h):l.min,d=0;dl[1].max||xl[0].max))continue;if("y"===u[g].err&&(v>l[0].max||vl[1].max))continue;var w=!0,k=!0;b>m[1]&&(w=!1,b=m[1]),y=x?v={pixelCoord:g,idealPixelCoord:v.idealPixelCoord-x}:m=null,m&&s.push(m);s.reverse()}else{var y=n.computeTickSize(p,d,r),w={min:p,max:d,tickSize:y};s=e.plot.linearTickGenerator(w)}return s},a=function(e,t){var i=e.min,n=e.max;return i<=0&&n<(i=null===e.datamin?e.min=.1:d(t,e))&&(e.max=null!==e.datamax?e.datamax:e.options.max,e.options.offset.below=0,e.options.offset.above=0),i},r=function(t,i,n){var o=0t.left&&s.leftt.top&&s.topt.left&&n.leftt.top&&n.topd.zoomRange[1])continue}var x=e.plot.saturated.saturate(m.below-(p.min-f)),b=e.plot.saturated.saturate(m.above-(p.max-g));d.offset={below:x,above:b}}}a.setupGrid(!0),a.draw(),t.preventEvent||a.getPlaceholder().trigger("plotzoom",[a,t])},a.pan=function(i){var n={x:+i.left,y:+i.top};isNaN(n.x)&&(n.x=0),isNaN(n.y)&&(n.y=0),e.each(i.axes||a.getAxes(),(function(e,o){var a=o.options,r=n[o.direction];if((a.axisPan||!i.axes)&&(a.plotPan||i.axes)){var s=o.p2c(a.panRange[0])-o.p2c(o.min),l=o.p2c(a.panRange[1])-o.p2c(o.max);if(void 0!==a.panRange[0]&&l<=r&&(r=l),void 0!==a.panRange[1]&&r<=s&&(r=s),0!==r){var c=t.saturate(o.c2p(o.p2c(o.min)+r)-o.c2p(o.p2c(o.min))),u=t.saturate(o.c2p(o.p2c(o.max)+r)-o.c2p(o.p2c(o.max)));isFinite(c)||(c=0),isFinite(u)||(u=0),a.offset={below:t.saturate(c+(a.offset.below||0)),above:t.saturate(u+(a.offset.above||0))}}}})),a.setupGrid(!0),a.draw(),i.preventEvent||a.getPlaceholder().trigger("plotpan",[a,i])},a.recenter=function(t){e.each(t.axes||a.getAxes(),(function(e,i){t.axes?"x"===this.direction?i.options.offset={below:0}:"y"===this.direction&&(i.options.offset={above:0}):i.options.offset={below:0,above:0}})),a.setupGrid(!0),a.draw()};var P=null,C={x:0,y:0};a.smartPan=function(e,i,o,r,s){var l,c,u,h,p,d,g,m,v,x,b,y,w,k=!!s||(c=e,Math.abs(c.y)=n||Math.abs(c.x)=n),T=a.getAxes();e=s?function(e){switch(!P&&Math.max(Math.abs(e.x),Math.abs(e.y))>=n&&(P=Math.abs(e.x)=n?{x:0,y:u.y}:Math.abs(u.y)=n?{x:u.x,y:0}:u),h=e,0t.left&&i.leftt.top&&i.top=t.length?null:t[e.fillBetween]:null}(t,e.getData());if(n){for(var o,a,r,s,l,c,u,h,p=i.pointsize,d=i.points,f=n.datapoints.pointsize,g=n.datapoints.points,m=[],v=t.lines.show,x=2=d.length);){if(u=m.length,null==d[w]){for(h=0;h=g.length){if(!v)for(h=0;h=e.min&&n<=e.max&&t.push([n,i])}return t.sort((function(e,t){return e[0]-t[0]})),t}function n(t,n,o){if("categories"===t[n].options.mode){if(!t[n].categories){var a={},r=t[n].options.categories||{};if(e.isArray(r))for(var s=0;st&&(t=e[i]);return t+1}(i),l=0;l=g.length);){if(p=x.length,null==g[S]){for(d=0;d=v.length){if(!b)for(d=0;dt)&&(o=e,c=f,u=g,h=(n=i).offset(),p={left:0,top:0},m=a(o)/c.prevDistance,v=a(o),p.left=l(o,"pinch").x-h.left,p.top=l(o,"pinch").y-h.top,n.zoom({center:p,amount:m,axes:u.touchedAxis}),c.prevDistance=v,f.zoomEnable=!0),d=null}),1e3/60))},end:function(e){d&&(clearTimeout(d),d=null),b(e),f.prevDistance=null}},p={recenterPlot:function(t){t&&t.detail&&"touchstart"===t.detail.type&&function(t,i,o,a){var r,s,l,c,u;(l=i,c=a,void 0!==(u=(s=t).getTouchedAxis(l.detail.firstTouch.x,l.detail.firstTouch.y))[0]&&(c.prevTouchedAxis=u[0].direction),void 0!==(u=s.getTouchedAxis(l.detail.secondTouch.x,l.detail.secondTouch.y))[0]&&(c.touchedAxis=u,c.currentTouchedAxis=u[0].direction),n(c)&&(c.touchedAxis=null,c.prevTouchedAxis="none",c.currentTouchedAxis="none"),"x"===a.currentTouchedAxis&&"x"===a.prevTouchedAxis||"y"===a.currentTouchedAxis&&"y"===a.prevTouchedAxis||"none"===a.currentTouchedAxis&&"none"===a.prevTouchedAxis)&&(t.recenter({axes:a.touchedAxis}),r=a.touchedAxis?new e.Event("re-center",{detail:{axisTouched:a.touchedAxis}}):new e.Event("re-center",{detail:i}),t.getPlaceholder().trigger(r))}(i,t,0,g)}},!0!==c.pan.enableTouch&&!0!==c.zoom.enableTouch||(i.hooks.bindEvents.push((function(e,t){var i=e.getOptions();i.zoom.interactive&&i.zoom.enableTouch&&(t[0].addEventListener("pinchstart",h.start,!1),t[0].addEventListener("pinchdrag",h.drag,!1),t[0].addEventListener("pinchend",h.end,!1)),i.pan.interactive&&i.pan.enableTouch&&(t[0].addEventListener("panstart",u.start,!1),t[0].addEventListener("pandrag",u.drag,!1),t[0].addEventListener("panend",u.end,!1)),i.recenter.interactive&&i.recenter.enableTouch&&t[0].addEventListener("doubletap",p.recenterPlot,!1)})),i.hooks.shutdown.push((function(e,t){t[0].removeEventListener("panstart",u.start),t[0].removeEventListener("pandrag",u.drag),t[0].removeEventListener("panend",u.end),t[0].removeEventListener("pinchstart",h.start),t[0].removeEventListener("pinchdrag",h.drag),t[0].removeEventListener("pinchend",h.end),t[0].removeEventListener("doubletap",p.recenterPlot)})))}function n(e){return!e.touchedAxis||0===e.touchedAxis.length}function o(e,t,i,n){var o,a=l(e,t);switch(n.navigationConstraint){case"unconstrained":n.touchedAxis=null,i.prevTapPosition={x:i.prevPanPosition.x,y:i.prevPanPosition.y},i.prevPanPosition={x:a.x,y:a.y};break;case"axisConstrained":o=n.touchedAxis[0].direction,n.currentTouchedAxis=o,i.prevTapPosition[o]=i.prevPanPosition[o],i.prevPanPosition[o]=a[o]}}function a(e){var t,i,n,o,a=e.detail.touches[0],r=e.detail.touches[1];return t=a.pageX,i=a.pageY,n=r.pageX,o=r.pageY,Math.sqrt((t-n)*(t-n)+(i-o)*(i-o))}function r(e,t,i,n){var o=l(e,t);switch(n.navigationConstraint){case"unconstrained":i.prevPanPosition.x=o.x,i.prevPanPosition.y=o.y;break;case"axisConstrained":i.prevPanPosition[n.currentTouchedAxis]=o[n.currentTouchedAxis]}}function s(e,t,i){var n=l(e,t);return{x:n.x-i.prevPanPosition.x,y:n.y-i.prevPanPosition.y}}function l(e,t){return"pinch"===t?{x:(e.detail.touches[0].pageX+e.detail.touches[1].pageX)/2,y:(e.detail.touches[0].pageY+e.detail.touches[1].pageY)/2}:{x:e.detail.touches[0].pageX,y:e.detail.touches[0].pageY}}e.plot.plugins.push({init:function(e){e.hooks.processOptions.push(i)},options:{zoom:{enableTouch:!1},pan:{enableTouch:!1,touchMode:"manual"},recenter:{enableTouch:!0}},name:"navigateTouch",version:"0.3"})}(jQuery),function(e){var t=e.plot.browser,i="hover";e.plot.plugins.push({init:function(n){var o,a=[];function r(e){var t=n.getOptions(),o=new CustomEvent("mouseevent");return o.pageX=e.detail.changedTouches[0].pageX,o.pageY=e.detail.changedTouches[0].pageY,o.clientX=e.detail.changedTouches[0].clientX,o.clientY=e.detail.changedTouches[0].clientY,t.grid.hoverable&&s(o,i,30),!1}function s(e,t,i){var o=n.getData();if(void 0!==e&&0s.max||rl.max)){var u=t.points.radius+t.points.lineWidth/2;n.lineWidth=u,n.strokeStyle=c;var h=1.5*u;a=s.p2c(a),r=l.p2c(r),n.beginPath();var p=t.points.symbol;"circle"===p?n.arc(a,r,h,0,2*Math.PI,!1):"string"==typeof p&&o.drawSymbol&&o.drawSymbol[p]&&o.drawSymbol[p](n,a,r,h,!1),n.closePath(),n.stroke()}}function y(t,i,n){var o,a="string"==typeof t.highlightColor?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString(),r=a,s=t.bars.barWidth[0]||t.bars.barWidth;switch(t.bars.align){case"left":o=0;break;case"right":o=-s;break;default:o=-s/2}n.lineWidth=t.bars.lineWidth,n.strokeStyle=a;var l=t.bars.fillTowards||0,c=l>t.yaxis.min?Math.min(t.yaxis.max,l):t.yaxis.min;e.plot.drawSeries.drawBar(i[0],i[1],i[2]||c,o,o+s,(function(){return r}),t.xaxis,t.yaxis,n,t.bars.horizontal,t.bars.lineWidth)}n.hooks.bindEvents.push((function(e,t){var i=e.getOptions();(i.grid.hoverable||i.grid.clickable)&&(t[0].addEventListener("touchevent",h,!1),t[0].addEventListener("tap",r,!1)),i.grid.clickable&&t.bind("click",u),i.grid.hoverable&&(t.bind("mousemove",l),t.bind("mouseleave",c))})),n.hooks.shutdown.push((function(e,t){t[0].removeEventListener("tap",r),t[0].removeEventListener("touchevent",h),t.unbind("mousemove",l),t.unbind("mouseleave",c),t.unbind("click",u),a=[]})),n.hooks.processOptions.push((function(e,t){e.highlight=d,e.unhighlight=f,(t.grid.hoverable||t.grid.clickable)&&(e.hooks.drawOverlay.push(x),e.hooks.processDatapoints.push(m),e.hooks.setupGrid.push(v)),o=e.getPlaceholder()[0].lastMouseMoveEvent}))},options:{grid:{hoverable:!1,clickable:!1}},name:"hover",version:"0.1"})}(jQuery),function(e){function t(e,t){var i,n={twoTouches:!1,currentTapStart:{x:0,y:0},currentTapEnd:{x:0,y:0},prevTap:{x:0,y:0},currentTap:{x:0,y:0},interceptedLongTap:!1,isUnsupportedGesture:!1,prevTapTime:null,tapStartTime:null,longTapTriggerId:null};function o(t){var o=e.getOptions();(o.pan.active||o.zoom.active)&&(3<=t.touches.length?n.isUnsupportedGesture=!0:n.isUnsupportedGesture=!1,i.dispatchEvent(new CustomEvent("touchevent",{detail:t})),g(t)?a(t,"pinch"):(a(t,"pan"),f(t)||(function(e){var t=(new Date).getTime(),i=t-n.prevTapTime;return 0<=i&&i<500&&d(n.prevTap.x,n.prevTap.y,n.currentTap.x,n.currentTap.y)<20?(e.firstTouch=n.prevTap,e.secondTouch=n.currentTap,!0):(n.prevTapTime=t,!1)}(t)&&a(t,"doubleTap"),a(t,"tap"),a(t,"longTap"))))}function a(e,t){switch(t){case"pan":r[e.type](e);break;case"pinch":s[e.type](e);break;case"doubleTap":l.onDoubleTap(e);break;case"longTap":c[e.type](e);break;case"tap":u[e.type](e)}}var r={touchstart:function(e){var t;n.prevTap={x:n.currentTap.x,y:n.currentTap.y},h(e),t=e,n.tapStartTime=(new Date).getTime(),n.interceptedLongTap=!1,n.currentTapStart={x:t.touches[0].pageX,y:t.touches[0].pageY},n.currentTapEnd={x:t.touches[0].pageX,y:t.touches[0].pageY},i.dispatchEvent(new CustomEvent("panstart",{detail:e}))},touchmove:function(e){var t;p(e),h(e),t=e,n.currentTapEnd={x:t.touches[0].pageX,y:t.touches[0].pageY},n.isUnsupportedGesture||i.dispatchEvent(new CustomEvent("pandrag",{detail:e}))},touchend:function(e){var t;p(e),f(e)?(i.dispatchEvent(new CustomEvent("pinchend",{detail:e})),i.dispatchEvent(new CustomEvent("panstart",{detail:e}))):(t=e).touches&&0===t.touches.length&&i.dispatchEvent(new CustomEvent("panend",{detail:e}))}},s={touchstart:function(e){i.dispatchEvent(new CustomEvent("pinchstart",{detail:e}))},touchmove:function(e){p(e),n.twoTouches=g(e),n.isUnsupportedGesture||i.dispatchEvent(new CustomEvent("pinchdrag",{detail:e}))},touchend:function(e){p(e)}},l={onDoubleTap:function(e){p(e),i.dispatchEvent(new CustomEvent("doubletap",{detail:e}))}},c={touchstart:function(e){c.waitForLongTap(e)},touchmove:function(e){},touchend:function(e){n.longTapTriggerId&&(clearTimeout(n.longTapTriggerId),n.longTapTriggerId=null)},isLongTap:function(e){return 1500<=(new Date).getTime()-n.tapStartTime&&!n.interceptedLongTap&&d(n.currentTapStart.x,n.currentTapStart.y,n.currentTapEnd.x,n.currentTapEnd.y)<20&&(n.interceptedLongTap=!0)},waitForLongTap:function(e){n.longTapTriggerId||(n.longTapTriggerId=setTimeout((function(){c.isLongTap(e)&&i.dispatchEvent(new CustomEvent("longtap",{detail:e})),n.longTapTriggerId=null}),1500))}},u={touchstart:function(e){n.tapStartTime=(new Date).getTime()},touchmove:function(e){},touchend:function(e){u.isTap(e)&&(i.dispatchEvent(new CustomEvent("tap",{detail:e})),p(e))},isTap:function(e){return(new Date).getTime()-n.tapStartTime<=125&&d(n.currentTapStart.x,n.currentTapStart.y,n.currentTapEnd.x,n.currentTapEnd.y)<20}};function h(e){n.currentTap={x:e.touches[0].pageX,y:e.touches[0].pageY}}function p(t){n.isUnsupportedGesture||(t.preventDefault(),e.getOptions().propagateSupportedGesture||t.stopPropagation())}function d(e,t,i,n){return Math.sqrt((e-i)*(e-i)+(t-n)*(t-n))}function f(e){return n.twoTouches&&1===e.touches.length}function g(t){return!!(t.touches&&2<=t.touches.length&&t.touches[0].target===e.getEventHolder()&&t.touches[1].target===e.getEventHolder())}(!0===t.pan.enableTouch||t.zoom.enableTouch)&&(e.hooks.bindEvents.push((function(e,t){i=t[0],t[0].addEventListener("touchstart",o,!1),t[0].addEventListener("touchmove",o,!1),t[0].addEventListener("touchend",o,!1)})),e.hooks.shutdown.push((function(e,t){t[0].removeEventListener("touchstart",o),t[0].removeEventListener("touchmove",o),t[0].removeEventListener("touchend",o),n.longTapTriggerId&&(clearTimeout(n.longTapTriggerId),n.longTapTriggerId=null)})))}jQuery.plot.plugins.push({init:function(e){e.hooks.processOptions.push(t)},options:{propagateSupportedGesture:!1},name:"navigateTouch",version:"0.3"})}(),function(e){var t=e.plot.saturated.floorInBase,i=function(e,t){var i=new e(t),n=i.setTime.bind(i);i.update=function(e){e=Math.round(1e3*e)/1e3,n(e),this.microseconds=1e3*(e-Math.floor(e))};var o=i.getTime.bind(i);return i.getTime=function(){return o()+this.microseconds/1e3},i.setTime=function(e){this.update(e)},i.getMicroseconds=function(){return this.microseconds},i.setMicroseconds=function(e){var t=o()+e/1e3;this.update(t)},i.setUTCMicroseconds=function(e){this.setMicroseconds(e)},i.getUTCMicroseconds=function(){return this.getMicroseconds()},i.microseconds=null,i.microEpoch=null,i.update(t),i};function n(e,t,i,n){if("function"==typeof e.strftime)return e.strftime(t);var o,a=function(e,t){return t=""+(null==t?"0":t),1===(e=""+e).length?t+e:e},r=function(e,t,i){var n,o=1e3*e+t;if(i<6&&0=p);++f);var g=d[f][0],m=d[f][1];if("year"===m){if(null!==n.minTickSize&&void 0!==n.minTickSize&&"year"===n.minTickSize[1])g=Math.floor(n.minTickSize[0]);else{var v=parseFloat("1e"+Math.floor(Math.log(e.delta/i.year)/Math.LN10)),x=e.delta/i.year/v;g=x<1.5?1:x<3?2:x<7.5?5:10,g*=v}g<1&&(g=1)}e.tickSize=n.tickSize||[g,m];var b=e.tickSize[0],y=b*i[m=e.tickSize[1]];"microsecond"===m?c.setMicroseconds(t(c.getMicroseconds(),b)):"millisecond"===m?c.setMilliseconds(t(c.getMilliseconds(),b)):"second"===m?c.setSeconds(t(c.getSeconds(),b)):"minute"===m?c.setMinutes(t(c.getMinutes(),b)):"hour"===m?c.setHours(t(c.getHours(),b)):"month"===m?c.setMonth(t(c.getMonth(),b)):"quarter"===m?c.setMonth(3*t(c.getMonth()/3,b)):"year"===m&&c.setFullYear(t(c.getFullYear(),b)),y>=i.millisecond&&c.setMicroseconds(0),y>=i.second&&c.setMilliseconds(0),y>=i.minute&&c.setSeconds(0),y>=i.hour&&c.setMinutes(0),y>=i.day&&c.setHours(0),y>=4*i.day&&c.setDate(1),y>=2*i.month&&c.setMonth(t(c.getMonth(),3)),y>=2*i.quarter&&c.setMonth(t(c.getMonth(),6)),y>=i.year&&c.setMonth(0);var w,k,T=0,M=Number.NaN;do{if(k=M,w=c.getTime(),M=n&&"seconds"===n.timeBase?w/1e3:n&&"microseconds"===n.timeBase?1e3*w:w,o.push(M),"month"===m||"quarter"===m)if(b<1){c.setDate(1);var S=c.getTime();c.setMonth(c.getMonth()+("quarter"===m?3:1));var P=c.getTime();c.setTime(M+T*i.hour+(P-S)*b),T=c.getHours(),c.setHours(0)}else c.setMonth(c.getMonth()+b*("quarter"===m?3:1));else"year"===m?c.setFullYear(c.getFullYear()+b):"seconds"===n.timeBase?c.setTime(1e3*(M+y)):"microseconds"===n.timeBase?c.setTime((M+y)/1e3):c.setTime(M+y)}while(M=e&&Math.abs(i.second.y-i.first.y)>=e}t.clearSelection=f,t.setSelection=function(e,n){var o;"y"===h(t)?(i.first.x=0,i.second.x=t.width()):(o=g(e,"x"),i.first.x=o.axis.p2c(o.from),i.second.x=o.axis.p2c(o.to)),"x"===h(t)?(i.first.y=0,i.second.y=t.height()):(o=g(e,"y"),i.first.y=o.axis.p2c(o.from),i.second.y=o.axis.p2c(o.to)),i.show=!0,t.triggerRedrawOverlay(),!n&&m()&&c()},t.getSelection=l,t.hooks.bindEvents.push((function(e,t){null!=e.getOptions().selection.mode&&(e.addEventHandler("dragstart",r,t,0),e.addEventHandler("drag",a,t,0),e.addEventHandler("dragend",s,t,0))})),t.hooks.drawOverlay.push((function(t,n){if(i.show&&m()){var o=t.getPlotOffset(),a=t.getOptions();n.save(),n.translate(o.left,o.top);var r=e.color.parse(a.selection.color),s=a.selection.visualization,l=a.selection.displaySelectionDecorations,c=1;"fill"===s&&(c=.8),n.strokeStyle=r.scale("a",c).toString(),n.lineWidth=1,n.lineJoin=a.selection.shape,n.fillStyle=r.scale("a",.4).toString();var u=Math.min(i.first.x,i.second.x)+.5,p=u,d=Math.min(i.first.y,i.second.y)+.5,f=d,g=Math.abs(i.second.x-i.first.x)-1,v=Math.abs(i.second.y-i.first.y)-1;"x"===h(t)&&(v+=d,d=0),"y"===h(t)&&(g+=u,u=0),"fill"===s?(n.fillRect(u,d,g,v),n.strokeRect(u,d,g,v)):(n.fillRect(0,0,t.width(),t.height()),n.clearRect(u,d,g,v),l&&(x=n,b=u,y=d,w=g,k=v,T=p,M=f,S=h(t),P=Math.max(0,Math.min(15,w/2-2,k/2-2)),x.fillStyle="#ffffff","xy"===S&&(x.beginPath(),x.moveTo(b,y+P),x.lineTo(b-3,y+P),x.lineTo(b-3,y-3),x.lineTo(b+P,y-3),x.lineTo(b+P,y),x.lineTo(b,y),x.closePath(),x.moveTo(b,y+k-P),x.lineTo(b-3,y+k-P),x.lineTo(b-3,y+k+3),x.lineTo(b+P,y+k+3),x.lineTo(b+P,y+k),x.lineTo(b,y+k),x.closePath(),x.moveTo(b+w,y+P),x.lineTo(b+w+3,y+P),x.lineTo(b+w+3,y-3),x.lineTo(b+w-P,y-3),x.lineTo(b+w-P,y),x.lineTo(b+w,y),x.closePath(),x.moveTo(b+w,y+k-P),x.lineTo(b+w+3,y+k-P),x.lineTo(b+w+3,y+k+3),x.lineTo(b+w-P,y+k+3),x.lineTo(b+w-P,y+k),x.lineTo(b+w,y+k),x.closePath(),x.stroke(),x.fill()),b=T,y=M,"x"===S&&(x.beginPath(),x.moveTo(b,y+15),x.lineTo(b,y-15),x.lineTo(b-3,y-15),x.lineTo(b-3,y+15),x.closePath(),x.moveTo(b+w,y+15),x.lineTo(b+w,y-15),x.lineTo(b+w+3,y-15),x.lineTo(b+w+3,y+15),x.closePath(),x.stroke(),x.fill()),"y"===S&&(x.beginPath(),x.moveTo(b-15,y),x.lineTo(b+15,y),x.lineTo(b+15,y-3),x.lineTo(b-15,y-3),x.closePath(),x.moveTo(b-15,y+k),x.lineTo(b+15,y+k),x.lineTo(b+15,y+k+3),x.lineTo(b-15,y+k+3),x.closePath(),x.stroke(),x.fill()))),n.restore()}var x,b,y,w,k,T,M,S,P})),t.hooks.shutdown.push((function(e,t){t.unbind("dragstart",r),t.unbind("drag",a),t.unbind("dragend",s)}))},options:{selection:{mode:null,visualization:"focus",displaySelectionDecorations:!0,color:"#888888",shape:"round",minSize:5}},name:"selection",version:"1.1"})}(jQuery),function(e){var t=1,i=e.plot.browser,n=i.getPixelRatio;function o(e,o){var u=e.filter(a);t=n(o.getContext("2d"));var h,p=u.map((function(e){var t,n,o=new Image;return new Promise((n=e,(t=o).sourceDescription='',t.sourceComponent=n,function(e,o){var a,c,u,h,p,d,f,g,m,v,x,b;t.onload=function(i){t.successfullyLoaded=!0,e(t)},t.onabort=function(i){t.successfullyLoaded=!1,console.log("Can't generate temp image from "+t.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",t.sourceComponent),e(t)},t.onerror=function(i){t.successfullyLoaded=!1,console.log("Can't generate temp image from "+t.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",t.sourceComponent),e(t)},c=t,"CANVAS"===(a=n).tagName&&(u=a,c.src=u.toDataURL("image/png")),"svg"===a.tagName&&(h=a,p=c,i.isSafari()||i.isMobileSafari()?(d=h,f=p,v=l(v=s(r(document),d)),m=function(e){for(var t="",i=new Uint8Array(e),n=0;ne[c].genLeft&&(a=e[c].genLeft),r>e[c].genTop&&(r=e[c].genTop);for(c=1;c',"",i.innerHTML,""].join("\n")}function l(e){var t="";return e.match(/^]+xmlns="http:\/\/www\.w3\.org\/2000\/svg"/)||(t=e.replace(/^]+"http:\/\/www\.w3\.org\/1999\/xlink"/)||(t=e.replace(/^\r\n'+t}function c(){return-100}e.plot.composeImages=o,e.plot.plugins.push({init:function(e){e.composeImages=o},name:"composeImages",version:"1.0"})}(jQuery),function(e){function t(e){var t="",i=e.name,n=e.xPos,o=e.yPos,a=e.fillColor,r=e.strokeColor,s=e.strokeWidth;switch(i){case"circle":default:t='';break;case"diamond":t='';break;case"cross":t='';break;case"rectangle":t='';break;case"plus":t='';break;case"bar":t='';break;case"area":t='';break;case"line":t=''}return t}function i(e,t){for(var i in e)if(e.hasOwnProperty(i)&&e[i]!==t[i])return!0;return!1}e.plot.plugins.push({init:function(n){n.hooks.setupGrid.push((function(n){var o=n.getOptions(),a=n.getData(),r=o.legend.labelFormatter,s=o.legend.legendEntries,l=o.legend.plotOffset,c=function(t,i,n){var o=i,a=t.reduce((function(e,t,i){var n=o?o(t.label,t):t.label;if(!t.hasOwnProperty("label")||n){var a={label:n||"Plot "+(i+1),color:t.color,options:{lines:t.lines,points:t.points,bars:t.bars}};e.push(a)}return e}),[]);if(n)if(e.isFunction(n))a.sort(n);else if("reverse"===n)a.reverse();else{var r="descending"!==n;a.sort((function(e,t){return e.label===t.label?0:e.label',p[d++]='',p[d++]='';var x=0,b=[],y=window.getComputedStyle(document.querySelector("body"));for(c=0;cb[w]&&(b[w]=k+48):b[w]=k+48}for(c=0;c'+v.label+"",p[d++]=""+l+s+""}p[d++]="",null==m[0]&&(m=[m,m]),"n"===g.charAt(0)?f+="top:"+(m[1]+h.top)+"px;":"s"===g.charAt(0)&&(f+="bottom:"+(m[1]+h.bottom)+"px;"),"e"===g.charAt(1)?f+="right:"+(m[0]+h.right)+"px;":"w"===g.charAt(1)&&(f+="left:"+(m[0]+h.left)+"px;");var M=6;for(c=0;c'+p.join("")+"").appendTo(o)).css("width",M+"px"),S.css("height",P+"em"),S.css("pointerEvents","none"))}}(n,o,n.getPlaceholder(),c)}))},options:{legend:{show:!1,noColumns:1,labelFormatter:null,container:null,position:"ne",margin:5,sorted:null}},name:"legend",version:"1.0"})}(jQuery),function(e,t,i){var n,o=[],a=e.resize=e.extend(e.resize,{}),r=!1,s="setTimeout",l="resize",c=l+"-special-event",u="pendingDelay",h="activeDelay",p="throttleWindow";function d(i){!0===r&&(r=i||1);for(var s=o.length-1;s>=0;s--){var h=e(o[s]);if(h[0]==t||h.is(":visible")){var p=h.width(),f=h.height(),g=h.data(c);!g||p===g.w&&f===g.h||(h.trigger(l,[g.w=p,g.h=f]),r=i||!0)}else(g=h.data(c)).w=0,g.h=0}null!==n&&(r&&(null==i||i-r<1e3)?n=t.requestAnimationFrame(d):(n=setTimeout(d,a[u]),r=!1))}a[u]=200,a[h]=20,a[p]=!0,e.event.special[l]={setup:function(){if(!a[p]&&this[s])return!1;var t=e(this);o.push(this),t.data(c,{w:t.width(),h:t.height()}),1===o.length&&(n=i,d())},teardown:function(){if(!a[p]&&this[s])return!1;for(var t=e(this),i=o.length-1;i>=0;i--)if(o[i]==this){o.splice(i,1);break}t.removeData(c),o.length||(r?cancelAnimationFrame(n):clearTimeout(n),n=null)},add:function(t){if(!a[p]&&this[s])return!1;var n;function o(t,o,a){var r=e(this),s=r.data(c)||{};s.w=o!==i?o:r.width(),s.h=a!==i?a:r.height(),n.apply(this,arguments)}if(e.isFunction(t))return n=t,o;n=t.handler,t.handler=o}},t.requestAnimationFrame||(t.requestAnimationFrame=t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e,i){return t.setTimeout((function(){e((new Date).getTime())}),a[h])}),t.cancelAnimationFrame||(t.cancelAnimationFrame=t.webkitCancelRequestAnimationFrame||t.mozCancelRequestAnimationFrame||t.oCancelRequestAnimationFrame||t.msCancelRequestAnimationFrame||clearTimeout)}(jQuery,window),jQuery.plot.plugins.push({init:function(e){function t(){var t=e.getPlaceholder();0!==t.width()&&0!==t.height()&&(e.resize(),e.setupGrid(),e.draw())}e.hooks.bindEvents.push((function(e,i){e.getPlaceholder().resize(t)})),e.hooks.shutdown.push((function(e,i){e.getPlaceholder().unbind("resize",t)}))},options:{},name:"resize",version:"1.0"}),function(e){function t(e,t,i,n){var o="categories"===t.xaxis.options.mode,a="categories"===t.yaxis.options.mode;if(o||a){var r=n.format;if(!r){var s=t;if((r=[]).push({x:!0,number:!0,required:!0,computeRange:!0}),r.push({y:!0,number:!0,required:!0,computeRange:!0}),s.bars.show||s.lines.show&&s.lines.fill){var l=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);r.push({y:!0,number:!0,required:!1,defaultValue:0,computeRange:l}),s.bars.horizontal&&(delete r[r.length-1].y,r[r.length-1].x=!0)}n.format=r}for(var c=0;c=e.min&&n<=e.max&&t.push([n,i])}return t.sort((function(e,t){return e[0]-t[0]})),t}function n(t,n,o){if("categories"===t[n].options.mode){if(!t[n].categories){var a={},r=t[n].options.categories||{};if(e.isArray(r))for(var s=0;st&&(t=e[i]);return t+1}(i),l=0;l"+e+"
"+Math.round(t.percent)+"%"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};e.plot.plugins.push({init:function(t){var i=null,n=null,o=null,a=null,r=null,s=null,l=!1,c=null,u=[];function h(t,a,r){l||(l=!0,i=t.getCanvas(),n=e(i).parent(),o=t.getOptions(),t.setData(function(t){var i,n,a=0,r=0,s=0,l=o.series.pie.combine.color,c=[];for(i=0;io.series.pie.combine.threshold)&&c.push(e.extend(t[i],{data:[[1,n]],color:t[i].color,label:t[i].label,angle:n*Math.PI*2/a,percent:n/(a/100)}));s>1&&c.push({data:[[1,r]],color:l,label:o.series.pie.combine.label,angle:r*Math.PI*2/a,percent:r/(a/100)});return c}(t.getData())))}function p(t,i){if(n){var u=t.getPlaceholder().width(),h=t.getPlaceholder().height(),p=n.children().filter(".legend").children().width()||0;c=i,l=!1,a=Math.min(u,h/o.series.pie.tilt)/2,s=h/2+o.series.pie.offset.top,r=u/2,"auto"===o.series.pie.offset.left?(o.legend.position.match("w")?r+=p/2:r-=p/2,ru-a&&(r=u-a)):r+=o.series.pie.offset.left;var f=t.getData(),g=0;do{g>0&&(a*=.95),g+=1,m(),o.series.pie.tilt<=.8&&v()}while(!x()&&g<10);g>=10&&(m(),n.prepend("
Could not draw pie with labels contained inside canvas
")),t.setSeries&&t.insertLegend&&(t.setSeries(f),t.insertLegend())}function m(){c.clearRect(0,0,u,h),n.children().filter(".pieLabel, .pieLabelBackground").remove()}function v(){var e=o.series.pie.shadow.left,t=o.series.pie.shadow.top,i=o.series.pie.shadow.alpha,n=o.series.pie.radius>1?o.series.pie.radius:a*o.series.pie.radius;if(!(n>=u/2-e||n*o.series.pie.tilt>=h/2-t||n<=10)){c.save(),c.translate(e,t),c.globalAlpha=i,c.fillStyle="#000",c.translate(r,s),c.scale(1,o.series.pie.tilt);for(var l=1;l<=10;l++)c.beginPath(),c.arc(0,0,n,0,2*Math.PI,!1),c.fill(),n-=l;c.restore()}}function x(){var t,i=Math.PI*o.series.pie.startAngle,l=o.series.pie.radius>1?o.series.pie.radius:a*o.series.pie.radius;c.save(),c.translate(r,s),c.scale(1,o.series.pie.tilt),c.save();var p=i;for(t=0;t0){for(c.save(),c.lineWidth=o.series.pie.stroke.width,p=i,t=0;t1?o.series.pie.label.radius:a*o.series.pie.label.radius,c=0;c=100*o.series.pie.label.threshold&&!p(f[c],t,c))return!1;t+=f[c].angle}return!0;function p(t,i,a){if(0===t.data[0][1])return!0;var c,p=o.legend.labelFormatter,d=o.series.pie.label.formatter;c=p?p(t.label,t):t.label,d&&(c=d(c,t));var f=(i+t.angle+i)/2,g=r+Math.round(Math.cos(f)*l),m=s+Math.round(Math.sin(f)*l)*o.series.pie.tilt,v=""+c+"";n.append(v);var x=n.children("#pieLabel"+a),b=m-x.height()/2,y=g-x.width()/2;if(x.css("top",b),x.css("left",y),0-b>0||0-y>0||h-(b+x.height())<0||u-(y+x.width())<0)return!1;if(0!==o.series.pie.label.background.opacity){var w=o.series.pie.label.background.color;null==w&&(w=t.color);var k="top:"+b+"px;left:"+y+"px;";e("
").css("opacity",o.series.pie.label.background.opacity).insertBefore(x)}return!0}}();function g(e,t,i){e<=0||isNaN(e)||(i?c.fillStyle=t:(c.strokeStyle=t,c.lineJoin="round"),c.beginPath(),Math.abs(e-2*Math.PI)>1e-9&&c.moveTo(0,0),c.arc(0,0,l,p,p+e/2,!1),c.arc(0,0,l,p+e/2,p+e,!1),c.closePath(),p+=e,i?c.fill():c.stroke())}}}function d(e){if(o.series.pie.innerRadius>0){e.save();var t=o.series.pie.innerRadius>1?o.series.pie.innerRadius:a*o.series.pie.innerRadius;e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle=o.series.pie.stroke.color,e.arc(0,0,t,0,2*Math.PI,!1),e.fill(),e.closePath(),e.restore(),e.save(),e.beginPath(),e.strokeStyle=o.series.pie.stroke.color,e.arc(0,0,t,0,2*Math.PI,!1),e.stroke(),e.closePath(),e.restore()}}function f(e,t){for(var i=!1,n=-1,o=e.length,a=o-1;++n1?u.series.pie.radius:a*u.series.pie.radius,p=0;p1?t.series.pie.tilt=1:t.series.pie.tilt<0&&(t.series.pie.tilt=0))})),t.hooks.bindEvents.push((function(e,t){var i=e.getOptions();i.series.pie.show&&(i.grid.hoverable&&(t.unbind("mousemove").mousemove(g),t.bind("mouseleave",g)),i.grid.clickable&&t.unbind("click").click(m))})),t.hooks.shutdown.push((function(e,t){t.unbind("mousemove",g),t.unbind("mouseleave",g),t.unbind("click",m),u=[]})),t.hooks.processDatapoints.push((function(e,t,i,n){e.getOptions().series.pie.show&&h(e,t,i)})),t.hooks.drawOverlay.push((function(e,t){e.getOptions().series.pie.show&&function(e,t){var i=e.getOptions(),n=i.series.pie.radius>1?i.series.pie.radius:a*i.series.pie.radius;t.save(),t.translate(r,s),t.scale(1,i.series.pie.tilt);for(var o=0;o1e-9&&t.moveTo(0,0),t.arc(0,0,n,e.startAngle,e.startAngle+e.angle/2,!1),t.arc(0,0,n,e.startAngle+e.angle/2,e.startAngle+e.angle,!1),t.closePath(),t.fill())}d(t),t.restore()}(e,t)})),t.hooks.draw.push((function(e,t){e.getOptions().series.pie.show&&p(e,t)}))},options:t,name:"pie",version:"1.1"})}(jQuery),jQuery.plot.plugins.push({init:function(e){e.hooks.processDatapoints.push((function(e,t,i){if(null!=t.stack&&!1!==t.stack){var n=t.bars.show||t.lines.show&&t.lines.fill,o=i.pointsize>2&&(t.bars.horizontal?i.format[2].x:i.format[2].y);n&&!o&&function(e,t){for(var i=[],n=0;n=g.length);){if(p=x.length,null==g[S]){for(d=0;d=v.length){if(!b)for(d=0;dc){if(b&&S>0&&null!=g[S-f]){for(l=s+(g[S-f+M]-s)*(c-r)/(g[S-f+T]-r),x.push(c),x.push(l+u),d=2;d0&&null!=v[P-m]&&(h=u+(v[P-m+M]-u)*(r-c)/(v[P-m+T]-c)),x[p+M]+=h,S+=f}k=!1,p!==x.length&&n&&(x[p+2]+=h)}if(w&&p!==x.length&&p>0&&null!==x[p]&&x[p]!==x[p-f]&&x[p+1]!==x[p-f+1]){for(d=0;dt.x-4&&ot.y-4&&a