/*! * bean.js - copyright Jacob Thornton 2011 * https://github.com/fat/bean * MIT License * special thanks to: * dean edwards: http://dean.edwards.name/ * dperini: https://github.com/dperini/nwevents * the entire mootools team: github.com/mootools/mootools-core */ ((t,e,i)=>{"undefined"!=typeof module?module.exports=i(t,e):"function"==typeof define&&"object"==typeof define.amd?define(i):e[t]=i(t,e)})("bean",this,function(t,e){function n(t,e){return h||e||t!==w&&t!==l?t:S}function u(t,e,i,o,s){var n,a,l,r,h,c,d,f=i,p=i&&"string"==typeof i;if(e&&!i&&"object"==typeof e)for(n in e)e.hasOwnProperty(n)&&u.apply(this,[t,n,e[n]]);else{r=3{var n=e.replace(k,""),a=e.replace(M,"").split(".");if(W.has(t,n,i))return;"unload"===n&&(i=z(P,t,n,i,o));if(A[n]){A[n].condition&&(i=H(t,i,n,A[n].condition,!0));n=A[n].base||n}a=W.put(new _(t,n,i,o,a[0]&&a));a.handler=a.isNative?B(t,a.handler,s):H(t,a.handler,n,!1,s,!1);a.eventSupport&&O(a.target,a.eventType,a.handler,!0,a.customType)})(t,a[l],i,f,r)}return t}var c,d,g,m,x,v,y,b,l=window,i=e[t],D=/over|out/,M=/[^\.]*(?=\..*)\.|.*/,k=/\..*/,s="addEventListener",a="attachEvent",r="detachEvent",w=document||{},S=w.documentElement||{},h=S[s],f=h?s:a,T=Array.prototype.slice,E=/click|mouse|menu|drag|drop/i,L=/^touch|^gesture/i,F={one:1},p=((t,e,i)=>{for(i=0;i{function t(t,e,i,o,s){this.element=t;this.type=e;this.handler=i;this.original=o;this.namespaces=s;this.custom=A[e];this.isNative=p[e]&&t[f];this.eventType=h||this.isNative?e:"propertychange";this.customType=!h&&!this.isNative&&e;this.target=n(t,this.isNative);this.eventSupport=this.target[f]}t.prototype={inNamespaces:function(t){var e,i;if(!t)return!0;if(this.namespaces)for(e=t.length;e--;)for(i=this.namespaces.length;i--;)if(t[e]===this.namespaces[i])return!0;return!1},matches:function(t,e,i){return!(this.element!==t||e&&this.original!==e||i&&this.handler!==i)}};return t})(),W=(c={},d=function(t,e,i,o,s){if(e&&"*"!==e){var n,a=0,l=c["$"+e],r="*"===t;if(l)for(n=l.length;a{for(;null!==(e=e.parentNode);)if(e===t)return 1})(this,e):null===e}if(l[a]){var R=function(){var t,e=W.entries();for(t in e)e[t].type&&"unload"!==e[t].type&&I(e[t].element,e[t].type);l[r]("onunload",R);l.CollectGarbage&&l.CollectGarbage()};l[a]("onunload",R)}return N});!function(){var t=this,e=this.Flotr,l={_:_,bean:bean,isIphone:/iphone/i.test(navigator.userAgent),isIE:-1!=navigator.appVersion.indexOf("MSIE")&&parseFloat(navigator.appVersion.split("MSIE")[1]),graphTypes:{},plugins:{},addType:function(t,e){l.graphTypes[t]=e;l.defaultOptions[t]=e.options||{};l.defaultOptions.defaultType=l.defaultOptions.defaultType||t},addPlugin:function(t,e){l.plugins[t]=e;l.defaultOptions[t]=e.options||{}},draw:function(t,e,i,o){o=o||l.Graph;return new o(t,e,i)},merge:function(t,e){var i,o,s=e||{};for(i in t){o=t[i];o&&"object"==typeof o?o.constructor===Array?s[i]=this._.clone(o):o.constructor===RegExp||this._.isElement(o)||o.jquery?s[i]=o:s[i]=l.merge(o,e?e[i]:void 0):s[i]=o}return s},clone:function(t){return l.merge(t,{})},getTickSize:function(t,e,i,o){var s=(i-e)/t,n=l.getMagnitude(s),a=10,s=s/n;s<1.5?a=1:s<2.25?a=2:s<3?a=0===o?2:2.5:s<7.5&&(a=5);return a*n},defaultTickFormatter:function(t,e){return t+""},defaultTrackFormatter:function(t){return"("+t.x+", "+t.y+")"},engineeringNotation:function(t,e,i){var o=["Y","Z","E","P","T","G","M","k",""],s=o.length;i=i||1e3;e=Math.pow(10,e||2);if(0===t)return 0;if(1{var r=Flotr._;function h(t,e,i,o){this.rgba=["r","g","b","a"];for(var s=4;-1<--s;)this[this.rgba[s]]=arguments[s]||(3==s?1:0);this.normalize()}var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};h.prototype={scale:function(t,e,i,o){for(var s=4;-1<--s;)r.isUndefined(arguments[s])||(this[this.rgba[s]]*=arguments[s]);return this.normalize()},alpha:function(t){r.isUndefined(t)||r.isNull(t)||(this.a=t);return this.normalize()},clone:function(){return new h(this.r,this.b,this.g,this.a)},limit:function(t,e,i){return Math.max(Math.min(t,i),e)},normalize:function(){var t=this.limit;this.r=t(parseInt(this.r,10),0,255);this.g=t(parseInt(this.g,10),0,255);this.b=t(parseInt(this.b,10),0,255);this.a=t(this.a,0,1);return this},distance:function(t){if(t){t=new h.parse(t);for(var e=0,i=3;-1<--i;)e+=Math.abs(this[this.rgba[i]]-t[this.rgba[i]]);return e}},toString:function(){return 1<=this.a?"rgb("+[this.r,this.g,this.b].join(",")+")":"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"},contrast:function(){var t=1-(.299*this.r+.587*this.g+.114*this.b)/255;return t<.5?"#000000":"#ffffff"}};r.extend(h,{parse:function(t){var e,i;return t instanceof h?t:(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(t))?new h(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(t))?new h(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)):(e=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(t))?new h(parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)):(e=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(t))?new h(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4])):(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(t))?new h(2.55*parseFloat(e[1]),2.55*parseFloat(e[2]),2.55*parseFloat(e[3])):(e=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(t))?new h(2.55*parseFloat(e[1]),2.55*parseFloat(e[2]),2.55*parseFloat(e[3]),parseFloat(e[4])):(i=(t+"").replace(/^\s*([\S\s]*?)\s*$/,"$1").toLowerCase(),"transparent"==i?new h(255,255,255,0):(e=o[i])?new h(e[0],e[1],e[2]):new h(0,0,0,0))},processColor:function(t,e){var i=e.opacity;if(!t)return"rgba(0, 0, 0, 0)";if(t instanceof h)return t.alpha(i).toString();if(r.isString(t))return h.parse(t).alpha(i).toString();var o=t.colors?t:{colors:t};if(!e.ctx)return r.isArray(o.colors)?h.parse(r.isArray(o.colors[0])?o.colors[0][1]:o.colors[0]).alpha(i).toString():"rgba(0, 0, 0, 0)";o=r.extend({start:"top",end:"bottom"},o);/top/i.test(o.start)&&(e.x1=0);/left/i.test(o.start)&&(e.y1=0);/bottom/i.test(o.end)&&(e.x2=0);/right/i.test(o.end)&&(e.y2=0);for(var s,n,a=e.ctx.createLinearGradient(e.x1,e.y1,e.x2,e.y2),l=0;l=s.second&&i(m,"Milliseconds",l,0);x>=s.minute&&i(m,"Seconds",l,0);x>=s.hour&&i(m,"Minutes",l,0);x>=s.day&&i(m,"Hours",l,0);x>=4*s.day&&i(m,"Date",l,1);x>=s.year&&i(m,"Month",l,0);var y,b=0,M=NaN;do{y=M;M=m.getTime();f.push({v:M/r,label:u(M/r,t)});if("month"==e)if(p<1){i(m,"Date",l,1);var k=m.getTime(),w=(i(m,"Month",l,o(m,"Month",l)+1),m.getTime());m.setTime(M+b*s.hour+(w-k)*p);b=o(m,"Hours",l);i(m,"Hours",l,0)}else i(m,"Month",l,o(m,"Month",l)+p);else"year"==e?i(m,"FullYear",l,o(m,"FullYear",l)+p):m.setTime(M+x)}while(M{var o=Flotr._;function s(t){return t&&t.jquery?t[0]:t}Flotr.DOM={addClass:function(t,e){t=s(t);var i=t.className||"";o.include(i.split(/\s+/g),e)||(t.className=(i?i+" ":"")+e)},create:function(t){return document.createElement(t)},node:function(t){var e,i=Flotr.DOM.create("div");i.innerHTML=t;e=i.children[0];i.innerHTML="";return e},empty:function(t){t=s(t);t.innerHTML=""},remove:function(t){t=s(t);t.parentNode.removeChild(t)},hide:function(t){t=s(t);Flotr.DOM.setStyles(t,{display:"none"})},insert:function(t,e){t=s(t);o.isString(e)?t.innerHTML+=e:o.isElement(e)&&t.appendChild(e)},opacity:function(t,e){t=s(t);t.style.opacity=e},position:function(t,e){t=s(t);if(!t.offsetParent)return{left:t.offsetLeft||0,top:t.offsetTop||0};e=this.position(t.offsetParent);e.left+=t.offsetLeft;e.top+=t.offsetTop;return e},removeClass:function(t,e){var i=t.className||"";t=s(t);t.className=o.filter(i.split(/\s+/g),function(t){if(t!=e)return!0}).join(" ")},setStyles:function(i,t){i=s(i);o.each(t,function(t,e){i.style[e]=t})},show:function(t){t=s(t);Flotr.DOM.setStyles(t,{display:""})},size:function(t){t=s(t);return{height:t.offsetHeight,width:t.offsetWidth}}}})();(()=>{var o=Flotr,s=o.bean;o.EventAdapter={observe:function(t,e,i){s.add(t,e,i);return this},fire:function(t,e,i){s.fire(t,e,i);"undefined"!=typeof Prototype&&Event.fire(t,e,i);return this},stopObserving:function(t,e,i){s.remove(t,e,i);return this},eventPointer:function(t){var e,i;return!o._.isUndefined(t.touches)&&0{function t(t){this.o=t}var a=Flotr,n=a.DOM,s=a._;t.prototype={dimensions:function(t,e,i,o){return t?this.o.html?this.html(t,this.o.element,i,o):this.canvas(t,e):{width:0,height:0}},canvas:function(t,e){if(this.o.textEnabled){e=e||{};var i=this.measureText(t,e),i=i.width,o=e.size||a.defaultOptions.fontSize,s=e.angle||0,n=Math.cos(s),s=Math.sin(s),s={width:Math.abs(n*i)+Math.abs(s*o)+2,height:Math.abs(s*i)+Math.abs(n*o)+6};return s}},html:function(t,e,i,o){var s=n.create("div");n.setStyles(s,{position:"absolute",top:"-10000px"});n.setStyles(s,{top:"0px",left:"-10000px"});n.insert(s,'
'+t+"
");n.insert(this.o.element,s);return n.size(s)},measureText:function(t,e){var i,o=this.o.ctx;if(!o.fillText||a.isIphone&&o.measure)return{width:o.measure(t,e)};e=s.extend({size:a.defaultOptions.fontSize,weight:1,angle:0},e);o.save();o.font=(1{var d=Flotr.DOM,g=Flotr.EventAdapter,m=Flotr._,x=Flotr;Graph=function(t,e,i){this._setEl(t);this._initMembers();this._initPlugins();g.fire(this.el,"flotr:beforeinit",[this]);this.data=e;this.series=x.Series.getSeries(e);this._initOptions(i);this._initGraphTypes();this._initCanvas();this._text=new x.Text({element:this.el,ctx:this.ctx,html:this.options.HtmlText,textEnabled:this.textEnabled});g.fire(this.el,"flotr:afterconstruct",[this]);this._initEvents();this.findDataRanges();this.calculateSpacing();this.draw(m.bind(function(){g.fire(this.el,"flotr:afterinit",[this])},this))};function t(t,e,i){g.observe.apply(this,arguments);this._handles.push(arguments);return this}Graph.prototype={destroy:function(){g.fire(this.el,"flotr:destroy");m.each(this._handles,function(t){g.stopObserving.apply(this,t)});this._handles=[];this.el.graph=null},observe:t,_observe:t,processColor:function(t,e){var i={x1:0,y1:0,x2:this.plotWidth,y2:this.plotHeight,opacity:1,ctx:this.ctx};m.extend(i,e);return x.Color.processColor(t,i)},findDataRanges:function(){var e,i,o,t=this.axes;m.each(this.series,function(t){o=t.getRange();if(o){e=t.xaxis;i=t.yaxis;e.datamin=Math.min(o.xmin,e.datamin);e.datamax=Math.max(o.xmax,e.datamax);i.datamin=Math.min(o.ymin,i.datamin);i.datamax=Math.max(o.ymax,i.datamax);e.used=e.used||o.xused;i.used=i.used||o.yused}},this);t.x.used||t.x2.used||(t.x.used=!0);t.y.used||t.y2.used||(t.y.used=!0);m.each(t,function(t){t.calculateRange()});var s=m.keys(x.graphTypes),n=!1;m.each(this.series,function(e){if(!e.hide){m.each(s,function(t){if(e[t]&&e[t].show){this.extendRange(t,e);n=!0}},this);n||this.extendRange(this.options.defaultType,e)}},this)},extendRange:function(t,e){this[t].extendRange&&this[t].extendRange(e,e.data,e[t],this[t]);this[t].extendYRange&&this[t].extendYRange(e.yaxis,e.data,e[t],this[t]);this[t].extendXRange&&this[t].extendXRange(e.xaxis,e.data,e[t],this[t])},calculateSpacing:function(){var t,e=this.axes,i=this.options,o=this.series,s=i.grid.labelMargin,n=this._text,a=e.x,l=e.x2,r=e.y,h=e.y2,c=i.grid.outlineWidth;m.each(e,function(t){t.calculateTicks();t.calculateTextDimensions(n,i)});e=n.dimensions(i.title,{size:1.5*i.fontSize},"font-size:1em;font-weight:bold;","flotr-title");this.titleHeight=e.height;e=n.dimensions(i.subtitle,{size:i.fontSize},"font-size:smaller;","flotr-subtitle");this.subtitleHeight=e.height;for(t=0;t=r.length){d=0;++c}}for(d=0,i=0;d{var l=Flotr._;function e(t){this.orientation=1;this.offset=0;this.datamin=Number.MAX_VALUE;this.datamax=-Number.MAX_VALUE;l.extend(this,t)}e.prototype={setScale:function(){var t=this.length,e=this.max,i=this.min,o=this.offset,s=this.orientation,n=this.options,a="logarithmic"===n.scaling,l=a?t/(r(e,n.base)-r(i,n.base)):t/(e-i);this.scale=l;if(a){this.d2p=function(t){return o+s*(r(t,n.base)-r(i,n.base))*l};this.p2d=function(t){return t=(o+s*t)/l+r(i,n.base),e=n.base,e===Math.E?Math.exp(t):Math.pow(e,t);var e}}else{this.d2p=function(t){return o+s*(t-i)*l};this.p2d=function(t){return(o+s*t)/l+i}}},calculateTicks:function(){var t=this.options;this.ticks=[];this.minorTicks=[];if(t.ticks){this._cleanUserTicks(t.ticks,this.ticks);this._cleanUserTicks(t.minorTicks||[],this.minorTicks)}else"time"==t.mode?this._calculateTimeTicks():"logarithmic"===t.scaling?this._calculateLogTicks():this._calculateTicks();l.each(this.ticks,function(t){t.label+=""});l.each(this.minorTicks,function(t){t.label+=""})},calculateRange:function(){if(this.used){var t=this,e=t.options,i=null!==e.min?e.min:t.datamin,o=null!==e.max?e.max:t.datamax,s=e.autoscaleMargin;if("logarithmic"==e.scaling){i<=0&&(i=t.datamin);o<=0&&(o=i)}if(o==i){var n=o?.01:1;null===e.min&&(i-=n);null===e.max&&(o+=n)}if("logarithmic"===e.scaling){i<0&&(i=o/e.base);var n=Math.log(o),n=(e.base!=Math.E&&(n/=Math.log(e.base)),Math.ceil(n)),a=Math.log(i);e.base!=Math.E&&(a/=Math.log(e.base));a=Math.ceil(a);t.tickSize=Flotr.getTickSize(e.noTicks,a,n,null===e.tickDecimals?0:e.tickDecimals);null===e.minorTickFreq&&(e.minorTickFreq=10s.length&&(s=this.ticks[o].label)}this.maxLabel=t.dimensions(s,{size:e.fontSize,angle:Flotr.toRad(this.options.labelsAngle)},"font-size:smaller;","flotr-grid-label");this.titleSize=t.dimensions(this.options.title,{size:1.2*e.fontSize,angle:Flotr.toRad(this.options.titleAngle)},"font-weight:bold;","flotr-axis-title")},_cleanUserTicks:function(t,e){var i,o,s,n,a=this.options;l.isFunction(t)&&(t=t({min:this.min,max:this.max}));for(o=0;o{var i=Flotr._;function o(t){i.extend(this,t)}o.prototype={getRange:function(){var t,e,i,o=this.data,s=o.length,n=Number.MAX_VALUE,a=Number.MAX_VALUE,l=-Number.MAX_VALUE,r=-Number.MAX_VALUE,h=!1,c=!1;if(s<0||this.hide)return!1;for(i=0;i=e[h][0]&&l<=e[h+1][0]){if(Math.abs(o(e[h][1])-r)<8){a.x=e[h][0];a.y=e[h][1];a.index=h;a.seriesIndex=t.index}break}};this.drawHit=function(t){var e=t.context,i=t.args,o=t.data,s=t.xScale,n=i.index,s=s(i.x),i=t.yScale(i.y);if(o.length-1>n){o=t.xScale(o[n+1][0]);e.save();e.strokeStyle=t.color;e.lineWidth=t.lineWidth;e.beginPath();e.moveTo(s,i);e.lineTo(o,i);e.stroke();e.closePath();e.restore()}};this.clearHit=function(t){var e=t.context,i=t.args,o=t.data,s=t.xScale,n=t.lineWidth,a=i.index,s=s(i.x),i=t.yScale(i.y);if(o.length-1>a){o=t.xScale(o[a+1][0]);e.clearRect(s-n,i-n,o-s+2*n,2*n)}}}}});Flotr.addType("bars",{options:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,fillOpacity:.4,horizontal:!1,stacked:!1,centered:!0,topPadding:.1,grouped:!1},stack:{positive:[],negative:[],_positive:[],_negative:[]},draw:function(t){var e=t.context;this.current+=1;e.save();e.lineJoin="miter";e.lineWidth=t.lineWidth;e.strokeStyle=t.color;t.fill&&(e.fillStyle=t.fillStyle);this.plot(t);e.restore()},plot:function(t){var e,i,o,s,n,a=t.data,l=t.context,r=t.shadowSize;if(!(a.length<1)){this.translate(l,t.horizontal);for(e=0;ee.top||t.stacked&&t.horizontal&&a.yScale(a.y)>e.bottom&&a.yScale(a.y)e.y)&&Math.abs(r-e.left)n.max||ha.max)){if(un.max){c=n.max;n.lastSerie!=t&&(p=!1)}da.max){h=a.max;a.lastSerie!=t&&(p=!1)}if(o){l.beginPath();l.moveTo(n.d2p(u),a.d2p(d)+i);l.lineTo(n.d2p(u),a.d2p(h)+i);l.lineTo(n.d2p(c),a.d2p(h)+i);l.lineTo(n.d2p(c),a.d2p(d)+i);l.fill();l.closePath()}if(t.gantt.lineWidth){l.beginPath();l.moveTo(n.d2p(u),a.d2p(d)+i);l[f?"lineTo":"moveTo"](n.d2p(u),a.d2p(h)+i);l[p?"lineTo":"moveTo"](n.d2p(c),a.d2p(h)+i);l.lineTo(n.d2p(c),a.d2p(d)+i);l.stroke();l.closePath()}}}}},plotShadows:function(t,e,i){var o=t.data;if(!(o.length<1))for(var s=t.xaxis,n=t.yaxis,a=this.ctx,l=this.options.shadowSize,r=0;rs.max||fn.max)){hs.max&&(c=s.max);dn.max&&(f=n.max);c=s.d2p(c)-s.d2p(h)-(s.d2p(c)+l<=this.plotWidth?0:l),d=n.d2p(d)-n.d2p(f)-(n.d2p(d)+l<=this.plotHeight?0:l);a.fillStyle="rgba(0,0,0,0.05)";a.fillRect(Math.min(s.d2p(h)+l,this.plotWidth),Math.min(n.d2p(f)+l,this.plotHeight),c,d)}}}},extendXRange:function(t){if(null===t.options.max){for(var e,i,o,s=t.min,n=t.max,a={},l=null,r=0;ro&&(o=t.max+i.barWidth)}}t.lastSerie=null;t.max=o;t.min=s;t.tickSize=Flotr.getTickSize(t.options.noTicks,s,o,t.options.tickDecimals)}}});(()=>{Flotr.defaultMarkerFormatter=function(t){return Math.round(100*t.y)/100+""};Flotr.addType("markers",{options:{show:!1,lineWidth:1,color:"#000000",fill:!1,fillColor:"#FFFFFF",fillOpacity:.4,stroke:!1,position:"ct",verticalMargin:0,labelFormatter:Flotr.defaultMarkerFormatter,fontSize:Flotr.defaultOptions.fontSize,stacked:!1,stackingType:"b",horizontal:!1},stack:{positive:[],negative:[],values:[]},draw:function(t){var i,o,e,s,n,a,l=t.data,r=t.context,h=!!t.stacked&&t.stack,c=t.stackingType;r.save();r.lineJoin="round";r.lineWidth=t.lineWidth;r.strokeStyle="rgba(0,0,0,0.5)";r.fillStyle=t.fillStyle;function d(t,e){o=h.negative[t]||0;i=h.positive[t]||0;return 0{Flotr._;Flotr.defaultPieLabelFormatter=function(t,e){return(100*e/t).toFixed(2)+"%"};Flotr.addType("pie",{options:{show:!1,lineWidth:1,fill:!0,fillColor:null,fillOpacity:.6,explode:6,sizeRatio:.6,startAngle:Math.PI/4,labelFormatter:Flotr.defaultPieLabelFormatter,pie3D:!1,pie3DviewAngle:Math.PI/2*.8,pie3DspliceThickness:20,epsilon:.1},draw:function(t){var e,i=t.data,o=t.context,s=t.lineWidth,n=t.shadowSize,a=t.sizeRatio,l=t.height,r=t.width,h=t.explode,c=t.color,d=t.fill,f=t.fillStyle,a=Math.min(r,l)*a/2,i=i[0][1],p=[],u=2*Math.PI*i/this.total,g=this.startAngle||2*Math.PI*t.startAngle,m=g+u,u=g+u/2,i=t.labelFormatter(this.total,i),x=h+a+4,v=Math.cos(u)*x,x=Math.sin(u)*x,y=v<0?"right":"left",b=0',i,"")}else{n.textAlign=y;n.textBaseline=b;Flotr.drawText(o,i,v,x,n)}if(t.htmlText||!t.textEnabled){d=Flotr.DOM.node('
');Flotr.DOM.insert(d,p.join(""));Flotr.DOM.insert(t.element,d)}o.restore();this.startAngle=m;this.slices=this.slices||[];this.slices.push({radius:a,x:e,y:u,explode:h,start:g,end:m})},plotSlice:function(t,e,i,o,s,n){n.beginPath();n.moveTo(t,e);n.arc(t,e,i,o,s,!1);n.lineTo(t,e);n.closePath()},hit:function(t){var e=t.data[0],i=t.args,o=t.index,s=i[0],i=i[1],n=this.slices[o],a=s.relX-t.width/2,s=s.relY-t.height/2,l=Math.sqrt(a*a+s*s),r=Math.atan(s/a),h=2*Math.PI,c=n.explode||t.explode,d=n.start%h,f=n.end%h,p=t.epsilon;a<0?r+=Math.PI:0p))){i.x=e[0];i.y=e[1];i.sAngle=d;i.eAngle=f;i.index=0;i.seriesIndex=o;i.fraction=e[1]/this.total}},drawHit:function(t){var e=t.context,i=this.slices[t.args.seriesIndex];e.save();e.translate(t.width/2,t.height/2);this.plotSlice(i.x,i.y,i.radius,i.start,i.end,e);e.stroke();e.restore()},clearHit:function(t){var e=t.context,i=this.slices[t.args.seriesIndex],o=2*t.lineWidth,s=i.radius+o;e.save();e.translate(t.width/2,t.height/2);e.clearRect(i.x-s,i.y-s,2*s+o,2*s+o);e.restore()},extendYRange:function(t,e){this.total=(this.total||0)+e[0][1]}})})();Flotr.addType("points",{options:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#FFFFFF",fillOpacity:1,hitRadius:null},draw:function(t){var e=t.context,i=t.shadowSize;e.save();if(0t.width||o<0||o>t.height)){n.beginPath();if(e)n.arc(i,o+e,t.radius,0,Math.PI,!1);else{n.arc(i,o,t.radius,0,2*Math.PI,!0);t.fill&&n.fill()}n.stroke();n.closePath()}}}}});Flotr.addType("radar",{options:{show:!1,lineWidth:2,fill:!0,fillOpacity:.4,radiusRatio:.9,sensibility:2},draw:function(t){var e=t.context,i=t.shadowSize;e.save();e.translate(t.width/2,t.height/2);e.lineWidth=t.lineWidth;e.fillStyle="rgba(0,0,0,0.05)";e.strokeStyle="rgba(0,0,0,0.05)";this.plot(t,i/2);e.strokeStyle="rgba(0,0,0,0.1)";this.plot(t,i/4);e.strokeStyle=t.color;e.fillStyle=t.fillStyle;this.plot(t);e.restore()},plot:function(t,e){var i,o,s=t.data,n=t.context,a=Math.min(t.height,t.width)*t.radiusRatio/2,l=2*Math.PI/s.length,r=-Math.PI/2;e=e||0;n.beginPath();for(i=0;i{var a=Flotr.DOM;Flotr.addPlugin("crosshair",{options:{mode:null,color:"#FF0000",hideCursor:!0},callbacks:{"flotr:mousemove":function(t,e){if(this.options.crosshair.mode){this.crosshair.clearCrosshair();this.crosshair.drawCrosshair(e)}}},drawCrosshair:function(t){var e=this.octx,i=this.options.crosshair,o=this.plotOffset,s=o.left+Math.round(t.relX)+.5,n=o.top+Math.round(t.relY)+.5;if(t.relX<0||t.relY<0||t.relX>this.plotWidth||t.relY>this.plotHeight){this.el.style.cursor=null;a.removeClass(this.el,"flotr-crosshair")}else{if(i.hideCursor){this.el.style.cursor="none";a.addClass(this.el,"flotr-crosshair")}e.save();e.strokeStyle=i.color;e.lineWidth=1;e.beginPath();if(-1!=i.mode.indexOf("x")){e.moveTo(s,o.top);e.lineTo(s,o.top+this.plotHeight)}if(-1!=i.mode.indexOf("y")){e.moveTo(o.left,n);e.lineTo(o.left+this.plotWidth,n)}e.stroke();e.restore()}},clearCrosshair:function(){var t=this.plotOffset,e=this.lastMousePos,i=this.octx;if(e){i.clearRect(Math.round(e.relX)+t.left,t.top,1,this.plotHeight+1);i.clearRect(t.left,Math.round(e.relY)+t.top,this.plotWidth+1,1)}}})})();(()=>{var a=Flotr.DOM,l=Flotr._;Flotr.addPlugin("download",{saveImage:function(t,e,i,o){var s,n=this.options.grid;if(Flotr.isIE&&Flotr.isIE<9)return s=""+this.canvas.firstChild.innerHTML+"",window.open().document.write(s);if("jpeg"===t||"png"===t){s=((t,e,i,o,s,n)=>{var a="image/"+t,l=i.getImageData(0,0,o,s),r=new Image;i.save();i.globalCompositeOperation="destination-over";i.fillStyle=n;i.fillRect(0,0,o,s);r.src=e.toDataURL(a);i.restore();i.clearRect(0,0,o,s);i.putImageData(l,0,0);return r})(t,this.canvas,this.ctx,this.canvasWidth,this.canvasHeight,n&&n.backgroundColor||"#ffffff");if(!l.isElement(s)||!o)return window.open(s.src);this.download.restoreCanvas();a.hide(this.canvas);a.hide(this.overlay);a.setStyles({position:"absolute"});a.insert(this.el,s);this.saveImageElement=s}},restoreCanvas:function(){a.show(this.canvas);a.show(this.overlay);this.saveImageElement&&this.el.removeChild(this.saveImageElement);this.saveImageElement=null}})})();(()=>{var b=Flotr.EventAdapter,M=Flotr._;Flotr.addPlugin("graphGrid",{callbacks:{"flotr:beforedraw":function(){this.graphGrid.drawGrid()},"flotr:afterdraw":function(){this.graphGrid.drawOutline()}},drawGrid:function(){var i,o,s,n=this.ctx,t=this.options,a=t.grid,e=a.verticalLines,l=a.horizontalLines,r=a.minorVerticalLines,h=a.minorHorizontalLines,c=this.plotHeight,d=this.plotWidth;(e||r||l||h)&&b.fire(this.el,"flotr:beforegrid",[this.axes.x,this.axes.y,t,this]);n.save();n.lineWidth=1;n.strokeStyle=a.tickColor;function f(t){for(o=0;o=i.max||(t==i.min||t==i.max)&&a.outlineWidth||e(Math.floor(i.d2p(t))+n.lineWidth/2)})}function u(t){n.moveTo(t,0);n.lineTo(t,c)}function g(t){n.moveTo(0,t);n.lineTo(d,t)}if(a.circular){n.translate(this.plotOffset.left+d/2,this.plotOffset.top+c/2);var m=Math.min(c,d)*t.radar.radiusRatio/2,x=this.axes.x.ticks.length,v=Math.PI/x*2,y=-Math.PI/2;n.beginPath();i=this.axes.y;l&&f(i.ticks);h&&f(i.minorTicks);e&&M.times(x,function(t){n.moveTo(0,0);n.lineTo(Math.cos(t*v+y)*m,Math.sin(t*v+y)*m)})}else{n.translate(this.plotOffset.left,this.plotOffset.top);if(a.backgroundColor){n.fillStyle=this.processColor(a.backgroundColor,{x1:0,y1:0,x2:d,y2:c});n.fillRect(0,0,d,c)}n.beginPath();i=this.axes.x;e&&p(i.ticks,u);r&&p(i.minorTicks,u);i=this.axes.y;l&&p(i.ticks,g);h&&p(i.minorTicks,g)}n.stroke();n.restore();(e||r||l||h)&&b.fire(this.el,"flotr:aftergrid",[this.axes.x,this.axes.y,t,this])},drawOutline:function(){var t,e,o,s=this,n=s.options,a=n.grid,l=a.outline,r=s.ctx,h=a.backgroundImage,c=s.plotOffset,d=c.left,f=c.top,p=s.plotWidth,u=s.plotHeight;if(a.outlineWidth){r.save();if(a.circular){r.translate(d+p/2,f+u/2);var g=Math.min(u,p)*n.radar.radiusRatio/2,m=this.axes.x.ticks.length,x=Math.PI/m*2,v=-Math.PI/2;r.beginPath();r.lineWidth=a.outlineWidth;r.strokeStyle=a.color;r.lineJoin="round";for(i=0;i<=m;++i)r[0===i?"moveTo":"lineTo"](Math.cos(i*x+v)*g,Math.sin(i*x+v)*g);r.stroke()}else{r.translate(d,f);s=a.outlineWidth,n=.5-s+(s+1)%2/2,d="lineTo",f="moveTo";r.lineWidth=s;r.strokeStyle=a.color;r.lineJoin="miter";r.beginPath();r.moveTo(n,n);p-=s/2%1;u+=s/2;r[-1!==l.indexOf("n")?d:f](p,n);r[-1!==l.indexOf("e")?d:f](p,u);r[-1!==l.indexOf("s")?d:f](n,u);r[-1!==l.indexOf("w")?d:f](n,n);r.stroke();r.closePath()}r.restore();if(h){a=h.src||h;e=(parseInt(h.left,10)||0)+c.left;o=(parseInt(h.top,10)||0)+c.top;t=new Image;t.onload=function(){r.save();h.alpha&&(r.globalAlpha=h.alpha);r.globalCompositeOperation="destination-over";r.drawImage(t,0,0,t.width,t.height,e,o,p,u);r.restore()};t.src=a}}}})})();(()=>{var g=Flotr.DOM,m=Flotr._,l=Flotr;Flotr.addPlugin("hit",{callbacks:{"flotr:mousemove":function(t,e){this.hit.track(e)},"flotr:click":function(t){var e=this.hit.track(t);e&&!m.isUndefined(e.index)&&(t.hit=e)},"flotr:mouseout":function(t){t.relatedTarget!==this.mouseTrack&&this.hit.clearHit()},"flotr:destroy":function(){this.options.mouse.container&&g.remove(this.mouseTrack);this.mouseTrack=null}},track:function(t){if(this.options.mouse.track||m.any(this.series,function(t){return t.mouse&&t.mouse.track}))return this.hit.hit(t)},executeOnType:function(t,o,s){var n,a=!1;m.isArray(t)||(t=[t]);m.each(t,function(e,i){m.each(m.keys(l.graphTypes),function(t){if(e[t]&&e[t].show&&!e.hide&&this[t][o]){n=this.getOptions(e,t);n.fill=!!e.mouse.fillColor;n.fillStyle=this.processColor(e.mouse.fillColor||"#ffffff",{opacity:e.mouse.fillOpacity});n.color=e.mouse.lineColor;n.context=this.octx;n.index=i;s&&(n.args=s);this[t][o].call(this[t],n);a=!0}},this)},this);return a},drawHit:function(t){var e=this.octx,i=t.series;if(i.mouse.lineColor){e.save();e.lineWidth=i.points?i.points.lineWidth:1;e.strokeStyle=i.mouse.lineColor;e.fillStyle=this.processColor(i.mouse.fillColor||"#ffffff",{opacity:i.mouse.fillOpacity});e.translate(this.plotOffset.left,this.plotOffset.top);if(!this.hit.executeOnType(i,"drawHit",t)){var o=t.xaxis,s=t.yaxis;e.beginPath();e.arc(o.d2p(t.x),s.d2p(t.y),i.points.hitRadius||i.points.radius||i.mouse.radius,0,2*Math.PI,!0);e.fill();e.stroke();e.closePath()}e.restore();this.clip(e)}this.prevHit=t},clearHit:function(){var t=this.prevHit,e=this.octx,i=this.plotOffset;e.save();e.translate(i.left,i.top);if(t){if(!this.hit.executeOnType(t.series,"clearHit",this.prevHit)){var i=t.series,o=i.points?i.points.lineWidth:1;offset=(i.points.hitRadius||i.points.radius||i.mouse.radius)+o;e.clearRect(t.xaxis.d2p(t.x)-offset,t.yaxis.d2p(t.y)-offset,2*offset,2*offset)}g.hide(this.mouseTrack);this.options&&this.options.mouse&&this.options.mouse.cursorPointer&&$(this.el).css("cursor","");this.prevHit=null}e.restore()},hit:function(t){var e,i,o,s,n,a,l,r=this.options,h=this.prevHit;if(0!==this.series.length){l={relX:t.relX,relY:t.relY,absX:t.absX,absY:t.absY,series:this.series};if(r.mouse.trackY&&!r.mouse.trackAll&&this.hit.executeOnType(this.series,"hit",[t,l])&&!m.isUndefined(l.seriesIndex)){s=this.series[l.seriesIndex];l.series=s;l.mouse=s.mouse;l.xaxis=s.xaxis;l.yaxis=s.yaxis}else{e=this.hit.closest(t);if(e){e=r.mouse.trackY?e.point:e.x;o=e.seriesIndex;s=this.series[o];n=s.xaxis;a=s.yaxis;i=2*s.mouse.sensibility;if(r.mouse.trackAll||e.distanceXe.xaxis.max)){s=Math.abs(r-a);n=Math.abs(h-l);o=s*s+n*n;if(o');this.mouseTrack=r;g.insert(f||this.el,r)}(!d||d<0)&&(d=0);n&&n.toFixed&&(n=n.toFixed(d));a&&a.toFixed&&(a=a.toFixed(d));d=t.mouse.trackFormatter({x:n,y:a,series:t.series,index:t.index,nearest:t,fraction:t.fraction});if(m.isNull(d)||m.isUndefined(d)){g.hide(r);this.options&&this.options.mouse&&this.options.mouse.cursorPointer&&$(this.el).css("cursor","")}else{r.innerHTML=d;g.show(r);this.options&&this.options.mouse&&this.options.mouse.cursorPointer&&$(this.el).css("cursor","pointer");if(o){n=g.size(r);if(f){a=g.position(this.el);p=a.top;u=a.left}if(t.mouse.relative)if(i.pie&&i.pie.show){d=this.plotWidth/2,f=this.plotHeight/2,a=Math.min(this.canvasWidth,this.canvasHeight)*i.pie.sizeRatio,i=t.sAngle.5*this.canvasHeight+.25*this.canvasHeight){f-=20;e="bottom:"+f+"px;top:auto;";e+="left:"+(s+c+d+Math.cos(i)*a/2)+"px;right:auto;"}}else{if(t.mouse.autoPositionHorizontal){o=t.xaxis.d2p(t.x)>2*this.plotWidth/3?"w":"e";t.x<0&&(o=t.xaxis.d2p(t.x)<+this.plotWidth/4?"e":"w")}if(t.mouse.autoPositionVertical){f=n&&42this.plotHeight*f?"s":"n";t.y<0&&this.plotHeight-t.yaxis.d2p(t.y)>+this.plotHeight/4&&(o="s");this.plotWidth-t.xaxis.d2p(t.x)<42&&(o+="w;")}if(t.mouse.autoPositionVerticalHalf){o=this.plotHeight-t.yaxis.d2p(t.y)>this.plotHeight/2?"s":"n";t.xaxis.d2p(t.x)>2*this.plotWidth/3?o+="w":o+="e"}if(t.mouse.autoPositionHorizontalHalf){o=this.plotHeight-t.yaxis.d2p(t.y)>3*this.plotHeight/4?"s":"n";t.xaxis.d2p(t.x)>this.plotWidth/2?o+="w":o+="e"}e+="top:";/n/.test(o)?e+=p-s+h+t.yaxis.d2p(t.y)-n.height:e+=p+s+h+t.yaxis.d2p(t.y);e+="px;bottom:auto;left:";/w/.test(o)?e+=u-s+c+t.xaxis.d2p(t.x)-n.width:e+=u+s+c+t.xaxis.d2p(t.x);e+="px;right:auto;"}else{e+="top:";"n"==o.charAt(0)?e+=p+s+h:"s"==o.charAt(0)&&(e+=p-s+h+this.plotHeight-n.height);e+="px;bottom:auto;left:";"e"==o.charAt(1)?e+=u-s+c+this.plotWidth-n.width:"w"==o.charAt(1)&&(e+=u+s+c);e+="px;right:auto;"}r.style.cssText=l+e;t.mouse.relative&&(/[ew]/.test(o)?/[ns]/.test(o)||(r.style.top=p+h+t.yaxis.d2p(t.y)-g.size(r).height/2+"px"):r.style.left=u+c+t.xaxis.d2p(t.x)-g.size(r).width/2+"px")}}}})})();(()=>{function h(t,e){return Math.min(Math.max(0,t),e.plotWidth-1)}function c(t,e){return Math.min(Math.max(0,t),e.plotHeight)}Flotr.DOM;var i=Flotr.EventAdapter,n=Flotr._;Flotr.addPlugin("selection",{options:{pinchOnly:null,mode:null,color:"#B6D9FF",fps:20},callbacks:{"flotr:mouseup":function(t){var e=this.options.selection,i=this.selection,o=this.getEventPosition(t);if(e&&e.mode){i.interval&&clearInterval(i.interval);this.multitouches?i.updateSelection():e.pinchOnly||i.setSelectionPos(i.selection.second,o);i.clearSelection();if(i.selecting&&i.selectionIsSane()){i.drawSelection();i.fireSelectEvent();this.ignoreClick=!0}}},"flotr:mousedown":function(t){var e,i=this.options.selection,o=this.selection,s=this.getEventPosition(t);if(i&&i.mode&&((e=t,e.which?1===e.which:0===e.button||1===e.button)||!n.isUndefined(t.touches))){i.pinchOnly||o.setSelectionPos(o.selection.first,s);o.interval&&clearInterval(o.interval);this.lastMousePos.pageX=null;o.selecting=!1;o.interval=setInterval(n.bind(o.updateSelection,this),1e3/i.fps)}},"flotr:destroy":function(t){clearInterval(this.selection.interval)}},getArea:function(){var t=this.selection.selection,e=this.axes,i=(t.first,e.x.p2d(t.first.x)),o=e.x.p2d(t.second.x),s=e.y.p2d(t.first.y),e=e.y.p2d(t.second.y);return{x1:Math.min(i,o),y1:Math.min(s,e),x2:Math.max(i,o),y2:Math.max(s,e),xfirst:i,xsecond:o,yfirst:s,ysecond:e}},selection:{first:{x:-1,y:-1},second:{x:-1,y:-1}},prevSelection:null,interval:null,fireSelectEvent:function(t){var e=this.selection.getArea();t=t||"select";e.selection=this.selection.selection;i.fire(this.el,"flotr:"+t,[e,this])},setSelection:function(t,e){var i=this.options,o=this.axes.x,s=this.axes.y,n=s.scale,a=o.scale,l=-1!=i.selection.mode.indexOf("x"),i=-1!=i.selection.mode.indexOf("y"),r=this.selection.selection;this.selection.clearSelection();r.first.y=c(l&&!i?0:(s.max-t.y1)*n,this);r.second.y=c(l&&!i?this.plotHeight-1:(s.max-t.y2)*n,this);r.first.x=h(i&&!l?0:(t.x1-o.min)*a,this);r.second.x=h(i&&!l?this.plotWidth:(t.x2-o.min)*a,this);this.selection.drawSelection();e||this.selection.fireSelectEvent()},setSelectionPos:function(t,e){var i=this.options.selection.mode,o=this.selection.selection;-1==i.indexOf("x")?t.x=t==o.first?0:this.plotWidth:t.x=h(e.relX,this);-1==i.indexOf("y")?t.y=t==o.first?0:this.plotHeight-1:t.y=c(e.relY,this)},drawSelection:function(){this.selection.fireSelectEvent("selecting");var t=this.selection.selection,e=this.octx,i=this.options,o=this.plotOffset,s=this.selection.prevSelection;if(!s||t.first.x!=s.first.x||t.first.y!=s.first.y||t.second.x!=s.second.x||t.second.y!=s.second.y){e.save();e.strokeStyle=this.processColor(i.selection.color,{opacity:.8});e.lineWidth=1;e.lineJoin="miter";e.fillStyle=this.processColor(i.selection.color,{opacity:.4});this.selection.prevSelection={first:{x:t.first.x,y:t.first.y},second:{x:t.second.x,y:t.second.y}};var s=Math.min(t.first.x,t.second.x),i=Math.min(t.first.y,t.second.y),n=Math.abs(t.second.x-t.first.x),t=Math.abs(t.second.y-t.first.y);e.fillRect(s+o.left+.5,i+o.top+.5,n,t);e.strokeRect(s+o.left+.5,i+o.top+.5,n,t);e.restore()}},updateSelection:function(){if(this.lastMousePos.pageX){this.selection.selecting=!0;if(this.multitouches){this.selection.setSelectionPos(this.selection.selection.first,this.getEventPosition(this.multitouches[0]));this.selection.setSelectionPos(this.selection.selection.second,this.getEventPosition(this.multitouches[1]))}else{if(this.options.selection.pinchOnly)return;this.selection.setSelectionPos(this.selection.selection.second,this.lastMousePos)}this.selection.clearSelection();this.selection.selectionIsSane()&&this.selection.drawSelection()}},clearSelection:function(){if(this.selection.prevSelection){var t=this.selection.prevSelection,e=this.plotOffset,i=Math.min(t.first.x,t.second.x),o=Math.min(t.first.y,t.second.y),s=Math.abs(t.second.x-t.first.x),t=Math.abs(t.second.y-t.first.y);this.octx.clearRect(i+e.left-1+.5,o+e.top-1,s+2+.5,t+2+.5);this.selection.prevSelection=null}},selectionIsSane:function(){var t=this.selection.selection;return 5<=Math.abs(t.second.x-t.first.x)||5<=Math.abs(t.second.y-t.first.y)}})})();(()=>{var d=Flotr.DOM;Flotr.addPlugin("labels",{callbacks:{"flotr:afterdraw":function(){this.labels.draw()}},draw:function(){for(var p,r,a,l,h,t,c="",e=0,u=this.options,g=this.ctx,i=this.axes,m=(u.fontSize,0);m(c?t.plotWidth:t.plotHeight))){Flotr.drawText(g,p.label,(h=t,a=c,l=d,r=s,h.plotOffset.left+(a?r:l?-u.grid.labelMargin:u.grid.labelMargin+h.plotWidth)),(a=t,r=c,l=d,n=s,a.plotOffset.top+(r?u.grid.labelMargin:n)+(r&&l?a.plotHeight:0)),f);if(!c&&!d){g.save();g.strokeStyle=f.color;g.beginPath();g.moveTo(t.plotOffset.left+t.plotWidth-8,t.plotOffset.top+e.d2p(p.v));g.lineTo(t.plotOffset.left+t.plotWidth,t.plotOffset.top+e.d2p(p.v));g.stroke();g.restore()}}}}}function n(t,e){var i,o,s=1===e.orientation,n=1===e.n,a="",l=t.plotOffset;if(!s&&!n){g.save();g.strokeStyle=e.options.color||u.grid.color;g.beginPath()}if(e.options.showLabels&&(n||e.used))for(m=0;m(s?t.canvasWidth:t.canvasHeight))){o=l.top+(s?(n?1:-1)*(t.plotHeight+u.grid.labelMargin):e.d2p(p.v)-e.maxLabel.height/2);i=s?l.left+e.d2p(p.v)-r/2:0;a="";0===m?a=" first":m===e.ticks.length-1&&(a=" last");a+=s?" flotr-grid-label-x":" flotr-grid-label-y";c+=['
'+p.label+"
"].join(" ");if(!s&&!n){g.moveTo(l.left+t.plotWidth-8,l.top+e.d2p(p.v));g.lineTo(l.left+t.plotWidth,l.top+e.d2p(p.v))}}}}}})})();(()=>{var O=Flotr.DOM,H=Flotr._;Flotr.addPlugin("legend",{options:{show:!0,noColumns:1,labelFormatter:function(t){return t},labelBoxBorderColor:"#CCCCCC",labelBoxWidth:14,labelBoxHeight:10,labelBoxMargin:5,container:null,position:"nw",margin:5,backgroundColor:"#F0F0F0",backgroundOpacity:.85},callbacks:{"flotr:afterinit":function(){this.legend.insertLegend()},"flotr:destroy":function(){var t=this.legend.markup;if(t){this.legend.markup=null;O.remove(t)}}},insertLegend:function(){if(this.options.legend.show){var t=this.series,e=this.plotOffset,i=this.options,o=i.legend,s=[],n=!1,a=this.ctx,l=H.filter(t,function(t){return t.label&&!t.hide}).length,r=o.position,h=o.margin,c=o.backgroundOpacity;if(l){var d=o.labelBoxWidth,f=o.labelBoxHeight,p=o.labelBoxMargin,u=e.left+h,g=e.top+h,m=0,x={size:1.1*i.fontSize,color:i.grid.color};for(W=t.length-1;-1":"");n=!0}var y=t[W],b=o.labelBoxWidth,M=o.labelBoxHeight,k=o.labelFormatter(y.label),w="background-color:"+(y.bars&&y.bars.show&&y.bars.fillColor&&y.bars.fill?y.bars.fillColor:y.color)+";";s.push('','
','
','
',"
","
","",'',k,"")}n&&s.push("");if(0'+s.join("")+"";if(o.container){S=O.node(S);this.legend.markup=S;O.insert(o.container,S)}else{var T={position:"absolute",zIndex:"2",border:"1px solid "+o.labelBoxBorderColor};if("n"==r.charAt(0)){T.top=h+e.top+"px";T.bottom="auto"}else if("c"==r.charAt(0)){T.top=h+(this.plotHeight-l)/2+"px";T.bottom="auto"}else if("s"==r.charAt(0)){T.bottom=h+e.bottom+"px";T.top="auto"}if("e"==r.charAt(1)){T.right=h+e.right+"px";T.left="auto"}else if("w"==r.charAt(1)){T.left=h+e.left+"px";T.right="auto"}var F=O.create("div");F.className="flotr-legend";O.setStyles(F,T);O.insert(F,S);O.insert(this.el,F);if(c){S=o.backgroundColor||i.grid.backgroundColor||"#ffffff";H.extend(T,O.size(F),{backgroundColor:S,zIndex:"",border:""});T.width+="px";T.height+="px";F=O.create("div");F.className="flotr-legend-bg";O.setStyles(F,T);O.opacity(F,c);O.insert(F," ");O.insert(this.el,F)}}}}else{"s"==r.charAt(0)&&(g=e.top+this.plotHeight-(h+l));"c"==r.charAt(0)&&(g=e.top+this.plotHeight/2-(h+l/2));"e"==r.charAt(1)&&(u=e.left+this.plotWidth-(h+v));w=this.processColor(o.backgroundColor,{opacity:c});a.fillStyle=w;a.fillRect(u,g,v,l);a.strokeStyle=o.labelBoxBorderColor;a.strokeRect(Flotr.toPixel(u),Flotr.toPixel(g),v,l);for(var A=u+p,C=g+p,W=0;W{function l(e){var t;return this.options.spreadsheet.tickFormatter?this.options.spreadsheet.tickFormatter(e):(t=h.find(this.axes.x.ticks,function(t){return t.v==e}),t?t.label:e)}var r=Flotr.DOM,h=Flotr._;Flotr.addPlugin("spreadsheet",{options:{show:!1,tabGraphLabel:"Graph",tabDataLabel:"Data",toolbarDownload:"Download CSV",toolbarSelectAll:"Select all",csvFileSeparator:",",decimalSeparator:".",tickFormatter:null,initialTab:"graph"},callbacks:{"flotr:afterconstruct":function(){if(this.options.spreadsheet.show){var t,e=this.spreadsheet,i=r.node('
'),o=r.node('
'+this.options.spreadsheet.tabGraphLabel+"
"),s=r.node('
'+this.options.spreadsheet.tabDataLabel+"
");e.tabsContainer=i;e.tabs={graph:o,data:s};r.insert(i,o);r.insert(i,s);r.insert(this.el,i);t=r.size(s).height+2;this.plotOffset.bottom+=t;r.setStyles(i,{top:this.canvasHeight-t+"px"});this.observe(o,"click",function(){e.showTab("graph")}).observe(s,"click",function(){e.showTab("data")});"graph"!==this.options.spreadsheet.initialTab&&e.showTab(this.options.spreadsheet.initialTab)}}},loadDataGrid:function(){if(!this.seriesData){var t=this.series,n={};h.each(t,function(t,s){h.each(t.data,function(t){var e=t[0],i=t[1],o=n[e];if(o)o[s+1]=i;else{o=[];o[0]=e;o[s+1]=i;n[e]=o}})});this.seriesData=h.sortBy(n,function(t,e){return parseInt(e,10)})}return this.seriesData},constructDataGrid:function(){if(this.spreadsheet.datagrid)return this.spreadsheet.datagrid;var t=this.series,e=this.spreadsheet.loadDataGrid(),i=[""],n=[''];n.push("");h.each(t,function(t,e){n.push('");i.push("")});n.push("");h.each(e,function(s){n.push("");h.times(t.length+1,function(t){var e="td",i=s[t],i=h.isUndefined(i)?"":Math.round(1e5*i)/1e5;if(0===t){var e="th",o=l.call(this,i);o&&(i=o)}n.push("<"+e+("th"==e?' scope="row"':"")+">"+i+"")},this);n.push("")},this);i.push("");e=r.node(n.join(""));s=r.node('");a=r.node('");this.observe(s,"click",h.bind(this.spreadsheet.downloadCSV,this)).observe(a,"click",h.bind(this.spreadsheet.selectAllData,this));var o=r.node('
');r.insert(o,s);r.insert(o,a);var s=this.canvasHeight-r.size(this.spreadsheet.tabsContainer).height-2,a=r.node('
');r.insert(a,o);r.insert(a,e);r.insert(this.el,a);this.spreadsheet.datagrid=e;this.spreadsheet.container=a;return e},showTab:function(t){if(this.spreadsheet.activeTab!==t){switch(t){case"graph":r.hide(this.spreadsheet.container);r.removeClass(this.spreadsheet.tabs.data,"selected");r.addClass(this.spreadsheet.tabs.graph,"selected");break;case"data":this.spreadsheet.datagrid||this.spreadsheet.constructDataGrid();r.show(this.spreadsheet.container);r.addClass(this.spreadsheet.tabs.data,"selected");r.removeClass(this.spreadsheet.tabs.graph,"selected");break;default:throw"Illegal tab name: "+t}this.spreadsheet.activeTab=t}},selectAllData:function(){if(this.spreadsheet.tabs){var t,e,i,o=this.spreadsheet.constructDataGrid();this.spreadsheet.showTab("data");setTimeout(function(){if((e=o.ownerDocument)&&(i=e.defaultView)&&i.getSelection&&e.createRange&&(i=window.getSelection())&&i.removeAllRanges){t=e.createRange();t.selectNode(o);i.removeAllRanges();i.addRange(t)}else if(document.body&&document.body.createTextRange&&(t=document.body.createTextRange())){t.moveToElementText(o);t.select()}},0);return!0}return!1},downloadCSV:function(){var i="",t=this.series,s=this.options,e=this.spreadsheet.loadDataGrid(),n=encodeURIComponent(s.spreadsheet.csvFileSeparator);if(s.spreadsheet.decimalSeparator===s.spreadsheet.csvFileSeparator)throw"The decimal separator is the same as the column separator ("+s.spreadsheet.decimalSeparator+")";h.each(t,function(t,e){i+=n+'"'+(t.label||String.fromCharCode(65+e)).replace(/\"/g,'\\"')+'"'});i+="%0D%0A";i+=h.reduce(e,function(t,e){var i=l.call(this,e[0])||"",i='"'+(i+"").replace(/\"/g,'\\"')+'"',o=e.slice(1).join(n);"."!==s.spreadsheet.decimalSeparator&&(o=o.replace(/\./g,s.spreadsheet.decimalSeparator));return t+i+n+o+"%0D%0A"},"",this);if(Flotr.isIE&&Flotr.isIE<9){i=i.replace(new RegExp(n,"g"),decodeURIComponent(n)).replace(/%0A/g,"\n").replace(/%0D/g,"\r");window.open().document.write(i)}else window.open("data:text/csv,"+i)}})})();(()=>{var n=Flotr.DOM;Flotr.addPlugin("titles",{callbacks:{"flotr:afterdraw":function(){this.titles.drawTitles()}},drawTitles:function(){var t=this.options,e=t.grid.labelMargin,i=this.ctx,o=this.axes;if(!t.HtmlText&&this.textEnabled){var s={size:t.fontSize,color:t.grid.color,textAlign:"center"};t.subtitle&&Flotr.drawText(i,t.subtitle,this.plotOffset.left+this.plotWidth/2,this.titleHeight+this.subtitleHeight-2,s);s.weight=1.5;s.size*=1.5;t.title&&Flotr.drawText(i,t.title,this.plotOffset.left+this.plotWidth/2,this.titleHeight-2,s);s.weight=1.8;s.size*=.8;if(o.x.options.title&&o.x.used){s.textAlign=o.x.options.titleAlign||"center";s.textBaseline="top";s.angle=Flotr.toRad(o.x.options.titleAngle);s=Flotr.getBestTextAlign(s.angle,s);Flotr.drawText(i,o.x.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+o.x.maxLabel.height+this.plotHeight+2*e,s)}if(o.x2.options.title&&o.x2.used){s.textAlign=o.x2.options.titleAlign||"center";s.textBaseline="bottom";s.angle=Flotr.toRad(o.x2.options.titleAngle);s=Flotr.getBestTextAlign(s.angle,s);Flotr.drawText(i,o.x2.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top-o.x2.maxLabel.height-2*e,s)}if(o.y.options.title&&o.y.used){s.textAlign=o.y.options.titleAlign||"right";s.textBaseline="middle";s.angle=Flotr.toRad(o.y.options.titleAngle);s=Flotr.getBestTextAlign(s.angle,s);Flotr.drawText(i,o.y.options.title,this.plotOffset.left-o.y.maxLabel.width-2*e,this.plotOffset.top+this.plotHeight/2,s)}if(o.y2.options.title&&o.y2.used){s.textAlign=o.y2.options.titleAlign||"left";s.textBaseline="middle";s.angle=Flotr.toRad(o.y2.options.titleAngle);s=Flotr.getBestTextAlign(s.angle,s);Flotr.drawText(i,o.y2.options.title,this.plotOffset.left+this.plotWidth+o.y2.maxLabel.width+2*e,this.plotOffset.top+this.plotHeight/2,s)}}else{i=[];t.title&&i.push('
',t.title,"
");t.subtitle&&i.push('
',t.subtitle,"
");i.push("");i.push('
');o.x.options.title&&o.x.used&&i.push('
',o.x.options.title,"
");o.x2.options.title&&o.x2.used&&i.push('
',o.x2.options.title,"
");o.y.options.title&&o.y.used&&i.push('
',o.y.options.title,"
");o.y2.options.title&&o.y2.used&&i.push('
',o.y2.options.title,"
");i=i.join(""),e=n.create("div");n.setStyles({color:t.grid.color});e.className="flotr-titles";n.insert(this.el,e);n.insert(e,i)}}})})(); //# sourceMappingURL=flotr2.js.map
 '+(t.label||String.fromCharCode(65+e))+"