squidanalyzer/resources/flotr2.js

111 lines
111 KiB
JavaScript

var round = Math.round;
function toggle(idButton, idDiv, label) {
if(document.getElementById(idDiv)) {
if(document.getElementById(idDiv).style.display == 'none') {
document.getElementById(idDiv).style.display = 'block';
document.getElementById(idButton).value = 'Hide '+label;
} else {
document.getElementById(idDiv).style.display = 'none';
document.getElementById(idButton).value = 'Show '+label;
}
}
}
function dateTracker(obj, gtype, labels, datasets)
{
var dateToDisplay = new Date(parseInt(obj.x));
var posValue = parseInt(obj.x);
// look for the position in data arrays
var pos = 0;
if (datasets != undefined) {
for (pos=0; pos < datasets[0].length; pos++) {
// If timestamp are the same we have found the position
if (datasets[0][pos][0] == posValue) {
// get out of here
break;
}
}
} else {
return '<span class="mfigure">NO DATASET</span>';
}
var textToShow = '<div class="mouse-figures">';
for (var i = 0; i < labels.length; i++) {
if (datasets[i] != undefined) {
textToShow += '<span class="mfigure">'+pretty_print_number(datasets[i][pos][1], gtype)+' <small>'+labels[i]+'</small></span><br>';
}
}
textToShow += '</div>';
return textToShow;
}
function dateTracker2(obj, dtype, gtype)
{
var dateToDisplay = obj.x;
if (dtype == 'month') {
var pos = parseInt(obj.x);
dateToDisplay = months[(pos-1)%12];
}
return dateToDisplay+', '+obj.series.label+': '+round(obj.y);
}
function pretty_print_number(val, type)
{
if (type == 'size') {
if (val >= 1125899906842624) {
val = (val / 1125899906842624);
val = val.toFixed(2) + " PiB";
} else if (val >= 1099511627776) {
val = (val / 1099511627776);
val = val.toFixed(2) + " TiB";
} else if (val >= 1073741824) {
val = (val / 1073741824);
val = val.toFixed(2) + " GiB";
} else if (val >= 1048576) {
val = (val / 1048576);
val = val.toFixed(2) + " MiB";
} else if (val >= 1024) {
val = (val / 1024);
val = val.toFixed(2) + " KiB";
} else {
val = val + " B";
}
} else if (type == 'duration') {
if (val >= 1000) {
val = (val / 1000);
val = val.toFixed(3) + " sec";
} else {
val = val + " ms";
}
} else {
if (val >= 1000000000000000) {
val = (val / 1000000000000000);
val = val.toFixed(2) + " P";
} else if (val >= 1000000000000) {
val = (val / 1000000000000);
val = val.toFixed(2) + " T";
} else if (val >= 1000000000) {
val = (val / 1000000000);
val = val.toFixed(2) + " G";
} else if (val >= 1000000) {
val = (val / 1000000);
val = val.toFixed(2) + " M";
} else if (val >= 1000) {
val = (val / 1000);
val = val.toFixed(2) + " K";
}
}
return val;
}
function pieTracker(obj)
{
return obj.series.label+': '+round(obj.y);
}
/* bean.min.js: see https://github.com/darold/squidanalyzer/tree/master/resources/LICENSE */
(function(a,c,b){if(typeof module!="undefined"&&module.exports){module.exports=b()}else{if(typeof define=="function"&&define.amd){define(b)}else{c[a]=b()}}})("bean",this,function(l,O){l=l||"bean";O=O||this;var G=window,H=O[l],t=/[^\.]*(?=\..*)\.|.*/,C=/\..*/,j="addEventListener",a="removeEventListener",g=document||{},u=g.documentElement||{},q=u[j],v=q?j:"attachEvent",A={},n=Array.prototype.slice,I=function(P,Q){return P.split(Q||" ")},k=function(P){return typeof P=="string"},o=function(P){return typeof P=="function"},z="click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll ",c="show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinput 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 ",M=(function(R,Q,P){for(P=0;P<Q.length;P++){Q[P]&&(R[Q[P]]=1)}return R}({},I(z+(q?c:"")))),y=(function(){var Q="compareDocumentPosition" in u?function(S,R){return R.compareDocumentPosition&&(R.compareDocumentPosition(S)&16)===16}:"contains" in u?function(S,R){R=R.nodeType===9||R===window?u:R;return R!==S&&R.contains(S)}:function(S,R){while(S=S.parentNode){if(S===R){return 1}}return 0},P=function(R){var S=R.relatedTarget;return !S?S==null:(S!==this&&S.prefix!=="xul"&&!/document/.test(this.toString())&&!Q(S,this))};return{mouseenter:{base:"mouseover",condition:P},mouseleave:{base:"mouseout",condition:P},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}()),E=(function(){var Y=I("altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which propertyName"),W=Y.concat(I("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement")),Q=W.concat(I("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis")),S=Y.concat(I("char charCode key keyCode keyIdentifier keyLocation location")),R=Y.concat(I("data")),X=Y.concat(I("touches targetTouches changedTouches scale rotation")),aa=Y.concat(I("data origin source")),T=Y.concat(I("state")),U=/over|out/,P=[{reg:/key/i,fix:function(ab,ac){ac.keyCode=ab.keyCode||ab.which;return S}},{reg:/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,fix:function(ac,ad,ab){ad.rightClick=ac.which===3||ac.button===2;ad.pos={x:0,y:0};if(ac.pageX||ac.pageY){ad.clientX=ac.pageX;ad.clientY=ac.pageY}else{if(ac.clientX||ac.clientY){ad.clientX=ac.clientX+g.body.scrollLeft+u.scrollLeft;ad.clientY=ac.clientY+g.body.scrollTop+u.scrollTop}}if(U.test(ab)){ad.relatedTarget=ac.relatedTarget||ac[(ab=="mouseover"?"from":"to")+"Element"]}return W}},{reg:/mouse.*(wheel|scroll)/i,fix:function(){return Q}},{reg:/^text/i,fix:function(){return R}},{reg:/^touch|^gesture/i,fix:function(){return X}},{reg:/^message$/i,fix:function(){return aa}},{reg:/^popstate$/i,fix:function(){return T}},{reg:/.*/,fix:function(){return Y}}],V={},Z=function(ac,af,ab){if(!arguments.length){return}ac=ac||((af.ownerDocument||af.document||af).parentWindow||G).event;this.originalEvent=ac;this.isNative=ab;this.isBean=true;if(!ac){return}var aj=ac.type,ah=ac.target||ac.srcElement,ag,ae,ad,ai,ak;this.target=ah&&ah.nodeType===3?ah.parentNode:ah;if(ab){ak=V[aj];if(!ak){for(ag=0,ae=P.length;ag<ae;ag++){if(P[ag].reg.test(aj)){V[aj]=ak=P[ag].fix;break}}}ai=ak(ac,this,aj);for(ag=ai.length;ag--;){if(!((ad=ai[ag]) in this)&&ad in ac){this[ad]=ac[ad]}}}};Z.prototype.preventDefault=function(){if(this.originalEvent.preventDefault){this.originalEvent.preventDefault()}else{this.originalEvent.returnValue=false}};Z.prototype.stopPropagation=function(){if(this.originalEvent.stopPropagation){this.originalEvent.stopPropagation()}else{this.originalEvent.cancelBubble=true}};Z.prototype.stop=function(){this.preventDefault();this.stopPropagation();this.stopped=true};Z.prototype.stopImmediatePropagation=function(){if(this.originalEvent.stopImmediatePropagation){this.originalEvent.stopImmediatePropagation()}this.isImmediatePropagationStopped=function(){return true}};Z.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()};Z.prototype.clone=function(ac){var ab=new Z(this,this.element,this.isNative);ab.currentTarget=ac;return ab};return Z}()),d=function(Q,P){return !q&&!P&&(Q===g||Q===G)?u:Q},i=(function(){var Q=function(S,V,X,R){var U=function(Z,Y){return V.apply(S,R?n.call(Y,Z?0:1).concat(R):Y)},W=function(Z,Y){return V.__beanDel?V.__beanDel.ft(Z.target,S):Y},T=X?function(Y){var Z=W(Y,this);if(X.apply(Z,arguments)){if(Y){Y.currentTarget=Z}return U(Y,arguments)}}:function(Y){if(V.__beanDel){Y=Y.clone(W(Y))}return U(Y,arguments)};T.__beanDel=V.__beanDel;return T},P=function(V,X,Z,T,S,W,Y){var U=y[X],R;if(X=="unload"){Z=s(b,V,X,Z,T)}if(U){if(U.condition){Z=Q(V,Z,U.condition,W)}X=U.base||X}this.isNative=R=M[X]&&!!V[v];this.customType=!q&&!R&&X;this.element=V;this.type=X;this.original=T;this.namespaces=S;this.eventType=q||R?X:"propertychange";this.target=d(V,R);this[v]=!!this.target[v];this.root=Y;this.handler=Q(V,Z,null,W)};P.prototype.inNamespaces=function(T){var S,R,U=0;if(!T){return true}if(!this.namespaces){return false}for(S=T.length;S--;){for(R=this.namespaces.length;R--;){if(T[S]==this.namespaces[R]){U++}}}return T.length===U};P.prototype.matches=function(S,R,T){return this.element===S&&(!R||this.original===R)&&(!T||this.handler===T)};return P}()),K=(function(){var U={},T=function(Z,ac,W,ag,ae,ad){var ab=ae?"r":"$";if(!ac||ac=="*"){for(var ah in U){if(ah.charAt(0)==ab){T(Z,ah.substr(1),W,ag,ae,ad)}}}else{var Y=0,X,aa=U[ab+ac],af=Z=="*";if(!aa){return}for(X=aa.length;Y<X;Y++){if((af||aa[Y].matches(Z,W,ag))&&!ad(aa[Y],aa,Y,ac)){return}}}},S=function(Z,aa,Y,W){var X,ab=U[(W?"r":"$")+aa];if(ab){for(X=ab.length;X--;){if(!ab[X].root&&ab[X].matches(Z,Y,null)){return true}}}return false},R=function(Z,aa,Y,X){var W=[];T(Z,aa,Y,null,X,function(ab){return W.push(ab)});return W},V=function(Y){var W=!Y.root&&!this.has(Y.element,Y.type,null,false),X=(Y.root?"r":"$")+Y.type;(U[X]||(U[X]=[])).push(Y);return W},Q=function(W){T(W.element,W.type,null,W.handler,W.root,function(Y,Z,X){Z.splice(X,1);Y.removed=true;if(Z.length===0){delete U[(Y.root?"r":"$")+Y.type]}return false})},P=function(){var X,W=[];for(X in U){if(X.charAt(0)=="$"){W=W.concat(U[X])}}return W};return{has:S,get:R,put:V,del:Q,entries:P}}()),w,N=function(P){if(!arguments.length){w=g.querySelectorAll?function(Q,R){return R.querySelectorAll(Q)}:function(){throw new Error("Bean: No selector engine installed")}}else{w=P}},D=function(T,S){if(!q&&S&&T&&T.propertyName!="_on"+S){return}var R=K.get(this,S||T.type,null,false),P=R.length,Q=0;T=new E(T,this,true);if(S){T.type=S}for(;Q<P&&!T.isImmediatePropagationStopped();Q++){if(!R[Q].removed){R[Q].handler.call(this,T)}}},J=q?function(P,Q,R){P[R?j:a](Q,D,false)}:function(P,Q,T,S){var R;if(T){K.put(R=new i(P,S||Q,function(U){D.call(P,U,S)},D,null,null,true));if(S&&P["_on"+S]==null){P["_on"+S]=0}R.target.attachEvent("on"+R.eventType,R.handler)}else{R=K.get(P,S||Q,D,true)[0];if(R){R.target.detachEvent("on"+R.eventType,R.handler);K.del(R)}}},s=function(T,P,R,Q,S){return function(){Q.apply(this,arguments);T(P,R,S)}},b=function(T,S,X,P){var W=S&&S.replace(C,""),Q=K.get(T,W,null,false),V={},U,R;for(U=0,R=Q.length;U<R;U++){if((!X||Q[U].original===X)&&Q[U].inNamespaces(P)){K.del(Q[U]);if(!V[Q[U].eventType]&&Q[U][v]){V[Q[U].eventType]={t:Q[U].eventType,c:Q[U].type}}}}for(U in V){if(!K.has(T,V[U].t,null,false)){J(T,V[U].t,false,V[U].c)}}},m=function(P,R){var S=function(V,T){var U,W=k(P)?w(P,T):P;for(;V&&V!==T;V=V.parentNode){for(U=W.length;U--;){if(W[U]===V){return V}}}},Q=function(U){var T=S(U.target,this);if(T){R.apply(T,arguments)}};Q.__beanDel={ft:S,selector:P};return Q},L=q?function(Q,S,R){var P=g.createEvent(Q?"HTMLEvents":"UIEvents");P[Q?"initEvent":"initUIEvent"](S,true,true,G,1);R.dispatchEvent(P)}:function(P,R,Q){Q=d(Q,P);P?Q.fireEvent("on"+R,g.createEventObject()):Q["_on"+R]++},F=function(T,P,V){var S=k(P),Q,U,W,R;if(S&&P.indexOf(" ")>0){P=I(P);for(R=P.length;R--;){F(T,P[R],V)}return T}U=S&&P.replace(C,"");if(U&&y[U]){U=y[U].base}if(!P||S){if(W=S&&P.replace(t,"")){W=I(W,".")}b(T,U,V,W)}else{if(o(P)){b(T,null,P)}else{for(Q in P){if(P.hasOwnProperty(Q)){F(T,Q,P[Q])}}}}return T},x=function(Q,Z,P,X){var W,V,T,R,U,Y,S;if(P===undefined&&typeof Z=="object"){for(V in Z){if(Z.hasOwnProperty(V)){x.call(this,Q,V,Z[V])}}return}if(!o(P)){W=X;U=n.call(arguments,4);X=m(P,W,w)}else{U=n.call(arguments,3);X=W=P}T=I(Z);if(this===A){X=s(F,Q,Z,X,W)}for(R=T.length;R--;){S=K.put(Y=new i(Q,T[R].replace(C,""),X,W,I(T[R].replace(t,""),"."),U,false));if(Y[v]&&S){J(Q,Y.eventType,true,Y.customType)}}return Q},f=function(R,Q,S,P){return x.apply(null,!k(S)?n.call(arguments):[R,S,Q,P].concat(arguments.length>3?n.call(arguments,5):[]))},h=function(){return x.apply(A,arguments)},r=function(S,X,V){var U=I(X),T,R,Q,W,P;for(T=U.length;T--;){X=U[T].replace(C,"");if(W=U[T].replace(t,"")){W=I(W,".")}if(!W&&!V&&S[v]){L(M[X],X,S)}else{P=K.get(S,X,null,false);V=[false].concat(V);for(R=0,Q=P.length;R<Q;R++){if(P[R].inNamespaces(W)){P[R].handler.apply(S,V)}}}}return S},p=function(T,W,U){var Q=K.get(W,U,null,false),P=Q.length,S=0,R,V;for(;S<P;S++){if(Q[S].original){R=[T,Q[S].type];if(V=Q[S].handler.__beanDel){R.push(V.selector)}R.push(Q[S].original);x.apply(null,R)}}return T},B={on:x,add:f,one:h,off:F,remove:F,clone:p,fire:r,Event:E,setSelectorEngine:N,noConflict:function(){O[l]=H;return this}};if(G.attachEvent){var e=function(){var Q,P=K.entries();for(Q in P){if(P[Q].type&&P[Q].type!=="unload"){F(P[Q].element,P[Q].type)}}G.detachEvent("onunload",e);G.CollectGarbage&&G.CollectGarbage()};G.attachEvent("onunload",e)}N();return B});/* underscore.min.js: see https://github.com/darold/squidanalyzer/tree/master/resources/LICENSE */
(function(){var v=this;var k=v._;var I=Array.prototype,g=Object.prototype,n=Function.prototype;var L=I.push,l=I.slice,c=g.toString,j=g.hasOwnProperty;var s=Array.isArray,e=Object.keys,J=n.bind,B=Object.create;var E=function(){};var P=function(Q){if(Q instanceof P){return Q}if(!(this instanceof P)){return new P(Q)}this._wrapped=Q};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports){exports=module.exports=P}exports._=P}else{v._=P}P.VERSION="1.8.3";var b=function(R,Q,S){if(Q===void 0){return R}switch(S==null?3:S){case 1:return function(T){return R.call(Q,T)};case 2:return function(U,T){return R.call(Q,U,T)};case 3:return function(U,T,V){return R.call(Q,U,T,V)};case 4:return function(T,V,U,W){return R.call(Q,T,V,U,W)}}return function(){return R.apply(Q,arguments)}};var F=function(R,Q,S){if(R==null){return P.identity}if(P.isFunction(R)){return b(R,Q,S)}if(P.isObject(R)){return P.matcher(R)}return P.property(R)};P.iteratee=function(R,Q){return F(R,Q,Infinity)};var p=function(R,Q){return function(Z){var X=arguments.length;if(X<2||Z==null){return Z}for(var T=1;T<X;T++){var Y=arguments[T],W=R(Y),S=W.length;for(var V=0;V<S;V++){var U=W[V];if(!Q||Z[U]===void 0){Z[U]=Y[U]}}}return Z}};var C=function(R){if(!P.isObject(R)){return{}}if(B){return B(R)}E.prototype=R;var Q=new E;E.prototype=null;return Q};var M=function(Q){return function(R){return R==null?void 0:R[Q]}};var K=Math.pow(2,53)-1;var O=M("length");var D=function(R){var Q=O(R);return typeof Q=="number"&&Q>=0&&Q<=K};P.each=P.forEach=function(U,V,R){V=b(V,R);var Q,T;if(D(U)){for(Q=0,T=U.length;Q<T;Q++){V(U[Q],Q,U)}}else{var S=P.keys(U);for(Q=0,T=S.length;Q<T;Q++){V(U[S[Q]],S[Q],U)}}return U};P.map=P.collect=function(V,X,S){X=F(X,S);var U=!D(V)&&P.keys(V),T=(U||V).length,R=Array(T);for(var Q=0;Q<T;Q++){var W=U?U[Q]:Q;R[Q]=X(V[W],W,V)}return R};function z(Q){function R(W,Y,S,V,T,U){for(;T>=0&&T<U;T+=Q){var X=V?V[T]:T;S=Y(S,W[X],X,W)}return S}return function(X,Y,S,U){Y=b(Y,U,4);var W=!D(X)&&P.keys(X),V=(W||X).length,T=Q>0?0:V-1;if(arguments.length<3){S=X[W?W[T]:T];T+=Q}return R(X,Y,S,W,T,V)}}P.reduce=P.foldl=P.inject=z(1);P.reduceRight=P.foldr=z(-1);P.find=P.detect=function(T,Q,S){var R;if(D(T)){R=P.findIndex(T,Q,S)}else{R=P.findKey(T,Q,S)}if(R!==void 0&&R!==-1){return T[R]}};P.filter=P.select=function(T,Q,S){var R=[];Q=F(Q,S);P.each(T,function(W,U,V){if(Q(W,U,V)){R.push(W)}});return R};P.reject=function(S,Q,R){return P.filter(S,P.negate(F(Q)),R)};P.every=P.all=function(V,Q,S){Q=F(Q,S);var U=!D(V)&&P.keys(V),T=(U||V).length;for(var R=0;R<T;R++){var W=U?U[R]:R;if(!Q(V[W],W,V)){return false}}return true};P.some=P.any=function(V,Q,S){Q=F(Q,S);var U=!D(V)&&P.keys(V),T=(U||V).length;for(var R=0;R<T;R++){var W=U?U[R]:R;if(Q(V[W],W,V)){return true}}return false};P.contains=P.includes=P.include=function(T,S,Q,R){if(!D(T)){T=P.values(T)}if(typeof Q!="number"||R){Q=0}return P.indexOf(T,S,Q)>=0};P.invoke=function(S,T){var Q=l.call(arguments,2);var R=P.isFunction(T);return P.map(S,function(V){var U=R?T:V[T];return U==null?U:U.apply(V,Q)})};P.pluck=function(R,Q){return P.map(R,P.property(Q))};P.where=function(R,Q){return P.filter(R,P.matcher(Q))};P.findWhere=function(R,Q){return P.find(R,P.matcher(Q))};P.max=function(T,V,Q){var Y=-Infinity,W=-Infinity,X,S;if(V==null&&T!=null){T=D(T)?T:P.values(T);for(var U=0,R=T.length;U<R;U++){X=T[U];if(X>Y){Y=X}}}else{V=F(V,Q);P.each(T,function(ab,Z,aa){S=V(ab,Z,aa);if(S>W||S===-Infinity&&Y===-Infinity){Y=ab;W=S}})}return Y};P.min=function(T,V,Q){var Y=Infinity,W=Infinity,X,S;if(V==null&&T!=null){T=D(T)?T:P.values(T);for(var U=0,R=T.length;U<R;U++){X=T[U];if(X<Y){Y=X}}}else{V=F(V,Q);P.each(T,function(ab,Z,aa){S=V(ab,Z,aa);if(S<W||S===Infinity&&Y===Infinity){Y=ab;W=S}})}return Y};P.shuffle=function(U){var V=D(U)?U:P.values(U);var T=V.length;var Q=Array(T);for(var R=0,S;R<T;R++){S=P.random(0,R);if(S!==R){Q[R]=Q[S]}Q[S]=V[R]}return Q};P.sample=function(R,S,Q){if(S==null||Q){if(!D(R)){R=P.values(R)}return R[P.random(R.length-1)]}return P.shuffle(R).slice(0,Math.max(0,S))};P.sortBy=function(R,S,Q){S=F(S,Q);return P.pluck(P.map(R,function(V,T,U){return{value:V,index:T,criteria:S(V,T,U)}}).sort(function(W,V){var U=W.criteria;var T=V.criteria;if(U!==T){if(U>T||U===void 0){return 1}if(U<T||T===void 0){return -1}}return W.index-V.index}),"value")};var q=function(Q){return function(T,U,S){var R={};U=F(U,S);P.each(T,function(X,V){var W=U(X,V,T);Q(R,X,W)});return R}};P.groupBy=q(function(Q,S,R){if(P.has(Q,R)){Q[R].push(S)}else{Q[R]=[S]}});P.indexBy=q(function(Q,S,R){Q[R]=S});P.countBy=q(function(Q,S,R){if(P.has(Q,R)){Q[R]++}else{Q[R]=1}});P.toArray=function(Q){if(!Q){return[]}if(P.isArray(Q)){return l.call(Q)}if(D(Q)){return P.map(Q,P.identity)}return P.values(Q)};P.size=function(Q){if(Q==null){return 0}return D(Q)?Q.length:P.keys(Q).length};P.partition=function(U,Q,S){Q=F(Q,S);var T=[],R=[];P.each(U,function(W,V,X){(Q(W,V,X)?T:R).push(W)});return[T,R]};P.first=P.head=P.take=function(S,R,Q){if(S==null){return void 0}if(R==null||Q){return S[0]}return P.initial(S,S.length-R)};P.initial=function(S,R,Q){return l.call(S,0,Math.max(0,S.length-(R==null||Q?1:R)))};P.last=function(S,R,Q){if(S==null){return void 0}if(R==null||Q){return S[S.length-1]}return P.rest(S,Math.max(0,S.length-R))};P.rest=P.tail=P.drop=function(S,R,Q){return l.call(S,R==null||Q?1:R)};P.compact=function(Q){return P.filter(Q,P.identity)};var x=function(W,S,X,aa){var R=[],Z=0;for(var U=aa||0,Q=O(W);U<Q;U++){var Y=W[U];if(D(Y)&&(P.isArray(Y)||P.isArguments(Y))){if(!S){Y=x(Y,S,X)}var T=0,V=Y.length;R.length+=V;while(T<V){R[Z++]=Y[T++]}}else{if(!X){R[Z++]=Y}}}return R};P.flatten=function(R,Q){return x(R,Q,false)};P.without=function(Q){return P.difference(Q,l.call(arguments,1))};P.uniq=P.unique=function(X,T,W,R){if(!P.isBoolean(T)){R=W;W=T;T=false}if(W!=null){W=F(W,R)}var Z=[];var Q=[];for(var V=0,S=O(X);V<S;V++){var Y=X[V],U=W?W(Y,V,X):Y;if(T){if(!V||Q!==U){Z.push(Y)}Q=U}else{if(W){if(!P.contains(Q,U)){Q.push(U);Z.push(Y)}}else{if(!P.contains(Z,Y)){Z.push(Y)}}}}return Z};P.union=function(){return P.uniq(x(arguments,true,true))};P.intersection=function(W){var Q=[];var V=arguments.length;for(var S=0,U=O(W);S<U;S++){var T=W[S];if(P.contains(Q,T)){continue}for(var R=1;R<V;R++){if(!P.contains(arguments[R],T)){break}}if(R===V){Q.push(T)}}return Q};P.difference=function(R){var Q=x(arguments,true,true,1);return P.filter(R,function(S){return !P.contains(Q,S)})};P.zip=function(){return P.unzip(arguments)};P.unzip=function(T){var S=T&&P.max(T,O).length||0;var Q=Array(S);for(var R=0;R<S;R++){Q[R]=P.pluck(T,R)}return Q};P.object=function(U,R){var Q={};for(var S=0,T=O(U);S<T;S++){if(R){Q[U[S]]=R[S]}else{Q[U[S][0]]=U[S][1]}}return Q};function u(Q){return function(V,R,T){R=F(R,T);var U=O(V);var S=Q>0?0:U-1;for(;S>=0&&S<U;S+=Q){if(R(V[S],S,V)){return S}}return -1}}P.findIndex=u(1);P.findLastIndex=u(-1);P.sortedIndex=function(X,V,W,S){W=F(W,S,1);var U=W(V);var Q=0,T=O(X);while(Q<T){var R=Math.floor((Q+T)/2);if(W(X[R])<U){Q=R+1}else{T=R}}return Q};function f(Q,R,S){return function(X,W,T){var U=0,V=O(X);if(typeof T=="number"){if(Q>0){U=T>=0?T:Math.max(T+V,U)}else{V=T>=0?Math.min(T+1,V):T+V+1}}else{if(S&&T&&V){T=S(X,W);return X[T]===W?T:-1}}if(W!==W){T=R(l.call(X,U,V),P.isNaN);return T>=0?T+U:-1}for(T=Q>0?U:V-1;T>=0&&T<V;T+=Q){if(X[T]===W){return T}}return -1}}P.indexOf=f(1,P.findIndex,P.sortedIndex);P.lastIndexOf=f(-1,P.findLastIndex);P.range=function(V,S,U){if(S==null){S=V||0;V=0}U=U||1;var T=Math.max(Math.ceil((S-V)/U),0);var R=Array(T);for(var Q=0;Q<T;Q++,V+=U){R[Q]=V}return R};var y=function(V,S,U,W,T){if(!(W instanceof S)){return V.apply(U,T)}var R=C(V.prototype);var Q=V.apply(R,T);if(P.isObject(Q)){return Q}return R};P.bind=function(T,R){if(J&&T.bind===J){return J.apply(T,l.call(arguments,1))}if(!P.isFunction(T)){throw new TypeError("Bind must be called on a function")}var Q=l.call(arguments,2);var S=function(){return y(T,S,R,this,Q.concat(l.call(arguments)))};return S};P.partial=function(R){var S=l.call(arguments,1);var Q=function(){var T=0,W=S.length;var U=Array(W);for(var V=0;V<W;V++){U[V]=S[V]===P?arguments[T++]:S[V]}while(T<arguments.length){U.push(arguments[T++])}return y(R,Q,this,this,U)};return Q};P.bindAll=function(T){var R,S=arguments.length,Q;if(S<=1){throw new Error("bindAll must be passed function names")}for(R=1;R<S;R++){Q=arguments[R];T[Q]=P.bind(T[Q],T)}return T};P.memoize=function(R,Q){var S=function(V){var U=S.cache;var T=""+(Q?Q.apply(this,arguments):V);if(!P.has(U,T)){U[T]=R.apply(this,arguments)}return U[T]};S.cache={};return S};P.delay=function(R,S){var Q=l.call(arguments,2);return setTimeout(function(){return R.apply(null,Q)},S)};P.defer=P.partial(P.delay,P,1);P.throttle=function(R,T,X){var Q,V,Y;var W=null;var U=0;if(!X){X={}}var S=function(){U=X.leading===false?0:P.now();W=null;Y=R.apply(Q,V);if(!W){Q=V=null}};return function(){var Z=P.now();if(!U&&X.leading===false){U=Z}var aa=T-(Z-U);Q=this;V=arguments;if(aa<=0||aa>T){if(W){clearTimeout(W);W=null}U=Z;Y=R.apply(Q,V);if(!W){Q=V=null}}else{if(!W&&X.trailing!==false){W=setTimeout(S,aa)}}return Y}};P.debounce=function(S,U,R){var X,W,Q,V,Y;var T=function(){var Z=P.now()-V;if(Z<U&&Z>=0){X=setTimeout(T,U-Z)}else{X=null;if(!R){Y=S.apply(Q,W);if(!X){Q=W=null}}}};return function(){Q=this;W=arguments;V=P.now();var Z=R&&!X;if(!X){X=setTimeout(T,U)}if(Z){Y=S.apply(Q,W);Q=W=null}return Y}};P.wrap=function(Q,R){return P.partial(R,Q)};P.negate=function(Q){return function(){return !Q.apply(this,arguments)}};P.compose=function(){var Q=arguments;var R=Q.length-1;return function(){var T=R;var S=Q[R].apply(this,arguments);while(T--){S=Q[T].call(this,S)}return S}};P.after=function(R,Q){return function(){if(--R<1){return Q.apply(this,arguments)}}};P.before=function(S,R){var Q;return function(){if(--S>0){Q=R.apply(this,arguments)}if(S<=1){R=null}return Q}};P.once=P.partial(P.before,2);var G=!{toString:null}.propertyIsEnumerable("toString");var a=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function d(U,T){var Q=a.length;var R=U.constructor;var S=(P.isFunction(R)&&R.prototype)||g;var V="constructor";if(P.has(U,V)&&!P.contains(T,V)){T.push(V)}while(Q--){V=a[Q];if(V in U&&U[V]!==S[V]&&!P.contains(T,V)){T.push(V)}}}P.keys=function(S){if(!P.isObject(S)){return[]}if(e){return e(S)}var R=[];for(var Q in S){if(P.has(S,Q)){R.push(Q)}}if(G){d(S,R)}return R};P.allKeys=function(S){if(!P.isObject(S)){return[]}var R=[];for(var Q in S){R.push(Q)}if(G){d(S,R)}return R};P.values=function(U){var T=P.keys(U);var S=T.length;var Q=Array(S);for(var R=0;R<S;R++){Q[R]=U[T[R]]}return Q};P.mapObject=function(V,X,S){X=F(X,S);var U=P.keys(V),T=U.length,R={},W;for(var Q=0;Q<T;Q++){W=U[Q];R[W]=X(V[W],W,V)}return R};P.pairs=function(U){var S=P.keys(U);var R=S.length;var T=Array(R);for(var Q=0;Q<R;Q++){T[Q]=[S[Q],U[S[Q]]]}return T};P.invert=function(U){var Q={};var T=P.keys(U);for(var R=0,S=T.length;R<S;R++){Q[U[T[R]]]=T[R]}return Q};P.functions=P.methods=function(S){var R=[];for(var Q in S){if(P.isFunction(S[Q])){R.push(Q)}}return R.sort()};P.extend=p(P.allKeys);P.extendOwn=P.assign=p(P.keys);P.findKey=function(W,Q,T){Q=F(Q,T);var V=P.keys(W),S;for(var R=0,U=V.length;R<U;R++){S=V[R];if(Q(W[S],S,W)){return S}}};P.pick=function(S,W,Q){var aa={},T=S,V,Z;if(T==null){return aa}if(P.isFunction(W)){Z=P.allKeys(T);V=b(W,Q)}else{Z=x(arguments,false,false,1);V=function(ac,ab,ad){return ab in ad};T=Object(T)}for(var U=0,R=Z.length;U<R;U++){var Y=Z[U];var X=T[Y];if(V(X,Y,T)){aa[Y]=X}}return aa};P.omit=function(S,T,Q){if(P.isFunction(T)){T=P.negate(T)}else{var R=P.map(x(arguments,false,false,1),String);T=function(V,U){return !P.contains(R,U)}}return P.pick(S,T,Q)};P.defaults=p(P.allKeys,true);P.create=function(R,S){var Q=C(R);if(S){P.extendOwn(Q,S)}return Q};P.clone=function(Q){if(!P.isObject(Q)){return Q}return P.isArray(Q)?Q.slice():P.extend({},Q)};P.tap=function(R,Q){Q(R);return R};P.isMatch=function(R,Q){var V=P.keys(Q),U=V.length;if(R==null){return !U}var W=Object(R);for(var T=0;T<U;T++){var S=V[T];if(Q[S]!==W[S]||!(S in W)){return false}}return true};var N=function(Y,X,R,T){if(Y===X){return Y!==0||1/Y===1/X}if(Y==null||X==null){return Y===X}if(Y instanceof P){Y=Y._wrapped}if(X instanceof P){X=X._wrapped}var V=c.call(Y);if(V!==c.call(X)){return false}switch(V){case"[object RegExp]":case"[object String]":return""+Y===""+X;case"[object Number]":if(+Y!==+Y){return +X!==+X}return +Y===0?1/+Y===1/X:+Y===+X;case"[object Date]":case"[object Boolean]":return +Y===+X}var S=V==="[object Array]";if(!S){if(typeof Y!="object"||typeof X!="object"){return false}var W=Y.constructor,U=X.constructor;if(W!==U&&!(P.isFunction(W)&&W instanceof W&&P.isFunction(U)&&U instanceof U)&&("constructor" in Y&&"constructor" in X)){return false}}R=R||[];T=T||[];var Q=R.length;while(Q--){if(R[Q]===Y){return T[Q]===X}}R.push(Y);T.push(X);if(S){Q=Y.length;if(Q!==X.length){return false}while(Q--){if(!N(Y[Q],X[Q],R,T)){return false}}}else{var aa=P.keys(Y),Z;Q=aa.length;if(P.keys(X).length!==Q){return false}while(Q--){Z=aa[Q];if(!(P.has(X,Z)&&N(Y[Z],X[Z],R,T))){return false}}}R.pop();T.pop();return true};P.isEqual=function(R,Q){return N(R,Q)};P.isEmpty=function(Q){if(Q==null){return true}if(D(Q)&&(P.isArray(Q)||P.isString(Q)||P.isArguments(Q))){return Q.length===0}return P.keys(Q).length===0};P.isElement=function(Q){return !!(Q&&Q.nodeType===1)};P.isArray=s||function(Q){return c.call(Q)==="[object Array]"};P.isObject=function(R){var Q=typeof R;return Q==="function"||Q==="object"&&!!R};P.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(Q){P["is"+Q]=function(R){return c.call(R)==="[object "+Q+"]"}});if(!P.isArguments(arguments)){P.isArguments=function(Q){return P.has(Q,"callee")}}if(typeof/./!="function"&&typeof Int8Array!="object"){P.isFunction=function(Q){return typeof Q=="function"||false}}P.isFinite=function(Q){return isFinite(Q)&&!isNaN(parseFloat(Q))};P.isNaN=function(Q){return P.isNumber(Q)&&Q!==+Q};P.isBoolean=function(Q){return Q===true||Q===false||c.call(Q)==="[object Boolean]"};P.isNull=function(Q){return Q===null};P.isUndefined=function(Q){return Q===void 0};P.has=function(R,Q){return R!=null&&j.call(R,Q)};P.noConflict=function(){v._=k;return this};P.identity=function(Q){return Q};P.constant=function(Q){return function(){return Q}};P.noop=function(){};P.property=M;P.propertyOf=function(Q){return Q==null?function(){}:function(R){return Q[R]}};P.matcher=P.matches=function(Q){Q=P.extendOwn({},Q);return function(R){return P.isMatch(R,Q)}};P.times=function(U,T,S){var Q=Array(Math.max(0,U));T=b(T,S,1);for(var R=0;R<U;R++){Q[R]=T(R)}return Q};P.random=function(R,Q){if(Q==null){Q=R;R=0}return R+Math.floor(Math.random()*(Q-R+1))};P.now=Date.now||function(){return new Date().getTime()};var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};var m=P.invert(r);var w=function(U){var R=function(V){return U[V]};var T="(?:"+P.keys(U).join("|")+")";var S=RegExp(T);var Q=RegExp(T,"g");return function(V){V=V==null?"":""+V;return S.test(V)?V.replace(Q,R):V}};P.escape=w(r);P.unescape=w(m);P.result=function(Q,S,T){var R=Q==null?void 0:Q[S];if(R===void 0){R=T}return P.isFunction(R)?R.call(Q):R};var A=0;P.uniqueId=function(Q){var R=++A+"";return Q?Q+R:R};P.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/(.)^/;var h={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"};var i=/\\|'|\r|\n|\u2028|\u2029/g;var H=function(Q){return"\\"+h[Q]};P.template=function(Z,T,W){if(!T&&W){T=W}T=P.defaults({},T,P.templateSettings);var U=RegExp([(T.escape||t).source,(T.interpolate||t).source,(T.evaluate||t).source].join("|")+"|$","g");var V=0;var Q="__p+='";Z.replace(U,function(ab,ac,aa,ae,ad){Q+=Z.slice(V,ad).replace(i,H);V=ad+ab.length;if(ac){Q+="'+\n((__t=("+ac+"))==null?'':_.escape(__t))+\n'"}else{if(aa){Q+="'+\n((__t=("+aa+"))==null?'':__t)+\n'"}else{if(ae){Q+="';\n"+ae+"\n__p+='"}}}return ab});Q+="';\n";if(!T.variable){Q="with(obj||{}){\n"+Q+"}\n"}Q="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+Q+"return __p;\n";try{var S=new Function(T.variable||"obj","_",Q)}catch(X){X.source=Q;throw X}var Y=function(aa){return S.call(this,aa,P)};var R=T.variable||"obj";Y.source="function("+R+"){\n"+Q+"}";return Y};P.chain=function(R){var Q=P(R);Q._chain=true;return Q};var o=function(Q,R){return Q._chain?P(R).chain():R};P.mixin=function(Q){P.each(P.functions(Q),function(R){var S=P[R]=Q[R];P.prototype[R]=function(){var T=[this._wrapped];L.apply(T,arguments);return o(this,S.apply(P,T))}})};P.mixin(P);P.each(["pop","push","reverse","shift","sort","splice","unshift"],function(Q){var R=I[Q];P.prototype[Q]=function(){var S=this._wrapped;R.apply(S,arguments);if((Q==="shift"||Q==="splice")&&S.length===0){delete S[0]}return o(this,S)}});P.each(["concat","join","slice"],function(Q){var R=I[Q];P.prototype[Q]=function(){return o(this,R.apply(this._wrapped,arguments))}});P.prototype.value=function(){return this._wrapped};P.prototype.valueOf=P.prototype.toJSON=P.prototype.value;P.prototype.toString=function(){return""+this._wrapped};if(typeof define==="function"&&define.amd){define("underscore",[],function(){return P})}}.call(this));/* flotr2.min.js: see https://github.com/darold/squidanalyzer/tree/master/resources/LICENSE */
(function(){var b=this,c=this.Flotr,a;a={_:_,bean:bean,isIphone:/iphone/i.test(navigator.userAgent),isIE:(navigator.appVersion.indexOf("MSIE")!=-1?parseFloat(navigator.appVersion.split("MSIE")[1]):false),graphTypes:{},plugins:{},addType:function(d,e){a.graphTypes[d]=e;a.defaultOptions[d]=e.options||{};a.defaultOptions.defaultType=a.defaultOptions.defaultType||d},addPlugin:function(d,e){a.plugins[d]=e;a.defaultOptions[d]=e.options||{}},draw:function(e,f,d,g){g=g||a.Graph;return new g(e,f,d)},merge:function(h,f){var g,e,d=f||{};for(g in h){e=h[g];if(e&&typeof(e)==="object"){if(e.constructor===Array){d[g]=this._.clone(e)}else{if(e.constructor!==RegExp&&!this._.isElement(e)&&!e.jquery){d[g]=a.merge(e,(f?f[g]:undefined))}else{d[g]=e}}}else{d[g]=e}}return d},clone:function(d){return a.merge(d,{})},getTickSize:function(h,g,d,e){var l=(d-g)/h,k=a.getMagnitude(l),j=10,f=l/k;if(f<1.5){j=1}else{if(f<2.25){j=2}else{if(f<3){j=((e===0)?2:2.5)}else{if(f<7.5){j=5}}}}return j*k},defaultTickFormatter:function(e,d){return e+""},defaultTrackFormatter:function(d){return"("+d.x+", "+d.y+")"},engineeringNotation:function(h,d,g){var f=["Y","Z","E","P","T","G","M","k",""],j=["y","z","a","f","p","n","µ","m",""],e=f.length;g=g||1000;d=Math.pow(10,d||2);if(h===0){return 0}if(h>1){while(e--&&(h>=g)){h/=g}}else{f=j;e=f.length;while(e--&&(h<1)){h*=g}}return(Math.round(h*d)/d)+f[e]},getMagnitude:function(d){return Math.pow(10,Math.floor(Math.log(d)/Math.LN10))},toPixel:function(d){return Math.floor(d)+0.5},toRad:function(d){return -d*(Math.PI/180)},floorInBase:function(e,d){return d*Math.floor(e/d)},drawText:function(e,g,d,h,f){if(!e.fillText){e.drawText(g,d,h,f);return}f=this._.extend({size:a.defaultOptions.fontSize,color:"#000000",textAlign:"left",textBaseline:"bottom",weight:1,angle:0},f);e.save();e.translate(d,h);e.rotate(f.angle);e.fillStyle=f.color;e.font=(f.weight>1?"bold ":"")+(f.size*1.3)+"px sans-serif";e.textAlign=f.textAlign;e.textBaseline=f.textBaseline;e.fillText(g,0,0);e.restore()},getBestTextAlign:function(e,d){d=d||{textAlign:"center",textBaseline:"middle"};e+=a.getTextAngleFromAlign(d);if(Math.abs(Math.cos(e))>0.01){d.textAlign=(Math.cos(e)>0?"right":"left")}if(Math.abs(Math.sin(e))>0.01){d.textBaseline=(Math.sin(e)>0?"top":"bottom")}return d},alignTable:{"right middle":0,"right top":Math.PI/4,"center top":Math.PI/2,"left top":3*(Math.PI/4),"left middle":Math.PI,"left bottom":-3*(Math.PI/4),"center bottom":-Math.PI/2,"right bottom":-Math.PI/4,"center middle":0},getTextAngleFromAlign:function(d){return a.alignTable[d.textAlign+" "+d.textBaseline]||0},noConflict:function(){b.Flotr=c;return this}};b.Flotr=a})();Flotr.defaultOptions={colors:["#00A8F0","#C0D800","#CB4B4B","#4DA74D","#9440ED"],ieBackgroundColor:"#FFFFFF",title:null,subtitle:null,shadowSize:4,defaultType:null,HtmlText:true,fontColor:"#545454",fontSize:7.5,resolution:1,parseFloat:true,preventDefault:true,xaxis:{ticks:null,minorTicks:null,showLabels:true,showMinorLabels:false,labelsAngle:0,title:null,titleAngle:0,noTicks:5,minorTickFreq:null,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscale:false,autoscaleMargin:0,color:null,mode:"normal",timeFormat:null,timeMode:"UTC",timeUnit:"millisecond",scaling:"linear",base:Math.E,titleAlign:"center",margin:true},x2axis:{},yaxis:{ticks:null,minorTicks:null,showLabels:true,showMinorLabels:false,labelsAngle:0,title:null,titleAngle:90,noTicks:5,minorTickFreq:null,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscale:false,autoscaleMargin:0,color:null,scaling:"linear",base:Math.E,titleAlign:"center",margin:true},y2axis:{titleAngle:270},grid:{color:"#545454",backgroundColor:null,backgroundImage:null,watermarkAlpha:0.4,tickColor:"#DDDDDD",labelMargin:3,verticalLines:true,minorVerticalLines:null,horizontalLines:true,minorHorizontalLines:null,outlineWidth:1,outline:"nsew",circular:false},mouse:{track:false,trackAll:false,position:"se",relative:false,trackFormatter:Flotr.defaultTrackFormatter,margin:5,lineColor:"#FF3F19",trackDecimals:1,sensibility:2,trackY:true,radius:3,fillColor:null,fillOpacity:0.4}};(function(){var b=Flotr._;function c(j,h,e,f){this.rgba=["r","g","b","a"];var d=4;while(-1<--d){this[this.rgba[d]]=arguments[d]||((d==3)?1:0)}this.normalize()}var a={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]};c.prototype={scale:function(g,f,h,e){var d=4;while(-1<--d){if(!b.isUndefined(arguments[d])){this[this.rgba[d]]*=arguments[d]}}return this.normalize()},alpha:function(d){if(!b.isUndefined(d)&&!b.isNull(d)){this.a=d}return this.normalize()},clone:function(){return new c(this.r,this.b,this.g,this.a)},limit:function(e,d,f){return Math.max(Math.min(e,f),d)},normalize:function(){var d=this.limit;this.r=d(parseInt(this.r,10),0,255);this.g=d(parseInt(this.g,10),0,255);this.b=d(parseInt(this.b,10),0,255);this.a=d(this.a,0,1);return this},distance:function(e){if(!e){return}e=new c.parse(e);var f=0,d=3;while(-1<--d){f+=Math.abs(this[this.rgba[d]]-e[this.rgba[d]])}return f},toString:function(){return(this.a>=1)?"rgb("+[this.r,this.g,this.b].join(",")+")":"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"},contrast:function(){var d=1-(0.299*this.r+0.587*this.g+0.114*this.b)/255;return(d<0.5?"#000000":"#ffffff")}};b.extend(c,{parse:function(e){if(e instanceof c){return e}var d;if((d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))){return new c(parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16))}if((d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))){return new c(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10))}if((d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))){return new c(parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16))}if((d=/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(e))){return new c(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10),parseFloat(d[4]))}if((d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(e))){return new c(parseFloat(d[1])*2.55,parseFloat(d[2])*2.55,parseFloat(d[3])*2.55)}if((d=/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(e))){return new c(parseFloat(d[1])*2.55,parseFloat(d[2])*2.55,parseFloat(d[3])*2.55,parseFloat(d[4]))}var f=(e+"").replace(/^\s*([\S\s]*?)\s*$/,"$1").toLowerCase();if(f=="transparent"){return new c(255,255,255,0)}return(d=a[f])?new c(d[0],d[1],d[2]):new c(0,0,0,0)},processColor:function(d,f){var e=f.opacity;if(!d){return"rgba(0, 0, 0, 0)"}if(d instanceof c){return d.alpha(e).toString()}if(b.isString(d)){return c.parse(d).alpha(e).toString()}var l=d.colors?d:{colors:d};if(!f.ctx){if(!b.isArray(l.colors)){return"rgba(0, 0, 0, 0)"}return c.parse(b.isArray(l.colors[0])?l.colors[0][1]:l.colors[0]).alpha(e).toString()}l=b.extend({start:"top",end:"bottom"},l);if(/top/i.test(l.start)){f.x1=0}if(/left/i.test(l.start)){f.y1=0}if(/bottom/i.test(l.end)){f.x2=0}if(/right/i.test(l.end)){f.y2=0}var h,k,g,j=f.ctx.createLinearGradient(f.x1,f.y1,f.x2,f.y2);for(h=0;h<l.colors.length;h++){k=l.colors[h];if(b.isArray(k)){g=k[0];k=k[1]}else{g=h/(l.colors.length-1)}j.addColorStop(g,c.parse(k).alpha(e))}return j}});Flotr.Color=c})();Flotr.Date={set:function(b,a,d,c){d=d||"UTC";a="set"+(d==="UTC"?"UTC":"")+a;b[a](c)},get:function(b,a,c){c=c||"UTC";a="get"+(c==="UTC"?"UTC":"")+a;return b[a]()},format:function(g,k,f){if(!g){return}var b=this.get,j={h:b(g,"Hours",f).toString(),H:l(b(g,"Hours",f)),M:l(b(g,"Minutes",f)),S:l(b(g,"Seconds",f)),s:b(g,"Milliseconds",f),d:b(g,"Date",f).toString(),m:(b(g,"Month",f)+1).toString(),y:b(g,"FullYear",f).toString(),b:Flotr.Date.monthNames[b(g,"Month",f)]};function l(c){c+="";return c.length==1?"0"+c:c}var a=[],h,m=false;for(var e=0;e<k.length;++e){h=k.charAt(e);if(m){a.push(j[h]||h);m=false}else{if(h=="%"){m=true}else{a.push(h)}}}return a.join("")},getFormat:function(c,b){var a=Flotr.Date.timeUnits;if(c<a.second){return"%h:%M:%S.%s"}else{if(c<a.minute){return"%h:%M:%S"}else{if(c<a.day){return(b<2*a.day)?"%h:%M":"%b %d %h:%M"}else{if(c<a.month){return"%b %d"}else{if(c<a.year){return(b<a.year)?"%b":"%b %y"}else{return"%y"}}}}}},formatter:function(a,f){var b=f.options,h=Flotr.Date.timeUnits[b.timeUnit],g=new Date(a*h);if(f.options.timeFormat){return Flotr.Date.format(g,b.timeFormat,b.timeMode)}var e=(f.max-f.min)*h,c=f.tickSize*Flotr.Date.timeUnits[f.tickUnit];return Flotr.Date.format(g,Flotr.Date.getFormat(c,e),b.timeMode)},generator:function(b){var l=this.set,z=this.get,j=this.timeUnits,h=this.spec,e=b.options,m=e.timeMode,C=j[e.timeUnit],q=b.min*C,s=b.max*C,A=(s-q)/e.noTicks,B=[],p=b.tickSize,n,r,t;r=(e.tickFormatter===Flotr.defaultTickFormatter?this.formatter:e.tickFormatter);for(t=0;t<h.length-1;++t){var w=h[t][0]*j[h[t][1]];if(A<(w+h[t+1][0]*j[h[t+1][1]])/2&&w>=p){break}}p=h[t][0];n=h[t][1];if(n=="year"){p=Flotr.getTickSize(e.noTicks*j.year,q,s,0);if(p==0.5){n="month";p=6}}b.tickUnit=n;b.tickSize=p;var g=p*j[n];w=new Date(q);function a(d){l(w,d,m,Flotr.floorInBase(z(w,d,m),p))}switch(n){case"millisecond":a("Milliseconds");break;case"second":a("Seconds");break;case"minute":a("Minutes");break;case"hour":a("Hours");break;case"month":a("Month");break;case"year":a("FullYear");break}if(g>=j.second){l(w,"Milliseconds",m,0)}if(g>=j.minute){l(w,"Seconds",m,0)}if(g>=j.hour){l(w,"Minutes",m,0)}if(g>=j.day){l(w,"Hours",m,0)}if(g>=j.day*4){l(w,"Date",m,1)}if(g>=j.year){l(w,"Month",m,0)}var u=0,k=NaN,o;do{o=k;k=w.getTime();B.push({v:k/C,label:r(k/C,b)});if(n=="month"){if(p<1){l(w,"Date",m,1);var f=w.getTime();l(w,"Month",m,z(w,"Month",m)+1);var c=w.getTime();w.setTime(k+u*j.hour+(c-f)*p);u=z(w,"Hours",m);l(w,"Hours",m,0)}else{l(w,"Month",m,z(w,"Month",m)+p)}}else{if(n=="year"){l(w,"FullYear",m,z(w,"FullYear",m)+p)}else{w.setTime(k+g)}}}while(k<s&&k!=o);return B},timeUnits:{millisecond:1,second:1000,minute:1000*60,hour:1000*60*60,day:1000*60*60*24,month:1000*60*60*24*30,year:1000*60*60*24*365.2425},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"],[0.25,"month"],[0.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"]};(function(){var b=Flotr._;function a(c){return(c&&c.jquery)?c[0]:c}Flotr.DOM={addClass:function(d,c){d=a(d);var e=(d.className?d.className:"");if(b.include(e.split(/\s+/g),c)){return}d.className=(e?e+" ":"")+c},create:function(c){return document.createElement(c)},node:function(c){var e=Flotr.DOM.create("div"),d;e.innerHTML=c;d=e.children[0];e.innerHTML="";return d},empty:function(c){c=a(c);c.innerHTML=""},remove:function(c){c=a(c);c.parentNode.removeChild(c)},hide:function(c){c=a(c);Flotr.DOM.setStyles(c,{display:"none"})},insert:function(c,d){c=a(c);if(b.isString(d)){c.innerHTML+=d}else{if(b.isElement(d)){c.appendChild(d)}}},opacity:function(d,c){d=a(d);d.style.opacity=c},position:function(c,d){c=a(c);if(!c.offsetParent){return{left:(c.offsetLeft||0),top:(c.offsetTop||0)}}d=this.position(c.offsetParent);d.left+=c.offsetLeft;d.top+=c.offsetTop;return d},removeClass:function(d,c){var e=(d.className?d.className:"");d=a(d);d.className=b.filter(e.split(/\s+/g),function(f){if(f!=c){return true}}).join(" ")},setStyles:function(c,d){c=a(c);b.each(d,function(f,e){c.style[e]=f})},show:function(c){c=a(c);Flotr.DOM.setStyles(c,{display:""})},size:function(c){c=a(c);return{height:c.offsetHeight,width:c.offsetWidth}}}})();(function(){var b=Flotr,a=b.bean;b.EventAdapter={observe:function(d,c,e){a.add(d,c,e);return this},fire:function(e,d,c){a.fire(e,d,c);if(typeof(Prototype)!="undefined"){Event.fire(e,d,c)}return this},stopObserving:function(d,c,e){a.remove(d,c,e);return this},eventPointer:function(f){if(!b._.isUndefined(f.touches)&&f.touches.length>0){return{x:f.touches[0].pageX,y:f.touches[0].pageY}}else{if(!b._.isUndefined(f.changedTouches)&&f.changedTouches.length>0){return{x:f.changedTouches[0].pageX,y:f.changedTouches[0].pageY}}else{if(f.pageX||f.pageY){return{x:f.pageX,y:f.pageY}}else{if(f.clientX||f.clientY){var g=document,c=g.body,h=g.documentElement;return{x:f.clientX+c.scrollLeft+h.scrollLeft,y:f.clientY+c.scrollTop+h.scrollTop}}}}}}}})();(function(){var c=Flotr,d=c.DOM,a=c._,b=function(e){this.o=e};b.prototype={dimensions:function(h,f,e,g){if(!h){return{width:0,height:0}}return(this.o.html)?this.html(h,this.o.element,e,g):this.canvas(h,f)},canvas:function(n,f){if(!this.o.textEnabled){return}f=f||{};var k=this.measureText(n,f),g=k.width,o=f.size||c.defaultOptions.fontSize,j=f.angle||0,l=Math.cos(j),h=Math.sin(j),p=2,m=6,e;e={width:Math.abs(l*g)+Math.abs(h*o)+p,height:Math.abs(h*g)+Math.abs(l*o)+m};return e},html:function(h,e,g,f){var j=d.create("div");d.setStyles(j,{position:"absolute",top:"-10000px"});d.insert(j,'<div style="'+g+'" class="'+f+' flotr-dummy-div">'+h+"</div>");d.insert(this.o.element,j);return d.size(j)},measureText:function(h,g){var e=this.o.ctx,f;if(!e.fillText||(c.isIphone&&e.measure)){return{width:e.measure(h,g)}}g=a.extend({size:c.defaultOptions.fontSize,weight:1,angle:0},g);e.save();e.font=(g.weight>1?"bold ":"")+(g.size*1.3)+"px sans-serif";f=e.measureText(h);e.restore();return f}};Flotr.Text=b})();(function(){var e=Flotr.DOM,c=Flotr.EventAdapter,a=Flotr._,b=Flotr;Graph=function(g,h,f){this._setEl(g);this._initMembers();this._initPlugins();c.fire(this.el,"flotr:beforeinit",[this]);this.data=h;this.series=b.Series.getSeries(h);this._initOptions(f);this._initGraphTypes();this._initCanvas();this._text=new b.Text({element:this.el,ctx:this.ctx,html:this.options.HtmlText,textEnabled:this.textEnabled});c.fire(this.el,"flotr:afterconstruct",[this]);this._initEvents();this.findDataRanges();this.calculateSpacing();this.draw(a.bind(function(){c.fire(this.el,"flotr:afterinit",[this])},this))};function d(g,f,h){c.observe.apply(this,arguments);this._handles.push(arguments);return this}Graph.prototype={destroy:function(){c.fire(this.el,"flotr:destroy");a.each(this._handles,function(f){c.stopObserving.apply(this,f)});this._handles=[];this.el.graph=null},observe:d,_observe:d,processColor:function(f,g){var h={x1:0,y1:0,x2:this.plotWidth,y2:this.plotHeight,opacity:1,ctx:this.ctx};a.extend(h,g);return b.Color.processColor(f,h)},findDataRanges:function(){var f=this.axes,l,j,g;a.each(this.series,function(m){g=m.getRange();if(g){l=m.xaxis;j=m.yaxis;l.datamin=Math.min(g.xmin,l.datamin);l.datamax=Math.max(g.xmax,l.datamax);j.datamin=Math.min(g.ymin,j.datamin);j.datamax=Math.max(g.ymax,j.datamax);l.used=(l.used||g.xused);j.used=(j.used||g.yused)}},this);if(!f.x.used&&!f.x2.used){f.x.used=true}if(!f.y.used&&!f.y2.used){f.y.used=true}a.each(f,function(m){m.calculateRange()});var h=a.keys(b.graphTypes),k=false;a.each(this.series,function(m){if(m.hide){return}a.each(h,function(n){if(m[n]&&m[n].show){this.extendRange(n,m);k=true}},this);if(!k){this.extendRange(this.options.defaultType,m)}},this)},extendRange:function(g,f){if(this[g].extendRange){this[g].extendRange(f,f.data,f[g],this[g])}if(this[g].extendYRange){this[g].extendYRange(f.yaxis,f.data,f[g],this[g])}if(this[g].extendXRange){this[g].extendXRange(f.xaxis,f.data,f[g],this[g])}},calculateSpacing:function(){var v=this.axes,z=this.options,r=this.series,k=z.grid.labelMargin,m=this._text,w=v.x,f=v.x2,u=v.y,t=v.y2,o=z.grid.outlineWidth,q,n,h,s;a.each(v,function(j){j.calculateTicks();j.calculateTextDimensions(m,z)});s=m.dimensions(z.title,{size:z.fontSize*1.5},"font-size:1em;font-weight:bold;","flotr-title");this.titleHeight=s.height;s=m.dimensions(z.subtitle,{size:z.fontSize},"font-size:smaller;","flotr-subtitle");this.subtitleHeight=s.height;for(n=0;n<z.length;++n){if(r[n].points.show){o=Math.max(o,r[n].points.radius+r[n].points.lineWidth/2)}}var g=this.plotOffset;if(w.options.margin===false){g.bottom=0;g.top=0}else{if(w.options.margin===true){g.bottom+=(z.grid.circular?0:(w.used&&w.options.showLabels?(w.maxLabel.height+k):0))+(w.used&&w.options.title?(w.titleSize.height+k):0)+o;g.top+=(z.grid.circular?0:(f.used&&f.options.showLabels?(f.maxLabel.height+k):0))+(f.used&&f.options.title?(f.titleSize.height+k):0)+this.subtitleHeight+this.titleHeight+o}else{g.bottom=w.options.margin;g.top=w.options.margin}}if(u.options.margin===false){g.left=0;g.right=0}else{if(u.options.margin===true){g.left+=(z.grid.circular?0:(u.used&&u.options.showLabels?(u.maxLabel.width+k):0))+(u.used&&u.options.title?(u.titleSize.width+k):0)+o;g.right+=(z.grid.circular?0:(t.used&&t.options.showLabels?(t.maxLabel.width+k):0))+(t.used&&t.options.title?(t.titleSize.width+k):0)+o}else{g.left=u.options.margin;g.right=u.options.margin}}g.top=Math.floor(g.top);this.plotWidth=this.canvasWidth-g.left-g.right;this.plotHeight=this.canvasHeight-g.bottom-g.top;w.length=f.length=this.plotWidth;u.length=t.length=this.plotHeight;u.offset=t.offset=this.plotHeight;w.setScale();f.setScale();u.setScale();t.setScale()},draw:function(h){var g=this.ctx,f;c.fire(this.el,"flotr:beforedraw",[this.series,this]);if(this.series.length){g.save();g.translate(this.plotOffset.left,this.plotOffset.top);for(f=0;f<this.series.length;f++){if(!this.series[f].hide){this.drawSeries(this.series[f])}}g.restore();this.clip()}c.fire(this.el,"flotr:afterdraw",[this.series,this]);if(h){h()}},drawSeries:function(g){function f(k,l){var j=this.getOptions(k,l);this[l].draw(j)}var h=false;g=g||this.series;a.each(b.graphTypes,function(j,k){if(g[k]&&g[k].show&&this[k]){h=true;f.call(this,g,k)}},this);if(!h){f.call(this,g,this.options.defaultType)}},getOptions:function(g,l){var j=g[l],k=this[l],m=g.xaxis,h=g.yaxis,f={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:g.data,color:g.color,shadowSize:g.shadowSize,xScale:m.d2p,yScale:h.d2p,xInverse:m.p2d,yInverse:h.p2d};f=b.merge(j,f);f.fillStyle=this.processColor(j.fillColor||g.color,{opacity:j.fillOpacity});return f},getEventPosition:function(m){var n=document,p=n.body,q=n.documentElement,o=this.axes,k=this.plotOffset,l=this.lastMousePos,g=c.eventPointer(m),t=g.x-l.pageX,s=g.y-l.pageY,f,j,h;if("ontouchstart" in this.el){f=e.position(this.overlay);j=g.x-f.left-k.left;h=g.y-f.top-k.top}else{f=this.overlay.getBoundingClientRect();j=m.clientX-f.left-k.left-p.scrollLeft-q.scrollLeft;h=m.clientY-f.top-k.top-p.scrollTop-q.scrollTop}return{x:o.x.p2d(j),x2:o.x2.p2d(j),y:o.y.p2d(h),y2:o.y2.p2d(h),relX:j,relY:h,dX:t,dY:s,absX:g.x,absY:g.y,pageX:g.x,pageY:g.y}},clickHandler:function(f){if(this.ignoreClick){this.ignoreClick=false;return this.ignoreClick}c.fire(this.el,"flotr:click",[this.getEventPosition(f),this])},mouseMoveHandler:function(f){if(this.mouseDownMoveHandler){return}var g=this.getEventPosition(f);c.fire(this.el,"flotr:mousemove",[f,g,this]);this.lastMousePos=g},mouseDownHandler:function(f){if(this.mouseUpHandler){return}this.mouseUpHandler=a.bind(function(g){c.stopObserving(document,"mouseup",this.mouseUpHandler);c.stopObserving(document,"mousemove",this.mouseDownMoveHandler);this.mouseDownMoveHandler=null;this.mouseUpHandler=null;c.fire(this.el,"flotr:mouseup",[g,this])},this);this.mouseDownMoveHandler=a.bind(function(g){var h=this.getEventPosition(g);c.fire(this.el,"flotr:mousemove",[f,h,this]);this.lastMousePos=h},this);c.observe(document,"mouseup",this.mouseUpHandler);c.observe(document,"mousemove",this.mouseDownMoveHandler);c.fire(this.el,"flotr:mousedown",[f,this]);this.ignoreClick=false},drawTooltip:function(l,o,n,q){var f=this.getMouseTrack(),g="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;",h=q.position,k=q.margin,j=this.plotOffset;if(o!==null&&n!==null){if(!q.relative){if(h.charAt(0)=="n"){g+="top:"+(k+j.top)+"px;bottom:auto;"}else{if(h.charAt(0)=="s"){g+="bottom:"+(k+j.bottom)+"px;top:auto;"}}if(h.charAt(1)=="e"){g+="right:"+(k+j.right)+"px;left:auto;"}else{if(h.charAt(1)=="w"){g+="left:"+(k+j.left)+"px;right:auto;"}}}else{if(h.charAt(0)=="n"){g+="bottom:"+(k-j.top-n+this.canvasHeight)+"px;top:auto;"}else{if(h.charAt(0)=="s"){g+="top:"+(k+j.top+n)+"px;bottom:auto;"}}if(h.charAt(1)=="e"){g+="left:"+(k+j.left+o)+"px;right:auto;"}else{if(h.charAt(1)=="w"){g+="right:"+(k-j.left-o+this.canvasWidth)+"px;left:auto;"}}}f.style.cssText=g;e.empty(f);e.insert(f,l);e.show(f)}else{e.hide(f)}},clip:function(g){var k=this.plotOffset,f=this.canvasWidth,j=this.canvasHeight;g=g||this.ctx;if(b.isIE&&b.isIE<9&&!b.isFlashCanvas){if(g===this.octx){return}g.save();g.fillStyle=this.processColor(this.options.ieBackgroundColor);g.fillRect(0,0,f,k.top);g.fillRect(0,0,k.left,j);g.fillRect(0,j-k.bottom,f,k.bottom);g.fillRect(f-k.right,0,k.right,j);g.restore()}else{g.clearRect(0,0,f,k.top);g.clearRect(0,0,k.left,j);g.clearRect(0,j-k.bottom,f,k.bottom);g.clearRect(f-k.right,0,k.right,j)}},_initMembers:function(){this._handles=[];this.lastMousePos={pageX:null,pageY:null};this.plotOffset={left:0,right:0,top:0,bottom:0};this.ignoreClick=true;this.prevHit=null},_initGraphTypes:function(){a.each(b.graphTypes,function(f,g){this[g]=b.clone(f)},this)},_initEvents:function(){var g=this.el,j,f,h;if("ontouchstart" in g){j=a.bind(function(k){h=true;c.stopObserving(document,"touchend",j);c.fire(g,"flotr:mouseup",[event,this]);this.multitouches=null;if(!f){this.clickHandler(k)}},this);this.observe(this.overlay,"touchstart",a.bind(function(k){f=false;h=false;this.ignoreClick=false;if(k.touches&&k.touches.length>1){this.multitouches=k.touches}c.fire(g,"flotr:mousedown",[event,this]);this.observe(document,"touchend",j)},this));this.observe(this.overlay,"touchmove",a.bind(function(k){var l=this.getEventPosition(k);if(this.options.preventDefault){k.preventDefault()}f=true;if(this.multitouches||(k.touches&&k.touches.length>1)){this.multitouches=k.touches}else{if(!h){c.fire(g,"flotr:mousemove",[event,l,this])}}this.lastMousePos=l},this))}else{this.observe(this.overlay,"mousedown",a.bind(this.mouseDownHandler,this)).observe(g,"mousemove",a.bind(this.mouseMoveHandler,this)).observe(this.overlay,"click",a.bind(this.clickHandler,this)).observe(g,"mouseout",function(k){c.fire(g,"flotr:mouseout",k)})}},_initCanvas:function(){var j=this.el,h=this.options,k=j.children,p=[],g,l,q,f;for(l=k.length;l--;){g=k[l];if(!this.canvas&&g.className==="flotr-canvas"){this.canvas=g}else{if(!this.overlay&&g.className==="flotr-overlay"){this.overlay=g}else{p.push(g)}}}for(l=p.length;l--;){j.removeChild(p[l])}e.setStyles(j,{position:"relative"});q={};q.width=j.clientWidth;q.height=j.clientHeight;if(q.width<=0||q.height<=0||h.resolution<=0){throw"Invalid dimensions for plot, width = "+q.width+", height = "+q.height+", resolution = "+h.resolution}this.canvas=m(this.canvas,"canvas");this.overlay=m(this.overlay,"overlay");this.ctx=n(this.canvas);this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);this.octx=n(this.overlay);this.octx.clearRect(0,0,this.overlay.width,this.overlay.height);this.canvasHeight=q.height;this.canvasWidth=q.width;this.textEnabled=!!this.ctx.drawText||!!this.ctx.fillText;function m(r,o){if(!r){r=e.create("canvas");if(typeof FlashCanvas!="undefined"&&typeof r.getContext==="function"){FlashCanvas.initElement(r);this.isFlashCanvas=true}r.className="flotr-"+o;r.style.cssText="position:absolute;left:0px;top:0px;";e.insert(j,r)}a.each(q,function(s,t){e.show(r);if(o=="canvas"&&r.getAttribute(t)===s){return}r.setAttribute(t,s*h.resolution);r.style[t]=s+"px"});r.context_=null;return r}function n(o){if(window.G_vmlCanvasManager){window.G_vmlCanvasManager.initElement(o)}var r=o.getContext("2d");if(!window.G_vmlCanvasManager){r.scale(h.resolution,h.resolution)}return r}},_initPlugins:function(){a.each(b.plugins,function(g,f){a.each(g.callbacks,function(h,j){this.observe(this.el,j,a.bind(h,this))},this);this[f]=b.clone(g);a.each(this[f],function(h,j){if(a.isFunction(h)){this[f][j]=a.bind(h,this)}},this)},this)},_initOptions:function(g){var A=b.clone(b.defaultOptions);A.x2axis=a.extend(a.clone(A.xaxis),A.x2axis);A.y2axis=a.extend(a.clone(A.yaxis),A.y2axis);this.options=b.merge(g||{},A);if(this.options.grid.minorVerticalLines===null&&this.options.xaxis.scaling==="logarithmic"){this.options.grid.minorVerticalLines=true}if(this.options.grid.minorHorizontalLines===null&&this.options.yaxis.scaling==="logarithmic"){this.options.grid.minorHorizontalLines=true}c.fire(this.el,"flotr:afterinitoptions",[this]);this.axes=b.Axis.getAxes(this.options);var n=[],h=[],q=this.series.length,v=this.series.length,k=this.options.colors,f=[],m=0,u,p,o,z;for(p=v-1;p>-1;--p){u=this.series[p].color;if(u){--v;if(a.isNumber(u)){n.push(u)}else{f.push(b.Color.parse(u))}}}for(p=n.length-1;p>-1;--p){v=Math.max(v,n[p]+1)}for(p=0;h.length<v;){u=(k.length==p)?new b.Color(100,100,100):b.Color.parse(k[p]);var l=m%2==1?-1:1,r=1+l*Math.ceil(m/2)*0.2;u.scale(r,r,r);h.push(u);if(++p>=k.length){p=0;++m}}for(p=0,o=0;p<q;++p){z=this.series[p];if(!z.color){z.color=h[o++].toString()}else{if(a.isNumber(z.color)){z.color=h[z.color].toString()}}if(!z.xaxis){z.xaxis=this.axes.x}if(z.xaxis==1){z.xaxis=this.axes.x}else{if(z.xaxis==2){z.xaxis=this.axes.x2}}if(!z.yaxis){z.yaxis=this.axes.y}if(z.yaxis==1){z.yaxis=this.axes.y}else{if(z.yaxis==2){z.yaxis=this.axes.y2}}for(var w in b.graphTypes){z[w]=a.extend(a.clone(this.options[w]),z[w])}z.mouse=a.extend(a.clone(this.options.mouse),z.mouse);if(a.isUndefined(z.shadowSize)){z.shadowSize=this.options.shadowSize}}},_setEl:function(f){if(!f){throw"The target container doesn't exist"}else{if(f.graph instanceof Graph){f.graph.destroy()}else{if(!f.clientWidth){throw"The target container must be visible"}}}f.graph=this;this.el=f}};Flotr.Graph=Graph})();(function(){var c=Flotr._,a="logarithmic";function b(f){this.orientation=1;this.offset=0;this.datamin=Number.MAX_VALUE;this.datamax=-Number.MAX_VALUE;c.extend(this,f)}b.prototype={setScale:function(){var l=this.length,f=this.max,j=this.min,n=this.offset,g=this.orientation,h=this.options,k=h.scaling===a,m;if(k){m=l/(d(f,h.base)-d(j,h.base))}else{m=l/(f-j)}this.scale=m;if(k){this.d2p=function(o){return n+g*(d(o,h.base)-d(j,h.base))*m};this.p2d=function(o){return e((n+g*o)/m+d(j,h.base),h.base)}}else{this.d2p=function(o){return n+g*(o-j)*m};this.p2d=function(o){return(n+g*o)/m+j}}},calculateTicks:function(){var f=this.options;this.ticks=[];this.minorTicks=[];if(f.ticks){this._cleanUserTicks(f.ticks,this.ticks);this._cleanUserTicks(f.minorTicks||[],this.minorTicks)}else{if(f.mode=="time"){this._calculateTimeTicks()}else{if(f.scaling==="logarithmic"){this._calculateLogTicks()}else{this._calculateTicks()}}}c.each(this.ticks,function(g){g.label+=""});c.each(this.minorTicks,function(g){g.label+=""})},calculateRange:function(){if(!this.used){return}var l=this,n=l.options,k=n.min!==null?n.min:l.datamin,f=n.max!==null?n.max:l.datamax,m=n.autoscaleMargin;if(n.scaling=="logarithmic"){if(k<=0){k=l.datamin}if(f<=0){f=k}}if(f==k){var g=f?0.01:1;if(n.min===null){k-=g}if(n.max===null){f+=g}}if(n.scaling==="logarithmic"){if(k<0){k=f/n.base}var h=Math.log(f);if(n.base!=Math.E){h/=Math.log(n.base)}h=Math.ceil(h);var j=Math.log(k);if(n.base!=Math.E){j/=Math.log(n.base)}j=Math.ceil(j);l.tickSize=Flotr.getTickSize(n.noTicks,j,h,n.tickDecimals===null?0:n.tickDecimals);if(n.minorTickFreq===null){if(h-j>10){n.minorTickFreq=0}else{if(h-j>5){n.minorTickFreq=2}else{n.minorTickFreq=5}}}}else{l.tickSize=Flotr.getTickSize(n.noTicks,k,f,n.tickDecimals)}l.min=k;l.max=f;if(n.min===null&&n.autoscale){l.min-=l.tickSize*m;if(l.min<0&&l.datamin>=0){l.min=0}l.min=l.tickSize*Math.floor(l.min/l.tickSize)}if(n.max===null&&n.autoscale){l.max+=l.tickSize*m;if(l.max>0&&l.datamax<=0&&l.datamax!=l.datamin){l.max=0}l.max=l.tickSize*Math.ceil(l.max/l.tickSize)}if(l.min==l.max){l.max=l.min+1}},calculateTextDimensions:function(g,f){var j="",k,h;if(this.options.showLabels){for(h=0;h<this.ticks.length;++h){k=this.ticks[h].label.length;if(k>j.length){j=this.ticks[h].label}}}this.maxLabel=g.dimensions(j,{size:f.fontSize,angle:Flotr.toRad(this.options.labelsAngle)},"font-size:smaller;","flotr-grid-label");this.titleSize=g.dimensions(this.options.title,{size:f.fontSize*1.2,angle:Flotr.toRad(this.options.titleAngle)},"font-weight:bold;","flotr-axis-title")},_cleanUserTicks:function(m,n){var l=this,h=this.options,f,k,g,j;if(c.isFunction(m)){m=m({min:l.min,max:l.max})}for(k=0;k<m.length;++k){j=m[k];if(typeof(j)==="object"){f=j[0];g=(j.length>1)?j[1]:h.tickFormatter(f,{min:l.min,max:l.max})}else{f=j;g=h.tickFormatter(f,{min:this.min,max:this.max})}n[k]={v:f,label:g}}},_calculateTimeTicks:function(){this.ticks=Flotr.Date.generator(this)},_calculateLogTicks:function(){var l=this,m=l.options,h,k;var g=Math.log(l.max);if(m.base!=Math.E){g/=Math.log(m.base)}g=Math.ceil(g);var j=Math.log(l.min);if(m.base!=Math.E){j/=Math.log(m.base)}j=Math.ceil(j);for(i=j;i<g;i+=l.tickSize){k=(m.base==Math.E)?Math.exp(i):Math.pow(m.base,i);var n=k*((m.base==Math.E)?Math.exp(l.tickSize):Math.pow(m.base,l.tickSize));var f=(n-k)/m.minorTickFreq;l.ticks.push({v:k,label:m.tickFormatter(k,{min:l.min,max:l.max})});for(h=k+f;h<n;h+=f){l.minorTicks.push({v:h,label:m.tickFormatter(h,{min:l.min,max:l.max})})}}k=(m.base==Math.E)?Math.exp(i):Math.pow(m.base,i);l.ticks.push({v:k,label:m.tickFormatter(k,{min:l.min,max:l.max})})},_calculateTicks:function(){var k=this,g=k.options,p=k.tickSize,m=k.min,r=k.max,f=p*Math.ceil(m/p),h,q,t,s,n,l;if(g.minorTickFreq){q=p/g.minorTickFreq}for(n=0;(t=s=f+n*p)<=r;++n){h=g.tickDecimals;if(h===null){h=1-Math.floor(Math.log(p)/Math.LN10)}if(h<0){h=0}t=t.toFixed(h);k.ticks.push({v:t,label:g.tickFormatter(t,{min:k.min,max:k.max})});if(g.minorTickFreq){for(l=0;l<g.minorTickFreq&&(n*p+l*q)<r;++l){t=s+l*q;k.minorTicks.push({v:t,label:g.tickFormatter(t,{min:k.min,max:k.max})})}}}}};c.extend(b,{getAxes:function(f){return{x:new b({options:f.xaxis,n:1,length:this.plotWidth}),x2:new b({options:f.x2axis,n:2,length:this.plotWidth}),y:new b({options:f.yaxis,n:1,length:this.plotHeight,offset:this.plotHeight,orientation:-1}),y2:new b({options:f.y2axis,n:2,length:this.plotHeight,offset:this.plotHeight,orientation:-1})}}});function d(g,f){g=Math.log(Math.max(g,Number.MIN_VALUE));if(f!==Math.E){g/=Math.log(f)}return g}function e(g,f){return(f===Math.E)?Math.exp(g):Math.pow(f,g)}Flotr.Axis=b})();(function(){var b=Flotr._;function a(c){b.extend(this,c)}a.prototype={getRange:function(){var g=this.data,d=g.length,c=Number.MAX_VALUE,n=Number.MAX_VALUE,h=-Number.MAX_VALUE,e=-Number.MAX_VALUE,k=false,j=false,m,l,f;if(d<0||this.hide){return false}for(f=0;f<d;f++){m=g[f][0];l=g[f][1];if(m!==null){if(m<c){c=m;k=true}if(m>h){h=m;k=true}}if(l!==null){if(l<n){n=l;j=true}if(l>e){e=l;j=true}}}return{xmin:c,xmax:h,ymin:n,ymax:e,xused:k,yused:j}}};b.extend(a,{getSeries:function(c){return b.map(c,function(e){var d;if(e.data){d=new a();b.extend(d,e)}else{d=new a({data:e})}return d})}});Flotr.Series=a})();Flotr.addType("lines",{options:{show:false,lineWidth:2,fill:false,fillBorder:false,fillColor:null,fillOpacity:0.4,steps:false,stacked:false},stack:{values:[]},draw:function(b){var c=b.context,a=b.lineWidth,d=b.shadowSize,e;c.save();c.lineJoin="round";if(d){c.lineWidth=d/2;e=a/2+c.lineWidth/2;c.strokeStyle="rgba(0,0,0,0.1)";this.plot(b,e+d/2,false);c.strokeStyle="rgba(0,0,0,0.2)";this.plot(b,e,false)}c.lineWidth=a;c.strokeStyle=b.color;this.plot(b,0,true);c.restore()},plot:function(e,l,v){var c=e.context,q=e.width,p=e.height,z=e.xScale,b=e.yScale,w=e.data,k=e.stacked?this.stack:false,f=w.length-1,o=null,n=null,m=b(0),g=null,u,t,d,a,j,h,s;if(f<1){return}c.beginPath();for(s=0;s<f;++s){if(w[s][1]===null||w[s+1][1]===null){if(e.fill){if(s>0&&w[s][1]!==null){c.stroke();r();g=null;c.closePath();c.beginPath()}}continue}u=z(w[s][0]);t=z(w[s+1][0]);if(g===null){g=w[s]}if(k){j=k.values[w[s][0]]||0;h=k.values[w[s+1][0]]||k.values[w[s][0]]||0;d=b(w[s][1]+j);a=b(w[s+1][1]+h);if(v){w[s].y0=j;k.values[w[s][0]]=w[s][1]+j;if(s==f-1){w[s+1].y0=h;k.values[w[s+1][0]]=w[s+1][1]+h}}}else{d=b(w[s][1]);a=b(w[s+1][1])}if((d>p&&a>p)||(d<0&&a<0)||(u<0&&t<0)||(u>q&&t>q)){continue}if((o!=u)||(n!=d+l)){c.moveTo(u,d+l)}o=t;n=a+l;if(e.steps){c.lineTo(o+l/2,d+l);c.lineTo(o+l/2,n)}else{c.lineTo(o,n)}}if(!e.fill||e.fill&&!e.fillBorder){c.stroke()}r();function r(){if(!l&&e.fill&&g){u=z(g[0]);c.fillStyle=e.fillStyle;c.lineTo(t,m);c.lineTo(u,m);c.lineTo(u,b(g[1]));c.fill();if(e.fillBorder){c.stroke()}}}c.closePath()},extendYRange:function(b,f,l,m){var a=b.options;if(l.stacked&&((!a.max&&a.max!==0)||(!a.min&&a.min!==0))){var g=b.max,d=b.min,c=m.positiveSums||{},h=m.negativeSums||{},k,e;for(e=0;e<f.length;e++){k=f[e][0]+"";if(f[e][1]>0){c[k]=(c[k]||0)+f[e][1];g=Math.max(g,c[k])}else{h[k]=(h[k]||0)+f[e][1];d=Math.min(d,h[k])}}m.negativeSums=h;m.positiveSums=c;b.max=g;b.min=d}if(l.steps){this.hit=function(w){var r=w.data,t=w.args,j=w.yScale,s=t[0],o=r.length,p=t[1],v=w.xInverse(s.relX),u=s.relY,q;for(q=0;q<o-1;q++){if(v>=r[q][0]&&v<=r[q+1][0]){if(Math.abs(j(r[q][1])-u)<8){p.x=r[q][0];p.y=r[q][1];p.index=q;p.seriesIndex=w.index}break}}};this.drawHit=function(u){var n=u.context,q=u.args,o=u.data,t=u.xScale,p=q.index,s=t(q.x),r=u.yScale(q.y),j;if(o.length-1>p){j=u.xScale(o[p+1][0]);n.save();n.strokeStyle=u.color;n.lineWidth=u.lineWidth;n.beginPath();n.moveTo(s,r);n.lineTo(j,r);n.stroke();n.closePath();n.restore()}};this.clearHit=function(v){var o=v.context,r=v.args,p=v.data,u=v.xScale,n=v.lineWidth,q=r.index,t=u(r.x),s=v.yScale(r.y),j;if(p.length-1>q){j=v.xScale(p[q+1][0]);o.clearRect(t-n,s-n,j-t+2*n,2*n)}}}}});Flotr.addType("bars",{options:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,fillOpacity:0.4,horizontal:false,stacked:false,centered:true,topPadding:0.1,grouped:false},stack:{positive:[],negative:[],_positive:[],_negative:[]},draw:function(a){var b=a.context;this.current+=1;b.save();b.lineJoin="miter";b.lineWidth=a.lineWidth;b.strokeStyle=a.color;if(a.fill){b.fillStyle=a.fillStyle}this.plot(a);b.restore()},plot:function(k){var e=k.data,c=k.context,b=k.shadowSize,f,g,d,h,a,j;if(e.length<1){return}this.translate(c,k.horizontal);for(f=0;f<e.length;f++){g=this.getBarGeometry(e[f][0],e[f][1],k);if(g===null){continue}d=g.left;h=g.top;a=g.width;j=g.height;if(k.fill){c.fillRect(d,h,a,j)}if(b){c.save();c.fillStyle="rgba(0,0,0,0.05)";c.fillRect(d+b,h+b,a,j);c.restore()}if(k.lineWidth){c.strokeRect(d,h,a,j)}}},translate:function(b,a){if(a){b.rotate(-Math.PI/2);b.scale(-1,1)}},getBarGeometry:function(j,h,c){var p=c.horizontal,l=c.barWidth,o=c.centered,e=c.stacked?this.stack:false,a=c.lineWidth,r=o?l/2:0,t=p?c.yScale:c.xScale,b=p?c.xScale:c.yScale,m=p?h:j,n=p?j:h,g=0,s,d,q,k,f;if(c.grouped){this.current/this.groups;m=m-r;l=l/this.groups;r=l/2;m=m+l*this.current-r}if(e){s=n>0?e.positive:e.negative;g=s[m]||g;s[m]=g+n}d=t(m-r);q=t(m+l-r);k=b(n+g);f=b(g);if(f<0){f=0}return(j===null||h===null)?null:{x:m,y:n,xScale:t,yScale:b,top:k,left:Math.min(d,q)-a/2,width:Math.abs(q-d)-a,height:f-k}},hit:function(o){var e=o.data,g=o.args,f=g[0],b=g[1],l=o.xInverse(f.relX),k=o.yInverse(f.relY),h=this.getBarGeometry(l,k,o),a=h.width/2,c=h.left,m=h.y,j,d;for(d=e.length;d--;){j=this.getBarGeometry(e[d][0],e[d][1],o);if(((m>0&&m<j.y)||(m<0&&m>j.y))&&(Math.abs(c-j.left)<a)){b.x=e[d][0];b.y=e[d][1];b.index=d;b.seriesIndex=o.index}}},drawHit:function(c){var d=c.context,b=c.args,h=this.getBarGeometry(b.x,b.y,c),g=h.left,f=h.top,e=h.width,a=h.height;d.save();d.strokeStyle=c.color;d.lineWidth=c.lineWidth;this.translate(d,c.horizontal);d.beginPath();d.moveTo(g,f+a);d.lineTo(g,f);d.lineTo(g+e,f);d.lineTo(g+e,f+a);if(c.fill){d.fillStyle=c.fillStyle;d.fill()}d.stroke();d.closePath();d.restore()},clearHit:function(j){var b=j.context,e=j.args,f=this.getBarGeometry(e.x,e.y,j),c=f.left,a=f.width,g=f.top,h=f.height,d=2*j.lineWidth;b.save();this.translate(b,j.horizontal);b.clearRect(c-d,Math.min(g,g+h)-d,a+2*d,Math.abs(h)+2*d);b.restore()},extendXRange:function(c,d,b,a){this._extendRange(c,d,b,a);this.groups=(this.groups+1)||1;this.current=0},extendYRange:function(c,d,b,a){this._extendRange(c,d,b,a)},_extendRange:function(c,g,q,p){var m=c.options.max;if(_.isNumber(m)||_.isString(m)){return}var e=c.min,k=c.max,a=q.horizontal,b=c.orientation,d=this.positiveSums||{},l=this.negativeSums||{},o,n,h,f;if((b==1&&!a)||(b==-1&&a)){if(q.centered){k=Math.max(c.datamax+q.barWidth,k);e=Math.min(c.datamin-q.barWidth,e)}}if(q.stacked&&((b==1&&a)||(b==-1&&!a))){for(f=g.length;f--;){o=g[f][(b==1?1:0)]+"";n=g[f][(b==1?0:1)];if(n>0){d[o]=(d[o]||0)+n;k=Math.max(k,d[o])}else{l[o]=(l[o]||0)+n;e=Math.min(e,l[o])}}}if((b==1&&a)||(b==-1&&!a)){if(q.topPadding&&(c.max===c.datamax||(q.stacked&&this.stackMax!==k))){k+=q.topPadding*(k-e)}}this.stackMin=e;this.stackMax=k;this.negativeSums=l;this.positiveSums=d;c.max=k;c.min=e}});Flotr.addType("bubbles",{options:{show:false,lineWidth:2,fill:true,fillOpacity:0.4,baseRadius:2},draw:function(a){var b=a.context,c=a.shadowSize;b.save();b.lineWidth=a.lineWidth;b.fillStyle="rgba(0,0,0,0.05)";b.strokeStyle="rgba(0,0,0,0.05)";this.plot(a,c/2);b.strokeStyle="rgba(0,0,0,0.1)";this.plot(a,c/4);b.strokeStyle=a.color;b.fillStyle=a.fillStyle;this.plot(a);b.restore()},plot:function(j,b){var c=j.data,a=j.context,g,d,h,f,e;b=b||0;for(d=0;d<c.length;++d){g=this.getGeometry(c[d],j);a.beginPath();a.arc(g.x+b,g.y+b,g.z,0,2*Math.PI,true);a.stroke();if(j.fill){a.fill()}a.closePath()}},getGeometry:function(a,b){return{x:b.xScale(a[0]),y:b.yScale(a[1]),z:a[2]*b.baseRadius}},hit:function(l){var c=l.data,e=l.args,d=e[0],b=e[1],h=d.relX,g=d.relY,a,f,k,j;b.best=b.best||Number.MAX_VALUE;for(i=c.length;i--;){f=this.getGeometry(c[i],l);k=f.x-h;j=f.y-g;a=Math.sqrt(k*k+j*j);if(a<f.z&&f.z<b.best){b.x=c[i][0];b.y=c[i][1];b.index=i;b.seriesIndex=l.index;b.best=f.z}}},drawHit:function(a){var b=a.context,c=this.getGeometry(a.data[a.args.index],a);b.save();b.lineWidth=a.lineWidth;b.fillStyle=a.fillStyle;b.strokeStyle=a.color;b.beginPath();b.arc(c.x,c.y,c.z,0,2*Math.PI,true);b.fill();b.stroke();b.closePath();b.restore()},clearHit:function(a){var b=a.context,d=this.getGeometry(a.data[a.args.index],a),c=d.z+a.lineWidth;b.save();b.clearRect(d.x-c,d.y-c,2*c,2*c);b.restore()}});Flotr.addType("candles",{options:{show:false,lineWidth:1,wickLineWidth:1,candleWidth:0.6,fill:true,upFillColor:"#00A8F0",downFillColor:"#CB4B4B",fillOpacity:0.5,barcharts:false},draw:function(a){var b=a.context;b.save();b.lineJoin="miter";b.lineCap="butt";b.lineWidth=a.wickLineWidth||a.lineWidth;this.plot(a);b.restore()},plot:function(e){var A=e.data,d=e.context,B=e.xScale,c=e.yScale,r=e.candleWidth/2,l=e.shadowSize,a=e.lineWidth,s=e.wickLineWidth,g=(s%2)/2,t,w,m,j,n,k,C,q,f,z,h,p,b,u,o,v;if(A.length<1){return}for(v=0;v<A.length;v++){w=A[v];m=w[0];n=w[1];k=w[2];C=w[3];q=w[4];f=B(m-r);z=B(m+r);h=c(C);p=c(k);b=c(Math.min(n,q));u=c(Math.max(n,q));t=e[n>q?"downFillColor":"upFillColor"];if(e.fill&&!e.barcharts){d.fillStyle="rgba(0,0,0,0.05)";d.fillRect(f+l,u+l,z-f,b-u);d.save();d.globalAlpha=e.fillOpacity;d.fillStyle=t;d.fillRect(f,u+a,z-f,b-u);d.restore()}if(a||s){m=Math.floor((f+z)/2)+g;d.strokeStyle=t;d.beginPath();if(e.barcharts){d.moveTo(m,Math.floor(p+a));d.lineTo(m,Math.floor(h+a));o=n<q;d.moveTo(o?z:f,Math.floor(u+a));d.lineTo(m,Math.floor(u+a));d.moveTo(m,Math.floor(b+a));d.lineTo(o?f:z,Math.floor(b+a))}else{d.strokeRect(f,u+a,z-f,b-u);d.moveTo(m,Math.floor(u+a));d.lineTo(m,Math.floor(p+a));d.moveTo(m,Math.floor(b+a));d.lineTo(m,Math.floor(h+a))}d.closePath();d.stroke()}}},hit:function(c){var t=c.xScale,b=c.yScale,s=c.data,a=c.args,k=a[0],o=c.candleWidth/2,m=a[1],j=k.relX,g=k.relY,d=s.length,p,q,h,u,e,r,l,f;for(p=0;p<d;p++){q=s[p],h=q[2];u=q[3];e=t(q[0]-o);r=t(q[0]+o);f=b(u);l=b(h);if(j>e&&j<r&&g>l&&g<f){m.x=q[0];m.index=p;m.seriesIndex=c.index;return}}},drawHit:function(a){var b=a.context;b.save();this.plot(_.defaults({fill:!!a.fillColor,upFillColor:a.color,downFillColor:a.color,data:[a.data[a.args.index]]},a));b.restore()},clearHit:function(m){var h=m.args,c=m.context,l=m.xScale,d=m.yScale,f=m.lineWidth,b=m.candleWidth/2,g=m.data[h.index],e=l(g[0]-b)-f,k=l(g[0]+b)+f,j=d(g[2]),a=d(g[3])+f;c.clearRect(e,j,k-e,a-j)},extendXRange:function(b,c,a){if(b.options.max===null){b.max=Math.max(b.datamax+0.5,b.max);b.min=Math.min(b.datamin-0.5,b.min)}}});Flotr.addType("gantt",{options:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,fillOpacity:0.4,centered:true},draw:function(c){var a=this.ctx,e=c.gantt.barWidth,d=Math.min(c.gantt.lineWidth,e);a.save();a.translate(this.plotOffset.left,this.plotOffset.top);a.lineJoin="miter";a.lineWidth=d;a.strokeStyle=c.color;a.save();this.gantt.plotShadows(c,e,0,c.gantt.fill);a.restore();if(c.gantt.fill){var b=c.gantt.fillColor||c.color;a.fillStyle=this.processColor(b,{opacity:c.gantt.fillOpacity})}this.gantt.plot(c,e,0,c.gantt.fill);a.restore()},plot:function(j,n,e,p){var v=j.data;if(v.length<1){return}var r=j.xaxis,b=j.yaxis,o=this.ctx,q;for(q=0;q<v.length;q++){var h=v[q][0],l=v[q][1],t=v[q][2],f=true,k=true,a=true;if(l===null||t===null){continue}var c=l,u=l+t,g=h-(j.gantt.centered?n/2:0),m=h+n-(j.gantt.centered?n/2:0);if(u<r.min||c>r.max||m<b.min||g>b.max){continue}if(c<r.min){c=r.min;f=false}if(u>r.max){u=r.max;if(r.lastSerie!=j){k=false}}if(g<b.min){g=b.min}if(m>b.max){m=b.max;if(b.lastSerie!=j){k=false}}if(p){o.beginPath();o.moveTo(r.d2p(c),b.d2p(g)+e);o.lineTo(r.d2p(c),b.d2p(m)+e);o.lineTo(r.d2p(u),b.d2p(m)+e);o.lineTo(r.d2p(u),b.d2p(g)+e);o.fill();o.closePath()}if(j.gantt.lineWidth&&(f||a||k)){o.beginPath();o.moveTo(r.d2p(c),b.d2p(g)+e);o[f?"lineTo":"moveTo"](r.d2p(c),b.d2p(m)+e);o[k?"lineTo":"moveTo"](r.d2p(u),b.d2p(m)+e);o[a?"lineTo":"moveTo"](r.d2p(u),b.d2p(g)+e);o.stroke();o.closePath()}}},plotShadows:function(g,j,c){var u=g.data;if(u.length<1){return}var p,f,h,r,q=g.xaxis,a=g.yaxis,o=this.ctx,m=this.options.shadowSize;for(p=0;p<u.length;p++){f=u[p][0];h=u[p][1];r=u[p][2];if(h===null||r===null){continue}var b=h,t=h+r,e=f-(g.gantt.centered?j/2:0),k=f+j-(g.gantt.centered?j/2:0);if(t<q.min||b>q.max||k<a.min||e>a.max){continue}if(b<q.min){b=q.min}if(t>q.max){t=q.max}if(e<a.min){e=a.min}if(k>a.max){k=a.max}var n=q.d2p(t)-q.d2p(b)-((q.d2p(t)+m<=this.plotWidth)?0:m);var l=a.d2p(e)-a.d2p(k)-((a.d2p(e)+m<=this.plotHeight)?0:m);o.fillStyle="rgba(0,0,0,0.05)";o.fillRect(Math.min(q.d2p(b)+m,this.plotWidth),Math.min(a.d2p(k)+m,this.plotHeight),n,l)}},extendXRange:function(b){if(b.options.max===null){var c=b.min,k=b.max,e,d,m,n,h,a={},l={},f=null;for(e=0;e<this.series.length;++e){n=this.series[e];h=n.gantt;if(h.show&&n.xaxis==b){for(d=0;d<n.data.length;d++){if(h.show){y=n.data[d][0]+"";a[y]=Math.max((a[y]||0),n.data[d][1]+n.data[d][2]);f=n}}for(d in a){k=Math.max(a[d],k)}}}b.lastSerie=f;b.max=k;b.min=c}},extendYRange:function(b){if(b.options.max===null){var l=Number.MIN_VALUE,d=Number.MAX_VALUE,f,e,o,k,a={},m={},h=null;for(f=0;f<this.series.length;++f){o=this.series[f];k=o.gantt;if(k.show&&!o.hide&&o.yaxis==b){var c=Number.MIN_VALUE,n=Number.MAX_VALUE;for(e=0;e<o.data.length;e++){c=Math.max(c,o.data[e][0]);n=Math.min(n,o.data[e][0])}if(k.centered){l=Math.max(c+0.5,l);d=Math.min(n-0.5,d)}else{l=Math.max(c+1,l);d=Math.min(n,d)}if(k.barWidth+c>l){l=b.max+k.barWidth}}}b.lastSerie=h;b.max=l;b.min=d;b.tickSize=Flotr.getTickSize(b.options.noTicks,d,l,b.options.tickDecimals)}}});(function(){Flotr.defaultMarkerFormatter=function(b){return(Math.round(b.y*100)/100)+""};Flotr.addType("markers",{options:{show:false,lineWidth:1,color:"#000000",fill:false,fillColor:"#FFFFFF",fillOpacity:0.4,stroke:false,position:"ct",verticalMargin:0,labelFormatter:Flotr.defaultMarkerFormatter,fontSize:Flotr.defaultOptions.fontSize,stacked:false,stackingType:"b",horizontal:false},stack:{positive:[],negative:[],values:[]},draw:function(o){var f=o.data,c=o.context,l=o.stacked?o.stack:false,j=o.stackingType,b,h,g,e,n,k,m;c.save();c.lineJoin="round";c.lineWidth=o.lineWidth;c.strokeStyle="rgba(0,0,0,0.5)";c.fillStyle=o.fillStyle;function d(q,p){h=l.negative[q]||0;b=l.positive[q]||0;if(p>0){l.positive[q]=h+p;return h+p}else{l.negative[q]=b+p;return b+p}}for(e=0;e<f.length;++e){n=f[e][0];k=f[e][1];if(l){if(j=="b"){if(o.horizontal){k=d(k,n)}else{n=d(n,k)}}else{if(j=="a"){g=l.values[n]||0;l.values[n]=g+k;k=g+k}}}m=o.labelFormatter({x:n,y:k,index:e,data:f});this.plot(o.xScale(n),o.yScale(k),m,o)}c.restore()},plot:function(b,f,d,c){var e=c.context;if(a(d)&&!d.complete){throw"Marker image not loaded."}else{this._plot(b,f,d,c)}},_plot:function(j,f,h,k){var b=k.context,d=2,c=j,g=f,e;if(a(h)){e={height:h.height,width:h.width}}else{e=k.text.canvas(h)}e.width=Math.floor(e.width+d*2);e.height=Math.floor(e.height+d*2);if(k.position.indexOf("c")!=-1){c-=e.width/2+d}else{if(k.position.indexOf("l")!=-1){c-=e.width}}if(k.position.indexOf("m")!=-1){g-=e.height/2+d}else{if(k.position.indexOf("t")!=-1){g-=e.height+k.verticalMargin}else{g+=k.verticalMargin}}c=Math.floor(c)+0.5;g=Math.floor(g)+0.5;if(k.fill){b.fillRect(c,g,e.width,e.height)}if(k.stroke){b.strokeRect(c,g,e.width,e.height)}if(a(h)){b.drawImage(h,parseInt(c+d,10),parseInt(g+d,10))}else{Flotr.drawText(b,h,c+d,g+d,{textBaseline:"top",textAlign:"left",size:k.fontSize,color:k.color})}}});function a(b){return typeof b==="object"&&b.constructor&&(Image?true:b.constructor===Image)}})();(function(){var a=Flotr._;Flotr.defaultPieLabelFormatter=function(b,c){return(100*c/b).toFixed(2)+"%"};Flotr.addType("pie",{options:{show:false,lineWidth:1,fill:true,fillColor:null,fillOpacity:0.6,explode:6,sizeRatio:0.6,startAngle:Math.PI/4,labelFormatter:Flotr.defaultPieLabelFormatter,pie3D:false,pie3DviewAngle:(Math.PI/2*0.8),pie3DspliceThickness:20,epsilon:0.1},draw:function(e){var H=e.data,c=e.context,b=e.lineWidth,m=e.shadowSize,j=e.sizeRatio,s=e.height,u=e.width,z=e.explode,A=e.color,C=e.fill,h=e.fillStyle,f=Math.min(u,s)*j/2,w=H[0][1],o=[],D=1,d=Math.PI*2*w/this.total,B=this.startAngle||(2*Math.PI*e.startAngle),t=B+d,G=B+d/2,k=e.labelFormatter(this.total,w),v=z+f+4,r=Math.cos(G)*v,q=Math.sin(G)*v,g=r<0?"right":"left",F=q>0?"top":"bottom",E,n,l;c.save();c.translate(u/2,s/2);c.scale(1,D);n=Math.cos(G)*z;l=Math.sin(G)*z;if(m>0){this.plotSlice(n+m,l+m,f,B,t,c);if(C){c.fillStyle="rgba(0,0,0,0.1)";c.fill()}}this.plotSlice(n,l,f,B,t,c);if(C){c.fillStyle=h;c.fill()}c.lineWidth=b;c.strokeStyle=A;c.stroke();E={size:e.fontSize*1.2,color:e.fontColor,weight:1.5};if(k){if(e.htmlText||!e.textEnabled){divStyle="position:absolute;"+F+":"+(s/2+(F==="top"?q:-q))+"px;";divStyle+=g+":"+(u/2+(g==="right"?-r:r))+"px;";o.push('<div style="',divStyle,'" class="flotr-grid-label">',k,"</div>")}else{E.textAlign=g;E.textBaseline=F;Flotr.drawText(c,k,r,q,E)}}if(e.htmlText||!e.textEnabled){var p=Flotr.DOM.node('<div style="color:'+e.fontColor+'" class="flotr-labels"></div>');Flotr.DOM.insert(p,o.join(""));Flotr.DOM.insert(e.element,p)}c.restore();this.startAngle=t;this.slices=this.slices||[];this.slices.push({radius:f,x:n,y:l,explode:z,start:B,end:t})},plotSlice:function(c,g,b,f,d,e){e.beginPath();e.moveTo(c,g);e.arc(c,g,b,f,d,false);e.lineTo(c,g);e.closePath()},hit:function(t){var h=t.data[0],l=t.args,j=t.index,k=l[0],f=l[1],q=this.slices[j],p=k.relX-t.width/2,o=k.relY-t.height/2,b=Math.sqrt(p*p+o*o),e=Math.atan(o/p),c=Math.PI*2,m=q.explode||t.explode,d=q.start%c,g=q.end%c,s=t.epsilon;if(p<0){e+=Math.PI}else{if(p>0&&o<0){e+=c}}if(b<q.radius+m&&b>m){if((e>d&&e<g)||(d>g&&(e<g||e>d))||(d===g&&((q.start===q.end&&Math.abs(e-d)<s)||(q.start!==q.end&&Math.abs(e-d)>s)))){f.x=h[0];f.y=h[1];f.sAngle=d;f.eAngle=g;f.index=0;f.seriesIndex=j;f.fraction=h[1]/this.total}}},drawHit:function(b){var c=b.context,d=this.slices[b.args.seriesIndex];c.save();c.translate(b.width/2,b.height/2);this.plotSlice(d.x,d.y,d.radius,d.start,d.end,c);c.stroke();c.restore()},clearHit:function(c){var d=c.context,f=this.slices[c.args.seriesIndex],e=2*c.lineWidth,b=f.radius+e;d.save();d.translate(c.width/2,c.height/2);d.clearRect(f.x-b,f.y-b,2*b+e,2*b+e);d.restore()},extendYRange:function(b,c){this.total=(this.total||0)+c[0][1]}})})();Flotr.addType("points",{options:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#FFFFFF",fillOpacity:1,hitRadius:null},draw:function(b){var c=b.context,a=b.lineWidth,d=b.shadowSize;c.save();if(d>0){c.lineWidth=d/2;c.strokeStyle="rgba(0,0,0,0.1)";this.plot(b,d/2+c.lineWidth/2);c.strokeStyle="rgba(0,0,0,0.2)";this.plot(b,c.lineWidth/2)}c.lineWidth=b.lineWidth;c.strokeStyle=b.color;if(b.fill){c.fillStyle=b.fillStyle}this.plot(b);c.restore()},plot:function(j,c){var d=j.data,a=j.context,h=j.xScale,b=j.yScale,e,g,f;for(e=d.length-1;e>-1;--e){f=d[e][1];if(f===null){continue}g=h(d[e][0]);f=b(f);if(g<0||g>j.width||f<0||f>j.height){continue}a.beginPath();if(c){a.arc(g,f+c,j.radius,0,Math.PI,false)}else{a.arc(g,f,j.radius,0,2*Math.PI,true);if(j.fill){a.fill()}}a.stroke();a.closePath()}}});Flotr.addType("radar",{options:{show:false,lineWidth:2,fill:true,fillOpacity:0.4,radiusRatio:0.9,sensibility:2},draw:function(a){var b=a.context,c=a.shadowSize;b.save();b.translate(a.width/2,a.height/2);b.lineWidth=a.lineWidth;b.fillStyle="rgba(0,0,0,0.05)";b.strokeStyle="rgba(0,0,0,0.05)";this.plot(a,c/2);b.strokeStyle="rgba(0,0,0,0.1)";this.plot(a,c/4);b.strokeStyle=a.color;b.fillStyle=a.fillStyle;this.plot(a);b.restore()},plot:function(j,d){var e=j.data,a=j.context,g=Math.min(j.height,j.width)*j.radiusRatio/2,b=2*Math.PI/e.length,c=-Math.PI/2,f,h;d=d||0;a.beginPath();for(f=0;f<e.length;++f){h=e[f][1]/this.max;a[f===0?"moveTo":"lineTo"](Math.cos(f*b+c)*g*h+d,Math.sin(f*b+c)*g*h+d)}a.closePath();if(j.fill){a.fill()}a.stroke()},getGeometry:function(b,c){var a=Math.min(c.height,c.width)*c.radiusRatio/2,e=2*Math.PI/c.data.length,f=-Math.PI/2,d=b[1]/this.max;return{x:(Math.cos(b[0]*e+f)*a*d)+c.width/2,y:(Math.sin(b[0]*e+f)*a*d)+c.height/2}},hit:function(q){var h=q.args,g=h[0],b=h[1],m=g.relX,l=g.relY,a,k,p,o;for(var e=0;e<b.series.length;e++){var f=b.series[e];var d=f.data;for(var c=d.length;c--;){k=this.getGeometry(d[c],q);p=k.x-m;o=k.y-l;a=Math.sqrt(p*p+o*o);if(a<q.sensibility*2){b.x=d[c][0];b.y=d[c][1];b.index=c;b.seriesIndex=e;return b}}}},drawHit:function(m){var c=2*Math.PI/m.data.length;var d=-Math.PI/2;var f=Math.min(m.height,m.width)*m.radiusRatio/2;var l=m.args.series;var a=l.points.hitRadius||l.points.radius||l.mouse.radius;var b=m.context;b.translate(m.width/2,m.height/2);var e=m.args.index;var g=m.data[e][1]/this.max;var k=Math.cos(e*c+d)*f*g;var h=Math.sin(e*c+d)*f*g;b.beginPath();b.arc(k,h,a,0,2*Math.PI,true);b.closePath();b.stroke()},clearHit:function(m){var b=2*Math.PI/m.data.length;var d=-Math.PI/2;var f=Math.min(m.height,m.width)*m.radiusRatio/2;var a=m.context;var l=m.args.series,c=(l.points?l.points.lineWidth:1);offset=(l.points.hitRadius||l.points.radius||l.mouse.radius)+c;a.translate(m.width/2,m.height/2);var e=m.args.index;var g=m.data[e][1]/this.max;var k=Math.cos(e*b+d)*f*g;var h=Math.sin(e*b+d)*f*g;a.clearRect(k-offset,h-offset,offset*2,offset*2)},extendYRange:function(a,b){this.max=Math.max(a.max,this.max||-Number.MAX_VALUE)}});Flotr.addType("timeline",{options:{show:false,lineWidth:1,barWidth:0.2,fill:true,fillColor:null,fillOpacity:0.4,centered:true},draw:function(a){var b=a.context;b.save();b.lineJoin="miter";b.lineWidth=a.lineWidth;b.strokeStyle=a.color;b.fillStyle=a.fillStyle;this.plot(a);b.restore()},plot:function(b){var h=b.data,d=b.context,g=b.xScale,f=b.yScale,e=b.barWidth,a=b.lineWidth,c;Flotr._.each(h,function(t){var p=t[0],n=t[1],r=t[2],l=e,k=Math.ceil(g(p)),m=Math.ceil(g(p+r))-k,s=Math.round(f(n)),o=Math.round(f(n-l))-s,j=k-a/2,q=Math.round(s-o/2)-a/2;d.strokeRect(j,q,m,o);d.fillRect(j,q,m,o)})},extendRange:function(d){var e=d.data,f=d.xaxis,c=d.yaxis,b=d.timeline.barWidth;if(f.options.min===null){f.min=f.datamin-b/2}if(f.options.max===null){var a=f.max;Flotr._.each(e,function(g){a=Math.max(a,g[0]+g[2])},this);f.max=a+b/2}if(c.options.min===null){c.min=c.datamin-b}if(c.options.min===null){c.max=c.datamax+b}}});(function(){var a=Flotr.DOM;Flotr.addPlugin("crosshair",{options:{mode:null,color:"#FF0000",hideCursor:true},callbacks:{"flotr:mousemove":function(b,c){if(this.options.crosshair.mode){this.crosshair.clearCrosshair();this.crosshair.drawCrosshair(c)}}},drawCrosshair:function(g){var e=this.octx,d=this.options.crosshair,c=this.plotOffset,b=c.left+Math.round(g.relX)+0.5,f=c.top+Math.round(g.relY)+0.5;if(g.relX<0||g.relY<0||g.relX>this.plotWidth||g.relY>this.plotHeight){this.el.style.cursor=null;a.removeClass(this.el,"flotr-crosshair");return}if(d.hideCursor){this.el.style.cursor="none";a.addClass(this.el,"flotr-crosshair")}e.save();e.strokeStyle=d.color;e.lineWidth=1;e.beginPath();if(d.mode.indexOf("x")!=-1){e.moveTo(b,c.top);e.lineTo(b,c.top+this.plotHeight)}if(d.mode.indexOf("y")!=-1){e.moveTo(c.left,f);e.lineTo(c.left+this.plotWidth,f)}e.stroke();e.restore()},clearCrosshair:function(){var c=this.plotOffset,b=this.lastMousePos,d=this.octx;if(b){d.clearRect(Math.round(b.relX)+c.left,c.top,1,this.plotHeight+1);d.clearRect(c.left,Math.round(b.relY)+c.top,this.plotWidth+1,1)}}})})();(function(){var c=Flotr.DOM,b=Flotr._;function a(l,h,g,f,m,e){var d="image/"+l,k=g.getImageData(0,0,f,m),j=new Image();g.save();g.globalCompositeOperation="destination-over";g.fillStyle=e;g.fillRect(0,0,f,m);j.src=h.toDataURL(d);g.restore();g.clearRect(0,0,f,m);g.putImageData(k,0,0);return j}Flotr.addPlugin("download",{saveImage:function(h,g,d,e){var f=this.options.grid,j;if(Flotr.isIE&&Flotr.isIE<9){j="<html><body>"+this.canvas.firstChild.innerHTML+"</body></html>";return window.open().document.write(j)}if(h!=="jpeg"&&h!=="png"){return}j=a(h,this.canvas,this.ctx,this.canvasWidth,this.canvasHeight,f&&f.backgroundColor||"#ffffff");if(b.isElement(j)&&e){this.download.restoreCanvas();c.hide(this.canvas);c.hide(this.overlay);c.setStyles({position:"absolute"});c.insert(this.el,j);this.saveImageElement=j}else{return window.open(j.src)}},restoreCanvas:function(){c.show(this.canvas);c.show(this.overlay);if(this.saveImageElement){this.el.removeChild(this.saveImageElement)}this.saveImageElement=null}})})();(function(){var b=Flotr.EventAdapter,a=Flotr._;Flotr.addPlugin("graphGrid",{callbacks:{"flotr:beforedraw":function(){this.graphGrid.drawGrid()},"flotr:afterdraw":function(){this.graphGrid.drawOutline()}},drawGrid:function(){var p=this.ctx,e=this.options,c=e.grid,h=c.verticalLines,z=c.horizontalLines,o=c.minorVerticalLines,w=c.minorHorizontalLines,r=this.plotHeight,g=this.plotWidth,A,k,s,q;if(h||o||z||w){b.fire(this.el,"flotr:beforegrid",[this.axes.x,this.axes.y,e,this])}p.save();p.lineWidth=1;p.strokeStyle=c.tickColor;function n(v){for(s=0;s<v.length;++s){var j=v[s].v/A.max;for(q=0;q<=u;++q){p[q===0?"moveTo":"lineTo"](Math.cos(q*d+t)*f*j,Math.sin(q*d+t)*f*j)}}}function l(j,v){a.each(a.pluck(j,"v"),function(C){if((C<=A.min||C>=A.max)||(C==A.min||C==A.max)&&c.outlineWidth){return}v(Math.floor(A.d2p(C))+p.lineWidth/2)})}function m(j){p.moveTo(j,0);p.lineTo(j,r)}function B(j){p.moveTo(0,j);p.lineTo(g,j)}if(c.circular){p.translate(this.plotOffset.left+g/2,this.plotOffset.top+r/2);var f=Math.min(r,g)*e.radar.radiusRatio/2,u=this.axes.x.ticks.length,d=2*(Math.PI/u),t=-Math.PI/2;p.beginPath();A=this.axes.y;if(z){n(A.ticks)}if(w){n(A.minorTicks)}if(h){a.times(u,function(j){p.moveTo(0,0);p.lineTo(Math.cos(j*d+t)*f,Math.sin(j*d+t)*f)})}p.stroke()}else{p.translate(this.plotOffset.left,this.plotOffset.top);if(c.backgroundColor){p.fillStyle=this.processColor(c.backgroundColor,{x1:0,y1:0,x2:g,y2:r});p.fillRect(0,0,g,r)}p.beginPath();A=this.axes.x;if(h){l(A.ticks,m)}if(o){l(A.minorTicks,m)}A=this.axes.y;if(z){l(A.ticks,B)}if(w){l(A.minorTicks,B)}p.stroke()}p.restore();if(h||o||z||w){b.fire(this.el,"flotr:aftergrid",[this.axes.x,this.axes.y,e,this])}},drawOutline:function(){var o=this,g=o.options,c=g.grid,l=c.outline,w=o.ctx,e=c.backgroundImage,p=o.plotOffset,q=p.left,z=p.top,m=o.plotWidth,A=o.plotHeight,r,E,n,j,u,B;if(!c.outlineWidth){return}w.save();if(c.circular){w.translate(q+m/2,z+A/2);var h=Math.min(A,m)*g.radar.radiusRatio/2,D=this.axes.x.ticks.length,d=2*(Math.PI/D),C=-Math.PI/2;w.beginPath();w.lineWidth=c.outlineWidth;w.strokeStyle=c.color;w.lineJoin="round";for(i=0;i<=D;++i){w[i===0?"moveTo":"lineTo"](Math.cos(i*d+C)*h,Math.sin(i*d+C)*h)}w.stroke()}else{w.translate(q,z);var k=c.outlineWidth,f=0.5-k+((k+1)%2/2),s="lineTo",t="moveTo";w.lineWidth=k;w.strokeStyle=c.color;w.lineJoin="miter";w.beginPath();w.moveTo(f,f);m=m-(k/2)%1;A=A+k/2;w[l.indexOf("n")!==-1?s:t](m,f);w[l.indexOf("e")!==-1?s:t](m,A);w[l.indexOf("s")!==-1?s:t](f,A);w[l.indexOf("w")!==-1?s:t](f,f);w.stroke();w.closePath()}w.restore();if(e){n=e.src||e;j=(parseInt(e.left,10)||0)+p.left;u=(parseInt(e.top,10)||0)+p.top;E=new Image();E.onload=function(){w.save();if(e.alpha){w.globalAlpha=e.alpha}w.globalCompositeOperation="destination-over";w.drawImage(E,0,0,E.width,E.height,j,u,m,A);w.restore()};E.src=n}}})})();(function(){var d=Flotr.DOM,b=Flotr._,c=Flotr,a="opacity:0.7;background-color:#000;color:#fff;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;";Flotr.addPlugin("hit",{callbacks:{"flotr:mousemove":function(f,g){this.hit.track(g)},"flotr:click":function(f){var e=this.hit.track(f);if(e&&!b.isUndefined(e.index)){f.hit=e}},"flotr:mouseout":function(f){if(f.relatedTarget!==this.mouseTrack){this.hit.clearHit()}},"flotr:destroy":function(){if(this.options.mouse.container){d.remove(this.mouseTrack)}this.mouseTrack=null}},track:function(e){if(this.options.mouse.track||b.any(this.series,function(f){return f.mouse&&f.mouse.track})){return this.hit.hit(e)}},executeOnType:function(h,l,g){var k=false,f;if(!b.isArray(h)){h=[h]}function j(m,e){b.each(b.keys(c.graphTypes),function(n){if(m[n]&&m[n].show&&!m.hide&&this[n][l]){f=this.getOptions(m,n);f.fill=!!m.mouse.fillColor;f.fillStyle=this.processColor(m.mouse.fillColor||"#ffffff",{opacity:m.mouse.fillOpacity});f.color=m.mouse.lineColor;f.context=this.octx;f.index=e;if(g){f.args=g}this[n][l].call(this[n],f);k=true}},this)}b.each(h,j,this);return k},drawHit:function(j){var g=this.octx,f=j.series;if(f.mouse.lineColor){g.save();g.lineWidth=(f.points?f.points.lineWidth:1);g.strokeStyle=f.mouse.lineColor;g.fillStyle=this.processColor(f.mouse.fillColor||"#ffffff",{opacity:f.mouse.fillOpacity});g.translate(this.plotOffset.left,this.plotOffset.top);if(!this.hit.executeOnType(f,"drawHit",j)){var h=j.xaxis,e=j.yaxis;g.beginPath();g.arc(h.d2p(j.x),e.d2p(j.y),f.points.hitRadius||f.points.radius||f.mouse.radius,0,2*Math.PI,true);g.fill();g.stroke();g.closePath()}g.restore();this.clip(g)}this.prevHit=j},clearHit:function(){var g=this.prevHit,j=this.octx,e=this.plotOffset;j.save();j.translate(e.left,e.top);if(g){if(!this.hit.executeOnType(g.series,"clearHit",this.prevHit)){var f=g.series,h=(f.points?f.points.lineWidth:1);offset=(f.points.hitRadius||f.points.radius||f.mouse.radius)+h;j.clearRect(g.xaxis.d2p(g.x)-offset,g.yaxis.d2p(g.y)-offset,offset*2,offset*2)}d.hide(this.mouseTrack);this.prevHit=null}j.restore()},hit:function(l){var r=this.options,f=this.prevHit,e,h,o,j,k,q,p,m,g;if(this.series.length===0){return}g={relX:l.relX,relY:l.relY,absX:l.absX,absY:l.absY,series:this.series};if(r.mouse.trackY&&!r.mouse.trackAll&&this.hit.executeOnType(this.series,"hit",[l,g])&&!b.isUndefined(g.seriesIndex)){k=this.series[g.seriesIndex];g.series=k;g.mouse=k.mouse;g.xaxis=k.xaxis;g.yaxis=k.yaxis}else{e=this.hit.closest(l);if(e){e=r.mouse.trackY?e.point:e.x;j=e.seriesIndex;k=this.series[j];p=k.xaxis;m=k.yaxis;h=2*k.mouse.sensibility;if(r.mouse.trackAll||(e.distanceX<h/p.scale&&(!r.mouse.trackY||e.distanceY<h/m.scale))){g.series=k;g.xaxis=k.xaxis;g.yaxis=k.yaxis;g.mouse=k.mouse;g.x=e.x;g.y=e.y;g.dist=e.distance;g.index=e.dataIndex;g.seriesIndex=j}}}if(!f||(f.index!==g.index||f.seriesIndex!==g.seriesIndex)){this.hit.clearHit();if(g.series&&g.mouse&&g.mouse.track){this.hit.drawMouseTrack(g);this.hit.drawHit(g);Flotr.EventAdapter.fire(this.el,"flotr:hit",[g,this])}}return g},closest:function(q){var p=this.series,f=this.options,v=q.relX,t=q.relY,D=Number.MAX_VALUE,h=Number.MAX_VALUE,r={},k={},B=false,s,C,g,A,z,m,l,o,n,w,u;function e(j){j.distance=g;j.distanceX=A;j.distanceY=z;j.seriesIndex=w;j.dataIndex=u;j.x=o;j.y=n;B=true}for(w=0;w<p.length;w++){s=p[w];C=s.data;m=s.xaxis.p2d(v);l=s.yaxis.p2d(t);if(s.hide){continue}for(u=C.length;u--;){o=C[u][0];n=C[u][1];if(C[u].y0){n+=C[u].y0}if(o===null||n===null){continue}if(o<s.xaxis.min||o>s.xaxis.max){continue}A=Math.abs(o-m);z=Math.abs(n-l);g=A*A+z*z;if(g<D){D=g;e(r)}if(A<h){h=A;e(k)}}}return B?{point:r,x:k}:false},drawMouseTrack:function(A){var j="",u=A.series,z=A.mouse.position,B=A.mouse.margin,q=A.x,o=A.y,E=a,D=this.mouseTrack,r=this.plotOffset,g=r.left,G=r.right,k=r.bottom,v=r.top,J=A.mouse.trackDecimals,e=this.options,t=e.mouse.container,l=0,I=0,h,w,C;if(!D){D=d.node('<div class="flotr-mouse-value" style="'+E+'"></div>');this.mouseTrack=D;d.insert(t||this.el,D)}if(!J||J<0){J=0}if(q&&q.toFixed){q=q.toFixed(J)}if(o&&o.toFixed){o=o.toFixed(J)}C=A.mouse.trackFormatter({x:q,y:o,series:A.series,index:A.index,nearest:A,fraction:A.fraction});if(b.isNull(C)||b.isUndefined(C)){d.hide(D);return}else{D.innerHTML=C;d.show(D)}if(!z){return}w=d.size(D);if(t){h=d.position(this.el);l=h.top;I=h.left}if(!A.mouse.relative){j+="top:";if(z.charAt(0)=="n"){j+=(l+B+v)}else{if(z.charAt(0)=="s"){j+=(l-B+v+this.plotHeight-w.height)}}j+="px;bottom:auto;left:";if(z.charAt(1)=="e"){j+=(I-B+g+this.plotWidth-w.width)}else{if(z.charAt(1)=="w"){j+=(I+B+g)}}j+="px;right:auto;"}else{if(u.pie&&u.pie.show){var H={x:(this.plotWidth)/2,y:(this.plotHeight)/2},f=(Math.min(this.canvasWidth,this.canvasHeight)*u.pie.sizeRatio)/2,F=A.sAngle<A.eAngle?(A.sAngle+A.eAngle)/2:(A.sAngle+A.eAngle+2*Math.PI)/2;j+="bottom:"+(B-v-H.y-Math.sin(F)*f/2+this.canvasHeight)+"px;top:auto;";j+="left:"+(B+g+H.x+Math.cos(F)*f/2)+"px;right:auto;"}else{j+="top:";if(/n/.test(z)){j+=(l-B+v+A.yaxis.d2p(A.y)-w.height)}else{j+=(l+B+v+A.yaxis.d2p(A.y))}j+="px;bottom:auto;left:";if(/w/.test(z)){j+=(I-B+g+A.xaxis.d2p(A.x)-w.width)}else{j+=(I+B+g+A.xaxis.d2p(A.x))}j+="px;right:auto;"}}D.style.cssText=E+j;if(A.mouse.relative){if(!/[ew]/.test(z)){D.style.left=(I+g+A.xaxis.d2p(A.x)-d.size(D).width/2)+"px"}else{if(!/[ns]/.test(z)){D.style.top=(l+v+A.yaxis.d2p(A.y)-d.size(D).height/2)+"px"}}}}})})();(function(){function b(h,g){return(h.which?(h.which===1):(h.button===0||h.button===1))}function a(g,h){return Math.min(Math.max(0,g),h.plotWidth-1)}function f(h,g){return Math.min(Math.max(0,h),g.plotHeight)}var e=Flotr.DOM,d=Flotr.EventAdapter,c=Flotr._;Flotr.addPlugin("selection",{options:{pinchOnly:null,mode:null,color:"#B6D9FF",fps:20},callbacks:{"flotr:mouseup":function(j){var g=this.options.selection,h=this.selection,k=this.getEventPosition(j);if(!g||!g.mode){return}if(h.interval){clearInterval(h.interval)}if(this.multitouches){h.updateSelection()}else{if(!g.pinchOnly){h.setSelectionPos(h.selection.second,k)}}h.clearSelection();if(h.selecting&&h.selectionIsSane()){h.drawSelection();h.fireSelectEvent();this.ignoreClick=true}},"flotr:mousedown":function(j){var g=this.options.selection,h=this.selection,k=this.getEventPosition(j);if(!g||!g.mode){return}if(!g.mode||(!b(j)&&c.isUndefined(j.touches))){return}if(!g.pinchOnly){h.setSelectionPos(h.selection.first,k)}if(h.interval){clearInterval(h.interval)}this.lastMousePos.pageX=null;h.selecting=false;h.interval=setInterval(c.bind(h.updateSelection,this),1000/g.fps)},"flotr:destroy":function(g){clearInterval(this.selection.interval)}},getArea:function(){var n=this.selection.selection,g=this.axes,o=n.first,k=n.second,j,h,m,l;j=g.x.p2d(n.first.x);h=g.x.p2d(n.second.x);m=g.y.p2d(n.first.y);l=g.y.p2d(n.second.y);return{x1:Math.min(j,h),y1:Math.min(m,l),x2:Math.max(j,h),y2:Math.max(m,l),xfirst:j,xsecond:h,yfirst:m,ysecond:l}},selection:{first:{x:-1,y:-1},second:{x:-1,y:-1}},prevSelection:null,interval:null,fireSelectEvent:function(g){var h=this.selection.getArea();g=g||"select";h.selection=this.selection.selection;d.fire(this.el,"flotr:"+g,[h,this])},setSelection:function(h,n){var q=this.options,g=this.axes.x,m=this.axes.y,j=m.scale,o=g.scale,l=q.selection.mode.indexOf("x")!=-1,k=q.selection.mode.indexOf("y")!=-1,p=this.selection.selection;this.selection.clearSelection();p.first.y=f((l&&!k)?0:(m.max-h.y1)*j,this);p.second.y=f((l&&!k)?this.plotHeight-1:(m.max-h.y2)*j,this);p.first.x=a((k&&!l)?0:(h.x1-g.min)*o,this);p.second.x=a((k&&!l)?this.plotWidth:(h.x2-g.min)*o,this);this.selection.drawSelection();if(!n){this.selection.fireSelectEvent()}},setSelectionPos:function(k,j){var h=this.options.selection.mode,g=this.selection.selection;if(h.indexOf("x")==-1){k.x=(k==g.first)?0:this.plotWidth}else{k.x=a(j.relX,this)}if(h.indexOf("y")==-1){k.y=(k==g.first)?0:this.plotHeight-1}else{k.y=f(j.relY,this)}},drawSelection:function(){this.selection.fireSelectEvent("selecting");var p=this.selection.selection,o=this.octx,q=this.options,g=this.plotOffset,k=this.selection.prevSelection;if(k&&p.first.x==k.first.x&&p.first.y==k.first.y&&p.second.x==k.second.x&&p.second.y==k.second.y){return}o.save();o.strokeStyle=this.processColor(q.selection.color,{opacity:0.8});o.lineWidth=1;o.lineJoin="miter";o.fillStyle=this.processColor(q.selection.color,{opacity:0.4});this.selection.prevSelection={first:{x:p.first.x,y:p.first.y},second:{x:p.second.x,y:p.second.y}};var m=Math.min(p.first.x,p.second.x),l=Math.min(p.first.y,p.second.y),n=Math.abs(p.second.x-p.first.x),j=Math.abs(p.second.y-p.first.y);o.fillRect(m+g.left+0.5,l+g.top+0.5,n,j);o.strokeRect(m+g.left+0.5,l+g.top+0.5,n,j);o.restore()},updateSelection:function(){if(!this.lastMousePos.pageX){return}this.selection.selecting=true;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}else{this.selection.setSelectionPos(this.selection.selection.second,this.lastMousePos)}}this.selection.clearSelection();if(this.selection.selectionIsSane()){this.selection.drawSelection()}},clearSelection:function(){if(!this.selection.prevSelection){return}var o=this.selection.prevSelection,m=1,k=this.plotOffset,g=Math.min(o.first.x,o.second.x),n=Math.min(o.first.y,o.second.y),j=Math.abs(o.second.x-o.first.x),l=Math.abs(o.second.y-o.first.y);this.octx.clearRect(g+k.left-m+0.5,n+k.top-m,j+2*m+0.5,l+2*m+0.5);this.selection.prevSelection=null},selectionIsSane:function(){var g=this.selection.selection;return Math.abs(g.second.x-g.first.x)>=5||Math.abs(g.second.y-g.first.y)>=5}})})();(function(){var a=Flotr.DOM;Flotr.addPlugin("labels",{callbacks:{"flotr:afterdraw":function(){this.labels.draw()}},draw:function(){var d,r,g,m,o,f,u,b,t,k,q,j="",c=0,e=this.options,p=this.ctx,v=this.axes,s={size:e.fontSize};for(q=0;q<v.x.ticks.length;++q){if(v.x.ticks[q].label){++c}}o=this.plotWidth/c;if(e.grid.circular){p.save();p.translate(this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+this.plotHeight/2);f=this.plotHeight*e.radar.radiusRatio/2+e.fontSize;u=this.axes.x.ticks.length;b=2*(Math.PI/u);t=-Math.PI/2;h(this,v.x,false);h(this,v.x,true);h(this,v.y,false);h(this,v.y,true);p.restore()}if(!e.HtmlText&&this.textEnabled){n(this,v.x,"center","top");n(this,v.x2,"center","bottom");n(this,v.y,"right","middle");n(this,v.y2,"left","middle")}else{if((v.x.options.showLabels||v.x2.options.showLabels||v.y.options.showLabels||v.y2.options.showLabels)&&!e.grid.circular){j="";l(this,v.x);l(this,v.x2);l(this,v.y);l(this,v.y2);p.stroke();p.restore();k=a.create("div");a.setStyles(k,{fontSize:"smaller",color:e.grid.color});k.className="flotr-labels";a.insert(this.el,k);a.insert(k,j)}}function h(E,B,z){var C=z?B.minorTicks:B.ticks,D=B.orientation===1,w=B.n===1,A,F;A={color:B.options.color||e.grid.color,angle:Flotr.toRad(B.options.labelsAngle),textBaseline:"middle"};for(q=0;q<C.length&&(z?B.options.showMinorLabels:B.options.showLabels);++q){r=C[q];r.label+="";if(!r.label||!r.label.length){continue}x=Math.cos(q*b+t)*f;y=Math.sin(q*b+t)*f;A.textAlign=D?(Math.abs(x)<0.1?"center":(x<0?"right":"left")):"left";Flotr.drawText(p,r.label,D?x:3,D?y:-(B.ticks[q].v/B.max)*(f-e.fontSize),A)}}function n(H,C,B,A){var I=C.orientation===1,E=C.n===1,w,D;w={color:C.options.color||e.grid.color,textAlign:B,textBaseline:A,angle:Flotr.toRad(C.options.labelsAngle)};w=Flotr.getBestTextAlign(w.angle,w);for(q=0;q<C.ticks.length&&G(C);++q){r=C.ticks[q];if(!r.label||!r.label.length){continue}D=C.d2p(r.v);if(D<0||D>(I?H.plotWidth:H.plotHeight)){continue}Flotr.drawText(p,r.label,z(H,I,E,D),F(H,I,E,D),w);if(!I&&!E){p.save();p.strokeStyle=w.color;p.beginPath();p.moveTo(H.plotOffset.left+H.plotWidth-8,H.plotOffset.top+C.d2p(r.v));p.lineTo(H.plotOffset.left+H.plotWidth,H.plotOffset.top+C.d2p(r.v));p.stroke();p.restore()}}function G(J){return J.options.showLabels&&J.used}function z(L,K,J,M){return L.plotOffset.left+(K?M:(J?-e.grid.labelMargin:e.grid.labelMargin+L.plotWidth))}function F(L,K,J,M){return L.plotOffset.top+(K?e.grid.labelMargin:M)+((K&&J)?L.plotHeight:0)}}function l(F,B){var G=B.orientation===1,D=B.n===1,z="",A,w,E,C=F.plotOffset;if(!G&&!D){p.save();p.strokeStyle=B.options.color||e.grid.color;p.beginPath()}if(B.options.showLabels&&(D?true:B.used)){for(q=0;q<B.ticks.length;++q){r=B.ticks[q];if(!r.label||!r.label.length||((G?C.left:C.top)+B.d2p(r.v)<0)||((G?C.left:C.top)+B.d2p(r.v)>(G?F.canvasWidth:F.canvasHeight))){continue}E=C.top+(G?((D?1:-1)*(F.plotHeight+e.grid.labelMargin)):B.d2p(r.v)-B.maxLabel.height/2);A=G?(C.left+B.d2p(r.v)-o/2):0;z="";if(q===0){z=" first"}else{if(q===B.ticks.length-1){z=" last"}}z+=G?" flotr-grid-label-x":" flotr-grid-label-y";j+=['<div style="position:absolute; text-align:'+(G?"center":"right")+"; ","top:"+E+"px; ",((!G&&!D)?"right:":"left:")+A+"px; ","width:"+(G?o:((D?C.left:C.right)-e.grid.labelMargin))+"px; ",B.options.color?("color:"+B.options.color+"; "):" ",'" class="flotr-grid-label'+z+'">'+r.label+"</div>"].join(" ");if(!G&&!D){p.moveTo(C.left+F.plotWidth-8,C.top+B.d2p(r.v));p.lineTo(C.left+F.plotWidth,C.top+B.d2p(r.v))}}}}}})})();(function(){var b=Flotr.DOM,a=Flotr._;Flotr.addPlugin("legend",{options:{show:true,noColumns:1,labelFormatter:function(c){return c},labelBoxBorderColor:"#CCCCCC",labelBoxWidth:14,labelBoxHeight:10,labelBoxMargin:5,container:null,position:"nw",margin:5,backgroundColor:"#F0F0F0",backgroundOpacity:0.85},callbacks:{"flotr:afterinit":function(){this.legend.insertLegend()},"flotr:destroy":function(){var c=this.legend.markup;if(c){this.legend.markup=null;b.remove(c)}}},insertLegend:function(){if(!this.options.legend.show){return}var r=this.series,t=this.plotOffset,g=this.options,d=g.legend,P=[],e=false,D=this.ctx,L=a.filter(r,function(c){return(c.label&&!c.hide)}).length,B=d.position,C=d.margin,f=d.backgroundOpacity,F,k,E;if(L){var z=d.labelBoxWidth,O=d.labelBoxHeight,H=d.labelBoxMargin,K=t.left+C,I=t.top+C,N=0,G={size:g.fontSize*1.1,color:g.grid.color};for(F=r.length-1;F>-1;--F){if(!r[F].label||r[F].hide){continue}k=d.labelFormatter(r[F].label);N=Math.max(N,this._text.measureText(k,G).width)}var w=Math.round(z+H*3+N),h=Math.round(L*(H+O)+H);if(!f&&f!==0){f=0.1}if(!g.HtmlText&&this.textEnabled&&!d.container){if(B.charAt(0)=="s"){I=t.top+this.plotHeight-(C+h)}if(B.charAt(0)=="c"){I=t.top+(this.plotHeight/2)-(C+(h/2))}if(B.charAt(1)=="e"){K=t.left+this.plotWidth-(C+w)}E=this.processColor(d.backgroundColor,{opacity:f});D.fillStyle=E;D.fillRect(K,I,w,h);D.strokeStyle=d.labelBoxBorderColor;D.strokeRect(Flotr.toPixel(K),Flotr.toPixel(I),w,h);var q=K+H;var o=I+H;for(F=0;F<r.length;F++){if(!r[F].label||r[F].hide){continue}k=d.labelFormatter(r[F].label);D.fillStyle=r[F].color;D.fillRect(q,o,z-1,O-1);D.strokeStyle=d.labelBoxBorderColor;D.lineWidth=1;D.strokeRect(Math.ceil(q)-1.5,Math.ceil(o)-1.5,z+2,O+2);Flotr.drawText(D,k,q+z+H,o+O,G);o+=O+H}}else{for(F=0;F<r.length;++F){if(!r[F].label||r[F].hide){continue}if(F%d.noColumns===0){P.push(e?"</tr><tr>":"<tr>");e=true}var v=r[F],n=d.labelBoxWidth,j=d.labelBoxHeight;k=d.labelFormatter(v.label);E="background-color:"+((v.bars&&v.bars.show&&v.bars.fillColor&&v.bars.fill)?v.bars.fillColor:v.color)+";";P.push('<td class="flotr-legend-color-box">','<div style="border:1px solid ',d.labelBoxBorderColor,';padding:1px">','<div style="width:',(n-1),"px;height:",(j-1),"px;border:1px solid ",r[F].color,'">','<div style="width:',n,"px;height:",j,"px;",E,'"></div>',"</div>","</div>","</td>",'<td class="flotr-legend-label">',k,"</td>")}if(e){P.push("</tr>")}if(P.length>0){var J='<table style="font-size:smaller;color:'+g.grid.color+'">'+P.join("")+"</table>";if(d.container){J=b.node(J);this.legend.markup=J;b.insert(d.container,J)}else{var l={position:"absolute",zIndex:"2",border:"1px solid "+d.labelBoxBorderColor};if(B.charAt(0)=="n"){l.top=(C+t.top)+"px";l.bottom="auto"}else{if(B.charAt(0)=="c"){l.top=(C+(this.plotHeight-h)/2)+"px";l.bottom="auto"}else{if(B.charAt(0)=="s"){l.bottom=(C+t.bottom)+"px";l.top="auto"}}}if(B.charAt(1)=="e"){l.right=(C+t.right)+"px";l.left="auto"}else{if(B.charAt(1)=="w"){l.left=(C+t.left)+"px";l.right="auto"}}var u=b.create("div"),A;u.className="flotr-legend";b.setStyles(u,l);b.insert(u,J);b.insert(this.el,u);if(!f){return}var M=d.backgroundColor||g.grid.backgroundColor||"#ffffff";a.extend(l,b.size(u),{backgroundColor:M,zIndex:"",border:""});l.width+="px";l.height+="px";u=b.create("div");u.className="flotr-legend-bg";b.setStyles(u,l);b.opacity(u,f);b.insert(u," ");b.insert(this.el,u)}}}}}})})();(function(){function b(e){if(this.options.spreadsheet.tickFormatter){return this.options.spreadsheet.tickFormatter(e)}else{var d=a.find(this.axes.x.ticks,function(f){return f.v==e});if(d){return d.label}return e}}var c=Flotr.DOM,a=Flotr._;Flotr.addPlugin("spreadsheet",{options:{show:false,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){return}var e=this.spreadsheet,d=c.node('<div class="flotr-tabs-group" style="position:absolute;left:0px;width:'+this.canvasWidth+'px"></div>'),g=c.node('<div style="float:left" class="flotr-tab selected">'+this.options.spreadsheet.tabGraphLabel+"</div>"),f=c.node('<div style="float:left" class="flotr-tab">'+this.options.spreadsheet.tabDataLabel+"</div>"),h;e.tabsContainer=d;e.tabs={graph:g,data:f};c.insert(d,g);c.insert(d,f);c.insert(this.el,d);h=c.size(f).height+2;this.plotOffset.bottom+=h;c.setStyles(d,{top:this.canvasHeight-h+"px"});this.observe(g,"click",function(){e.showTab("graph")}).observe(f,"click",function(){e.showTab("data")});if(this.options.spreadsheet.initialTab!=="graph"){e.showTab(this.options.spreadsheet.initialTab)}}},loadDataGrid:function(){if(this.seriesData){return this.seriesData}var d=this.series,e={};a.each(d,function(g,f){a.each(g.data,function(j){var h=j[0],m=j[1],l=e[h];if(l){l[f+1]=m}else{var k=[];k[0]=h;k[f+1]=m;e[h]=k}})});this.seriesData=a.sortBy(e,function(g,f){return parseInt(f,10)});return this.seriesData},constructDataGrid:function(){if(this.spreadsheet.datagrid){return this.spreadsheet.datagrid}var n=this.series,k=this.spreadsheet.loadDataGrid(),e=["<colgroup><col />"],h,g,l;var f=['<table class="flotr-datagrid"><tr class="first-row">'];f.push("<th>&nbsp;</th>");a.each(n,function(p,o){f.push('<th scope="col">'+(p.label||String.fromCharCode(65+o))+"</th>");e.push("<col />")});f.push("</tr>");a.each(k,function(o){f.push("<tr>");a.times(n.length+1,function(r){var p="td",t=o[r],s=(!a.isUndefined(t)?Math.round(t*100000)/100000:"");if(r===0){p="th";var q=b.call(this,s);if(q){s=q}}f.push("<"+p+(p=="th"?' scope="row"':"")+">"+s+"</"+p+">")},this);f.push("</tr>")},this);e.push("</colgroup>");l=c.node(f.join(""));h=c.node('<button type="button" class="flotr-datagrid-toolbar-button">'+this.options.spreadsheet.toolbarDownload+"</button>");g=c.node('<button type="button" class="flotr-datagrid-toolbar-button">'+this.options.spreadsheet.toolbarSelectAll+"</button>");this.observe(h,"click",a.bind(this.spreadsheet.downloadCSV,this)).observe(g,"click",a.bind(this.spreadsheet.selectAllData,this));var j=c.node('<div class="flotr-datagrid-toolbar"></div>');c.insert(j,h);c.insert(j,g);var m=this.canvasHeight-c.size(this.spreadsheet.tabsContainer).height-2,d=c.node('<div class="flotr-datagrid-container" style="position:absolute;left:0px;top:0px;width:'+this.canvasWidth+"px;height:"+m+'px;overflow:auto;z-index:10"></div>');c.insert(d,j);c.insert(d,l);c.insert(this.el,d);this.spreadsheet.datagrid=l;this.spreadsheet.container=d;return l},showTab:function(d){if(this.spreadsheet.activeTab===d){return}switch(d){case"graph":c.hide(this.spreadsheet.container);c.removeClass(this.spreadsheet.tabs.data,"selected");c.addClass(this.spreadsheet.tabs.graph,"selected");break;case"data":if(!this.spreadsheet.datagrid){this.spreadsheet.constructDataGrid()}c.show(this.spreadsheet.container);c.addClass(this.spreadsheet.tabs.data,"selected");c.removeClass(this.spreadsheet.tabs.graph,"selected");break;default:throw"Illegal tab name: "+d}this.spreadsheet.activeTab=d},selectAllData:function(){if(this.spreadsheet.tabs){var e,d,h,g,f=this.spreadsheet.constructDataGrid();this.spreadsheet.showTab("data");setTimeout(function(){if((h=f.ownerDocument)&&(g=h.defaultView)&&g.getSelection&&h.createRange&&(e=window.getSelection())&&e.removeAllRanges){d=h.createRange();d.selectNode(f);e.removeAllRanges();e.addRange(d)}else{if(document.body&&document.body.createTextRange&&(d=document.body.createTextRange())){d.moveToElementText(f);d.select()}}},0);return true}else{return false}},downloadCSV:function(){var d="",f=this.series,e=this.options,h=this.spreadsheet.loadDataGrid(),g=encodeURIComponent(e.spreadsheet.csvFileSeparator);if(e.spreadsheet.decimalSeparator===e.spreadsheet.csvFileSeparator){throw"The decimal separator is the same as the column separator ("+e.spreadsheet.decimalSeparator+")"}a.each(f,function(k,j){d+=g+'"'+(k.label||String.fromCharCode(65+j)).replace(/\"/g,'\\"')+'"'});d+="%0D%0A";d+=a.reduce(h,function(k,l){var m=b.call(this,l[0])||"";m='"'+(m+"").replace(/\"/g,'\\"')+'"';var j=l.slice(1).join(g);if(e.spreadsheet.decimalSeparator!=="."){j=j.replace(/\./g,e.spreadsheet.decimalSeparator)}return k+m+g+j+"%0D%0A"},"",this);if(Flotr.isIE&&Flotr.isIE<9){d=d.replace(new RegExp(g,"g"),decodeURIComponent(g)).replace(/%0A/g,"\n").replace(/%0D/g,"\r");window.open().document.write(d)}else{window.open("data:text/csv,"+d)}}})})();(function(){var a=Flotr.DOM;Flotr.addPlugin("titles",{callbacks:{"flotr:afterdraw":function(){this.titles.drawTitles()}},drawTitles:function(){var e,d=this.options,g=d.grid.labelMargin,c=this.ctx,b=this.axes;if(!d.HtmlText&&this.textEnabled){var f={size:d.fontSize,color:d.grid.color,textAlign:"center"};if(d.subtitle){Flotr.drawText(c,d.subtitle,this.plotOffset.left+this.plotWidth/2,this.titleHeight+this.subtitleHeight-2,f)}f.weight=1.5;f.size*=1.5;if(d.title){Flotr.drawText(c,d.title,this.plotOffset.left+this.plotWidth/2,this.titleHeight-2,f)}f.weight=1.8;f.size*=0.8;if(b.x.options.title&&b.x.used){f.textAlign=b.x.options.titleAlign||"center";f.textBaseline="top";f.angle=Flotr.toRad(b.x.options.titleAngle);f=Flotr.getBestTextAlign(f.angle,f);Flotr.drawText(c,b.x.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+b.x.maxLabel.height+this.plotHeight+2*g,f)}if(b.x2.options.title&&b.x2.used){f.textAlign=b.x2.options.titleAlign||"center";f.textBaseline="bottom";f.angle=Flotr.toRad(b.x2.options.titleAngle);f=Flotr.getBestTextAlign(f.angle,f);Flotr.drawText(c,b.x2.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top-b.x2.maxLabel.height-2*g,f)}if(b.y.options.title&&b.y.used){f.textAlign=b.y.options.titleAlign||"right";f.textBaseline="middle";f.angle=Flotr.toRad(b.y.options.titleAngle);f=Flotr.getBestTextAlign(f.angle,f);Flotr.drawText(c,b.y.options.title,this.plotOffset.left-b.y.maxLabel.width-2*g,this.plotOffset.top+this.plotHeight/2,f)}if(b.y2.options.title&&b.y2.used){f.textAlign=b.y2.options.titleAlign||"left";f.textBaseline="middle";f.angle=Flotr.toRad(b.y2.options.titleAngle);f=Flotr.getBestTextAlign(f.angle,f);Flotr.drawText(c,b.y2.options.title,this.plotOffset.left+this.plotWidth+b.y2.maxLabel.width+2*g,this.plotOffset.top+this.plotHeight/2,f)}}else{e=[];if(d.title){e.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">',d.title,"</div>")}if(d.subtitle){e.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">',d.subtitle,"</div>")}e.push("</div>");e.push('<div class="flotr-axis-title" style="font-weight:bold;">');if(b.x.options.title&&b.x.used){e.push('<div style="position:absolute;top:',(this.plotOffset.top+this.plotHeight+d.grid.labelMargin+b.x.titleSize.height),"px;left:",this.plotOffset.left,"px;width:",this.plotWidth,"px;text-align:",b.x.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-x1">',b.x.options.title,"</div>")}if(b.x2.options.title&&b.x2.used){e.push('<div style="position:absolute;top:0;left:',this.plotOffset.left,"px;width:",this.plotWidth,"px;text-align:",b.x2.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-x2">',b.x2.options.title,"</div>")}if(b.y.options.title&&b.y.used){e.push('<div style="position:absolute;top:',(this.plotOffset.top+this.plotHeight/2-b.y.titleSize.height/2),"px;left:0;text-align:",b.y.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-y1">',b.y.options.title,"</div>")}if(b.y2.options.title&&b.y2.used){e.push('<div style="position:absolute;top:',(this.plotOffset.top+this.plotHeight/2-b.y.titleSize.height/2),"px;right:0;text-align:",b.y2.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-y2">',b.y2.options.title,"</div>")}e=e.join("");var h=a.create("div");a.setStyles({color:d.grid.color});h.className="flotr-titles";a.insert(this.el,h);a.insert(h,e)}}})})();