11 lines
87 KiB
JavaScript
11 lines
87 KiB
JavaScript
/*!
|
|
* 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<arguments.length?T.call(arguments,3):[];a=(p?i:e).split(" ");p&&(i=(h=e,c=f=o,d=s,function(t){for(var e,i="string"==typeof h?d(h,this):h,o=t.target;o&&o!==this;o=o.parentNode)for(e=i.length;e--;)if(i[e]===o)return c.apply(o,arguments)}),r=T.call(r,1));this===F&&(i=z(I,t,e,i,f));for(l=a.length;l--;)((t,e,i,o,s)=>{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<e.length;i++)t[e[i]]=1;return t})({},("click dblclick mouseup mousedown contextmenu mousewheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(h?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),A={mouseenter:{base:"mouseover",condition:o},mouseleave:{base:"mouseout",condition:o},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}},C=(g="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),m=g.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),x=g.concat("char charCode key keyCode".split(" ")),v=g.concat("touches targetTouches changedTouches scale rotation".split(" ")),y="preventDefault",b="stopPropagation",function(t,e){var i={originalEvent:t,isNative:e};if(t){var o,s,n,a,l=t.type,r=t.target||t.srcElement;i[y]=(s=t,function(){s[y]?s[y]():s.returnValue=!1});i[b]=(n=t,function(){n[b]?n[b]():n.cancelBubble=!0});i.stop=(a=i,function(){a[y]();a[b]();a.stopped=!0});i.target=r&&3===r.nodeType?r.parentNode:r;if(e){if(-1!==l.indexOf("key")){o=x;i.keyCode=t.which||t.keyCode}else if(E.test(l)){o=m;i.rightClick=3===t.which||2===t.button;i.pos={x:0,y:0};if(t.pageX||t.pageY){i.clientX=t.pageX;i.clientY=t.pageY}else if(t.clientX||t.clientY){i.clientX=t.clientX+w.body.scrollLeft+S.scrollLeft;i.clientY=t.clientY+w.body.scrollTop+S.scrollTop}D.test(l)&&(i.relatedTarget=t.relatedTarget||t[("mouseover"===l?"from":"to")+"Element"])}else L.test(l)&&(o=v);for(var h,c=t,d=i,f=o||g,p=f.length;p--;){h=f[p];!(h in d)&&h in c&&(d[h]=c[h])}}}return 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<n;a++)if((r||l[a].matches(t,i,o))&&!s(l[a],l,a,e))return}else for(var h in c)"$"===h.charAt(0)&&d(t,h.substr(1),i,o,s)},{has:function(t,e,i){var o,s=c["$"+e];if(s)for(o=s.length;o--;)if(s[o].matches(t,i,null))return!0;return!1},get:function(t,e,i){var o=[];d(t,e,i,null,function(t){return o.push(t)});return o},put:function(t){(c["$"+t.type]||(c["$"+t.type]=[])).push(t);return t},del:function(t){d(t.element,t.type,null,t.handler,function(t,e,i){e.splice(i,1);0===e.length&&delete c["$"+t.type];return!1})},entries:function(){var t,e=[];for(t in c)"$"===t.charAt(0)&&(e=e.concat(c[t]));return e}}),O=h?function(t,e,i,o){t[o?s:"removeEventListener"](e,i,!1)}:function(t,e,i,o,s){s&&o&&null===t["_on"+s]&&(t["_on"+s]=0);t[o?a:r]("on"+e,i)},B=function(e,i,o){return function(t){t=C(t||((this.ownerDocument||this.document||this).parentWindow||l).event,!0);return i.apply(e,[t].concat(o))}},H=function(e,i,o,s,n,a){return function(t){if(s?s.apply(this,arguments):h||t&&t.propertyName==="_on"+o||!t){t=t&&C(t||((this.ownerDocument||this.document||this).parentWindow||l).event,a);i.apply(e,!t||n&&0!==n.length?T.call(arguments,t?0:1).concat(n):arguments)}}},z=function(t,e,i,o,s){return function(){t(e,i,s);o.apply(this,arguments)}},P=function(t,e,i,o){for(var s,n=e&&e.replace(k,""),a=W.get(t,n,i),l=0,r=a.length;l<r;l++)if(a[l].inNamespaces(o)){(s=a[l]).eventSupport&&O(s.target,s.eventType,s.handler,!1,s.type);W.del(s)}},I=function(t,e,i){var o,s,n,a=P,l=e&&"string"==typeof e;if(l&&0<e.indexOf(" ")){e=e.split(" ");for(n=e.length;n--;)I(t,e[n],i)}else{s=l&&e.replace(k,"");s&&A[s]&&(s=A[s].type);if(!e||l){l=(l=l&&e.replace(M,""))&&l.split(".");a(t,s,i,l)}else if("function"==typeof e)a(t,null,e);else for(o in e)e.hasOwnProperty(o)&&I(t,o,e[o])}return t},X=h?function(t,e,i){var o=w.createEvent(t?"HTMLEvents":"UIEvents");o[t?"initEvent":"initUIEvent"](e,!0,!0,l,1);i.dispatchEvent(o)}:function(t,e,i){i=n(i,t);t?i.fireEvent("on"+e,w.createEventObject()):i["_on"+e]++},N={add:u,one:function(){return u.apply(F,arguments)},remove:I,clone:function(t,e,i){for(var o=0,s=W.get(e,i),n=s.length;o<n;o++)s[o].original&&u(t,s[o].type,s[o].original);return t},fire:function(t,e,i){for(var o,s,n,a,l=e.split(" "),r=l.length;r--;){e=l[r].replace(k,"");n=(n=l[r].replace(M,""))&&n.split(".");if(n||i||!t[f]){a=W.get(t,e);i=[!1].concat(i);for(o=0,s=a.length;o<s;o++)a[o].inNamespaces(n)&&a[o].handler.apply(t,i)}else X(p[e],e,t)}return t},noConflict:function(){e[t]=i;return this}};function o(t){var e=t.relatedTarget;return e?e!==this&&"xul"!==e.prefix&&!/document/.test(this.toString())&&!((t,e)=>{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<t)for(;s--&&i<=t;)t/=i;else{o=["y","z","a","f","p","n","µ","m",""];s=o.length;for(;s--&&t<1;)t*=i}return Math.round(t*e)/e+o[s]},getMagnitude:function(t){return Math.pow(10,Math.floor(Math.log(t)/Math.LN10))},toPixel:function(t){return Math.floor(t)+.5},toRad:function(t){return-t*(Math.PI/180)},floorInBase:function(t,e){return e*Math.floor(t/e)},drawText:function(t,e,i,o,s){if(t.fillText){s=this._.extend({size:l.defaultOptions.fontSize,color:"#000000",textAlign:"left",textBaseline:"bottom",weight:1,angle:0},s);t.save();t.translate(i,o);t.rotate(s.angle);t.fillStyle=s.color;t.font=(1<s.weight?"bold ":"")+1.3*s.size+"px sans-serif";t.textAlign=s.textAlign;t.textBaseline=s.textBaseline;t.fillText(e,0,0);t.restore()}else t.drawText(e,i,o,s)},getBestTextAlign:function(t,e){e=e||{textAlign:"center",textBaseline:"middle"};t+=l.getTextAngleFromAlign(e);.01<Math.abs(Math.cos(t))&&(e.textAlign=0<Math.cos(t)?"right":"left");.01<Math.abs(Math.sin(t))&&(e.textBaseline=0<Math.sin(t)?"top":"bottom");return e},alignTable:{"right middle":0,"right top":Math.PI/4,"center top":Math.PI/2,"left top":Math.PI/4*3,"left middle":Math.PI,"left bottom":Math.PI/4*-3,"center bottom":-Math.PI/2,"right bottom":-Math.PI/4,"center middle":0},getTextAngleFromAlign:function(t){return l.alignTable[t.textAlign+" "+t.textBaseline]||0},noConflict:function(){t.Flotr=e;return this}};t.Flotr=l}();Flotr.defaultOptions={colors:["#00A8F0","#C0D800","#CB4B4B","#4DA74D","#9440ED"],ieBackgroundColor:"#FFFFFF",title:null,subtitle:null,shadowSize:4,defaultType:null,HtmlText:!0,fontColor:"#545454",fontSize:7.5,resolution:1,parseFloat:!0,preventDefault:!0,xaxis:{ticks:null,minorTicks:null,showLabels:!0,showMinorLabels:!1,labelsAngle:0,title:null,titleAngle:0,noTicks:5,minorTickFreq:null,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscale:!1,autoscaleMargin:0,color:null,mode:"normal",timeFormat:null,timeMode:"UTC",timeUnit:"millisecond",scaling:"linear",base:Math.E,titleAlign:"center",margin:!0},x2axis:{},yaxis:{ticks:null,minorTicks:null,showLabels:!0,showMinorLabels:!1,labelsAngle:0,title:null,titleAngle:90,noTicks:5,minorTickFreq:null,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscale:!1,autoscaleMargin:0,color:null,scaling:"linear",base:Math.E,titleAlign:"center",margin:!0},y2axis:{titleAngle:270},grid:{color:"#545454",backgroundColor:null,backgroundImage:null,watermarkAlpha:.4,tickColor:"#DDDDDD",labelMargin:3,verticalLines:!0,minorVerticalLines:null,horizontalLines:!0,minorHorizontalLines:null,outlineWidth:1,outline:"nsew",circular:!1},mouse:{track:!1,trackAll:!1,position:"se",relative:!1,trackFormatter:Flotr.defaultTrackFormatter,margin:5,lineColor:"#FF3F19",trackDecimals:1,sensibility:2,trackY:!0,radius:3,fillColor:null,fillOpacity:.4}};(()=>{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<o.colors.length;l++){s=o.colors[l];if(r.isArray(s)){n=s[0];s=s[1]}else n=l/(o.colors.length-1);a.addColorStop(n,h.parse(s).alpha(i))}return a}});Flotr.Color=h})();Flotr.Date={set:function(t,e,i,o){i=i||"UTC";e="set"+("UTC"===i?"UTC":"")+e;t[e](o)},get:function(t,e,i){i=i||"UTC";e="get"+("UTC"===i?"UTC":"")+e;return t[e]()},format:function(t,e,i){if(t){for(var o,s=this.get,n={h:s(t,"Hours",i).toString(),H:h(s(t,"Hours",i)),M:h(s(t,"Minutes",i)),S:h(s(t,"Seconds",i)),s:s(t,"Milliseconds",i),d:s(t,"Date",i).toString(),m:(s(t,"Month",i)+1).toString(),y:s(t,"FullYear",i).toString(),b:Flotr.Date.monthNames[s(t,"Month",i)]},a=[],l=!1,r=0;r<e.length;++r){o=e.charAt(r);if(l){a.push(n[o]||o);l=!1}else"%"==o?l=!0:a.push(o)}return a.join("")}function h(t){t+="";return 1==t.length?"0"+t:t}},getFormat:function(t,e){var i=Flotr.Date.timeUnits;return t<i.second?"%h:%M:%S.%s":t<i.minute?"%h:%M:%S":t<i.day?e<2*i.day?"%h:%M":"%b %d %h:%M":t<i.month?"%b %d":t<i.year?e<i.year?"%b":"%b %y":"%y"},formatter:function(t,e){var i,o=e.options,s=Flotr.Date.timeUnits[o.timeUnit],n=new Date(t*s);return e.options.timeFormat?Flotr.Date.format(n,o.timeFormat,o.timeMode):(s=(e.max-e.min)*s,i=e.tickSize*Flotr.Date.timeUnits[e.tickUnit],Flotr.Date.format(n,Flotr.Date.getFormat(i,s),o.timeMode))},generator:function(t){for(var e,i=this.set,o=this.get,s=this.timeUnits,n=this.spec,a=t.options,l=a.timeMode,r=s[a.timeUnit],h=t.min*r,c=t.max*r,d=(c-h)/a.noTicks,f=[],p=t.tickSize,u=a.tickFormatter===Flotr.defaultTickFormatter?this.formatter:a.tickFormatter,g=0;g<n.length-1;++g){var m=n[g][0]*s[n[g][1]];if(d<(m+n[g+1][0]*s[n[g+1][1]])/2&&p<=m)break}p=n[g][0];e=n[g][1];if("year"==e){p=Flotr.getTickSize(a.noTicks*s.year,h,c,0);if(.5==p){e="month";p=6}}t.tickUnit=e;t.tickSize=p;var x=p*s[e],m=new Date(h);function v(t){i(m,t,l,Flotr.floorInBase(o(m,t,l),p))}switch(e){case"millisecond":v("Milliseconds");break;case"second":v("Seconds");break;case"minute":v("Minutes");break;case"hour":v("Hours");break;case"month":v("Month");break;case"year":v("FullYear")}x>=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<c&&M!=y);return f},timeUnits:{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,year:31556952e3},spec:[[1,"millisecond"],[20,"millisecond"],[50,"millisecond"],[100,"millisecond"],[200,"millisecond"],[500,"millisecond"],[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};(()=>{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<t.touches.length?{x:t.touches[0].pageX,y:t.touches[0].pageY}:!o._.isUndefined(t.changedTouches)&&0<t.changedTouches.length?{x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY}:t.pageX||t.pageY?{x:t.pageX,y:t.pageY}:t.clientX||t.clientY?(i=document,e=i.body,i=i.documentElement,{x:t.clientX+e.scrollLeft+i.scrollLeft,y:t.clientY+e.scrollTop+i.scrollTop}):void 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,'<div style="'+i+'" class="'+o+' flotr-dummy-div">'+t+"</div>");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<e.weight?"bold ":"")+1.3*e.size+"px sans-serif";i=o.measureText(t);o.restore();return i}};Flotr.Text=t})();(()=>{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<i.length;++t)o[t].points.show&&(c=Math.max(c,o[t].points.radius+o[t].points.lineWidth/2));e=this.plotOffset;if(!1===a.options.margin){e.bottom=0;e.top=0}else if(!0===a.options.margin){e.bottom+=(!i.grid.circular&&a.used&&a.options.showLabels?a.maxLabel.height+s:0)+(a.used&&a.options.title?a.titleSize.height+s:0)+c;e.top+=(!i.grid.circular&&l.used&&l.options.showLabels?l.maxLabel.height+s:0)+(l.used&&l.options.title?l.titleSize.height+s:0)+this.subtitleHeight+this.titleHeight+c}else{e.bottom=a.options.margin;e.top=a.options.margin}if(!1===r.options.margin){e.left=0;e.right=0}else if(!0===r.options.margin){e.left+=(!i.grid.circular&&r.used&&r.options.showLabels?r.maxLabel.width+s:0)+(r.used&&r.options.title?r.titleSize.width+s:0)+c;e.right+=(!i.grid.circular&&h.used&&h.options.showLabels?h.maxLabel.width+s:0)+(h.used&&h.options.title?h.titleSize.width+s:0)+c}else{e.left=r.options.margin;e.right=r.options.margin}e.top=Math.floor(e.top);this.plotWidth=this.canvasWidth-e.left-e.right;this.plotHeight=this.canvasHeight-e.bottom-e.top;a.length=l.length=this.plotWidth;r.length=h.length=this.plotHeight;r.offset=h.offset=this.plotHeight;a.setScale();l.setScale();r.setScale();h.setScale()},draw:function(t){var e,i=this.ctx;g.fire(this.el,"flotr:beforedraw",[this.series,this]);if(this.series.length){i.save();i.translate(this.plotOffset.left,this.plotOffset.top);for(e=0;e<this.series.length;e++){this.series[e].index=e;this.series[e].hide||this.drawSeries(this.series[e])}i.restore();this.clip()}g.fire(this.el,"flotr:afterdraw",[this.series,this]);t&&t()},drawSeries:function(i){function o(t,e){var i=this.getOptions(t,e);i.index=t.index;this[e].draw(i)}var s=!1;i=i||this.series;m.each(x.graphTypes,function(t,e){if(i[e]&&i[e].show&&this[e]){s=!0;o.call(this,i,e)}},this);s||o.call(this,i,this.options.defaultType)},getOptions:function(t,e){var i=t[e],o=(this[e],t.xaxis),s=t.yaxis,o={context:this.ctx,width:this.plotWidth,height:this.plotHeight,fontSize:this.options.fontSize,fontColor:this.options.fontColor,textEnabled:this.textEnabled,htmlText:this.options.HtmlText,text:this._text,element:this.el,data:t.data,color:t.color,shadowSize:t.shadowSize,xScale:o.d2p,yScale:s.d2p,xInverse:o.p2d,yInverse:s.p2d},o=x.merge(i,o);o.fillStyle=this.processColor(i.fillColor||t.color,{opacity:i.fillOpacity});return o},getEventPosition:function(t){var e,i,o,s=document,n=s.body,s=s.documentElement,a=this.axes,l=this.plotOffset,r=this.lastMousePos,h=g.eventPointer(t),c=h.x-r.pageX,r=h.y-r.pageY;if("ontouchstart"in this.el){e=d.position(this.overlay);i=h.x-e.left-l.left;o=h.y-e.top-l.top}else{e=this.overlay.getBoundingClientRect();i=t.clientX-e.left-l.left-n.scrollLeft-s.scrollLeft;o=t.clientY-e.top-l.top-n.scrollTop-s.scrollTop}return{x:a.x.p2d(i),x2:a.x2.p2d(i),y:a.y.p2d(o),y2:a.y2.p2d(o),relX:i,relY:o,dX:c,dY:r,absX:h.x,absY:h.y,pageX:h.x,pageY:h.y}},clickHandler:function(t){if(this.ignoreClick)return this.ignoreClick=!1,this.ignoreClick;g.fire(this.el,"flotr:click",[this.getEventPosition(t),this])},mouseMoveHandler:function(t){if(!this.mouseDownMoveHandler){var e=this.getEventPosition(t);g.fire(this.el,"flotr:mousemove",[t,e,this]);this.lastMousePos=e}},mouseDownHandler:function(i){if(!this.mouseUpHandler){this.mouseUpHandler=m.bind(function(t){g.stopObserving(document,"mouseup",this.mouseUpHandler);g.stopObserving(document,"mousemove",this.mouseDownMoveHandler);this.mouseDownMoveHandler=null;this.mouseUpHandler=null;g.fire(this.el,"flotr:mouseup",[t,this])},this);this.mouseDownMoveHandler=m.bind(function(t){var e=this.getEventPosition(t);g.fire(this.el,"flotr:mousemove",[i,e,this]);this.lastMousePos=e},this);g.observe(document,"mouseup",this.mouseUpHandler);g.observe(document,"mousemove",this.mouseDownMoveHandler);g.fire(this.el,"flotr:mousedown",[i,this]);this.ignoreClick=!1}},drawTooltip:function(t,e,i,o){var s=this.getMouseTrack(),n="opacity:0.7;background-color:#000;color:#fff;display:none;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;",a=o.position,l=o.margin,r=this.plotOffset;if(null!==e&&null!==i){if(o.relative){"n"==a.charAt(0)?n+="bottom:"+(l-r.top-i+this.canvasHeight)+"px;top:auto;":"s"==a.charAt(0)&&(n+="top:"+(l+r.top+i)+"px;bottom:auto;");"e"==a.charAt(1)?n+="left:"+(l+r.left+e)+"px;right:auto;":"w"==a.charAt(1)&&(n+="right:"+(l-r.left-e+this.canvasWidth)+"px;left:auto;")}else{"n"==a.charAt(0)?n+="top:"+(l+r.top)+"px;bottom:auto;":"s"==a.charAt(0)&&(n+="bottom:"+(l+r.bottom)+"px;top:auto;");"e"==a.charAt(1)?n+="right:"+(l+r.right)+"px;left:auto;":"w"==a.charAt(1)&&(n+="left:"+(l+r.left)+"px;right:auto;")}s.style.cssText=n;d.empty(s);d.insert(s,t);d.show(s)}else d.hide(s)},clip:function(t){var e=this.plotOffset,i=this.canvasWidth,o=this.canvasHeight;t=t||this.ctx;if(x.isIE&&x.isIE<9&&!x.isFlashCanvas){if(t!==this.octx){t.save();t.fillStyle=this.processColor(this.options.ieBackgroundColor);t.fillRect(0,0,i,e.top);t.fillRect(0,0,e.left,o);t.fillRect(0,o-e.bottom,i,e.bottom);t.fillRect(i-e.right,0,e.right,o);t.restore()}}else{t.clearRect(0,0,i,e.top);t.clearRect(0,0,e.left,o);t.clearRect(0,o-e.bottom,i,e.bottom);t.clearRect(i-e.right,0,e.right,o)}},_initMembers:function(){this._handles=[];this.lastMousePos={pageX:null,pageY:null};this.plotOffset={left:0,right:0,top:0,bottom:0};this.ignoreClick=!0;this.prevHit=null},_initGraphTypes:function(){m.each(x.graphTypes,function(t,e){this[e]=x.clone(t)},this)},_initEvents:function(){var e,i,o,s=this.el;if("ontouchstart"in s){e=m.bind(function(t){o=!0;g.stopObserving(document,"touchend",e);g.fire(s,"flotr:mouseup",[t,this]);this.multitouches=null;i||this.clickHandler(t)},this);this.observe(this.overlay,"touchstart",m.bind(function(t){i=!1;o=!1;this.ignoreClick=!1;t.touches&&1<t.touches.length&&(this.multitouches=t.touches);g.fire(s,"flotr:mousedown",[t,this]);this.observe(document,"touchend",e)},this));this.observe(this.overlay,"touchmove",m.bind(function(t){var e=this.getEventPosition(t);this.options.preventDefault&&t.preventDefault();i=!0;this.multitouches||t.touches&&1<t.touches.length?this.multitouches=t.touches:o||g.fire(s,"flotr:mousemove",[t,e,this]);this.lastMousePos=e},this))}this.observe(this.overlay,"mousedown",m.bind(this.mouseDownHandler,this)).observe(s,"mousemove",m.bind(this.mouseMoveHandler,this)).observe(this.overlay,"click",m.bind(this.clickHandler,this)).observe(s,"mouseout",function(t){g.fire(s,"flotr:mouseout",t)})},_initCanvas:function(){for(var t,e,s=this.el,n=this.options,i=s.children,o=[],a=i.length;a--;){t=i[a];this.canvas||"flotr-canvas"!==t.className?this.overlay||"flotr-overlay"!==t.className?o.push(t):this.overlay=t:this.canvas=t}for(a=o.length;a--;)s.removeChild(o[a]);d.setStyles(s,{position:"relative"});e={};e.width=s.clientWidth;e.height=s.clientHeight;if(e.width<=0||e.height<=0||n.resolution<=0)throw"Invalid dimensions for plot, width = "+e.width+", height = "+e.height+", resolution = "+n.resolution;this.canvas=l(this.canvas,"canvas");this.overlay=l(this.overlay,"overlay");this.ctx=r(this.canvas);this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);this.octx=r(this.overlay);this.octx.clearRect(0,0,this.overlay.width,this.overlay.height);this.canvasHeight=e.height;this.canvasWidth=e.width;this.textEnabled=!!this.ctx.drawText||!!this.ctx.fillText;function l(i,o){if(!i){i=d.create("canvas");if("undefined"!=typeof FlashCanvas&&"function"==typeof i.getContext){FlashCanvas.initElement(i);this.isFlashCanvas=!0}i.className="flotr-"+o;i.style.cssText="position:absolute;left:0px;top:0px;";d.insert(s,i)}m.each(e,function(t,e){d.show(i);if("canvas"!=o||i.getAttribute(e)!==t){i.setAttribute(e,t*n.resolution);i.style[e]=t+"px"}});i.context_=null;return i}function r(t){window.G_vmlCanvasManager&&window.G_vmlCanvasManager.initElement(t);var e=t.getContext("2d");window.G_vmlCanvasManager||e.scale(n.resolution,n.resolution);return e}},_initPlugins:function(){m.each(x.plugins,function(t,i){m.each(t.callbacks,function(t,e){this.observe(this.el,e,m.bind(t,this))},this);this[i]=x.clone(t);m.each(this[i],function(t,e){m.isFunction(t)&&(this[i][e]=m.bind(t,this))},this)},this)},_initOptions:function(t){var e=x.clone(x.defaultOptions);e.x2axis=m.extend(m.clone(e.xaxis),e.x2axis);e.y2axis=m.extend(m.clone(e.yaxis),e.y2axis);this.options=x.merge(t||{},e);null===this.options.grid.minorVerticalLines&&"logarithmic"===this.options.xaxis.scaling&&(this.options.grid.minorVerticalLines=!0);null===this.options.grid.minorHorizontalLines&&"logarithmic"===this.options.yaxis.scaling&&(this.options.grid.minorHorizontalLines=!0);g.fire(this.el,"flotr:afterinitoptions",[this]);this.axes=x.Axis.getAxes(this.options);for(var i,o,s=[],n=[],a=this.series.length,l=this.series.length,r=this.options.colors,h=[],c=0,d=l-1;-1<d;--d){f=this.series[d].color;if(f){--l;m.isNumber(f)?s.push(f):h.push(x.Color.parse(f))}}for(d=s.length-1;-1<d;--d)l=Math.max(l,s[d]+1);for(d=0;n.length<l;){var f=r.length==d?new x.Color(100,100,100):x.Color.parse(r[d]),p=c%2==1?-1:1,p=1+p*Math.ceil(c/2)*.2;f.scale(p,p,p);n.push(f);if(++d>=r.length){d=0;++c}}for(d=0,i=0;d<a;++d){o=this.series[d];o.color?m.isNumber(o.color)&&(o.color=n[o.color].toString()):o.color=n[i++].toString();o.xaxis||(o.xaxis=this.axes.x);1==o.xaxis?o.xaxis=this.axes.x:2==o.xaxis&&(o.xaxis=this.axes.x2);o.yaxis||(o.yaxis=this.axes.y);1==o.yaxis?o.yaxis=this.axes.y:2==o.yaxis&&(o.yaxis=this.axes.y2);for(var u in x.graphTypes)o[u]=m.extend(m.clone(this.options[u]),o[u]);o.mouse=m.extend(m.clone(this.options.mouse),o.mouse);m.isUndefined(o.shadowSize)&&(o.shadowSize=this.options.shadowSize)}},_setEl:function(t){if(!t)throw"The target container doesn't exist";if(t.graph instanceof Graph)t.graph.destroy();else if(!t.clientWidth)throw"The target container must be visible";t.graph=this;this.el=t}};Flotr.Graph=Graph})();(()=>{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=10<n-a?0:5<n-a?2:5)}else t.tickSize=Flotr.getTickSize(e.noTicks,i,o,e.tickDecimals);t.min=i;t.max=o;if(null===e.min&&e.autoscale){t.min-=t.tickSize*s;t.min<0&&0<=t.datamin&&(t.min=0);t.min=t.tickSize*Math.floor(t.min/t.tickSize)}if(null===e.max&&e.autoscale){t.max+=t.tickSize*s;0<t.max&&t.datamax<=0&&t.datamax!=t.datamin&&(t.max=0);t.max=t.tickSize*Math.ceil(t.max/t.tickSize)}t.min==t.max&&(t.max=t.min+1)}},calculateTextDimensions:function(t,e){var i,o,s="";if(this.options.showLabels)for(o=0;o<this.ticks.length;++o){i=this.ticks[o].label.length;i>s.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<t.length;++o){n=t[o];if("object"==typeof n){i=n[0];s=1<n.length?n[1]:a.tickFormatter(i,{min:this.min,max:this.max})}else{i=n;s=a.tickFormatter(i,{min:this.min,max:this.max})}e[o]={v:i,label:s}}},_calculateTimeTicks:function(){this.ticks=Flotr.Date.generator(this)},_calculateLogTicks:function(){var t,e=this,o=e.options,s=Math.log(e.max),s=(o.base!=Math.E&&(s/=Math.log(o.base)),Math.ceil(s)),n=Math.log(e.min);o.base!=Math.E&&(n/=Math.log(o.base));n=Math.ceil(n);for(i=n;i<s;i+=e.tickSize){var a=o.base==Math.E?Math.exp(i):Math.pow(o.base,i),l=a*(o.base==Math.E?Math.exp(e.tickSize):Math.pow(o.base,e.tickSize)),r=(l-a)/o.minorTickFreq;e.ticks.push({v:a,label:o.tickFormatter(a,{min:e.min,max:e.max})});for(t=a+r;t<l;t+=r)e.minorTicks.push({v:t,label:o.tickFormatter(t,{min:e.min,max:e.max})})}a=o.base==Math.E?Math.exp(i):Math.pow(o.base,i);e.ticks.push({v:a,label:o.tickFormatter(a,{min:e.min,max:e.max})})},_calculateTicks:function(){var t,e,i,o,s,n,a=this,l=a.options,r=a.tickSize,h=a.min,c=a.max,d=r*Math.ceil(h/r);l.minorTickFreq&&(e=r/l.minorTickFreq);for(s=0;(i=o=d+s*r)<=c;++s){t=l.tickDecimals;null===t&&(t=1-Math.floor(Math.log(r)/Math.LN10));t<0&&(t=0);i=i.toFixed(t);a.ticks.push({v:i,label:l.tickFormatter(i,{min:a.min,max:a.max})});if(l.minorTickFreq)for(n=0;n<l.minorTickFreq&&s*r+n*e<c;++n){i=o+n*e;a.minorTicks.push({v:i,label:l.tickFormatter(i,{min:a.min,max:a.max})})}}}};l.extend(e,{getAxes:function(t){return{x:new e({options:t.xaxis,n:1,length:this.plotWidth}),x2:new e({options:t.x2axis,n:2,length:this.plotWidth}),y:new e({options:t.yaxis,n:1,length:this.plotHeight,offset:this.plotHeight,orientation:-1}),y2:new e({options:t.y2axis,n:2,length:this.plotHeight,offset:this.plotHeight,orientation:-1})}}});function r(t,e){t=Math.log(Math.max(t,Number.MIN_VALUE));e!==Math.E&&(t/=Math.log(e));return t}Flotr.Axis=e})();(()=>{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<s;i++){t=o[i][0];e=o[i][1];if(null!==t){if(t<n){n=t;h=!0}if(l<t){l=t;h=!0}}if(null!==e){if(e<a){a=e;c=!0}if(r<e){r=e;c=!0}}}return{xmin:n,xmax:l,ymin:a,ymax:r,xused:h,yused:c}}};i.extend(o,{getSeries:function(t){return i.map(t,function(t){var e;if(t.data){e=new o;i.extend(e,t)}else e=new o({data:t});return e})}});Flotr.Series=o})();Flotr.addType("lines",{options:{show:!1,lineWidth:2,fill:!1,fillBorder:!1,fillColor:null,fillOpacity:.4,steps:!1,stacked:!1},stack:{values:[]},draw:function(t){var e,i=t.context,o=t.lineWidth,s=t.shadowSize;i.save();i.lineJoin="round";if(s){i.lineWidth=s/2;e=o/2+i.lineWidth/2;i.strokeStyle="rgba(0,0,0,0.1)";this.plot(t,e+s/2,!1);i.strokeStyle="rgba(0,0,0,0.2)";this.plot(t,e,!1)}i.lineWidth=o;i.strokeStyle=t.color;this.plot(t,0,!0);i.restore()},plot:function(t,e,i){var o,s,n,a,l,r,h,c=t.context,d=t.width,f=t.height,p=t.xScale,u=t.yScale,g=t.data,m=!!t.stacked&&this.stack,x=g.length-1,v=null,y=null,b=u(0),M=null;if(!(x<1)){c.beginPath();for(h=0;h<x;++h)if(null===g[h][1]||null===g[h+1][1]){if(t.fill&&0<h&&null!==g[h][1]){c.stroke();k();M=null;c.closePath();c.beginPath()}}else{o=p(g[h][0]);s=p(g[h+1][0]);null===M&&(M=g[h]);if(m){l=m.values[g[h][0]]||0;r=m.values[g[h+1][0]]||m.values[g[h][0]]||0;n=u(g[h][1]+l);a=u(g[h+1][1]+r);if(i){g[h].y0=l;m.values[g[h][0]]=g[h][1]+l;if(h==x-1){g[h+1].y0=r;m.values[g[h+1][0]]=g[h+1][1]+r}}}else{n=u(g[h][1]);a=u(g[h+1][1])}if(!(f<n&&f<a||n<0&&a<0||o<0&&s<0||d<o&&d<s)){v==o&&y==n+e||c.moveTo(o,n+e);v=s;y=a+e;if(t.steps){c.lineTo(v+e/2,n+e);c.lineTo(v+e/2,y)}else c.lineTo(v,y)}}t.fill&&(t.fill,t.fillBorder)||c.stroke();k();c.closePath()}function k(){if(!e&&t.fill&&M){o=p(M[0]);c.fillStyle=t.fillStyle;c.lineTo(s,b);c.lineTo(o,b);c.lineTo(o,u(M[1]));c.fill();t.fillBorder&&c.stroke()}}},extendYRange:function(t,e,i,o){var s=t.options;if(i.stacked&&(!s.max&&0!==s.max||!s.min&&0!==s.min)){for(var n,a=t.max,l=t.min,r=o.positiveSums||{},h=o.negativeSums||{},c=0;c<e.length;c++){n=e[c][0]+"";if(0<e[c][1]){r[n]=(r[n]||0)+e[c][1];a=Math.max(a,r[n])}else{h[n]=(h[n]||0)+e[c][1];l=Math.min(l,h[n])}}o.negativeSums=h;o.positiveSums=r;t.max=a;t.min=l}if(i.steps){this.hit=function(t){for(var e=t.data,i=t.args,o=t.yScale,s=i[0],n=e.length,a=i[1],l=t.xInverse(s.relX),r=s.relY,h=0;h<n-1;h++)if(l>=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;e<a.length;e++){n=this.getBarGeometry(a[e][0],a[e][1],t,!0);if(null!==n){i=n.left;o=n.top;s=n.width;n=n.height;t.fill&&l.fillRect(i,o,s,n);if(r){l.save();l.fillStyle="rgba(0,0,0,0.05)";l.fillRect(i+r,o+r,s,n);l.restore()}t.lineWidth&&l.strokeRect(i,o,s,n)}}}},translate:function(t,e){if(e){t.rotate(-Math.PI/2);t.scale(-1,1)}},getBarGeometry:function(t,e,i,o){var s=i.horizontal,n=i.barWidth,a=i.centered,l=!!i.stacked&&this.stack,r=i.lineWidth,a=a?n/2:0,h=s?i.yScale:i.xScale,c=s?i.xScale:i.yScale,d=s?e:t,s=s?t:e,f=0;if(i.grouped){this.current,this.groups;d-=a;n/=this.groups;a=n/2;d=d+n*this.current-a}if(l){l=0<s?l.positive:l.negative;f=l[d]||f;if(o){this.stackData=this.stackData||{};this.stackData[i.index]=this.stackData[i.index]||{};this.stackData[i.index][d]=f}else this.stackData&&Math.round(d)==d&&(f=this.stackData[i.index][d]);o&&(l[d]=f+s)}l=h(d-a);n=h(d+n-a);a=c(s+f);f=c(f);f<0&&(f=0);return null===t||null===e?null:{bottom:f,x:d,y:s,xScale:h,yScale:c,top:a,left:Math.min(l,n)-r/2,width:Math.abs(n-l)-r,height:f-a}},hit:function(t){for(var e,i=t.data,o=t.args,s=o[0],n=o[1],o=t.xInverse(s.relX),s=t.yInverse(s.relY),a=this.getBarGeometry(o,s,t),l=a.width/2,r=a.left,h=a.y,c=i.length;c--;){e=this.getBarGeometry(i[c][0],i[c][1],t);if((t.stacked&&!t.horizontal&&a.yScale(a.y)<e.bottom&&a.yScale(a.y)>e.top||t.stacked&&t.horizontal&&a.yScale(a.y)>e.bottom&&a.yScale(a.y)<e.top||!t.stacked&&0<h&&h<e.y||h<0&&h>e.y)&&Math.abs(r-e.left)<l){n.x=i[c][0];n.y=i[c][1];if(t.stacked){t.horizontal?n.x=t.xInverse(e.top):n.y=t.yInverse(e.top);n.bottom=e.bottom}n.index=c;n.seriesIndex=t.index}}},drawHit:function(t){var e=t.context,i=t.args,i=this.getBarGeometry(i.x,i.y,t),o=i.left,s=i.top,n=i.width,i=i.height;e.save();e.strokeStyle=t.color;e.lineWidth=t.lineWidth;this.translate(e,t.horizontal);e.beginPath();e.moveTo(o,s+i);t.stacked&&e.moveTo(o,t.args.bottom);e.lineTo(o,s);e.lineTo(o+n,s);t.stacked||e.lineTo(o+n,s+i);if(t.stacked){e.lineTo(o+n,t.args.bottom);e.lineTo(o,t.args.bottom)}if(t.fill){e.fillStyle=t.fillStyle;e.fill()}e.stroke();e.closePath();e.restore()},clearHit:function(t){var e=t.context,i=t.args,i=this.getBarGeometry(i.x,i.y,t),o=i.left,s=i.width,n=i.top,i=i.height,a=2*t.lineWidth;e.save();this.translate(e,t.horizontal);e.clearRect(o-a,Math.min(n,n+i)-a,s+2*a,Math.abs(i)+2*a);e.restore()},extendXRange:function(t,e,i,o){this._extendRange(t,e,i,o);this.groups=this.groups+1||1;this.current=0},extendYRange:function(t,e,i,o){this._extendRange(t,e,i,o)},_extendRange:function(t,e,i,o){var s=t.options.max;if(!_.isNumber(s)&&!_.isString(s)){var n,a,l,r=t.min,h=t.max,s=i.horizontal,c=t.orientation,d=this.positiveSums||{},f=this.negativeSums||{};if((1==c&&!s||-1==c&&s)&&i.centered){h=Math.max(t.datamax+i.barWidth,h);r=Math.min(t.datamin-i.barWidth,r)}if(i.stacked&&(1==c&&s||-1==c&&!s))for(l=e.length;l--;){n=e[l][1==c?1:0]+"";a=e[l][1==c?0:1];if(0<a){d[n]=(d[n]||0)+a;h=Math.max(h,d[n])}else{f[n]=(f[n]||0)+a;r=Math.min(r,f[n])}}(1==c&&s||-1==c&&!s)&&i.topPadding&&(t.max===t.datamax||i.stacked&&this.stackMax!==h)&&(h+=i.topPadding*(h-r));this.stackMin=r;this.stackMax=h;this.negativeSums=f;this.positiveSums=d;t.max=h;t.min=r}}});Flotr.addType("bubbles",{options:{show:!1,lineWidth:2,fill:!0,fillOpacity:.4,baseRadius:2},draw:function(t){var e=t.context,i=t.shadowSize;e.save();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;e=e||0;for(o=0;o<s.length;++o){i=this.getGeometry(s[o],t);n.beginPath();n.arc(i.x+e,i.y+e,i.z,0,2*Math.PI,!0);n.stroke();t.fill&&n.fill();n.closePath()}},getGeometry:function(t,e){return{x:e.xScale(t[0]),y:e.yScale(t[1]),z:t[2]*e.baseRadius}},hit:function(t){var e,o,s,n=t.data,a=t.args,l=a[0],r=a[1],h=l.relX,c=l.relY;r.best=r.best||Number.MAX_VALUE;for(i=n.length;i--;){e=this.getGeometry(n[i],t);o=e.x-h;s=e.y-c;o=Math.sqrt(o*o+s*s);if(o<e.z&&e.z<r.best){r.x=n[i][0];r.y=n[i][1];r.index=i;r.seriesIndex=t.index;r.best=e.z}}},drawHit:function(t){var e=t.context,i=this.getGeometry(t.data[t.args.index],t);e.save();e.lineWidth=t.lineWidth;e.fillStyle=t.fillStyle;e.strokeStyle=t.color;e.beginPath();e.arc(i.x,i.y,i.z,0,2*Math.PI,!0);e.fill();e.stroke();e.closePath();e.restore()},clearHit:function(t){var e=t.context,i=this.getGeometry(t.data[t.args.index],t),o=i.z+t.lineWidth;e.save();e.clearRect(i.x-o,i.y-o,2*o,2*o);e.restore()}});Flotr.addType("candles",{options:{show:!1,lineWidth:1,wickLineWidth:1,candleWidth:.6,fill:!0,upFillColor:"#00A8F0",downFillColor:"#CB4B4B",fillOpacity:.5,barcharts:!1},draw:function(t){var e=t.context;e.save();e.lineJoin="miter";e.lineCap="butt";e.lineWidth=t.wickLineWidth||t.lineWidth;this.plot(t);e.restore()},plot:function(t){var e,i,o,s,n,a,l,r,h,c,d,f=t.data,p=t.context,u=t.xScale,g=t.yScale,m=t.candleWidth/2,x=t.shadowSize,v=t.lineWidth,y=t.wickLineWidth,b=y%2/2;if(!(f.length<1))for(d=0;d<f.length;d++){o=f[d];e=o[0];i=o[1];l=o[2];a=o[3];o=o[4];s=u(e-m);n=u(e+m);a=g(a);l=g(l);r=g(Math.min(i,o));h=g(Math.max(i,o));c=t[o<i?"downFillColor":"upFillColor"];if(t.fill&&!t.barcharts){p.fillStyle="rgba(0,0,0,0.05)";p.fillRect(s+x,h+x,n-s,r-h);p.save();p.globalAlpha=t.fillOpacity;p.fillStyle=c;p.fillRect(s,h+v,n-s,r-h);p.restore()}if(v||y){e=Math.floor((s+n)/2)+b;p.strokeStyle=c;p.beginPath();if(t.barcharts){p.moveTo(e,Math.floor(l+v));p.lineTo(e,Math.floor(a+v));c=i<o;p.moveTo(c?n:s,Math.floor(h+v));p.lineTo(e,Math.floor(h+v));p.moveTo(e,Math.floor(r+v));p.lineTo(c?s:n,Math.floor(r+v))}else{p.strokeRect(s,h+v,n-s,r-h);p.moveTo(e,Math.floor(h+v));p.lineTo(e,Math.floor(l+v));p.moveTo(e,Math.floor(r+v));p.lineTo(e,Math.floor(a+v))}p.closePath();p.stroke()}}},hit:function(t){for(var e,i,o,s,n,a=t.xScale,l=t.yScale,r=t.data,h=t.args,c=h[0],d=t.candleWidth/2,f=h[1],p=c.relX,u=c.relY,g=r.length,m=0;m<g;m++){e=r[m],s=e[2];n=e[3];i=a(e[0]-d);o=a(e[0]+d);n=l(n);s=l(s);if(i<p&&p<o&&s<u&&u<n){f.x=e[0];f.index=m;f.seriesIndex=t.index;return}}},drawHit:function(t){var e=t.context;e.save();this.plot(_.defaults({fill:!!t.fillColor,upFillColor:t.color,downFillColor:t.color,data:[t.data[t.args.index]]},t));e.restore()},clearHit:function(t){var e=t.args,i=t.context,o=t.xScale,s=t.yScale,n=t.lineWidth,a=t.candleWidth/2,e=t.data[e.index],l=o(e[0]-a)-n,o=o(e[0]+a)+n,a=s(e[2]),s=s(e[3])+n;i.clearRect(l,a,o-l,s-a)},extendXRange:function(t,e,i){if(null===t.options.max){t.max=Math.max(t.datamax+.5,t.max);t.min=Math.min(t.datamin-.5,t.min)}}});Flotr.addType("gantt",{options:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,fillOpacity:.4,centered:!0},draw:function(t){var e=this.ctx,i=t.gantt.barWidth,o=Math.min(t.gantt.lineWidth,i);e.save();e.translate(this.plotOffset.left,this.plotOffset.top);e.lineJoin="miter";e.lineWidth=o;e.strokeStyle=t.color;e.save();this.gantt.plotShadows(t,i,0,t.gantt.fill);e.restore();if(t.gantt.fill){o=t.gantt.fillColor||t.color;e.fillStyle=this.processColor(o,{opacity:t.gantt.fillOpacity})}this.gantt.plot(t,i,0,t.gantt.fill);e.restore()},plot:function(t,e,i,o){var s=t.data;if(!(s.length<1))for(var n=t.xaxis,a=t.yaxis,l=this.ctx,r=0;r<s.length;r++){var h=s[r][0],c=s[r][1],d=s[r][2],f=!0,p=!0;if(null!==c&&null!==d){var u=c,c=c+d,d=h-(t.gantt.centered?e/2:0),h=h+e-(t.gantt.centered?e/2:0);if(!(c<n.min||u>n.max||h<a.min||d>a.max)){if(u<n.min){u=n.min;f=!1}if(c>n.max){c=n.max;n.lastSerie!=t&&(p=!1)}d<a.min&&(d=a.min);if(h>a.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;r<o.length;r++){f=o[r][0];c=o[r][1];d=o[r][2];if(null!==c&&null!==d){var h=c,c=c+d,d=f-(t.gantt.centered?e/2:0),f=f+e-(t.gantt.centered?e/2:0);if(!(c<s.min||h>s.max||f<n.min||d>n.max)){h<s.min&&(h=s.min);c>s.max&&(c=s.max);d<n.min&&(d=n.min);f>n.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;r<this.series.length;++r){i=this.series[r];o=i.gantt;if(o.show&&i.xaxis==t){for(e=0;e<i.data.length;e++)if(o.show){y=i.data[e][0]+"";a[y]=Math.max(a[y]||0,i.data[e][1]+i.data[e][2]);l=i}for(e in a)n=Math.max(a[e],n)}}t.lastSerie=l;t.max=n;t.min=s}},extendYRange:function(t){if(null===t.options.max){for(var e,i,o=Number.MIN_VALUE,s=Number.MAX_VALUE,n=0;n<this.series.length;++n){e=this.series[n];i=e.gantt;if(i.show&&!e.hide&&e.yaxis==t){for(var a=Number.MIN_VALUE,l=Number.MAX_VALUE,r=0;r<e.data.length;r++){a=Math.max(a,e.data[r][0]);l=Math.min(l,e.data[r][0])}if(i.centered){o=Math.max(a+.5,o);s=Math.min(l-.5,s)}else{o=Math.max(a+1,o);s=Math.min(l,s)}i.barWidth+a>o&&(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<e?(h.positive[t]=o+e,o+e):(h.negative[t]=i+e,i+e)}for(e=0;e<l.length;++e){s=l[e][0];n=l[e][1];if(h)if("b"==c)t.horizontal?n=d(n,s):s=d(s,n);else if("a"==c){a=h.values[s]||0;h.values[s]=a+n;n=a+n}a=t.labelFormatter({x:s,y:n,index:e,data:l});this.plot(t.xScale(s),t.yScale(n),a,t)}r.restore()},plot:function(t,e,i,o){o.context;if(r(i)&&!i.complete)throw"Marker image not loaded.";this._plot(t,e,i,o)},_plot:function(t,e,i,o){var s=o.context,n=t,a=e,l=r(i)?{height:i.height,width:i.width}:o.text.canvas(i);l.width=Math.floor(l.width+4);l.height=Math.floor(l.height+4);-1!=o.position.indexOf("c")?n-=l.width/2+2:-1!=o.position.indexOf("l")&&(n-=l.width);-1!=o.position.indexOf("m")?a-=l.height/2+2:-1!=o.position.indexOf("t")?a-=l.height+o.verticalMargin:a+=o.verticalMargin;n=Math.floor(n)+.5;a=Math.floor(a)+.5;o.fill&&s.fillRect(n,a,l.width,l.height);o.stroke&&s.strokeRect(n,a,l.width,l.height);r(i)?s.drawImage(i,parseInt(n+2,10),parseInt(a+2,10)):Flotr.drawText(s,i,n+2,a+2,{textBaseline:"top",textAlign:"left",size:o.fontSize,color:o.color})}});function r(t){return"object"==typeof t&&t.constructor&&(Image||t.constructor===Image)}})();(()=>{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<x?"top":"bottom";o.save();o.translate(r/2,l/2);o.scale(1,1);e=Math.cos(u)*h;u=Math.sin(u)*h;if(0<n){this.plotSlice(e+n,u+n,a,g,m,o);if(d){o.fillStyle="rgba(0,0,0,0.1)";o.fill()}}this.plotSlice(e,u,a,g,m,o);if(d){o.fillStyle=f;o.fill()}o.lineWidth=s;o.strokeStyle=c;o.stroke();n={size:1.2*t.fontSize,color:t.fontColor,weight:1.5};if(i)if(t.htmlText||!t.textEnabled){divStyle="position:absolute;"+b+":"+(l/2+("top"==b?x:-x))+"px;";divStyle+=y+":"+(r/2+("right"==y?-v:v))+"px;";p.push('<div style="',divStyle,'" class="flotr-grid-label">',i,"</div>")}else{n.textAlign=y;n.textBaseline=b;Flotr.drawText(o,i,v,x,n)}if(t.htmlText||!t.textEnabled){d=Flotr.DOM.node('<div style="color:'+t.fontColor+'" class="flotr-labels"></div>');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:0<a&&s<0&&(r+=h);if(l<n.radius+c&&c<l&&(d<r&&r<f||f<d&&(r<f||d<r)||d==f&&(n.start===n.end&&Math.abs(r-d)<p||n.start!==n.end&&Math.abs(r-d)>p))){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(0<i){e.lineWidth=i/2;e.strokeStyle="rgba(0,0,0,0.1)";this.plot(t,i/2+e.lineWidth/2);e.strokeStyle="rgba(0,0,0,0.2)";this.plot(t,e.lineWidth/2)}e.lineWidth=t.lineWidth;e.strokeStyle=t.color;t.fill&&(e.fillStyle=t.fillStyle);this.plot(t);e.restore()},plot:function(t,e){for(var i,o,s=t.data,n=t.context,a=t.xScale,l=t.yScale,r=s.length-1;-1<r;--r){o=s[r][1];if(null!==o){i=a(s[r][0]);o=l(o);if(!(i<0||i>t.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<s.length;++i){o=s[i][1]/this.max;n[0===i?"moveTo":"lineTo"](Math.cos(i*l+r)*a*o+e,Math.sin(i*l+r)*a*o+e)}n.closePath();t.fill&&n.fill();n.stroke()},getGeometry:function(t,e){var i=Math.min(e.height,e.width)*e.radiusRatio/2,o=2*Math.PI/e.data.length,s=-Math.PI/2,n=t[1]/this.max;return{x:Math.cos(t[0]*o+s)*i*n+e.width/2,y:Math.sin(t[0]*o+s)*i*n+e.height/2}},hit:function(t){for(var e,i,o=t.args,s=o[0],n=o[1],a=s.relX,l=s.relY,r=0;r<n.series.length;r++)for(var h=n.series[r],c=h.data,d=c.length;d--;){i=this.getGeometry(c[d],t);e=i.x-a;i=i.y-l;e=Math.sqrt(e*e+i*i);if(e<2*t.sensibility){n.x=c[d][0];n.y=c[d][1];n.index=d;n.seriesIndex=r;return n}}},drawHit:function(t){var e=2*Math.PI/t.data.length,i=-Math.PI/2,o=Math.min(t.height,t.width)*t.radiusRatio/2,s=t.args.series,s=s.points.hitRadius||s.points.radius||s.mouse.radius,n=t.context,a=(n.translate(t.width/2,t.height/2),t.args.index),l=t.data[a][1]/this.max,r=Math.cos(a*e+i)*o*l,a=Math.sin(a*e+i)*o*l;n.beginPath();n.arc(r,a,s,0,2*Math.PI,!0);n.closePath();n.stroke()},clearHit:function(t){var e=2*Math.PI/t.data.length,i=-Math.PI/2,o=Math.min(t.height,t.width)*t.radiusRatio/2,s=t.context,n=t.args.series,a=n.points?n.points.lineWidth:1;offset=(n.points.hitRadius||n.points.radius||n.mouse.radius)+a;s.translate(t.width/2,t.height/2);var n=t.args.index,a=t.data[n][1]/this.max,l=Math.cos(n*e+i)*o*a,n=Math.sin(n*e+i)*o*a;s.clearRect(l-offset,n-offset,2*offset,2*offset)},extendYRange:function(t,e){this.max=Math.max(t.max,this.max||-Number.MAX_VALUE)}});Flotr.addType("timeline",{options:{show:!1,lineWidth:1,barWidth:.2,fill:!0,fillColor:null,fillOpacity:.4,centered:!0},draw:function(t){var e=t.context;e.save();e.lineJoin="miter";e.lineWidth=t.lineWidth;e.strokeStyle=t.color;e.fillStyle=t.fillStyle;this.plot(t);e.restore()},plot:function(t){var e=t.data,a=t.context,l=t.xScale,r=t.yScale,h=t.barWidth,c=t.lineWidth;Flotr._.each(e,function(t){var e=t[0],i=t[1],o=t[2],s=h,n=Math.ceil(l(e)),e=Math.ceil(l(e+o))-n,o=Math.round(r(i)),i=Math.round(r(i-s))-o,s=n-c/2,n=Math.round(o-i/2)-c/2;a.strokeRect(s,n,e,i);a.fillRect(s,n,e,i)})},extendRange:function(t){var e=t.data,i=t.xaxis,o=t.yaxis,s=t.timeline.barWidth;null===i.options.min&&(i.min=i.datamin-s/2);if(null===i.options.max){var n=i.max;Flotr._.each(e,function(t){n=Math.max(n,t[0]+t[2])},this);i.max=n+s/2}null===o.options.min&&(o.min=o.datamin-s);null===o.options.min&&(o.max=o.datamax+s)}});(()=>{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="<html><body>"+this.canvas.firstChild.innerHTML+"</body></html>",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<t.length;++o){var e=t[o].v/i.max;for(s=0;s<=x;++s)n[0===s?"moveTo":"lineTo"](Math.cos(s*v+y)*m*e,Math.sin(s*v+y)*m*e)}}function p(t,e){M.each(M.pluck(t,"v"),function(t){t<=i.min||t>=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.distanceX<i/n.scale&&(!r.mouse.trackY||e.distanceY<i/a.scale)){l.series=s;l.xaxis=s.xaxis;l.yaxis=s.yaxis;l.mouse=s.mouse;l.x=e.x;l.y=e.y;l.dist=e.distance;l.index=e.dataIndex;l.seriesIndex=o}}}if(!h||h.index!==l.index||h.seriesIndex!==l.seriesIndex){this.hit.clearHit();if(l.series&&l.mouse&&l.mouse.track){this.hit.drawMouseTrack(l);this.hit.drawHit(l);Flotr.EventAdapter.fire(this.el,"flotr:hit",[l,this])}}return l}},closest:function(t){var e,i,o,s,n,a,l,r,h,c,d,f=this.series,p=(this.options,t.relX),u=t.relY,g=Number.MAX_VALUE,m=Number.MAX_VALUE,x={},v={},y=!1;function b(t){t.distance=o;t.distanceX=s;t.distanceY=n;t.seriesIndex=c;t.dataIndex=d;t.x=r;t.y=h;y=!0}for(c=0;c<f.length;c++){e=f[c];i=e.data;a=e.xaxis.p2d(p);l=e.yaxis.p2d(u);if(!e.hide)for(d=i.length;d--;){r=i[d][0];h=i[d][1];i[d].y0&&(h+=i[d].y0);if(null!==r&&null!==h&&!(r<e.xaxis.min||r>e.xaxis.max)){s=Math.abs(r-a);n=Math.abs(h-l);o=s*s+n*n;if(o<g){g=o;b(x)}if(s<m){m=s;b(v)}}}}return!!y&&{point:x,x:v}},drawMouseTrack:function(t){var e="",i=t.series,o=t.mouse.position,s=t.mouse.margin,n=t.x,a=t.y,l="opacity:0.7;background-color:#000;color:#fff;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;",r=this.mouseTrack,h=this.plotOffset,c=h.left,h=h.top,d=t.mouse.trackDecimals,f=this.options,f=f.mouse.container,p=0,u=0;if(!r){r=g.node('<div class="flotr-mouse-value" style="'+l+'"></div>');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<t.eAngle?(t.sAngle+t.eAngle)/2:(t.sAngle+t.eAngle+2*Math.PI)/2;e+="bottom:"+(s-h-f-Math.sin(i)*a/2+this.canvasHeight)+"px;top:auto;";e+="left:"+(s+c+d+Math.cos(i)*a/2)+"px;right:auto;";f=s-h-f-Math.sin(i)*a/2+this.canvasHeight;if(f>.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&&42<n.height?.7:.75,o=this.plotHeight-t.yaxis.d2p(t.y)>this.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<i.x.ticks.length;++m)i.x.ticks[m].label&&++e;r=this.plotWidth/e;if(u.grid.circular){g.save();g.translate(this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+this.plotHeight/2);a=this.plotHeight*u.radar.radiusRatio/2+u.fontSize;t=this.axes.x.ticks.length;l=Math.PI/t*2;h=-Math.PI/2;o(0,i.x,!1);o(0,i.x,!0);o(0,i.y,!1);o(0,i.y,!0);g.restore()}if(!u.HtmlText&&this.textEnabled){s(this,i.x,"center","top");s(this,i.x2,"center","bottom");s(this,i.y,"right","middle");s(this,i.y2,"left","middle")}else if((i.x.options.showLabels||i.x2.options.showLabels||i.y.options.showLabels||i.y2.options.showLabels)&&!u.grid.circular){c="";n(this,i.x);n(this,i.x2);n(this,i.y);n(this,i.y2);g.stroke();g.restore();t=d.create("div");d.setStyles(t,{fontSize:"smaller",color:u.grid.color});t.className="flotr-labels";d.insert(this.el,t);d.insert(t,c)}function o(t,e,i){var o=i?e.minorTicks:e.ticks,s=1===e.orientation,n={size:e.options.fontSize||Flotr.defaultOptions.fontSize,color:e.options.color||u.grid.color,angle:Flotr.toRad(e.options.labelsAngle),textBaseline:"middle"};for(m=0;m<o.length&&(i?e.options.showMinorLabels:e.options.showLabels);++m){p=o[m];p.label+="";if(p.label&&p.label.length){x=Math.cos(m*l+h)*a;y=Math.sin(m*l+h)*a;n.textAlign=s?Math.abs(x)<.1?"center":x<0?"right":"left":"left";Flotr.drawText(g,p.label,s?x:3,s?y:-e.ticks[m].v/e.max*(a-u.fontSize),n)}}}function s(t,e,i,o){var s,n,a,l,r,h,c=1===e.orientation,d=1===e.n,f={color:e.options.color||u.grid.color,textAlign:i,textBaseline:o,angle:Flotr.toRad(e.options.labelsAngle)};f=Flotr.getBestTextAlign(f.angle,f);for(m=0;m<e.ticks.length&&(h=e,h.options.showLabels)&&h.used;++m){p=e.ticks[m];if(p.label&&p.label.length){s=e.d2p(p.v);if(!(s<0||s>(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<e.ticks.length;++m){p=e.ticks[m];if(!(!p.label||!p.label.length||(s?l.left:l.top)+e.d2p(p.v)<0||(s?l.left:l.top)+e.d2p(p.v)>(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+=['<div style="position:absolute; text-align:'+(s?"center":"right")+"; ","top:"+o+"px; ",(s||n?"left:":"right:")+i+"px; ","width:"+(s?r:(n?l.left:l.right)-u.grid.labelMargin)+"px; ",e.options.color?"color:"+e.options.color+"; ":" ",'" class="flotr-grid-label'+a+'">'+p.label+"</div>"].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<W;--W)if(t[W].label&&!t[W].hide){k=o.labelFormatter(t[W].label);m=Math.max(m,this._text.measureText(k,x).width)}var v=Math.round(d+3*p+m),l=Math.round(l*(p+f)+p);c||0===c||(c=.1);if(i.HtmlText||!this.textEnabled||o.container){for(W=0;W<t.length;++W)if(t[W].label&&!t[W].hide){if(W%o.noColumns==0){s.push(n?"</tr><tr>":"<tr>");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('<td class="flotr-legend-color-box">','<div style="border:1px solid ',o.labelBoxBorderColor,';padding:1px">','<div style="width:',b-1,"px;height:",M-1,"px;border:1px solid ",t[W].color,'">','<div style="width:',b,"px;height:",M,"px;",w,'"></div>',"</div>","</div>","</td>",'<td class="flotr-legend-label">',k,"</td>")}n&&s.push("</tr>");if(0<s.length){var S='<table style="font-size:smaller;color:'+i.grid.color+'">'+s.join("")+"</table>";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<t.length;W++)if(t[W].label&&!t[W].hide){k=o.labelFormatter(t[W].label);a.fillStyle=t[W].color;a.fillRect(A,C,d-1,f-1);a.strokeStyle=o.labelBoxBorderColor;a.lineWidth=1;a.strokeRect(Math.ceil(A)-1.5,Math.ceil(C)-1.5,d+2,f+2);Flotr.drawText(a,k,A+d+p,C+f,x);C+=f+p}}}}}})})();(()=>{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('<div class="flotr-tabs-group" style="position:absolute;left:0px;width:'+this.canvasWidth+'px"></div>'),o=r.node('<div style="float:left" class="flotr-tab selected">'+this.options.spreadsheet.tabGraphLabel+"</div>"),s=r.node('<div style="float:left" class="flotr-tab">'+this.options.spreadsheet.tabDataLabel+"</div>");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=["<colgroup><col />"],n=['<table class="flotr-datagrid"><tr class="first-row">'];n.push("<th> </th>");h.each(t,function(t,e){n.push('<th scope="col">'+(t.label||String.fromCharCode(65+e))+"</th>");i.push("<col />")});n.push("</tr>");h.each(e,function(s){n.push("<tr>");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+"</"+e+">")},this);n.push("</tr>")},this);i.push("</colgroup>");e=r.node(n.join(""));s=r.node('<button type="button" class="flotr-datagrid-toolbar-button">'+this.options.spreadsheet.toolbarDownload+"</button>");a=r.node('<button type="button" class="flotr-datagrid-toolbar-button">'+this.options.spreadsheet.toolbarSelectAll+"</button>");this.observe(s,"click",h.bind(this.spreadsheet.downloadCSV,this)).observe(a,"click",h.bind(this.spreadsheet.selectAllData,this));var o=r.node('<div class="flotr-datagrid-toolbar"></div>');r.insert(o,s);r.insert(o,a);var s=this.canvasHeight-r.size(this.spreadsheet.tabsContainer).height-2,a=r.node('<div class="flotr-datagrid-container" style="position:absolute;left:0px;top:0px;width:'+this.canvasWidth+"px;height:"+s+'px;overflow:auto;z-index:10"></div>');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('<div style="position:absolute;top:0;left:',this.plotOffset.left,"px;font-size:1em;font-weight:bold;text-align:center;width:",this.plotWidth,'px;" class="flotr-title">',t.title,"</div>");t.subtitle&&i.push('<div style="position:absolute;top:',this.titleHeight,"px;left:",this.plotOffset.left,"px;font-size:smaller;text-align:center;width:",this.plotWidth,'px;" class="flotr-subtitle">',t.subtitle,"</div>");i.push("</div>");i.push('<div class="flotr-axis-title" style="font-weight:bold;">');o.x.options.title&&o.x.used&&i.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight+t.grid.labelMargin+o.x.titleSize.height,"px;left:",this.plotOffset.left,"px;width:",this.plotWidth,"px;text-align:",o.x.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-x1">',o.x.options.title,"</div>");o.x2.options.title&&o.x2.used&&i.push('<div style="position:absolute;top:0;left:',this.plotOffset.left,"px;width:",this.plotWidth,"px;text-align:",o.x2.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-x2">',o.x2.options.title,"</div>");o.y.options.title&&o.y.used&&i.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight/2-o.y.titleSize.height/2,"px;left:0;text-align:",o.y.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-y1">',o.y.options.title,"</div>");o.y2.options.title&&o.y2.used&&i.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight/2-o.y.titleSize.height/2,"px;right:0;text-align:",o.y2.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-y2">',o.y2.options.title,"</div>");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
|