flot.bundle.js 99.7 KB
!function(n){n.color={},n.color.make=function(t,e,i,o){var a={};return a.r=t||0,a.g=e||0,a.b=i||0,a.a=null!=o?o:1,a.add=function(t,e){for(var i=0;i<t.length;++i)a[t.charAt(i)]+=e;return a.normalize()},a.scale=function(t,e){for(var i=0;i<t.length;++i)a[t.charAt(i)]*=e;return a.normalize()},a.toString=function(){return 1<=a.a?"rgb("+[a.r,a.g,a.b].join(",")+")":"rgba("+[a.r,a.g,a.b,a.a].join(",")+")"},a.normalize=function(){function t(t,e,i){return e<t?t:i<e?i:e}return a.r=t(0,parseInt(a.r),255),a.g=t(0,parseInt(a.g),255),a.b=t(0,parseInt(a.b),255),a.a=t(0,a.a,1),a},a.clone=function(){return n.color.make(a.r,a.b,a.g,a.a)},a.normalize()},n.color.extract=function(t,e){for(var i;(""==(i=t.css(e).toLowerCase())||"transparent"==i)&&(t=t.parent()).length&&!n.nodeName(t.get(0),"body"););return n.color.parse(i="rgba(0, 0, 0, 0)"==i?"transparent":i)},n.color.parse=function(t){var e,i=n.color.make;return(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(t))?i(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)):(e=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(t))?i(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4])):(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(t))?i(2.55*parseFloat(e[1]),2.55*parseFloat(e[2]),2.55*parseFloat(e[3])):(e=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(t))?i(2.55*parseFloat(e[1]),2.55*parseFloat(e[2]),2.55*parseFloat(e[3]),parseFloat(e[4])):(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(t))?i(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):(e=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(t))?i(parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)):"transparent"==(t=n.trim(t).toLowerCase())?i(255,255,255,0):i((e=o[t]||[0,0,0])[0],e[1],e[2])};var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function($){var d=Object.prototype.hasOwnProperty;function Z(t,e){var i=e.children("."+t)[0];if(null==i&&((i=document.createElement("canvas")).className=t,$(i).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(e),!i.getContext)){if(!window.G_vmlCanvasManager)throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");i=window.G_vmlCanvasManager.initElement(i)}this.element=i;t=this.context=i.getContext("2d"),i=window.devicePixelRatio||1,t=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;this.pixelRatio=i/t,this.resize(e.width(),e.height()),this.textContainer=null,this.text={},this._textCache={}}function o(k,C,t,e){var R=[],q={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},S=null,l=null,c=null,y=null,h=null,U=[],j=[],w={left:0,right:0,top:0,bottom:0},M=0,T=0,E={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},z=this;z.setData=p,z.setupGrid=A,z.draw=W,z.getPlaceholder=function(){return k},z.getCanvas=function(){return S.element},z.getPlotOffset=function(){return w},z.width=function(){return M},z.height=function(){return T},z.offset=function(){var t=c.offset();return t.left+=w.left,t.top+=w.top,t},z.getData=function(){return R},z.getAxes=function(){var i={};return $.each(U.concat(j),function(t,e){e&&(i[e.direction+(1!=e.n?e.n:"")+"axis"]=e)}),i},z.getXAxes=function(){return U},z.getYAxes=function(){return j},z.c2p=d,z.p2c=function(t){var e,i,o,a={};for(e=0;e<U.length;++e)if((i=U[e])&&i.used&&(o="x"+i.n,null==t[o]&&1==i.n&&(o="x"),null!=t[o])){a.left=i.p2c(t[o]);break}for(e=0;e<j.length;++e)if((i=j[e])&&i.used&&(o="y"+i.n,null==t[o]&&1==i.n&&(o="y"),null!=t[o])){a.top=i.p2c(t[o]);break}return a},z.getOptions=function(){return q},z.highlight=G,z.unhighlight=Q,z.triggerRedrawOverlay=v,z.pointOffset=function(t){return{left:parseInt(U[B(t,"x")-1].p2c(+t.x)+w.left,10),top:parseInt(j[B(t,"y")-1].p2c(+t.y)+w.top,10)}},z.shutdown=f,z.destroy=function(){f(),k.removeData("plot").empty(),R=[],U=[],j=[],g=[],z=E=h=y=c=l=S=q=null},z.resize=function(){var t=k.width(),e=k.height();S.resize(t,e),l.resize(t,e)},z.hooks=E;for(var L={Canvas:Z},i=0;i<e.length;++i){var o=e[i];o.init(z,L),o.options&&$.extend(!0,q,o.options)}$.extend(!0,q,t),t&&t.colors&&(q.colors=t.colors),null==q.xaxis.color&&(q.xaxis.color=$.color.parse(q.grid.color).scale("a",.22).toString()),null==q.yaxis.color&&(q.yaxis.color=$.color.parse(q.grid.color).scale("a",.22).toString()),null==q.xaxis.tickColor&&(q.xaxis.tickColor=q.grid.tickColor||q.xaxis.color),null==q.yaxis.tickColor&&(q.yaxis.tickColor=q.grid.tickColor||q.yaxis.color),null==q.grid.borderColor&&(q.grid.borderColor=q.grid.color),null==q.grid.tickColor&&(q.grid.tickColor=$.color.parse(q.grid.color).scale("a",.22).toString());var a,n,r,s,t=(t=k.css("font-size"))?+t.replace("px",""):13,u={style:k.css("font-style"),size:Math.round(.8*t),variant:k.css("font-variant"),weight:k.css("font-weight"),family:k.css("font-family")};for(r=q.xaxes.length||1,a=0;a<r;++a)(n=q.xaxes[a])&&!n.tickColor&&(n.tickColor=n.color),n=$.extend(!0,{},q.xaxis,n),(q.xaxes[a]=n).font&&(n.font=$.extend({},u,n.font),n.font.color||(n.font.color=n.color),n.font.lineHeight||(n.font.lineHeight=Math.round(1.15*n.font.size)));for(r=q.yaxes.length||1,a=0;a<r;++a)(n=q.yaxes[a])&&!n.tickColor&&(n.tickColor=n.color),n=$.extend(!0,{},q.yaxis,n),(q.yaxes[a]=n).font&&(n.font=$.extend({},u,n.font),n.font.color||(n.font.color=n.color),n.font.lineHeight||(n.font.lineHeight=Math.round(1.15*n.font.size)));for(q.xaxis.noTicks&&null==q.xaxis.ticks&&(q.xaxis.ticks=q.xaxis.noTicks),q.yaxis.noTicks&&null==q.yaxis.ticks&&(q.yaxis.ticks=q.yaxis.noTicks),q.x2axis&&(q.xaxes[1]=$.extend(!0,{},q.xaxis,q.x2axis),q.xaxes[1].position="top",null==q.x2axis.min&&(q.xaxes[1].min=null),null==q.x2axis.max)&&(q.xaxes[1].max=null),q.y2axis&&(q.yaxes[1]=$.extend(!0,{},q.yaxis,q.y2axis),q.yaxes[1].position="right",null==q.y2axis.min&&(q.yaxes[1].min=null),null==q.y2axis.max)&&(q.yaxes[1].max=null),q.grid.coloredAreas&&(q.grid.markings=q.grid.coloredAreas),q.grid.coloredAreasColor&&(q.grid.markingsColor=q.grid.coloredAreasColor),q.lines&&$.extend(!0,q.series.lines,q.lines),q.points&&$.extend(!0,q.series.points,q.points),q.bars&&$.extend(!0,q.series.bars,q.bars),null!=q.shadowSize&&(q.series.shadowSize=q.shadowSize),null!=q.highlightColor&&(q.series.highlightColor=q.highlightColor),a=0;a<q.xaxes.length;++a)V(U,a+1).options=q.xaxes[a];for(a=0;a<q.yaxes.length;++a)V(j,a+1).options=q.yaxes[a];for(s in E)q.hooks[s]&&q.hooks[s].length&&(E[s]=E[s].concat(q.hooks[s]));Y(E.processOptions,[q]),k.css("padding",0).children().filter(function(){return!$(this).hasClass("flot-overlay")&&!$(this).hasClass("flot-base")}).remove(),"static"==k.css("position")&&k.css("position","relative"),S=new Z("flot-base",k),l=new Z("flot-overlay",k),y=S.context,h=l.context,c=$(l.element).unbind();t=k.data("plot");function Y(t,e){e=[z].concat(e);for(var i=0;i<t.length;++i)t[i].apply(this,e)}function p(N){var t,e=(R=function(t){for(var e=[],i=0;i<t.length;++i){var o=$.extend(!0,{},q.series);null!=t[i].data?(o.data=t[i].data,delete t[i].data,$.extend(!0,o,t[i]),t[i].data=o.data):o.data=t[i],e.push(o)}return e}(N)).length,i=-1;for(t=0;t<R.length;++t){var o=R[t].color;null!=o&&(e--,"number"==typeof o)&&i<o&&(i=o)}e<=i&&(e=i+1);var a,n=[],r=q.colors,s=r.length,l=0;for(t=0;t<e;t++)a=$.color.parse(r[t%s]||"#666"),t%s==0&&t&&(l=0<=l?l<.5?-l-.2:0:-l),n[t]=a.scale("rgb",1+l);var h,c=0;for(t=0;t<R.length;++t){if(null==(h=R[t]).color?(h.color=n[c].toString(),++c):"number"==typeof h.color&&(h.color=n[h.color].toString()),null==h.lines.show){var u,p=!0;for(u in h)if(h[u]&&h[u].show){p=!1;break}p&&(h.lines.show=!0)}null==h.lines.zero&&(h.lines.zero=!!h.lines.fill),h.xaxis=V(U,B(h,"x")),h.yaxis=V(j,B(h,"y"))}var d,f,m,g,x,b,v,y,k,w,M,T,S,z,C=Number.POSITIVE_INFINITY,L=Number.NEGATIVE_INFINITY,A=Number.MAX_VALUE;function W(t,e,i){e<t.datamin&&e!=-A&&(t.datamin=e),i>t.datamax&&i!=A&&(t.datamax=i)}for($.each(X(),function(t,e){e.datamin=C,e.datamax=L,e.used=!1}),d=0;d<R.length;++d)(x=R[d]).datapoints={points:[]},Y(E.processRawData,[x,x.data,x.datapoints]);for(d=0;d<R.length;++d)if(x=R[d],M=x.data,(T=x.datapoints.format)||((T=[]).push({x:!0,number:!0,required:!0}),T.push({y:!0,number:!0,required:!0}),(x.bars.show||x.lines.show&&x.lines.fill)&&(z=!!(x.bars.show&&x.bars.zero||x.lines.show&&x.lines.zero),T.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:z}),x.bars.horizontal)&&(delete T[T.length-1].y,T[T.length-1].x=!0),x.datapoints.format=T),null==x.datapoints.pointsize){x.datapoints.pointsize=T.length,v=x.datapoints.pointsize,b=x.datapoints.points;var H=x.lines.show&&x.lines.steps;for(x.xaxis.used=x.yaxis.used=!0,f=m=0;f<M.length;++f,m+=v){var F=null==(w=M[f]);if(!F)for(g=0;g<v;++g)y=w[g],(k=T[g])&&(k.number&&null!=y&&(y=+y,isNaN(y)?y=null:y==1/0?y=A:y==-1/0&&(y=-A)),null==y)&&(k.required&&(F=!0),null!=k.defaultValue)&&(y=k.defaultValue),b[m+g]=y;if(F)for(g=0;g<v;++g)null!=(y=b[m+g])&&!1!==(k=T[g]).autoscale&&(k.x&&W(x.xaxis,y,y),k.y)&&W(x.yaxis,y,y),b[m+g]=null;else if(H&&0<m&&null!=b[m-v]&&b[m-v]!=b[m]&&b[m-v+1]!=b[m+1]){for(g=0;g<v;++g)b[m+v+g]=b[m+g];b[m+1]=b[m-v+1],m+=v}}}for(d=0;d<R.length;++d)x=R[d],Y(E.processDatapoints,[x,x.datapoints]);for(d=0;d<R.length;++d){x=R[d],b=x.datapoints.points,v=x.datapoints.pointsize,T=x.datapoints.format;var P=C,I=C,D=L,O=L;for(f=0;f<b.length;f+=v)if(null!=b[f])for(g=0;g<v;++g)y=b[f+g],(k=T[g])&&!1!==k.autoscale&&y!=A&&y!=-A&&(k.x&&(y<P&&(P=y),D<y)&&(D=y),k.y)&&(y<I&&(I=y),O<y)&&(O=y);if(x.bars.show){switch(x.bars.align){case"left":S=0;break;case"right":S=-x.bars.barWidth;break;default:S=-x.bars.barWidth/2}x.bars.horizontal?(I+=S,O+=S+x.bars.barWidth):(P+=S,D+=S+x.bars.barWidth)}W(x.xaxis,P,D),W(x.yaxis,I,O)}$.each(X(),function(t,e){e.datamin==C&&(e.datamin=null),e.datamax==L&&(e.datamax=null)})}function B(t,e){t=t[e+"axis"];return t="number"!=typeof(t="object"==typeof t?t.n:t)?1:t}function X(){return $.grep(U.concat(j),function(t){return t})}function d(t){for(var e,i={},o=0;o<U.length;++o)(e=U[o])&&e.used&&(i["x"+e.n]=e.c2p(t.left));for(o=0;o<j.length;++o)(e=j[o])&&e.used&&(i["y"+e.n]=e.c2p(t.top));return void 0!==i.x1&&(i.x=i.x1),void 0!==i.y1&&(i.y=i.y1),i}function V(t,e){return t[e-1]||(t[e-1]={n:e,direction:t==U?"x":"y",options:$.extend(!0,{},t==U?q.xaxis:q.yaxis)}),t[e-1]}function f(){x&&clearTimeout(x),c.unbind("mousemove",D),c.unbind("mouseleave",O),c.unbind("click",N),Y(E.shutdown,[c])}function A(){var t,e,i=X(),o=q.grid.show;for(e in w){var a=q.grid.margin||0;w[e]="number"==typeof a?a:a[e]||0}for(e in Y(E.processOffset,[w]),w)"object"==typeof q.grid.borderWidth?w[e]+=o?q.grid.borderWidth[e]:0:w[e]+=o?q.grid.borderWidth:0;if($.each(i,function(t,e){var i,o=e.options,o=(e.show=null==o.show?e.used:o.show,e.reserveSpace=null==o.reserveSpace?e.show:o.reserveSpace,e),e=o.options,a=+(null!=e.min?e.min:o.datamin),n=+(null!=e.max?e.max:o.datamax),r=n-a;0==r?(i=0==n?1:.01,null==e.min&&(a-=i),null!=e.max&&null==e.min||(n+=i)):null!=(i=e.autoscaleMargin)&&(null==e.min&&(a-=r*i)<0&&null!=o.datamin&&0<=o.datamin&&(a=0),null==e.max)&&0<(n+=r*i)&&null!=o.datamax&&o.datamax<=0&&(n=0),o.min=a,o.max=n}),o){var n=$.grep(i,function(t){return t.show||t.reserveSpace});for($.each(n,function(t,e){var i=e,o=i.options,a=(a="number"==typeof o.ticks&&0<o.ticks?o.ticks:.3*Math.sqrt("x"==i.direction?S.width:S.height),(i.max-i.min)/a),n=-Math.floor(Math.log(a)/Math.LN10),r=o.tickDecimals;null!=r&&r<n&&(n=r);var s,l=Math.pow(10,-n),h=a/l;if(h<1.5?p=1:h<3?(p=2,2.25<h&&(null==r||n+1<=r)&&(p=2.5,++n)):p=h<7.5?5:10,p*=l,null!=o.minTickSize&&p<o.minTickSize&&(p=o.minTickSize),i.delta=a,i.tickDecimals=Math.max(0,null!=r?r:n),i.tickSize=o.tickSize||p,"time"==o.mode&&!i.tickGenerator)throw new Error("Time mode requires the flot.time plugin.");i.tickGenerator||(i.tickGenerator=function(t){for(var e,i,o,a=[],n=(i=t.min,(o=t.tickSize)*Math.floor(i/o)),r=0,s=Number.NaN;e=s,s=n+r*t.tickSize,a.push(s),++r,s<t.max&&s!=e;);return a},i.tickFormatter=function(t,e){var i=e.tickDecimals?Math.pow(10,e.tickDecimals):1,t=""+Math.round(t*i)/i;if(null!=e.tickDecimals){var o=t.indexOf("."),o=-1==o?0:t.length-o-1;if(o<e.tickDecimals)return(o?t:t+".")+(""+i).substr(1,e.tickDecimals-o)}return t}),$.isFunction(o.tickFormatter)&&(i.tickFormatter=function(t,e){return""+o.tickFormatter(t,e)}),null!=o.alignTicksWithAxis&&(s=("x"==i.direction?U:j)[o.alignTicksWithAxis-1])&&s.used&&s!=i&&(0<(h=i.tickGenerator(i)).length&&(null==o.min&&(i.min=Math.min(i.min,h[0])),null==o.max)&&1<h.length&&(i.max=Math.max(i.max,h[h.length-1])),i.tickGenerator=function(t){for(var e,i=[],o=0;o<s.ticks.length;++o)e=(s.ticks[o].v-s.min)/(s.max-s.min),e=t.min+e*(t.max-t.min),i.push(e);return i},i.mode||null!=o.tickDecimals||(l=Math.max(0,1-Math.floor(Math.log(i.delta)/Math.LN10)),1<(a=i.tickGenerator(i)).length&&/\..*0$/.test((a[1]-a[0]).toFixed(l)))||(i.tickDecimals=l));var c,u,p,d=e,r=d.options.ticks,f=[];for(null==r||"number"==typeof r&&0<r?f=d.tickGenerator(d):r&&(f=$.isFunction(r)?r(d):r),d.ticks=[],c=0;c<f.length;++c){var m=null,g=f[c];"object"==typeof g?(u=+g[0],1<g.length&&(m=g[1])):u=+g,null==m&&(m=d.tickFormatter(u,d)),isNaN(u)||d.ticks.push({v:u,label:m})}p=(n=e).ticks,n.options.autoscaleMargin&&0<p.length&&(null==n.options.min&&(n.min=Math.min(n.min,p[0].v)),null==n.options.max)&&1<p.length&&(n.max=Math.max(n.max,p[p.length-1].v));for(var h=e,a=h.options,x=h.ticks||[],b=a.labelWidth||0,v=a.labelHeight||0,y=b||("x"==h.direction?Math.floor(S.width/(x.length||1)):null),i=h.direction+"Axis "+h.direction+h.n+"Axis",k="flot-"+h.direction+"-axis flot-"+h.direction+h.n+"-axis "+i,w=a.font||"flot-tick-label tickLabel",M=0;M<x.length;++M){var T=x[M];T.label&&(T=S.getTextInfo(k,T.label,w,null,y),b=Math.max(b,T.width),v=Math.max(v,T.height))}h.labelWidth=a.labelWidth||b,h.labelHeight=a.labelHeight||v}),t=n.length-1;0<=t;--t)!function(i){var t=i.labelWidth,e=i.labelHeight,o=i.options.position,a="x"===i.direction,n=i.options.tickLength,r=q.grid.axisMargin,s=q.grid.labelMargin,l=!0,h=!0,c=!0,u=!1;$.each(a?U:j,function(t,e){e&&(e.show||e.reserveSpace)&&(e===i?u=!0:e.options.position===o&&(u?h=!1:l=!1),u||(c=!1))}),h&&(r=0),null==n&&(n=c?"full":5),isNaN(+n)||(s+=+n),a?(e+=s,"bottom"==o?(w.bottom+=e+r,i.box={top:S.height-w.bottom,height:e}):(i.box={top:w.top+r,height:e},w.top+=e+r)):(t+=s,"left"==o?(i.box={left:w.left+r,width:t},w.left+=t+r):(w.right+=t+r,i.box={left:S.width-w.right,width:t})),i.position=o,i.tickLength=n,i.box.padding=s,i.innermost=l}(n[t]);var r,s=q.grid.minBorderMargin;if(null==s)for(r=s=0;r<R.length;++r)s=Math.max(s,2*(R[r].points.radius+R[r].points.lineWidth/2));var l={left:s,right:s,top:s,bottom:s};$.each(X(),function(t,e){e.reserveSpace&&e.ticks&&e.ticks.length&&("x"===e.direction?(l.left=Math.max(l.left,e.labelWidth/2),l.right=Math.max(l.right,e.labelWidth/2)):(l.bottom=Math.max(l.bottom,e.labelHeight/2),l.top=Math.max(l.top,e.labelHeight/2)))}),w.left=Math.ceil(Math.max(l.left,w.left)),w.right=Math.ceil(Math.max(l.right,w.right)),w.top=Math.ceil(Math.max(l.top,w.top)),w.bottom=Math.ceil(Math.max(l.bottom,w.bottom)),$.each(n,function(t,e){"x"==(e=e).direction?(e.box.left=w.left-e.labelWidth/2,e.box.width=S.width-w.left-w.right+e.labelWidth):(e.box.top=w.top-e.labelHeight/2,e.box.height=S.height-w.bottom-w.top+e.labelHeight)})}if(M=S.width-w.left-w.right,T=S.height-w.bottom-w.top,$.each(i,function(t,e){function i(t){return t}var o,a,n,r;a=(e=e).options.transform||i,n=e.options.inverseTransform,r="x"==e.direction?(o=e.scale=M/Math.abs(a(e.max)-a(e.min)),Math.min(a(e.max),a(e.min))):(o=-(o=e.scale=T/Math.abs(a(e.max)-a(e.min))),Math.max(a(e.max),a(e.min))),e.p2c=a==i?function(t){return(t-r)*o}:function(t){return(a(t)-r)*o},e.c2p=n?function(t){return n(r+t/o)}:function(t){return r+t/o}}),o&&$.each(X(),function(t,e){var i,o,a,n,r,s=e.box,l=e.direction+"Axis "+e.direction+e.n+"Axis",h="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+l,c=e.options.font||"flot-tick-label tickLabel";if(S.removeText(h),e.show&&0!=e.ticks.length)for(var u=0;u<e.ticks.length;++u)!(i=e.ticks[u]).label||i.v<e.min||i.v>e.max||("x"==e.direction?(n="center",o=w.left+e.p2c(i.v),"bottom"==e.position?a=s.top+s.padding:(a=s.top+s.height-s.padding,r="bottom")):(r="middle",a=w.top+e.p2c(i.v),"left"==e.position?(o=s.left+s.width-s.padding,n="right"):o=s.left+s.padding),S.addText(h,o,a,i.label,c,null,null,n,r))}),null!=q.legend.container?$(q.legend.container).html(""):k.find(".legend").remove(),q.legend.show){for(var h,c,u,p=[],d=[],f=!1,m=q.legend.labelFormatter,g=0;g<R.length;++g)(h=R[g]).label&&(c=m?m(h.label,h):h.label)&&d.push({label:c,color:h.color});q.legend.sorted&&($.isFunction(q.legend.sorted)?d.sort(q.legend.sorted):"reverse"==q.legend.sorted?d.reverse():(u="descending"!=q.legend.sorted,d.sort(function(t,e){return t.label==e.label?0:t.label<e.label!=u?1:-1})));for(var x,b,v,g=0;g<d.length;++g){var y=d[g];g%q.legend.noColumns==0&&(f&&p.push("</tr>"),p.push("<tr>"),f=!0),p.push('<td class="legendColorBox"><div style="border:1px solid '+q.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+y.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+y.label+"</td>")}f&&p.push("</tr>"),0!=p.length&&(i='<table style="font-size:smaller;color:'+q.grid.color+'">'+p.join("")+"</table>",null!=q.legend.container?$(q.legend.container).html(i):(x="",b=q.legend.position,null==(v=q.legend.margin)[0]&&(v=[v,v]),"n"==b.charAt(0)?x+="top:"+(v[1]+w.top)+"px;":"s"==b.charAt(0)&&(x+="bottom:"+(v[1]+w.bottom)+"px;"),"e"==b.charAt(1)?x+="right:"+(v[0]+w.right)+"px;":"w"==b.charAt(1)&&(x+="left:"+(v[0]+w.left)+"px;"),b=$('<div class="legend">'+i.replace('style="','style="position:absolute;'+x+";")+"</div>").appendTo(k),0!=q.legend.backgroundOpacity&&(null==(v=q.legend.backgroundColor)&&((v=(v=q.grid.backgroundColor)&&"string"==typeof v?$.color.parse(v):$.color.extract(b,"background-color")).a=1,v=v.toString()),i=b.children(),$('<div style="position:absolute;width:'+i.width()+"px;height:"+i.height()+"px;"+x+"background-color:"+v+';"> </div>').prependTo(b).css("opacity",q.legend.backgroundOpacity))))}}function W(){S.clear(),Y(E.drawBackground,[y]);var t=q.grid;t.show&&t.backgroundColor&&(y.save(),y.translate(w.left,w.top),y.fillStyle=J(q.grid.backgroundColor,T,0,"rgba(255, 255, 255, 0)"),y.fillRect(0,0,M,T),y.restore()),t.show&&!t.aboveData&&P();for(var e=0;e<R.length;++e){Y(E.drawSeries,[y,R[e]]),i=void 0;var i=R[e];if(i.lines.show){o=void 0;n=void 0;r=void 0;s=void 0;var o=i;var a=function(t,e,i,o,a){var n=t.points,r=t.pointsize,s=null,l=null;y.beginPath();for(var h=r;h<n.length;h+=r){var c=n[h-r],u=n[h-r+1],p=n[h],d=n[h+1];if(null!=c&&null!=p){if(u<=d&&u<a.min){if(d<a.min)continue;c=(a.min-u)/(d-u)*(p-c)+c,u=a.min}else if(d<=u&&d<a.min){if(u<a.min)continue;p=(a.min-u)/(d-u)*(p-c)+c,d=a.min}if(d<=u&&u>a.max){if(d>a.max)continue;c=(a.max-u)/(d-u)*(p-c)+c,u=a.max}else if(u<=d&&d>a.max){if(u>a.max)continue;p=(a.max-u)/(d-u)*(p-c)+c,d=a.max}if(c<=p&&c<o.min){if(p<o.min)continue;u=(o.min-c)/(p-c)*(d-u)+u,c=o.min}else if(p<=c&&p<o.min){if(c<o.min)continue;d=(o.min-c)/(p-c)*(d-u)+u,p=o.min}if(p<=c&&c>o.max){if(p>o.max)continue;u=(o.max-c)/(p-c)*(d-u)+u,c=o.max}else if(c<=p&&p>o.max){if(c>o.max)continue;d=(o.max-c)/(p-c)*(d-u)+u,p=o.max}c==s&&u==l||y.moveTo(o.p2c(c)+e,a.p2c(u)+i),s=p,l=d,y.lineTo(o.p2c(p)+e,a.p2c(d)+i)}}y.stroke()};y.save(),y.translate(w.left,w.top),y.lineJoin="round";var n=o.lines.lineWidth,r=o.shadowSize;0<n&&0<r&&(y.lineWidth=r,y.strokeStyle="rgba(0,0,0,0.1)",s=Math.PI/18,a(o.datapoints,Math.sin(s)*(n/2+r/2),Math.cos(s)*(n/2+r/2),o.xaxis,o.yaxis),y.lineWidth=r/2,a(o.datapoints,Math.sin(s)*(n/2+r/4),Math.cos(s)*(n/2+r/4),o.xaxis,o.yaxis));y.lineWidth=n,y.strokeStyle=o.color;var s=m(o.lines,o.color,0,T);s&&(y.fillStyle=s,function(t,e,i){for(var o=t.points,a=t.pointsize,n=Math.min(Math.max(0,i.min),i.max),r=0,s=!1,l=1,h=0,c=0;!(0<a&&r>o.length+a);){var u,p,d=o[(r+=a)-a],f=o[r-a+l],m=o[r],g=o[r+l];if(s){if(0<a&&null!=d&&null==m){c=r,a=-a,l=2;continue}if(a<0&&r==h+a){y.fill(),s=!1,l=1,r=h=c+(a=-a);continue}}if(null!=d&&null!=m){if(d<=m&&d<e.min){if(m<e.min)continue;f=(e.min-d)/(m-d)*(g-f)+f,d=e.min}else if(m<=d&&m<e.min){if(d<e.min)continue;g=(e.min-d)/(m-d)*(g-f)+f,m=e.min}if(m<=d&&d>e.max){if(m>e.max)continue;f=(e.max-d)/(m-d)*(g-f)+f,d=e.max}else if(d<=m&&m>e.max){if(d>e.max)continue;g=(e.max-d)/(m-d)*(g-f)+f,m=e.max}s||(y.beginPath(),y.moveTo(e.p2c(d),i.p2c(n)),s=!0),f>=i.max&&g>=i.max?(y.lineTo(e.p2c(d),i.p2c(i.max)),y.lineTo(e.p2c(m),i.p2c(i.max))):f<=i.min&&g<=i.min?(y.lineTo(e.p2c(d),i.p2c(i.min)),y.lineTo(e.p2c(m),i.p2c(i.min))):(u=d,p=m,f<=g&&f<i.min&&g>=i.min?(d=(i.min-f)/(g-f)*(m-d)+d,f=i.min):g<=f&&g<i.min&&f>=i.min&&(m=(i.min-f)/(g-f)*(m-d)+d,g=i.min),g<=f&&f>i.max&&g<=i.max?(d=(i.max-f)/(g-f)*(m-d)+d,f=i.max):f<=g&&g>i.max&&f<=i.max&&(m=(i.max-f)/(g-f)*(m-d)+d,g=i.max),d!=u&&y.lineTo(e.p2c(u),i.p2c(f)),y.lineTo(e.p2c(d),i.p2c(f)),y.lineTo(e.p2c(m),i.p2c(g)),m!=p&&(y.lineTo(e.p2c(m),i.p2c(g)),y.lineTo(e.p2c(p),i.p2c(g))))}}}(o.datapoints,o.xaxis,o.yaxis));0<n&&a(o.datapoints,0,0,o.xaxis,o.yaxis);y.restore()}if(i.bars.show&&!function(h){var t;switch(y.save(),y.translate(w.left,w.top),y.lineWidth=h.bars.lineWidth,y.strokeStyle=h.color,h.bars.align){case"left":t=0;break;case"right":t=-h.bars.barWidth;break;default:t=-h.bars.barWidth/2}var e=h.bars.fill?function(t,e){return m(h.bars,h.color,t,e)}:null;(function(t,e,i,o,a,n){for(var r=t.points,s=t.pointsize,l=0;l<r.length;l+=s)null!=r[l]&&I(r[l],r[l+1],r[l+2],e,i,o,a,n,y,h.bars.horizontal,h.bars.lineWidth)})(h.datapoints,t,t+h.bars.barWidth,e,h.xaxis,h.yaxis),y.restore()}(i),i.points.show){r=void 0;s=void 0;n=void 0;a=void 0;o=void 0;r=i;i=function(t,e,i,o,a,n,r,s){for(var l=t.points,h=t.pointsize,c=0;c<l.length;c+=h){var u=l[c],p=l[c+1];null==u||u<n.min||u>n.max||p<r.min||p>r.max||(y.beginPath(),u=n.p2c(u),p=r.p2c(p)+o,"circle"==s?y.arc(u,p,e,0,a?Math.PI:2*Math.PI,!1):s(y,u,p,e,a),y.closePath(),i&&(y.fillStyle=i,y.fill()),y.stroke())}};y.save(),y.translate(w.left,w.top);s=r.points.lineWidth,n=r.shadowSize,a=r.points.radius,o=r.points.symbol;0==s&&(s=1e-4);0<s&&0<n&&(n=n/2,y.lineWidth=n,y.strokeStyle="rgba(0,0,0,0.1)",i(r.datapoints,a,null,n+n/2,!0,r.xaxis,r.yaxis,o),y.strokeStyle="rgba(0,0,0,0.2)",i(r.datapoints,a,null,n/2,!0,r.xaxis,r.yaxis,o));y.lineWidth=s,y.strokeStyle=r.color,i(r.datapoints,a,m(r.points,r.color),0,!1,r.xaxis,r.yaxis,o),y.restore()}}Y(E.draw,[y]),t.show&&t.aboveData&&P(),S.render(),v()}function F(t,e){for(var i,o,a,n,r,s=X(),l=0;l<s.length;++l)if((i=s[l]).direction==e&&t[o=t[o=e+i.n+"axis"]||1!=i.n?o:e+"axis"]){n=t[o].from,r=t[o].to;break}return t[o]||(i=("x"==e?U:j)[0],n=t[e+"1"],r=t[e+"2"]),null!=n&&null!=r&&r<n&&(a=n,n=r,r=a),{from:n,to:r,axis:i}}function P(){y.save(),y.translate(w.left,w.top);var t,e,i=q.grid.markings;if(i)for($.isFunction(i)&&((h=z.getAxes()).xmin=h.xaxis.min,h.xmax=h.xaxis.max,h.ymin=h.yaxis.min,h.ymax=h.yaxis.max,i=i(h)),t=0;t<i.length;++t){var o,a,n,r=i[t],s=F(r,"x"),l=F(r,"y");null==s.from&&(s.from=s.axis.min),null==s.to&&(s.to=s.axis.max),null==l.from&&(l.from=l.axis.min),null==l.to&&(l.to=l.axis.max),s.to<s.axis.min||s.from>s.axis.max||l.to<l.axis.min||l.from>l.axis.max||(s.from=Math.max(s.from,s.axis.min),s.to=Math.min(s.to,s.axis.max),l.from=Math.max(l.from,l.axis.min),l.to=Math.min(l.to,l.axis.max),o=s.from===s.to,a=l.from===l.to,o&&a)||(s.from=Math.floor(s.axis.p2c(s.from)),s.to=Math.floor(s.axis.p2c(s.to)),l.from=Math.floor(l.axis.p2c(l.from)),l.to=Math.floor(l.axis.p2c(l.to)),o||a?(n=(a=r.lineWidth||q.grid.markingsLineWidth)%2?.5:0,y.beginPath(),y.strokeStyle=r.color||q.grid.markingsColor,y.lineWidth=a,o?(y.moveTo(s.to+n,l.from),y.lineTo(s.to+n,l.to)):(y.moveTo(s.from,l.to+n),y.lineTo(s.to,l.to+n)),y.stroke()):(y.fillStyle=r.color||q.grid.markingsColor,y.fillRect(s.from,l.to,s.to-s.from,l.from-l.to)))}for(var h=X(),c=q.grid.borderWidth,u=0;u<h.length;++u){var p,d,f,m=h[u],g=m.box,x=m.tickLength;if(m.show&&0!=m.ticks.length){for(y.lineWidth=1,"x"==m.direction?(p=0,d="full"==x?"top"==m.position?0:T:g.top-w.top+("top"==m.position?g.height:0)):(d=0,p="full"==x?"left"==m.position?0:M:g.left-w.left+("left"==m.position?g.width:0)),m.innermost||(y.strokeStyle=m.options.color,y.beginPath(),v=f=0,"x"==m.direction?v=M+1:f=T+1,1==y.lineWidth&&("x"==m.direction?d=Math.floor(d)+.5:p=Math.floor(p)+.5),y.moveTo(p,d),y.lineTo(p+v,d+f),y.stroke()),y.strokeStyle=m.options.tickColor,y.beginPath(),t=0;t<m.ticks.length;++t){var b=m.ticks[t].v,v=f=0;isNaN(b)||b<m.min||b>m.max||"full"==x&&("object"==typeof c&&0<c[m.position]||0<c)&&(b==m.min||b==m.max)||("x"==m.direction?(p=m.p2c(b),f="full"==x?-T:x,"top"==m.position&&(f=-f)):(d=m.p2c(b),v="full"==x?-M:x,"left"==m.position&&(v=-v)),1==y.lineWidth&&("x"==m.direction?p=Math.floor(p)+.5:d=Math.floor(d)+.5),y.moveTo(p,d),y.lineTo(p+v,d+f))}y.stroke()}}c&&(e=q.grid.borderColor,"object"==typeof c||"object"==typeof e?("object"!=typeof e&&(e={top:e,right:e,bottom:e,left:e}),0<(c="object"!=typeof c?{top:c,right:c,bottom:c,left:c}:c).top&&(y.strokeStyle=e.top,y.lineWidth=c.top,y.beginPath(),y.moveTo(0-c.left,0-c.top/2),y.lineTo(M,0-c.top/2),y.stroke()),0<c.right&&(y.strokeStyle=e.right,y.lineWidth=c.right,y.beginPath(),y.moveTo(M+c.right/2,0-c.top),y.lineTo(M+c.right/2,T),y.stroke()),0<c.bottom&&(y.strokeStyle=e.bottom,y.lineWidth=c.bottom,y.beginPath(),y.moveTo(M+c.right,T+c.bottom/2),y.lineTo(0,T+c.bottom/2),y.stroke()),0<c.left&&(y.strokeStyle=e.left,y.lineWidth=c.left,y.beginPath(),y.moveTo(0-c.left/2,T+c.bottom),y.lineTo(0-c.left/2,0),y.stroke())):(y.lineWidth=c,y.strokeStyle=q.grid.borderColor,y.strokeRect(-c/2,-c/2,M+c,T+c))),y.restore()}function I(t,e,i,o,a,n,r,s,l,h,c){var u,p,d,f,m,g,x,b,v;h?(m=!(b=g=x=!0),f=e+o,d=e+a,(p=t)<(u=i)&&(v=p,p=u,u=v,g=!(m=!0))):(b=!(m=g=x=!0),u=t+o,p=t+a,(f=e)<(d=i)&&(v=f,f=d,d=v,x=!(b=!0))),p<r.min||u>r.max||f<s.min||d>s.max||(u<r.min&&(u=r.min,m=!1),p>r.max&&(p=r.max,g=!1),d<s.min&&(d=s.min,b=!1),f>s.max&&(f=s.max,x=!1),u=r.p2c(u),d=s.p2c(d),p=r.p2c(p),f=s.p2c(f),n&&(l.fillStyle=n(d,f),l.fillRect(u,f,p-u,d-f)),0<c&&(m||g||x||b)&&(l.beginPath(),l.moveTo(u,d),m?l.lineTo(u,f):l.moveTo(u,f),x?l.lineTo(p,f):l.moveTo(p,f),g?l.lineTo(p,d):l.moveTo(p,d),b?l.lineTo(u,d):l.moveTo(u,d),l.stroke()))}function m(t,e,i,o){var a=t.fill;return a?t.fillColor?J(t.fillColor,i,o,e):((t=$.color.parse(e)).a="number"==typeof a?a:.4,t.normalize(),t.toString()):null}t&&(t.shutdown(),l.clear()),k.data("plot",z),p(C),A(),W(),q.grid.hoverable&&(c.mousemove(D),c.bind("mouseleave",O)),q.grid.clickable&&c.click(N),Y(E.bindEvents,[c]);var g=[],x=null;function D(t){q.grid.hoverable&&b("plothover",t,function(t){return 0!=t.hoverable})}function O(t){q.grid.hoverable&&b("plothover",t,function(t){return!1})}function N(t){b("plotclick",t,function(t){return 0!=t.clickable})}function b(t,e,i){var o=c.offset(),a=e.pageX-o.left-w.left,n=e.pageY-o.top-w.top,r=d({left:a,top:n}),s=(r.pageX=e.pageX,r.pageY=e.pageY,function(t,e,i){for(var o,a=q.grid.mouseActiveRadius,n=a*a+1,r=null,s=R.length-1;0<=s;--s)if(i(R[s])){var l,h,c=R[s],u=c.xaxis,p=c.yaxis,d=c.datapoints.points,f=u.c2p(t),m=p.c2p(e),g=a/u.scale,x=a/p.scale,b=c.datapoints.pointsize;if(u.options.inverseTransform&&(g=Number.MAX_VALUE),p.options.inverseTransform&&(x=Number.MAX_VALUE),c.lines.show||c.points.show)for(o=0;o<d.length;o+=b){var v,y=d[o],k=d[o+1];null==y||g<y-f||y-f<-g||x<k-m||k-m<-x||(v=(v=Math.abs(u.p2c(y)-t))*v+(v=Math.abs(p.p2c(k)-e))*v)<n&&(n=v,r=[s,o/b])}if(c.bars.show&&!r){switch(c.bars.align){case"left":l=0;break;case"right":l=-c.bars.barWidth;break;default:l=-c.bars.barWidth/2}for(h=l+c.bars.barWidth,o=0;o<d.length;o+=b){var y=d[o],k=d[o+1],w=d[o+2];null!=y&&(R[s].bars.horizontal?f<=Math.max(w,y)&&f>=Math.min(w,y)&&k+l<=m&&m<=k+h:y+l<=f&&f<=y+h&&m>=Math.min(w,k)&&m<=Math.max(w,k))&&(r=[s,o/b])}}}return r?(s=r[0],o=r[1],b=R[s].datapoints.pointsize,{datapoint:R[s].datapoints.points.slice(o*b,(o+1)*b),dataIndex:o,series:R[s],seriesIndex:s}):null}(a,n,i));if(s&&(s.pageX=parseInt(s.series.xaxis.p2c(s.datapoint[0])+o.left+w.left,10),s.pageY=parseInt(s.series.yaxis.p2c(s.datapoint[1])+o.top+w.top,10)),q.grid.autoHighlight){for(var l=0;l<g.length;++l){var h=g[l];h.auto!=t||s&&h.series==s.series&&h.point[0]==s.datapoint[0]&&h.point[1]==s.datapoint[1]||Q(h.series,h.point)}s&&G(s.series,s.datapoint,t)}k.trigger(t,[r,s])}function v(){var t=q.interaction.redrawOverlayInterval;-1==t?H():x=x||setTimeout(H,t)}function H(){var t,e,i,o,a,n,r,s;for(x=null,h.save(),l.clear(),h.translate(w.left,w.top),t=0;t<g.length;++t)(i=g[t]).series.bars.show?function(t,e){var i,o="string"==typeof t.highlightColor?t.highlightColor:$.color.parse(t.color).scale("a",.5).toString(),a=o;switch(t.bars.align){case"left":i=0;break;case"right":i=-t.bars.barWidth;break;default:i=-t.bars.barWidth/2}h.lineWidth=t.bars.lineWidth,h.strokeStyle=o,I(e[0],e[1],e[2]||0,i,i+t.bars.barWidth,function(){return a},t.xaxis,t.yaxis,h,t.bars.horizontal,t.bars.lineWidth)}(i.series,i.point):(e=i.series,i=i.point,s=r=n=a=o=void 0,a=i[0],i=i[1],n=e.xaxis,r=e.yaxis,s="string"==typeof e.highlightColor?e.highlightColor:$.color.parse(e.color).scale("a",.5).toString(),a<n.min||a>n.max||i<r.min||i>r.max||(o=e.points.radius+e.points.lineWidth/2,h.lineWidth=o,h.strokeStyle=s,s=1.5*o,a=n.p2c(a),i=r.p2c(i),h.beginPath(),"circle"==e.points.symbol?h.arc(a,i,s,0,2*Math.PI,!1):e.points.symbol(h,a,i,s,!1),h.closePath(),h.stroke()));h.restore(),Y(E.drawOverlay,[h])}function G(t,e,i){"number"==typeof t&&(t=R[t]),"number"==typeof e&&(o=t.datapoints.pointsize,e=t.datapoints.points.slice(o*e,o*(e+1)));var o=_(t,e);-1==o?(g.push({series:t,point:e,auto:i}),v()):i||(g[o].auto=!1)}function Q(t,e){var i;null==t&&null==e?(g=[],v()):("number"==typeof t&&(t=R[t]),"number"==typeof e&&(i=t.datapoints.pointsize,e=t.datapoints.points.slice(i*e,i*(e+1))),-1!=(i=_(t,e))&&(g.splice(i,1),v()))}function _(t,e){for(var i=0;i<g.length;++i){var o=g[i];if(o.series==t&&o.point[0]==e[0]&&o.point[1]==e[1])return i}return-1}function J(t,e,i,o){if("string"==typeof t)return t;for(var a=y.createLinearGradient(0,i,0,e),n=0,r=t.colors.length;n<r;++n){var s,l=t.colors[n];"string"!=typeof l&&(s=$.color.parse(o),null!=l.brightness&&(s=s.scale("rgb",l.brightness)),null!=l.opacity&&(s.a*=l.opacity),l=s.toString()),a.addColorStop(n/(r-1),l)}return a}}$.fn.detach||($.fn.detach=function(){return this.each(function(){this.parentNode&&this.parentNode.removeChild(this)})}),Z.prototype.resize=function(t,e){if(t<=0||e<=0)throw new Error("Invalid dimensions for plot, width = "+t+", height = "+e);var i=this.element,o=this.context,a=this.pixelRatio;this.width!=t&&(i.width=t*a,i.style.width=t+"px",this.width=t),this.height!=e&&(i.height=e*a,i.style.height=e+"px",this.height=e),o.restore(),o.save(),o.scale(a,a)},Z.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},Z.prototype.render=function(){var t,e=this._textCache;for(t in e)if(d.call(e,t)){var i,o=this.getTextLayer(t),a=e[t];for(i in o.hide(),a)if(d.call(a,i)){var n,r=a[i];for(n in r)if(d.call(r,n)){for(var s,l=r[n].positions,h=0;s=l[h];h++)s.active?s.rendered||(o.append(s.element),s.rendered=!0):(l.splice(h--,1),s.rendered&&s.element.detach());0==l.length&&delete r[n]}}o.show()}},Z.prototype.getTextLayer=function(t){var e=this.text[t];return null==e&&(null==this.textContainer&&(this.textContainer=$("<div class='flot-text'></div>").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),e=this.text[t]=$("<div></div>").addClass(t).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),e},Z.prototype.getTextInfo=function(t,e,i,o,a){var n,r,s;return e=""+e,n="object"==typeof i?i.style+" "+i.variant+" "+i.weight+" "+i.size+"px/"+i.lineHeight+"px "+i.family:i,null==(s=(r=null==(r=(s=null==(s=this._textCache[t])?this._textCache[t]={}:s)[n])?s[n]={}:r)[e])&&(a=$("<div></div>").html(e).css({position:"absolute","max-width":a,top:-9999}).appendTo(this.getTextLayer(t)),"object"==typeof i?a.css({font:n,color:i.color}):"string"==typeof i&&a.addClass(i),s=r[e]={width:a.outerWidth(!0),height:a.outerHeight(!0),element:a,positions:[]},a.detach()),s},Z.prototype.addText=function(t,e,i,o,a,n,r,s,l){var t=this.getTextInfo(t,o,a,n,r),h=t.positions;"center"==s?e-=t.width/2:"right"==s&&(e-=t.width),"middle"==l?i-=t.height/2:"bottom"==l&&(i-=t.height);for(var c,u=0;c=h[u];u++)if(c.x==e&&c.y==i)return void(c.active=!0);c={active:!0,rendered:!1,element:h.length?t.element.clone():t.element,x:e,y:i},h.push(c),c.element.css({top:Math.round(i),left:Math.round(e),"text-align":s})},Z.prototype.removeText=function(t,e,i,o,a,n){if(null==o){var r=this._textCache[t];if(null!=r)for(var s in r)if(d.call(r,s)){var l,h=r[s];for(l in h)if(d.call(h,l))for(var c=h[l].positions,u=0;p=c[u];u++)p.active=!1}}else for(var p,c=this.getTextInfo(t,o,a,n).positions,u=0;p=c[u];u++)p.x==e&&p.y==i&&(p.active=!1)},$.plot=function(t,e,i){return new o($(t),e,i,$.plot.plugins)},$.plot.version="0.8.3",$.plot.plugins=[],$.fn.plot=function(t,e){return this.each(function(){$.plot(this,t,e)})}}(jQuery),function(n){n.color={},n.color.make=function(t,e,i,o){var a={};return a.r=t||0,a.g=e||0,a.b=i||0,a.a=null!=o?o:1,a.add=function(t,e){for(var i=0;i<t.length;++i)a[t.charAt(i)]+=e;return a.normalize()},a.scale=function(t,e){for(var i=0;i<t.length;++i)a[t.charAt(i)]*=e;return a.normalize()},a.toString=function(){return 1<=a.a?"rgb("+[a.r,a.g,a.b].join(",")+")":"rgba("+[a.r,a.g,a.b,a.a].join(",")+")"},a.normalize=function(){function t(t,e,i){return e<t?t:i<e?i:e}return a.r=t(0,parseInt(a.r),255),a.g=t(0,parseInt(a.g),255),a.b=t(0,parseInt(a.b),255),a.a=t(0,a.a,1),a},a.clone=function(){return n.color.make(a.r,a.b,a.g,a.a)},a.normalize()},n.color.extract=function(t,e){for(var i;(""==(i=t.css(e).toLowerCase())||"transparent"==i)&&(t=t.parent(),!n.nodeName(t.get(0),"body")););return n.color.parse(i="rgba(0, 0, 0, 0)"==i?"transparent":i)},n.color.parse=function(t){var e,i=n.color.make;return(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(t))?i(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)):(e=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(t))?i(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4])):(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(t))?i(2.55*parseFloat(e[1]),2.55*parseFloat(e[2]),2.55*parseFloat(e[3])):(e=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(t))?i(2.55*parseFloat(e[1]),2.55*parseFloat(e[2]),2.55*parseFloat(e[3]),parseFloat(e[4])):(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(t))?i(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):(e=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(t))?i(parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)):"transparent"==(t=n.trim(t).toLowerCase())?i(255,255,255,0):i((e=o[t]||[0,0,0])[0],e[1],e[2])};var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(K){function o(F,w,t,e){var o,a,N=[],H={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85},xaxis:{show:null,position:"bottom",mode:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:!1},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1},shadowSize:3},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},hooks:{}},n=null,r=null,c=null,x=null,s=null,R=[],q=[],T={left:0,right:0,top:0,bottom:0},P=0,I=0,S=0,z=0,U={processOptions:[],processRawData:[],processDatapoints:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},g=this;g.setData=p,g.setupGrid=L,g.draw=A,g.getPlaceholder=function(){return F},g.getCanvas=function(){return n},g.getPlotOffset=function(){return T},g.width=function(){return S},g.height=function(){return z},g.offset=function(){var t=c.offset();return t.left+=T.left,t.top+=T.top,t},g.getData=function(){return N},g.getAxes=function(){var i={};return K.each(R.concat(q),function(t,e){e&&(i[e.direction+(1!=e.n?e.n:"")+"axis"]=e)}),i},g.getXAxes=function(){return R},g.getYAxes=function(){return q},g.c2p=d,g.p2c=function(t){var e,i,o,a={};for(e=0;e<R.length;++e)if((i=R[e])&&i.used&&(o="x"+i.n,null==t[o]&&1==i.n&&(o="x"),null!=t[o])){a.left=i.p2c(t[o]);break}for(e=0;e<q.length;++e)if((i=q[e])&&i.used&&(o="y"+i.n,null==t[o]&&1==i.n&&(o="y"),null!=t[o])){a.top=i.p2c(t[o]);break}return a},g.getOptions=function(){return H},g.highlight=_,g.unhighlight=J,g.triggerRedrawOverlay=k,g.pointOffset=function(t){return{left:parseInt(R[E(t,"x")-1].p2c(+t.x)+T.left),top:parseInt(q[E(t,"y")-1].p2c(+t.y)+T.top)}},g.shutdown=function(){v&&clearTimeout(v);c.unbind("mousemove",X),c.unbind("mouseleave",V),c.unbind("click",G),j(U.shutdown,[c])},g.resize=function(){M(),C(n),C(r)},g.hooks=U;for(var l=0;l<e.length;++l){var h=e[l];h.init(g),h.options&&K.extend(!0,H,h.options)}for(K.extend(!0,H,t),null==H.xaxis.color&&(H.xaxis.color=H.grid.color),null==H.yaxis.color&&(H.yaxis.color=H.grid.color),null==H.xaxis.tickColor&&(H.xaxis.tickColor=H.grid.tickColor),null==H.yaxis.tickColor&&(H.yaxis.tickColor=H.grid.tickColor),null==H.grid.borderColor&&(H.grid.borderColor=H.grid.color),null==H.grid.tickColor&&(H.grid.tickColor=K.color.parse(H.grid.color).scale("a",.22).toString()),o=0;o<Math.max(1,H.xaxes.length);++o)H.xaxes[o]=K.extend(!0,{},H.xaxis,H.xaxes[o]);for(o=0;o<Math.max(1,H.yaxes.length);++o)H.yaxes[o]=K.extend(!0,{},H.yaxis,H.yaxes[o]);for(H.xaxis.noTicks&&null==H.xaxis.ticks&&(H.xaxis.ticks=H.xaxis.noTicks),H.yaxis.noTicks&&null==H.yaxis.ticks&&(H.yaxis.ticks=H.yaxis.noTicks),H.x2axis&&(H.xaxes[1]=K.extend(!0,{},H.xaxis,H.x2axis),H.xaxes[1].position="top"),H.y2axis&&(H.yaxes[1]=K.extend(!0,{},H.yaxis,H.y2axis),H.yaxes[1].position="right"),H.grid.coloredAreas&&(H.grid.markings=H.grid.coloredAreas),H.grid.coloredAreasColor&&(H.grid.markingsColor=H.grid.coloredAreasColor),H.lines&&K.extend(!0,H.series.lines,H.lines),H.points&&K.extend(!0,H.series.points,H.points),H.bars&&K.extend(!0,H.series.bars,H.bars),null!=H.shadowSize&&(H.series.shadowSize=H.shadowSize),o=0;o<H.xaxes.length;++o)B(R,o+1).options=H.xaxes[o];for(o=0;o<H.yaxes.length;++o)B(q,o+1).options=H.yaxes[o];for(a in U)H.hooks[a]&&H.hooks[a].length&&(U[a]=U[a].concat(H.hooks[a]));j(U.processOptions,[H]);var t=F.children("canvas.base"),u=F.children("canvas.overlay");function j(t,e){e=[g].concat(e);for(var i=0;i<t.length;++i)t[i].apply(this,e)}function p(t){var e,i=(N=function(t){for(var e=[],i=0;i<t.length;++i){var o=K.extend(!0,{},H.series);null!=t[i].data?(o.data=t[i].data,delete t[i].data,K.extend(!0,o,t[i]),t[i].data=o.data):o.data=t[i],e.push(o)}return e}(t)).length,o=[],a=[];for(e=0;e<N.length;++e){var n=N[e].color;null!=n&&(--i,"number"==typeof n?a.push(n):o.push(K.color.parse(N[e].color)))}for(e=0;e<a.length;++e)i=Math.max(i,a[e]+1);var r,s=[],l=0;for(e=0;s.length<i;){r=H.colors.length==e?K.color.make(100,100,100):K.color.parse(H.colors[e]);var h=l%2==1?-1:1;r.scale("rgb",1+h*Math.ceil(l/2)*.2),s.push(r),++e>=H.colors.length&&(e=0,++l)}var c,u=0;for(e=0;e<N.length;++e){if(null==(c=N[e]).color?(c.color=s[u].toString(),++u):"number"==typeof c.color&&(c.color=s[c.color].toString()),null==c.lines.show){var p,d=!0;for(p in c)if(c[p]&&c[p].show){d=!1;break}d&&(c.lines.show=!0)}c.xaxis=B(R,E(c,"x")),c.yaxis=B(q,E(c,"y"))}var f,m,g,x,b,v,y,k,w,M,T=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,z=Number.MAX_VALUE;function C(t,e,i){e<t.datamin&&e!=-z&&(t.datamin=e),i>t.datamax&&i!=z&&(t.datamax=i)}for(K.each(Y(),function(t,e){e.datamin=T,e.datamax=S,e.used=!1}),f=0;f<N.length;++f)(b=N[f]).datapoints={points:[]},j(U.processRawData,[b,b.data,b.datapoints]);for(f=0;f<N.length;++f){var L=(b=N[f]).data,A=b.datapoints.format;if(A||((A=[]).push({x:!0,number:!0,required:!0}),A.push({y:!0,number:!0,required:!0}),(b.bars.show||b.lines.show&&b.lines.fill)&&(A.push({y:!0,number:!0,required:!1,defaultValue:0}),b.bars.horizontal)&&(delete A[A.length-1].y,A[A.length-1].x=!0),b.datapoints.format=A),null==b.datapoints.pointsize)for(b.datapoints.pointsize=A.length,y=b.datapoints.pointsize,v=b.datapoints.points,insertSteps=b.lines.show&&b.lines.steps,b.xaxis.used=b.yaxis.used=!0,m=g=0;m<L.length;++m,g+=y){var W=null==(M=L[m]);if(!W)for(x=0;x<y;++x)k=M[x],(w=A[x])&&(w.number&&null!=k&&(k=+k,isNaN(k)?k=null:k==1/0?k=z:k==-1/0&&(k=-z)),null==k)&&(w.required&&(W=!0),null!=w.defaultValue)&&(k=w.defaultValue),v[g+x]=k;if(W)for(x=0;x<y;++x)null!=(k=v[g+x])&&((w=A[x]).x&&C(b.xaxis,k,k),w.y)&&C(b.yaxis,k,k),v[g+x]=null;else if(insertSteps&&0<g&&null!=v[g-y]&&v[g-y]!=v[g]&&v[g-y+1]!=v[g+1]){for(x=0;x<y;++x)v[g+y+x]=v[g+x];v[g+1]=v[g-y+1],g+=y}}}for(f=0;f<N.length;++f)b=N[f],j(U.processDatapoints,[b,b.datapoints]);for(f=0;f<N.length;++f){b=N[f],v=b.datapoints.points,y=b.datapoints.pointsize;var F,P=T,I=T,D=S,O=S;for(m=0;m<v.length;m+=y)if(null!=v[m])for(x=0;x<y;++x)k=v[m+x],(w=A[x])&&k!=z&&k!=-z&&(w.x&&(k<P&&(P=k),D<k)&&(D=k),w.y)&&(k<I&&(I=k),O<k)&&(O=k);b.bars.show&&(F="left"==b.bars.align?0:-b.bars.barWidth/2,b.bars.horizontal?(I+=F,O+=F+b.bars.barWidth):(P+=F,D+=F+b.bars.barWidth)),C(b.xaxis,P,D),C(b.yaxis,I,O)}K.each(Y(),function(t,e){e.datamin==T&&(e.datamin=null),e.datamax==S&&(e.datamax=null)})}function E(t,e){t=t[e+"axis"];return t="number"!=typeof(t="object"==typeof t?t.n:t)?1:t}function Y(){return K.grep(R.concat(q),function(t){return t})}function d(t){for(var e,i={},o=0;o<R.length;++o)(e=R[o])&&e.used&&(i["x"+e.n]=e.c2p(t.left));for(o=0;o<q.length;++o)(e=q[o])&&e.used&&(i["y"+e.n]=e.c2p(t.top));return void 0!==i.x1&&(i.x=i.x1),void 0!==i.y1&&(i.y=i.y1),i}function B(t,e){return t[e-1]||(t[e-1]={n:e,direction:t==R?"x":"y",options:K.extend(!0,{},t==R?H.xaxis:H.yaxis)}),t[e-1]}function f(t,e){var i=document.createElement("canvas");return i.className=e,i.width=P,i.height=I,t||K(i).css({position:"absolute",left:0,top:0}),K(i).appendTo(F),(i=i.getContext?i:window.G_vmlCanvasManager.initElement(i)).getContext("2d").save(),i}function M(){if(P=F.width(),I=F.height(),P<=0||I<=0)throw"Invalid dimensions for plot, width = "+P+", height = "+I}function C(t){t.width!=P&&(t.width=P),t.height!=I&&(t.height=I);t=t.getContext("2d");t.restore(),t.save()}function L(){var t,e=Y();if(K.each(e,function(t,e){e.show=e.options.show,null==e.show&&(e.show=e.used),e.reserveSpace=e.show||e.options.reserveSpace;var i,o=e.options,a=+(null!=o.min?o.min:e.datamin),n=+(null!=o.max?o.max:e.datamax),r=n-a;0==r?(i=0==n?1:.01,null==o.min&&(a-=i),null!=o.max&&null==o.min||(n+=i)):null!=(i=o.autoscaleMargin)&&(null==o.min&&(a-=r*i)<0&&null!=e.datamin&&0<=e.datamin&&(a=0),null==o.max)&&0<(n+=r*i)&&null!=e.datamax&&e.datamax<=0&&(n=0),e.min=a,e.max=n}),allocatedAxes=K.grep(e,function(t){return t.reserveSpace}),T.left=T.right=T.top=T.bottom=0,H.grid.show){for(K.each(allocatedAxes,function(t,e){var i=e,a=i.options;d="number"==typeof a.ticks&&0<a.ticks?a.ticks:.3*Math.sqrt("x"==i.direction?P:I);var o,n,r,s,l=(i.max-i.min)/d;if("time"==a.mode){var u={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,year:525949.2*60*1e3},h=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]],c=0;null!=a.minTickSize&&(c="number"==typeof a.tickSize?a.tickSize:a.minTickSize[0]*u[a.minTickSize[1]]);for(var p=0;p<h.length-1&&!(l<(h[p][0]*u[h[p][1]]+h[p+1][0]*u[h[p+1][1]])/2&&h[p][0]*u[h[p][1]]>=c);++p);x=h[p][0],"year"==(d=h[p][1])&&(s=Math.pow(10,Math.floor(Math.log(l/u.year)/Math.LN10)),x=(b=l/u.year/s)<1.5?1:b<3?2:b<7.5?5:10,x*=s),i.tickSize=a.tickSize||[x,d],o=function(t){var e=[],i=t.tickSize[0],o=t.tickSize[1],a=new Date(t.min),n=i*u[o],r=("second"==o&&a.setUTCSeconds(tt(a.getUTCSeconds(),i)),"minute"==o&&a.setUTCMinutes(tt(a.getUTCMinutes(),i)),"hour"==o&&a.setUTCHours(tt(a.getUTCHours(),i)),"month"==o&&a.setUTCMonth(tt(a.getUTCMonth(),i)),"year"==o&&a.setUTCFullYear(tt(a.getUTCFullYear(),i)),a.setUTCMilliseconds(0),u.minute<=n&&a.setUTCSeconds(0),u.hour<=n&&a.setUTCMinutes(0),u.day<=n&&a.setUTCHours(0),4*u.day<=n&&a.setUTCDate(1),u.year<=n&&a.setUTCMonth(0),0),s=Number.NaN;do{var l,h,c=s,s=a.getTime()}while(e.push(s),"month"==o?i<1?(a.setUTCDate(1),l=a.getTime(),a.setUTCMonth(a.getUTCMonth()+1),h=a.getTime(),a.setTime(s+r*u.hour+(h-l)*i),r=a.getUTCHours(),a.setUTCHours(0)):a.setUTCMonth(a.getUTCMonth()+i):"year"==o?a.setUTCFullYear(a.getUTCFullYear()+i):a.setTime(s+n),s<t.max&&s!=c);return e},n=function(t,e){var i,o,t=new Date(t);return null!=a.timeformat?K.plot.formatDate(t,a.timeformat,a.monthNames):(i=e.tickSize[0]*u[e.tickSize[1]],e=e.max-e.min,o=a.twelveHourClock?" %p":"",fmt=i<u.minute?"%h:%M:%S"+o:i<u.day?e<2*u.day?"%h:%M"+o:"%b %d %h:%M"+o:i<u.month?"%b %d":i<u.year?e<u.year?"%b":"%b %y":"%y",K.plot.formatDate(t,fmt,a.monthNames))}}else{var d=a.tickDecimals,f=-Math.floor(Math.log(l)/Math.LN10);null!=d&&d<f&&(f=d),s=Math.pow(10,-f),(b=l/s)<1.5?x=1:b<3?(x=2,2.25<b&&(null==d||f+1<=d)&&(x=2.5,++f)):x=b<7.5?5:10,x*=s,null!=a.minTickSize&&x<a.minTickSize&&(x=a.minTickSize),i.tickDecimals=Math.max(0,null!=d?d:f),i.tickSize=a.tickSize||x,o=function(t){for(var e,i=[],o=tt(t.min,t.tickSize),a=0,n=Number.NaN;e=n,n=o+a*t.tickSize,i.push(n),++a,n<t.max&&n!=e;);return i},n=function(t,e){return t.toFixed(e.tickDecimals)}}null!=a.alignTicksWithAxis&&(r=("x"==i.direction?R:q)[a.alignTicksWithAxis-1])&&r.used&&r!=i&&(0<(b=o(i)).length&&(null==a.min&&(i.min=Math.min(i.min,b[0])),null==a.max)&&1<b.length&&(i.max=Math.max(i.max,b[b.length-1])),o=function(t){for(var e,i=[],o=0;o<r.ticks.length;++o)e=(r.ticks[o].v-r.min)/(r.max-r.min),e=t.min+e*(t.max-t.min),i.push(e);return i},"time"!=i.mode)&&null==a.tickDecimals&&(s=Math.max(0,1-Math.floor(Math.log(l)/Math.LN10)),1<(d=o(i)).length&&/\..*0$/.test((d[1]-d[0]).toFixed(s))||(i.tickDecimals=s)),i.tickGenerator=o,K.isFunction(a.tickFormatter)?i.tickFormatter=function(t,e){return""+a.tickFormatter(t,e)}:i.tickFormatter=n;var m,g,x,b,v=e,f=v.options.ticks,y=[];for(null==f||"number"==typeof f&&0<f?y=v.tickGenerator(v):f&&(y=K.isFunction(f)?f({min:v.min,max:v.max}):f),v.ticks=[],m=0;m<y.length;++m){var k=null,w=y[m];"object"==typeof w?(g=+w[0],1<w.length&&(k=w[1])):g=+w,null==k&&(k=v.tickFormatter(g,v)),isNaN(g)||v.ticks.push({v:g,label:k})}b=(x=e).ticks,x.options.autoscaleMargin&&0<b.length&&(null==x.options.min&&(x.min=Math.min(x.min,b[0].v)),null==x.options.max)&&1<b.length&&(x.max=Math.max(x.max,b[b.length-1].v));var M,T,S,z=e,d=z.options,C=z.ticks||[],L=[],A=d.labelWidth,d=d.labelHeight;function W(t,e){return K('<div style="position:absolute;top:-10000px;'+e+'font-size:smaller"><div class="'+z.direction+"Axis "+z.direction+z.n+'Axis">'+t.join("")+"</div></div>").appendTo(F)}if("x"==z.direction){if(null==A&&(A=Math.floor(P/(0<C.length?C.length:1))),null==d){for(L=[],M=0;M<C.length;++M)(T=C[M].label)&&L.push('<div class="tickLabel" style="float:left;width:'+A+'px">'+T+"</div>");0<L.length&&(L.push('<div style="clear:left"></div>'),d=(S=W(L,"width:10000px;")).height(),S.remove())}}else if(null==A||null==d){for(M=0;M<C.length;++M)(T=C[M].label)&&L.push('<div class="tickLabel">'+T+"</div>");0<L.length&&(S=W(L,""),null==A&&(A=S.children().width()),null==d&&(d=S.find("div.tickLabel").height()),S.remove())}null==d&&(d=0),z.labelWidth=A=null==A?0:A,z.labelHeight=d}),t=allocatedAxes.length-1;0<=t;--t)!function(t){var e=t.labelWidth,i=t.labelHeight,o=t.options.position,a=t.options.tickLength,n=H.grid.axisMargin,r=H.grid.labelMargin,s="x"==t.direction?R:q,l=K.grep(s,function(t){return t&&t.options.position==o&&t.reserveSpace}),l=(K.inArray(t,l)==l.length-1&&(n=0),null==a&&(a="full"),K.grep(s,function(t){return t&&t.reserveSpace}));(s=0==K.inArray(t,l))||"full"!=a||(a=5),isNaN(+a)||(r+=+a),"x"==t.direction?(i+=r,"bottom"==o?(T.bottom+=i+n,t.box={top:I-T.bottom,height:i}):(t.box={top:T.top+n,height:i},T.top+=i+n)):(e+=r,"left"==o?(t.box={left:T.left+n,width:e},T.left+=e+n):(T.right+=e+n,t.box={left:P-T.right,width:e})),t.position=o,t.tickLength=a,t.box.padding=r,t.innermost=s}(allocatedAxes[t]);var i,o=H.grid.minBorderMargin;if(null==o)for(t=o=0;t<N.length;++t)o=Math.max(o,N[t].points.radius+N[t].points.lineWidth/2);for(i in T)T[i]+=H.grid.borderWidth,T[i]=Math.max(o,T[i])}if(S=P-T.left-T.right,z=I-T.bottom-T.top,K.each(e,function(t,e){function i(t){return t}var o,a,n,r;a=(e=e).options.transform||i,n=e.options.inverseTransform,r="x"==e.direction?(o=e.scale=S/Math.abs(a(e.max)-a(e.min)),Math.min(a(e.max),a(e.min))):(o=-(o=e.scale=z/Math.abs(a(e.max)-a(e.min))),Math.max(a(e.max),a(e.min))),e.p2c=a==i?function(t){return(t-r)*o}:function(t){return(a(t)-r)*o},e.c2p=n?function(t){return n(r+t/o)}:function(t){return r+t/o}}),H.grid.show){K.each(allocatedAxes,function(t,e){"x"==(e=e).direction?(e.box.left=T.left,e.box.width=S):(e.box.top=T.top,e.box.height=z)}),F.find(".tickLabels").remove();for(var a=['<div class="tickLabels" style="font-size:smaller">'],n=Y(),r=0;r<n.length;++r){var s=n[r],l=s.box;if(s.show){a.push('<div class="'+s.direction+"Axis "+s.direction+s.n+'Axis" style="color:'+s.options.color+'">');for(var h=0;h<s.ticks.length;++h){var c=s.ticks[h];if(!(!c.label||c.v<s.min||c.v>s.max)){var u,p,d={},f=("x"==s.direction?(u="center",d.left=Math.round(T.left+s.p2c(c.v)-s.labelWidth/2),"bottom"==s.position?d.top=l.top+l.padding:d.bottom=I-(l.top+l.height-l.padding)):(d.top=Math.round(T.top+s.p2c(c.v)-s.labelHeight/2),u="left"==s.position?(d.right=P-(l.left+l.width-l.padding),"right"):(d.left=l.left+l.padding,"left")),d.width=s.labelWidth,["position:absolute","text-align:"+u]);for(p in d)f.push(p+":"+d[p]+"px");a.push('<div class="tickLabel" style="'+f.join(";")+'">'+c.label+"</div>")}}a.push("</div>")}}a.push("</div>"),F.append(a.join(""))}if(F.find(".legend").remove(),H.legend.show){for(var m,g,x,b,v,y=[],k=!1,w=H.legend.labelFormatter,M=0;M<N.length;++M)m=N[M],(g=m.label)&&(M%H.legend.noColumns==0&&(k&&y.push("</tr>"),y.push("<tr>"),k=!0),w&&(g=w(g,m)),y.push('<td class="legendColorBox"><div style="border:1px solid '+H.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+m.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+g+"</td>"));k&&y.push("</tr>"),0!=y.length&&(e='<table style="font-size:smaller;color:'+H.grid.color+'">'+y.join("")+"</table>",null!=H.legend.container?K(H.legend.container).html(e):(x="",b=H.legend.position,null==(v=H.legend.margin)[0]&&(v=[v,v]),"n"==b.charAt(0)?x+="top:"+(v[1]+T.top)+"px;":"s"==b.charAt(0)&&(x+="bottom:"+(v[1]+T.bottom)+"px;"),"e"==b.charAt(1)?x+="right:"+(v[0]+T.right)+"px;":"w"==b.charAt(1)&&(x+="left:"+(v[0]+T.left)+"px;"),b=K('<div class="legend">'+e.replace('style="','style="position:absolute;'+x+";")+"</div>").appendTo(F),0!=H.legend.backgroundOpacity&&(null==(v=H.legend.backgroundColor)&&((v=(v=H.grid.backgroundColor)&&"string"==typeof v?K.color.parse(v):K.color.extract(b,"background-color")).a=1,v=v.toString()),e=b.children(),K('<div style="position:absolute;width:'+e.width()+"px;height:"+e.height()+"px;"+x+"background-color:"+v+';"> </div>').prependTo(b).css("opacity",H.legend.backgroundOpacity))))}}function A(){x.clearRect(0,0,P,I);var t=H.grid;t.show&&t.backgroundColor&&(x.save(),x.translate(T.left,T.top),x.fillStyle=Z(H.grid.backgroundColor,z,0,"rgba(255, 255, 255, 0)"),x.fillRect(0,0,S,z),x.restore()),t.show&&!t.aboveData&&D();for(var e=0;e<N.length;++e){j(U.drawSeries,[x,N[e]]),i=void 0;var i=N[e];if(i.lines.show){o=void 0;n=void 0;r=void 0;s=void 0;var o=i;var a=function(t,e,i,o,a){var n=t.points,r=t.pointsize,s=null,l=null;x.beginPath();for(var h=r;h<n.length;h+=r){var c=n[h-r],u=n[h-r+1],p=n[h],d=n[h+1];if(null!=c&&null!=p){if(u<=d&&u<a.min){if(d<a.min)continue;c=(a.min-u)/(d-u)*(p-c)+c,u=a.min}else if(d<=u&&d<a.min){if(u<a.min)continue;p=(a.min-u)/(d-u)*(p-c)+c,d=a.min}if(d<=u&&u>a.max){if(d>a.max)continue;c=(a.max-u)/(d-u)*(p-c)+c,u=a.max}else if(u<=d&&d>a.max){if(u>a.max)continue;p=(a.max-u)/(d-u)*(p-c)+c,d=a.max}if(c<=p&&c<o.min){if(p<o.min)continue;u=(o.min-c)/(p-c)*(d-u)+u,c=o.min}else if(p<=c&&p<o.min){if(c<o.min)continue;d=(o.min-c)/(p-c)*(d-u)+u,p=o.min}if(p<=c&&c>o.max){if(p>o.max)continue;u=(o.max-c)/(p-c)*(d-u)+u,c=o.max}else if(c<=p&&p>o.max){if(c>o.max)continue;d=(o.max-c)/(p-c)*(d-u)+u,p=o.max}c==s&&u==l||x.moveTo(o.p2c(c)+e,a.p2c(u)+i),s=p,l=d,x.lineTo(o.p2c(p)+e,a.p2c(d)+i)}}x.stroke()};x.save(),x.translate(T.left,T.top),x.lineJoin="round";var n=o.lines.lineWidth,r=o.shadowSize;0<n&&0<r&&(x.lineWidth=r,x.strokeStyle="rgba(0,0,0,0.1)",s=Math.PI/18,a(o.datapoints,Math.sin(s)*(n/2+r/2),Math.cos(s)*(n/2+r/2),o.xaxis,o.yaxis),x.lineWidth=r/2,a(o.datapoints,Math.sin(s)*(n/2+r/4),Math.cos(s)*(n/2+r/4),o.xaxis,o.yaxis));x.lineWidth=n,x.strokeStyle=o.color;var s=m(o.lines,o.color,0,z);s&&(x.fillStyle=s,function(t,e,i){for(var o=t.points,a=t.pointsize,n=Math.min(Math.max(0,i.min),i.max),r=0,s=!1,l=1,h=0,c=0;!(0<a&&r>o.length+a);){var u,p,d=o[(r+=a)-a],f=o[r-a+l],m=o[r],g=o[r+l];if(s){if(0<a&&null!=d&&null==m){c=r,a=-a,l=2;continue}if(a<0&&r==h+a){x.fill(),s=!1,l=1,r=h=c+(a=-a);continue}}if(null!=d&&null!=m){if(d<=m&&d<e.min){if(m<e.min)continue;f=(e.min-d)/(m-d)*(g-f)+f,d=e.min}else if(m<=d&&m<e.min){if(d<e.min)continue;g=(e.min-d)/(m-d)*(g-f)+f,m=e.min}if(m<=d&&d>e.max){if(m>e.max)continue;f=(e.max-d)/(m-d)*(g-f)+f,d=e.max}else if(d<=m&&m>e.max){if(d>e.max)continue;g=(e.max-d)/(m-d)*(g-f)+f,m=e.max}s||(x.beginPath(),x.moveTo(e.p2c(d),i.p2c(n)),s=!0),f>=i.max&&g>=i.max?(x.lineTo(e.p2c(d),i.p2c(i.max)),x.lineTo(e.p2c(m),i.p2c(i.max))):f<=i.min&&g<=i.min?(x.lineTo(e.p2c(d),i.p2c(i.min)),x.lineTo(e.p2c(m),i.p2c(i.min))):(u=d,p=m,f<=g&&f<i.min&&g>=i.min?(d=(i.min-f)/(g-f)*(m-d)+d,f=i.min):g<=f&&g<i.min&&f>=i.min&&(m=(i.min-f)/(g-f)*(m-d)+d,g=i.min),g<=f&&f>i.max&&g<=i.max?(d=(i.max-f)/(g-f)*(m-d)+d,f=i.max):f<=g&&g>i.max&&f<=i.max&&(m=(i.max-f)/(g-f)*(m-d)+d,g=i.max),d!=u&&x.lineTo(e.p2c(u),i.p2c(f)),x.lineTo(e.p2c(d),i.p2c(f)),x.lineTo(e.p2c(m),i.p2c(g)),m!=p&&(x.lineTo(e.p2c(m),i.p2c(g)),x.lineTo(e.p2c(p),i.p2c(g))))}}}(o.datapoints,o.xaxis,o.yaxis));0<n&&a(o.datapoints,0,0,o.xaxis,o.yaxis);x.restore()}if(i.bars.show&&!function(c){x.save(),x.translate(T.left,T.top),x.lineWidth=c.bars.lineWidth,x.strokeStyle=c.color;var t="left"==c.bars.align?0:-c.bars.barWidth/2,e=c.bars.fill?function(t,e){return m(c.bars,c.color,t,e)}:null;(function(t,e,i,o,a,n,r){for(var s=t.points,l=t.pointsize,h=0;h<s.length;h+=l)null!=s[h]&&O(s[h],s[h+1],s[h+2],e,i,o,a,n,r,x,c.bars.horizontal,c.bars.lineWidth)})(c.datapoints,t,t+c.bars.barWidth,0,e,c.xaxis,c.yaxis),x.restore()}(i),i.points.show){r=void 0;s=void 0;n=void 0;a=void 0;o=void 0;r=i;i=function(t,e,i,o,a,n,r,s){for(var l=t.points,h=t.pointsize,c=0;c<l.length;c+=h){var u=l[c],p=l[c+1];null==u||u<n.min||u>n.max||p<r.min||p>r.max||(x.beginPath(),u=n.p2c(u),p=r.p2c(p)+o,"circle"==s?x.arc(u,p,e,0,a?Math.PI:2*Math.PI,!1):s(x,u,p,e,a),x.closePath(),i&&(x.fillStyle=i,x.fill()),x.stroke())}};x.save(),x.translate(T.left,T.top);s=r.points.lineWidth,n=r.shadowSize,a=r.points.radius,o=r.points.symbol;0<s&&0<n&&(n=n/2,x.lineWidth=n,x.strokeStyle="rgba(0,0,0,0.1)",i(r.datapoints,a,null,n+n/2,!0,r.xaxis,r.yaxis,o),x.strokeStyle="rgba(0,0,0,0.2)",i(r.datapoints,a,null,n/2,!0,r.xaxis,r.yaxis,o));x.lineWidth=s,x.strokeStyle=r.color,i(r.datapoints,a,m(r.points,r.color),0,!1,r.xaxis,r.yaxis,o),x.restore()}}j(U.draw,[x]),t.show&&t.aboveData&&D()}function W(t,e){var o,a,n,r,s,l=Y();for(i=0;i<l.length;++i)if((o=l[i]).direction==e&&t[a=t[a=e+o.n+"axis"]||1!=o.n?a:e+"axis"]){r=t[a].from,s=t[a].to;break}return t[a]||(o=("x"==e?R:q)[0],r=t[e+"1"],s=t[e+"2"]),null!=r&&null!=s&&s<r&&(n=r,r=s,s=n),{from:r,to:s,axis:o}}function D(){x.save(),x.translate(T.left,T.top);var t,e=H.grid.markings;if(e)for(K.isFunction(e)&&((n=g.getAxes()).xmin=n.xaxis.min,n.xmax=n.xaxis.max,n.ymin=n.yaxis.min,n.ymax=n.yaxis.max,e=e(n)),t=0;t<e.length;++t){var i=e[t],o=W(i,"x"),a=W(i,"y");null==o.from&&(o.from=o.axis.min),null==o.to&&(o.to=o.axis.max),null==a.from&&(a.from=a.axis.min),null==a.to&&(a.to=a.axis.max),o.to<o.axis.min||o.from>o.axis.max||a.to<a.axis.min||a.from>a.axis.max||(o.from=Math.max(o.from,o.axis.min),o.to=Math.min(o.to,o.axis.max),a.from=Math.max(a.from,a.axis.min),a.to=Math.min(a.to,a.axis.max),o.from==o.to&&a.from==a.to)||(o.from=o.axis.p2c(o.from),o.to=o.axis.p2c(o.to),a.from=a.axis.p2c(a.from),a.to=a.axis.p2c(a.to),o.from==o.to||a.from==a.to?(x.beginPath(),x.strokeStyle=i.color||H.grid.markingsColor,x.lineWidth=i.lineWidth||H.grid.markingsLineWidth,x.moveTo(o.from,a.from),x.lineTo(o.to,a.to),x.stroke()):(x.fillStyle=i.color||H.grid.markingsColor,x.fillRect(o.from,a.to,o.to-o.from,a.from-a.to)))}for(var n=Y(),r=H.grid.borderWidth,s=0;s<n.length;++s){var l,h,c,u=n[s],p=u.box,d=u.tickLength;if(u.show&&0!=u.ticks.length){for(x.strokeStyle=u.options.tickColor||K.color.parse(u.options.color).scale("a",.22).toString(),x.lineWidth=1,"x"==u.direction?(l=0,h="full"==d?"top"==u.position?0:z:p.top-T.top+("top"==u.position?p.height:0)):(h=0,l="full"==d?"left"==u.position?0:S:p.left-T.left+("left"==u.position?p.width:0)),u.innermost||(x.beginPath(),m=c=0,"x"==u.direction?m=S:c=z,1==x.lineWidth&&(l=Math.floor(l)+.5,h=Math.floor(h)+.5),x.moveTo(l,h),x.lineTo(l+m,h+c),x.stroke()),x.beginPath(),t=0;t<u.ticks.length;++t){var f=u.ticks[t].v,m=c=0;f<u.min||f>u.max||"full"==d&&0<r&&(f==u.min||f==u.max)||("x"==u.direction?(l=u.p2c(f),c="full"==d?-z:d,"top"==u.position&&(c=-c)):(h=u.p2c(f),m="full"==d?-S:d,"left"==u.position&&(m=-m)),1==x.lineWidth&&("x"==u.direction?l=Math.floor(l)+.5:h=Math.floor(h)+.5),x.moveTo(l,h),x.lineTo(l+m,h+c))}x.stroke()}}r&&(x.lineWidth=r,x.strokeStyle=H.grid.borderColor,x.strokeRect(-r/2,-r/2,S+r,z+r)),x.restore()}function O(t,e,i,o,a,n,r,s,l,h,c,u){var p,d,f,m,g,x,b,v,y;c?(g=!(v=x=b=!0),m=e+o,f=e+a,(d=t)<(p=i)&&(y=d,d=p,p=y,x=!(g=!0))):(v=!(g=x=b=!0),p=t+o,d=t+a,(m=e)<(f=i)&&(y=m,m=f,f=y,b=!(v=!0))),d<s.min||p>s.max||m<l.min||f>l.max||(p<s.min&&(p=s.min,g=!1),d>s.max&&(d=s.max,x=!1),f<l.min&&(f=l.min,v=!1),m>l.max&&(m=l.max,b=!1),p=s.p2c(p),f=l.p2c(f),d=s.p2c(d),m=l.p2c(m),r&&(h.beginPath(),h.moveTo(p,f),h.lineTo(p,m),h.lineTo(d,m),h.lineTo(d,f),h.fillStyle=r(f,m),h.fill()),0<u&&(g||x||b||v)&&(h.beginPath(),h.moveTo(p,f+n),g?h.lineTo(p,m+n):h.moveTo(p,m+n),b?h.lineTo(d,m+n):h.moveTo(d,m+n),x?h.lineTo(d,f+n):h.moveTo(d,f+n),v?h.lineTo(p,f+n):h.moveTo(p,f+n),h.stroke()))}function m(t,e,i,o){var a=t.fill;return a?t.fillColor?Z(t.fillColor,i,o,e):((t=K.color.parse(e)).a="number"==typeof a?a:.4,t.normalize(),t.toString()):null}t=0==t.length||0==u?(F.html(""),F.css({padding:0}),"static"==F.css("position")&&F.css("position","relative"),M(),n=f(!0,"base"),r=f(!1,"overlay"),!1):(n=t.get(0),r=u.get(0),!0),x=n.getContext("2d"),s=r.getContext("2d"),c=K([r,n]),t&&(F.data("plot").shutdown(),g.resize(),s.clearRect(0,0,P,I),c.unbind(),F.children().not([n,r]).remove()),F.data("plot",g),p(w),L(),A(),H.grid.hoverable&&(c.mousemove(X),c.mouseleave(V)),H.grid.clickable&&c.click(G),j(U.bindEvents,[c]);var b=[],v=null;function X(t){H.grid.hoverable&&y("plothover",t,function(t){return 0!=t.hoverable})}function V(t){H.grid.hoverable&&y("plothover",t,function(t){return!1})}function G(t){y("plotclick",t,function(t){return 0!=t.clickable})}function y(t,e,i){var o=c.offset(),a=e.pageX-o.left-T.left,n=e.pageY-o.top-T.top,r=d({left:a,top:n}),s=(r.pageX=e.pageX,r.pageY=e.pageY,function(t,e,i){for(var o=H.grid.mouseActiveRadius,a=o*o+1,n=null,r=N.length-1;0<=r;--r)if(i(N[r])){var s=N[r],l=s.xaxis,h=s.yaxis,c=s.datapoints.points,u=s.datapoints.pointsize,p=l.c2p(t),d=h.c2p(e),f=o/l.scale,m=o/h.scale;if(l.options.inverseTransform&&(f=Number.MAX_VALUE),h.options.inverseTransform&&(m=Number.MAX_VALUE),s.lines.show||s.points.show)for(k=0;k<c.length;k+=u){var g,x=c[k],b=c[k+1];null==x||f<x-p||x-p<-f||m<b-d||b-d<-m||(g=(g=Math.abs(l.p2c(x)-t))*g+(g=Math.abs(h.p2c(b)-e))*g)<a&&(a=g,n=[r,k/u])}if(s.bars.show&&!n)for(var v="left"==s.bars.align?0:-s.bars.barWidth/2,y=v+s.bars.barWidth,k=0;k<c.length;k+=u){var x=c[k],b=c[k+1],w=c[k+2];null!=x&&(N[r].bars.horizontal?p<=Math.max(w,x)&&p>=Math.min(w,x)&&b+v<=d&&d<=b+y:x+v<=p&&p<=x+y&&d>=Math.min(w,b)&&d<=Math.max(w,b))&&(n=[r,k/u])}}return n?(r=n[0],k=n[1],u=N[r].datapoints.pointsize,{datapoint:N[r].datapoints.points.slice(k*u,(k+1)*u),dataIndex:k,series:N[r],seriesIndex:r}):null}(a,n,i));if(s&&(s.pageX=parseInt(s.series.xaxis.p2c(s.datapoint[0])+o.left+T.left),s.pageY=parseInt(s.series.yaxis.p2c(s.datapoint[1])+o.top+T.top)),H.grid.autoHighlight){for(var l=0;l<b.length;++l){var h=b[l];h.auto!=t||s&&h.series==s.series&&h.point[0]==s.datapoint[0]&&h.point[1]==s.datapoint[1]||J(h.series,h.point)}s&&_(s.series,s.datapoint,t)}F.trigger(t,[r,s])}function k(){v=v||setTimeout(Q,30)}function Q(){var t,e,i,o,a,n,r;for(v=null,s.save(),s.clearRect(0,0,P,I),s.translate(T.left,T.top),t=0;t<b.length;++t)(i=b[t]).series.bars.show?function(t,e){s.lineWidth=t.bars.lineWidth,s.strokeStyle=K.color.parse(t.color).scale("a",.5).toString();var i=K.color.parse(t.color).scale("a",.5).toString(),o="left"==t.bars.align?0:-t.bars.barWidth/2;O(e[0],e[1],e[2]||0,o,o+t.bars.barWidth,0,function(){return i},t.xaxis,t.yaxis,s,t.bars.horizontal,t.bars.lineWidth)}(i.series,i.point):(e=i.series,i=i.point,r=n=a=o=void 0,a=i[0],i=i[1],n=e.xaxis,r=e.yaxis,a<n.min||a>n.max||i<r.min||i>r.max||(o=e.points.radius+e.points.lineWidth/2,s.lineWidth=o,s.strokeStyle=K.color.parse(e.color).scale("a",.5).toString(),o=1.5*o,a=n.p2c(a),i=r.p2c(i),s.beginPath(),"circle"==e.points.symbol?s.arc(a,i,o,0,2*Math.PI,!1):e.points.symbol(s,a,i,o,!1),s.closePath(),s.stroke()));s.restore(),j(U.drawOverlay,[s])}function _(t,e,i){"number"==typeof t&&(t=N[t]),"number"==typeof e&&(o=t.datapoints.pointsize,e=t.datapoints.points.slice(o*e,o*(e+1)));var o=$(t,e);-1==o?(b.push({series:t,point:e,auto:i}),k()):i||(b[o].auto=!1)}function J(t,e){null==t&&null==e&&(b=[],k());t=$(t="number"==typeof t?N[t]:t,e="number"==typeof e?t.data[e]:e);-1!=t&&(b.splice(t,1),k())}function $(t,e){for(var i=0;i<b.length;++i){var o=b[i];if(o.series==t&&o.point[0]==e[0]&&o.point[1]==e[1])return i}return-1}function Z(t,e,i,o){if("string"==typeof t)return t;for(var a=x.createLinearGradient(0,i,0,e),n=0,r=t.colors.length;n<r;++n){var s,l=t.colors[n];"string"!=typeof l&&(s=K.color.parse(o),null!=l.brightness&&(s=s.scale("rgb",l.brightness)),null!=l.opacity&&(s.a*=l.opacity),l=s.toString()),a.addColorStop(n/(r-1),l)}return a}}function tt(t,e){return e*Math.floor(t/e)}K.plot=function(t,e,i){return new o(K(t),e,i,K.plot.plugins)},K.plot.version="0.7",K.plot.plugins=[],K.plot.formatDate=function(t,e,i){function o(t){return 1==(t=""+t).length?"0"+t:t}var a=[],n=!1,r=!1,s=t.getUTCHours(),l=s<12;null==i&&(i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),-1!=e.search(/%p|%P/)&&(12<s?s-=12:0==s&&(s=12));for(var h=0;h<e.length;++h){var c=e.charAt(h);if(n){switch(c){case"h":c=""+s;break;case"H":c=o(s);break;case"M":c=o(t.getUTCMinutes());break;case"S":c=o(t.getUTCSeconds());break;case"d":c=""+t.getUTCDate();break;case"m":c=""+(t.getUTCMonth()+1);break;case"y":c=""+t.getUTCFullYear();break;case"b":c=""+i[t.getUTCMonth()];break;case"p":c=l?"am":"pm";break;case"P":c=l?"AM":"PM";break;case"0":r=!(c="")}c&&r&&(c=o(c),r=!1),a.push(c),r||(n=!1)}else"%"==c?n=!0:a.push(c)}return a.join("")}}(jQuery),function(i){function b(t,e){return e*Math.floor(t/e)}function r(t,e,i,o){if("function"==typeof t.strftime)return t.strftime(e);function a(t,e){return e=""+(null==e?"0":e),1==(t=""+t).length?e+t:t}var n=[],r=!1,s=t.getHours(),l=s<12;null==i&&(i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),null==o&&(o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);for(var h=12<s?s-12:0==s?12:s,c=0;c<e.length;++c){var u=e.charAt(c);if(r){switch(u){case"a":u=""+o[t.getDay()];break;case"b":u=""+i[t.getMonth()];break;case"d":u=a(t.getDate());break;case"e":u=a(t.getDate()," ");break;case"h":case"H":u=a(s);break;case"I":u=a(h);break;case"l":u=a(h," ");break;case"m":u=a(t.getMonth()+1);break;case"M":u=a(t.getMinutes());break;case"q":u=""+(Math.floor(t.getMonth()/3)+1);break;case"S":u=a(t.getSeconds());break;case"y":u=a(t.getFullYear()%100);break;case"Y":u=""+t.getFullYear();break;case"p":u=l?"am":"pm";break;case"P":u=l?"AM":"PM";break;case"w":u=""+t.getDay()}n.push(u),r=!1}else"%"==u?r=!0:n.push(u)}return n.join("")}function o(t){function e(t,e,i,o){t[e]=function(){return i[o].apply(i,arguments)}}for(var i={date:t},o=(null!=t.strftime&&e(i,"strftime",t,"strftime"),e(i,"getTime",t,"getTime"),e(i,"setTime",t,"setTime"),["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds"]),a=0;a<o.length;a++)e(i,"get"+o[a],t,"getUTC"+o[a]),e(i,"set"+o[a],t,"setUTC"+o[a]);return i}function v(t,e){var i;return"browser"==e.timezone?new Date(t):e.timezone&&"utc"!=e.timezone&&"undefined"!=typeof timezoneJS&&void 0!==timezoneJS.Date?((i=new timezoneJS.Date).setTimezone(e.timezone),i.setTime(t),i):o(new Date(t))}var y={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},t=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],k=t.concat([[3,"month"],[6,"month"],[1,"year"]]),w=t.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);i.plot.plugins.push({init:function(t){t.hooks.processOptions.push(function(t,e){i.each(t.getAxes(),function(t,e){var x=e.options;"time"==x.mode&&(e.tickGenerator=function(t){var e=[],i=v(t.min,x),o=0,a=x.tickSize&&"quarter"===x.tickSize[1]||x.minTickSize&&"quarter"===x.minTickSize[1]?w:k;null!=x.minTickSize&&(o="number"==typeof x.tickSize?x.tickSize:x.minTickSize[0]*y[x.minTickSize[1]]);for(var n=0;n<a.length-1&&!(t.delta<(a[n][0]*y[a[n][1]]+a[n+1][0]*y[a[n+1][1]])/2&&a[n][0]*y[a[n][1]]>=o);++n);var r,s,l=a[n][0],h=("year"==(c=a[n][1])&&(null!=x.minTickSize&&"year"==x.minTickSize[1]?l=Math.floor(x.minTickSize[0]):(r=Math.pow(10,Math.floor(Math.log(t.delta/y.year)/Math.LN10)),l=(s=t.delta/y.year/r)<1.5?1:s<3?2:s<7.5?5:10,l*=r),l<1)&&(l=1),t.tickSize=x.tickSize||[l,c],t.tickSize[0]),c=t.tickSize[1],u=h*y[c],p=("second"==c?i.setSeconds(b(i.getSeconds(),h)):"minute"==c?i.setMinutes(b(i.getMinutes(),h)):"hour"==c?i.setHours(b(i.getHours(),h)):"month"==c?i.setMonth(b(i.getMonth(),h)):"quarter"==c?i.setMonth(3*b(i.getMonth()/3,h)):"year"==c&&i.setFullYear(b(i.getFullYear(),h)),i.setMilliseconds(0),y.minute<=u&&i.setSeconds(0),y.hour<=u&&i.setMinutes(0),y.day<=u&&i.setHours(0),4*y.day<=u&&i.setDate(1),2*y.month<=u&&i.setMonth(b(i.getMonth(),3)),2*y.quarter<=u&&i.setMonth(b(i.getMonth(),6)),y.year<=u&&i.setMonth(0),0),d=Number.NaN;do{var f,m,g=d,d=i.getTime()}while(e.push(d),"month"==c||"quarter"==c?h<1?(i.setDate(1),f=i.getTime(),i.setMonth(i.getMonth()+("quarter"==c?3:1)),m=i.getTime(),i.setTime(d+p*y.hour+(m-f)*h),p=i.getHours(),i.setHours(0)):i.setMonth(i.getMonth()+h*("quarter"==c?3:1)):"year"==c?i.setFullYear(i.getFullYear()+h):i.setTime(d+u),d<t.max&&d!=g);return e},e.tickFormatter=function(t,e){var i,o,a,n,t=v(t,e.options);return null!=x.timeformat?r(t,x.timeformat,x.monthNames,x.dayNames):(i=e.options.tickSize&&"quarter"==e.options.tickSize[1]||e.options.minTickSize&&"quarter"==e.options.minTickSize[1],o=e.tickSize[0]*y[e.tickSize[1]],e=e.max-e.min,a=x.twelveHourClock?" %p":"",n=x.twelveHourClock?"%I":"%H",r(t,o<y.minute?n+":%M:%S"+a:o<y.day?e<2*y.day?n+":%M"+a:"%b %d "+n+":%M"+a:o<y.month?"%b %d":i&&o<y.quarter||!i&&o<y.year?e<y.year?"%b":"%b %Y":i&&o<y.year?e<y.year?"Q%q":"Q%q %Y":"%Y",x.monthNames,x.dayNames))})})})},options:{xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null}},name:"time",version:"1.0"}),i.plot.formatDate=r,i.plot.dateGenerator=v}(jQuery),function(a){function e(t){this.tipPosition={x:0,y:0},this.init(t)}e.prototype.init=function(t){function i(t){var e={};e.x=t.pageX,e.y=t.pageY,n.updateTooltipPosition(e)}function o(t,e,i){var o,a=n.getDomElement();i?(o=n.stringFormat(n.tooltipOptions.content,i),a.html(o),n.updateTooltipPosition({x:e.pageX,y:e.pageY}),a.css({left:n.tipPosition.x+n.tooltipOptions.shifts.x,top:n.tipPosition.y+n.tooltipOptions.shifts.y}).show(),"function"==typeof n.tooltipOptions.onHover&&n.tooltipOptions.onHover(i,a)):a.hide().html("")}var n=this;t.hooks.bindEvents.push(function(t,e){n.plotOptions=t.getOptions(),!1!==n.plotOptions.tooltip&&void 0!==n.plotOptions.tooltip&&(n.tooltipOptions=n.plotOptions.tooltipOpts,n.getDomElement(),a(t.getPlaceholder()).bind("plothover",o),a(e).bind("mousemove",i))}),t.hooks.shutdown.push(function(t,e){a(t.getPlaceholder()).unbind("plothover",o),a(e).unbind("mousemove",i)})},e.prototype.getDomElement=function(){var t;return 0<a("#flotTip").length?t=a("#flotTip"):((t=a("<div />").attr("id","flotTip")).appendTo("body").hide().css({position:"absolute"}),this.tooltipOptions.defaultTheme&&t.css({background:"#fff","z-index":"100",padding:"0.4em 0.6em","border-radius":"0.5em","font-size":"0.8em",border:"1px solid #111",display:"none","white-space":"nowrap"})),t},e.prototype.updateTooltipPosition=function(t){var e=a("#flotTip").outerWidth()+this.tooltipOptions.shifts.x,i=a("#flotTip").outerHeight()+this.tooltipOptions.shifts.y;t.x-a(window).scrollLeft()>a(window).innerWidth()-e&&(t.x-=e),t.y-a(window).scrollTop()>a(window).innerHeight()-i&&(t.y-=i),this.tipPosition.x=t.x,this.tipPosition.y=t.y},e.prototype.stringFormat=function(t,e){var i=/%x\.{0,1}(?:\d{0,})/,o=/%y\.{0,1}(?:\d{0,})/;return"function"==typeof t&&(t=t(e.series.label,e.series.data[e.dataIndex][0],e.series.data[e.dataIndex][1],e)),void 0!==e.series.percent&&(t=this.adjustValPrecision(/%p\.{0,1}(\d{0,})/,t,e.series.percent)),void 0!==e.series.label&&(t=t.replace(/%s/,e.series.label)),this.isTimeMode("xaxis",e)&&this.isXDateFormat(e)&&(t=t.replace(i,this.timestampToDate(e.series.data[e.dataIndex][0],this.tooltipOptions.xDateFormat))),this.isTimeMode("yaxis",e)&&this.isYDateFormat(e)&&(t=t.replace(o,this.timestampToDate(e.series.data[e.dataIndex][1],this.tooltipOptions.yDateFormat))),"number"==typeof e.series.data[e.dataIndex][0]&&(t=this.adjustValPrecision(i,t,e.series.data[e.dataIndex][0])),"number"==typeof e.series.data[e.dataIndex][1]&&(t=this.adjustValPrecision(o,t,e.series.data[e.dataIndex][1])),void 0!==e.series.xaxis.tickFormatter&&(t=t.replace(i,e.series.xaxis.tickFormatter(e.series.data[e.dataIndex][0],e.series.xaxis))),t=void 0!==e.series.yaxis.tickFormatter?t.replace(o,e.series.yaxis.tickFormatter(e.series.data[e.dataIndex][1],e.series.yaxis)):t},e.prototype.isTimeMode=function(t,e){return void 0!==e.series[t].options.mode&&"time"===e.series[t].options.mode},e.prototype.isXDateFormat=function(){return void 0!==this.tooltipOptions.xDateFormat&&null!==this.tooltipOptions.xDateFormat},e.prototype.isYDateFormat=function(){return void 0!==this.tooltipOptions.yDateFormat&&null!==this.tooltipOptions.yDateFormat},e.prototype.timestampToDate=function(t,e){t=new Date(t);return a.plot.formatDate(t,e)};a.plot.plugins.push({init:function(t){new e(t)},options:{tooltip:!(e.prototype.adjustValPrecision=function(t,e,i){var o;return null!==e.match(t)&&""!==RegExp.$1&&(o=RegExp.$1,i=i.toFixed(o),e=e.replace(t,i)),e}),tooltipOpts:{content:"%s | X: %x | Y: %y",xDateFormat:null,yDateFormat:null,shifts:{x:10,y:20},defaultTheme:!0,onHover:function(){}}},name:"tooltip",version:"0.6.1"})}(jQuery),function(v){"use strict";function y(t,e,i,o,a,n,r){var s=Math.pow,l=Math.sqrt,h=l(s(i-t,2)+s(o-e,2)),h=r*h/(h+l(s(a-i,2)+s(n-o,2))),l=r-h;return[i+h*(t-a),o+h*(e-n),i-l*(t-a),o-l*(e-n)]}var k=[];function w(t,e,i,o){(void 0===e||"bezier"!==e&&"quadratic"!==e)&&(e="quadratic"),e+="CurveTo",0==k.length?k.push([i[0],i[1],o.concat(i.slice(2)),e]):"quadraticCurveTo"==e&&2==i.length?(o=o.slice(0,2).concat(i),k.push([i[0],i[1],o,e])):k.push([i[2],i[3],o.concat(i.slice(2)),e])}function e(t,e,i){if(!0===i.splines.show){var o,a,n,r=[],s=i.splines.tension||.5,l=i.datapoints.points,h=i.datapoints.pointsize,c=t.getPlotOffset(),u=l.length,p=[];if(k=[],u/h<4)v.extend(i.lines,i.splines);else{for(o=0;o<u;o+=h)a=l[o],n=l[o+1],null==a||a<i.xaxis.min||a>i.xaxis.max||n<i.yaxis.min||n>i.yaxis.max||p.push(i.xaxis.p2c(a)+c.left,i.yaxis.p2c(n)+c.top);for(u=p.length,o=0;o<u-2;o+=2)r=r.concat(y.apply(this,p.slice(o,o+6).concat([s])));for(e.save(),e.strokeStyle=i.color,e.lineWidth=i.splines.lineWidth,w(0,"quadratic",p.slice(0,4),r.slice(0,2)),o=2;o<u-3;o+=2)w(0,"bezier",p.slice(o,o+4),r.slice(2*o-2,2*o+2));w(0,"quadratic",p.slice(u-2,u),[r[2*u-10],r[2*u-9],p[u-4],p[u-3]]);var d=k,f=e,t=t.height()+10,m=i.splines.fill,g=i.color;(g=v.color.parse(g)).a="number"==typeof m?m:.3,g.normalize(),g=g.toString(),f.beginPath(),f.moveTo(d[0][0],d[0][1]);for(var x=d.length,b=0;b<x;b++)f[d[b][3]].apply(f,d[b][2]);f.stroke(),f.lineWidth=0,f.lineTo(d[x-1][0],t),f.lineTo(d[0][0],t),f.closePath(),!1!==m&&(f.fillStyle=g,f.fill()),e.restore()}}}v.plot.plugins.push({init:function(t){t.hooks.drawSeries.push(e)},options:{series:{splines:{show:!1,lineWidth:2,tension:.5,fill:!1}}},name:"spline",version:"0.8.2"})}(jQuery),function(r,s,l){var h,c=[],u=r.resize=r.extend(r.resize,{}),p=!1,i="setTimeout",d="resize",f=d+"-special-event",m="pendingDelay",o="activeDelay",a="throttleWindow";function g(t){!0===p&&(p=t||1);for(var e=c.length-1;0<=e;e--){var i,o,a,n=r(c[e]);n[0]==s||n.is(":visible")?(i=n.width(),o=n.height(),!(a=n.data(f))||i===a.w&&o===a.h||(n.trigger(d,[a.w=i,a.h=o]),p=t||!0)):((a=n.data(f)).w=0,a.h=0)}null!==h&&(p&&(null==t||t-p<1e3)?h=s.requestAnimationFrame(g):(h=setTimeout(g,u[m]),p=!1))}u[m]=200,u[o]=20,u[a]=!0,r.event.special[d]={setup:function(){if(!u[a]&&this[i])return!1;var t=r(this);c.push(this),t.data(f,{w:t.width(),h:t.height()}),1===c.length&&(h=l,g())},teardown:function(){if(!u[a]&&this[i])return!1;for(var t=r(this),e=c.length-1;0<=e;e--)if(c[e]==this){c.splice(e,1);break}t.removeData(f),c.length||((p?cancelAnimationFrame:clearTimeout)(h),h=null)},add:function(t){var n;return!(!u[a]&&this[i])&&(r.isFunction(t)?(n=t,e):(n=t.handler,void(t.handler=e)));function e(t,e,i){var o=r(this),a=o.data(f)||{};a.w=e!==l?e:o.width(),a.h=i!==l?i:o.height(),n.apply(this,arguments)}}},s.requestAnimationFrame||(s.requestAnimationFrame=s.webkitRequestAnimationFrame||s.mozRequestAnimationFrame||s.oRequestAnimationFrame||s.msRequestAnimationFrame||function(t,e){return s.setTimeout(function(){t((new Date).getTime())},u[o])}),s.cancelAnimationFrame||(s.cancelAnimationFrame=s.webkitCancelRequestAnimationFrame||s.mozCancelRequestAnimationFrame||s.oCancelRequestAnimationFrame||s.msCancelRequestAnimationFrame||clearTimeout)}(jQuery,this),jQuery.plot.plugins.push({init:function(e){function i(){var t=e.getPlaceholder();0!=t.width()&&0!=t.height()&&(e.resize(),e.setupGrid(),e.draw())}e.hooks.bindEvents.push(function(t,e){t.getPlaceholder().resize(i)}),e.hooks.shutdown.push(function(t,e){t.getPlaceholder().unbind("resize",i)})},options:{},name:"resize",version:"1.0"}),function(y){y.plot.plugins.push({init:function(h){var a,c=null,u=null,p=null,d=null,f=null,n=!1,m=null,g=[];function x(t){var e;0<u.series.pie.innerRadius&&(t.save(),e=1<u.series.pie.innerRadius?u.series.pie.innerRadius:p*u.series.pie.innerRadius,t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle=u.series.pie.stroke.color,t.arc(0,0,e,0,2*Math.PI,!1),t.fill(),t.closePath(),t.restore(),t.save(),t.beginPath(),t.strokeStyle=u.series.pie.stroke.color,t.arc(0,0,e,0,2*Math.PI,!1),t.stroke(),t.closePath(),t.restore())}function b(t,e){for(var i,o,a=h.getData(),n=h.getOptions(),r=1<n.series.pie.radius?n.series.pie.radius:p*n.series.pie.radius,s=0;s<a.length;++s){var l=a[s];if(l.pie.show){if(m.save(),m.beginPath(),m.moveTo(0,0),m.arc(0,0,r,l.startAngle,l.startAngle+l.angle/2,!1),m.arc(0,0,r,l.startAngle+l.angle/2,l.startAngle+l.angle,!1),m.closePath(),i=t-d,o=e-f,m.isPointInPath){if(m.isPointInPath(t-d,e-f))return m.restore(),{datapoint:[l.percent,l.data],dataIndex:0,series:l,seriesIndex:s}}else if(function(t,e){for(var i=!1,o=-1,a=t.length,n=a-1;++o<a;n=o)(t[o][1]<=e[1]&&e[1]<t[n][1]||t[n][1]<=e[1]&&e[1]<t[o][1])&&e[0]<(t[n][0]-t[o][0])*(e[1]-t[o][1])/(t[n][1]-t[o][1])+t[o][0]&&(i=!i);return i}([[0,0],[r*Math.cos(l.startAngle),r*Math.sin(l.startAngle)],[r*Math.cos(l.startAngle+l.angle/4),r*Math.sin(l.startAngle+l.angle/4)],[r*Math.cos(l.startAngle+l.angle/2),r*Math.sin(l.startAngle+l.angle/2)],[r*Math.cos(l.startAngle+l.angle/1.5),r*Math.sin(l.startAngle+l.angle/1.5)],[r*Math.cos(l.startAngle+l.angle),r*Math.sin(l.startAngle+l.angle)]],[i,o]))return m.restore(),{datapoint:[l.percent,l.data],dataIndex:0,series:l,seriesIndex:s};m.restore()}}return null}function i(t){e("plothover",t)}function o(t){e("plotclick",t)}function e(t,e){var i,o,a=h.offset(),n=b(parseInt(e.pageX-a.left),parseInt(e.pageY-a.top));if(u.grid.autoHighlight)for(var r=0;r<g.length;++r){var s,l=g[r];l.auto!=t||n&&l.series==n.series||(s=void 0,null==(s=l.series)&&(g=[],h.triggerRedrawOverlay()),-1!=(s=v(s))&&(g.splice(s,1),h.triggerRedrawOverlay()))}n&&(a=n.series,i=t,-1==(o=v(a))?(g.push({series:a,auto:i}),h.triggerRedrawOverlay()):i||(g[o].auto=!1));a={pageX:e.pageX,pageY:e.pageY};c.trigger(t,[a,n])}function v(t){for(var e=0;e<g.length;++e)if(g[e].series==t)return e;return-1}h.hooks.processOptions.push(function(t,e){e.series.pie.show&&(e.grid.show=!1,"auto"==e.series.pie.label.show&&(e.legend.show?e.series.pie.label.show=!1:e.series.pie.label.show=!0),"auto"==e.series.pie.radius&&(e.series.pie.label.show?e.series.pie.radius=.75:e.series.pie.radius=1),1<e.series.pie.tilt?e.series.pie.tilt=1:e.series.pie.tilt<0&&(e.series.pie.tilt=0))}),h.hooks.bindEvents.push(function(t,e){t=t.getOptions();t.series.pie.show&&(t.grid.hoverable&&e.unbind("mousemove").mousemove(i),t.grid.clickable)&&e.unbind("click").click(o)}),h.hooks.processDatapoints.push(function(t,e,i,o){t.getOptions().series.pie.show&&(t=t,n||(n=!0,a=t.getCanvas(),c=y(a).parent(),u=t.getOptions(),t.setData(function(t){for(var e=0,i=0,o=0,a=u.series.pie.combine.color,n=[],r=0;r<t.length;++r){var s=t[r].data;y.isArray(s)&&1==s.length&&(s=s[0]),y.isArray(s)?!isNaN(parseFloat(s[1]))&&isFinite(s[1])?s[1]=+s[1]:s[1]=0:s=!isNaN(parseFloat(s))&&isFinite(s)?[1,+s]:[1,0],t[r].data=[s]}for(r=0;r<t.length;++r)e+=t[r].data[0][1];for(r=0;r<t.length;++r)(s=t[r].data[0][1])/e<=u.series.pie.combine.threshold&&(i+=s,o++,a=a||t[r].color);for(r=0;r<t.length;++r){s=t[r].data[0][1];(o<2||s/e>u.series.pie.combine.threshold)&&n.push(y.extend(t[r],{data:[[1,s]],color:t[r].color,label:t[r].label,angle:s*Math.PI*2/e,percent:s/(e/100)}))}1<o&&n.push({data:[[1,i]],color:a,label:u.series.pie.combine.label,angle:i*Math.PI*2/e,percent:i/(e/100)});return n}(t.getData()))))}),h.hooks.drawOverlay.push(function(t,e){if(t.getOptions().series.pie.show){var i=e,o=t.getOptions(),a=1<o.series.pie.radius?o.series.pie.radius:p*o.series.pie.radius;i.save(),i.translate(d,f),i.scale(1,o.series.pie.tilt);for(var n=0;n<g.length;++n){r=void 0;var r=g[n].series;r.angle<=0||isNaN(r.angle)||(i.fillStyle="rgba(255, 255, 255, "+o.series.pie.highlight.opacity+")",i.beginPath(),1e-9<Math.abs(r.angle-2*Math.PI)&&i.moveTo(0,0),i.arc(0,0,a,r.startAngle,r.startAngle+r.angle/2,!1),i.arc(0,0,a,r.startAngle+r.angle/2,r.startAngle+r.angle,!1),i.closePath(),i.fill())}x(i),i.restore()}}),h.hooks.draw.push(function(t,e){if(t.getOptions().series.pie.show){if(c){for(var r=t.getPlaceholder().width(),s=t.getPlaceholder().height(),i=c.children().filter(".legend").children().width()||0,l=(m=e,n=!1,p=Math.min(r,s/u.series.pie.tilt)/2,f=s/2+u.series.pie.offset.top,d=r/2,"auto"==u.series.pie.offset.left?(u.legend.position.match("w")?d+=i/2:d-=i/2,d<p?d=p:r-p<d&&(d=r-p)):d+=u.series.pie.offset.left,t.getData()),o=0;0<o&&(p*=.95),o+=1,a(),u.series.pie.tilt<=.8&&function(){var t=u.series.pie.shadow.left,e=u.series.pie.shadow.top,i=u.series.pie.shadow.alpha,o=1<u.series.pie.radius?u.series.pie.radius:p*u.series.pie.radius;if(!(r/2-t<=o||o*u.series.pie.tilt>=s/2-e||o<=10)){m.save(),m.translate(t,e),m.globalAlpha=i,m.fillStyle="#000",m.translate(d,f),m.scale(1,u.series.pie.tilt);for(var a=1;a<=10;a++)m.beginPath(),m.arc(0,0,o,0,2*Math.PI,!1),m.fill(),o-=a;m.restore()}}(),!function(){for(var i=Math.PI*u.series.pie.startAngle,o=1<u.series.pie.radius?u.series.pie.radius:p*u.series.pie.radius,a=(m.save(),m.translate(d,f),m.scale(1,u.series.pie.tilt),m.save(),i),t=0;t<l.length;++t)l[t].startAngle=a,e(l[t].angle,l[t].color,!0);if(m.restore(),0<u.series.pie.stroke.width){m.save(),m.lineWidth=u.series.pie.stroke.width,a=i;for(t=0;t<l.length;++t)e(l[t].angle,u.series.pie.stroke.color,!1);m.restore()}return x(m),m.restore(),!u.series.pie.label.show||function(){for(var t=i,n=1<u.series.pie.label.radius?u.series.pie.label.radius:p*u.series.pie.label.radius,e=0;e<l.length;++e){if(l[e].percent>=100*u.series.pie.label.threshold&&!function(t,e,i){if(0!=t.data[0][1]){var o=u.legend.labelFormatter,a=u.series.pie.label.formatter,a=(o=o?o(t.label,t):t.label,a&&(o=a(o,t)),(e+t.angle+e)/2),e=d+Math.round(Math.cos(a)*n),a=f+Math.round(Math.sin(a)*n)*u.series.pie.tilt,o="<span class='pieLabel' id='pieLabel"+i+"' style='position:absolute;top:"+a+"px;left:"+e+"px;'>"+o+"</span>",o=(c.append(o),c.children("#pieLabel"+i)),i=a-o.height()/2,a=e-o.width()/2;if(o.css("top",i),o.css("left",a),0<0-i||0<0-a||s-(i+o.height())<0||r-(a+o.width())<0)return;0!=u.series.pie.label.background.opacity&&(null==(e=u.series.pie.label.background.color)&&(e=t.color),t="top:"+i+"px;left:"+a+"px;",y("<div class='pieLabelBackground' style='position:absolute;width:"+o.width()+"px;height:"+o.height()+"px;"+t+"background-color:"+e+";'></div>").css("opacity",u.series.pie.label.background.opacity).insertBefore(o))}return 1}(l[e],t,e))return;t+=l[e].angle}return 1}();function e(t,e,i){t<=0||isNaN(t)||(i?m.fillStyle=e:(m.strokeStyle=e,m.lineJoin="round"),m.beginPath(),1e-9<Math.abs(t-2*Math.PI)&&m.moveTo(0,0),m.arc(0,0,o,a,a+t/2,!1),m.arc(0,0,o,a+t/2,a+t,!1),m.closePath(),a+=t,i?m.fill():m.stroke())}}()&&o<10;);10<=o&&(a(),c.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>")),t.setSeries&&t.insertLegend&&(t.setSeries(l),t.insertLegend())}function a(){m.clearRect(0,0,r,s),c.children().filter(".pieLabel, .pieLabelBackground").remove()}}})},options:{series:{pie:{show:!1,radius:"auto",innerRadius:0,startAngle:1.5,tilt:1,shadow:{left:5,top:15,alpha:.02},offset:{top:0,left:"auto"},stroke:{color:"#fff",width:1},label:{show:"auto",formatter:function(t,e){return"<div style='font-size:x-small;text-align:center;padding:2px;color:"+e.color+";'>"+t+"<br/>"+Math.round(e.percent)+"%</div>"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}},name:"pie",version:"1.1"})}(jQuery),jQuery.plot.plugins.push({init:function(t){function i(t,e,i){var o=i.points.length/i.pointsize;if(1==e.curvedLines.apply&&void 0===e.originSeries&&1.5<o)if(e.lines.fill)for(var a=h(i,e.curvedLines,1),n=h(i,e.curvedLines,2),r=(i.pointsize=3,i.points=[],0),s=0,l=0;l<a.length||r<n.length;)a[l]==n[r]?(i.points[s]=a[l],i.points[s+1]=a[l+1],i.points[s+2]=n[r+1],r+=2,l+=2):a[l]<n[r]?(i.points[s]=a[l],i.points[s+1]=a[l+1],i.points[s+2]=0<s?i.points[s-1]:null,l+=2):(i.points[s]=n[r],i.points[s+1]=1<s?i.points[s-2]:null,i.points[s+2]=n[r+1],r+=2),s+=3;else 0<e.lines.lineWidth&&(i.points=h(i,e.curvedLines,1),i.pointsize=2)}function h(t,e,i){var o,a=t.points,n=t.pointsize,r=e.curvePointFactor*(a.length/n),s=new Array,l=new Array,h=-1,c=-1,u=0;if(e.fit){o=void 0===e.fitPointDist?(t=a[0],(a[a.length-n]-t)/5e4):e.fitPointDist;for(var p=0;p<a.length;p+=n){for(var c=p+i,d=a[h=p]-o,f=a[h]+o,m=2;d==a[h]||f==a[h];)d=a[h]-o*m,f=a[h]+o*m,m++;s[u]=d,l[u]=a[c],s[++u]=a[h],l[u]=a[c],s[++u]=f,l[u]=a[c],u++}}else for(p=0;p<a.length;p+=n)c=(h=p)+i,s[u]=a[h],l[u]=a[c],u++;var g=s.length,x=new Array,b=new Array;x[0]=0,b[x[g-1]=0]=0;for(p=1;p<g-1;++p){var v=s[p+1]-s[p-1];if(0==v)return[];var v=(s[p]-s[p-1])/v,y=v*x[p-1]+2;x[p]=(v-1)/y,b[p]=(l[p+1]-l[p])/(s[p+1]-s[p])-(l[p]-l[p-1])/(s[p]-s[p-1]),b[p]=(6*b[p]/(s[p+1]-s[p-1])-v*b[p-1])/y}for(u=g-2;0<=u;--u)x[u]=x[u]*x[u+1]+b[u];var k=(s[g-1]-s[0])/(r-1),w=new Array,M=new Array,T=new Array;for(w[0]=s[0],M[0]=l[0],T.push(w[0]),T.push(M[0]),u=1;u<r;++u){w[u]=w[0]+u*k;for(var S=g-1,z=0;1<S-z;){var C=Math.round((S+z)/2);s[C]>w[u]?S=C:z=C}var L=s[S]-s[z];if(0==L)return[];var A=(s[S]-w[u])/L,W=(w[u]-s[z])/L;M[u]=A*l[z]+W*l[S]+((A*A*A-A)*x[z]+(W*W*W-W)*x[S])*(L*L)/6,T.push(w[u]),T.push(M[u])}return T}t.hooks.processOptions.push(function(t,e){e.series.curvedLines.active&&t.hooks.processDatapoints.unshift(i)})},options:{series:{curvedLines:{active:!1,apply:!1,fit:!1,curvePointFactor:20,fitPointDist:void 0}}},name:"curvedLines",version:"0.5"}),function(e){"use strict";e.plot.plugins.push({init:function(t){t.hooks.draw.push(function(Q,_){var J,$,Z,K,tt,et,it,ot,at,nt,rt,st,lt,ht,ct,ut,pt,dt={},ft="left";e.each(Q.getData(),function(t,e){if(e.valueLabels.show){var i=e.valueLabels.showLastValue,o=e.valueLabels.showMaxValue,a=e.valueLabels.showMinValue,n=e.valueLabels.showTextLabel,r=e.valueLabels.labelFormatter,s=e.valueLabels.xoffset,l=e.valueLabels.yoffset,h=e.valueLabels.xoffsetMin||s,c=e.valueLabels.yoffsetMin||l,u=e.valueLabels.xoffsetMax||s,p=e.valueLabels.yoffsetMax||l,d=e.valueLabels.xoffsetLast||s,f=e.valueLabels.yoffsetLast||l,m=e.valueLabels.valign,g=e.valueLabels.valignLast||m,x=e.valueLabels.valignMin,b=e.valueLabels.valignMax,v=e.valueLabels.align,y=e.valueLabels.horizAlign,k=e.valueLabels.horizAlignMin||y,N=e.valueLabels.horizAlignMax||y,H=e.valueLabels.horizAlignLast||y,R=e.valueLabels.fontcolor||"#222222",q=e.valueLabels.shadowColor,w=e.valueLabels.font||e.xaxis.font||"9pt san-serif",U=e.valueLabels.hideZero,M=e.valueLabels.hideSame,j=e.valueLabels.reverseAlignBelowZero,E=e.valueLabels.showShadow,Y=e.valueLabels.useDecimalComma,T=e.stack,S=e.valueLabels.decimals,z=e.valueLabels.useBackground,B=e.valueLabels.backgroundColor,C=e.valueLabels.useBorder,X=e.valueLabels.borderColor,L=(e.seriesIndex=t,null),A=-1e3,W=-1e3,V="categories"==e.xaxis.options.mode,G="categories"==e.yaxis.options.mode;if(pt=e.points.show?e.points.radius-e.points.lineWidth/2:0,(a||o)&&void 0!==e.data[0]){e.data[0][0]=+e.data[0][0],e.data[0][1]=+e.data[0][1];for(var F=+e.data[0][0],P=+e.data[0][0],I=+e.data[0][1],D=+e.data[0][1],O=1;O<e.data.length;++O)e.data[O][0]=+e.data[O][0],e.data[O][1]=+e.data[O][1],+e.data[O][0]<F&&(F=+e.data[O][0]),+e.data[O][0]>P&&(P=+e.data[O][0]),+e.data[O][1]<I&&(I=+e.data[O][1]),+e.data[O][1]>D&&(D=+e.data[O][1])}else for(a=!1,o=!1,O=0;O<e.data.length;++O)e.data[O][0]=+e.data[O][0],e.data[O][1]=+e.data[O][1];rt=a||o||i;for(O=0;O<e.data.length;++O)if(null!==e.data[O]){if(lt=e.data[O][0],tt=e.data[O][1],ht=!!(n&&2<e.data[O].length)&&e.data[O][2],rt){if(ct=!1,a&&I==tt&&!e.bars.horizontal?(K=h,ot=c,at=x,a=!(ct=!0)):a&&F==lt&&e.bars.horizontal?(K=h,ot=c,nt=k,a=!(ct=!0)):o&&D==tt&&!e.bars.horizontal?(K=u,ot=p,at=b,o=!(ct=!0)):o&&P==lt&&e.bars.horizontal?(K=u,ot=p,nt=N,o=!(ct=!0)):i&&O==e.data.length-1&&!e.bars.horizontal?(ct=!0,K=d,ot=f,at=g):i&&O==e.data.length-1&&e.bars.horizontal&&(ct=!0,K=d,ot=f,nt=H),!ct)continue}else j&&tt<0&&!e.bars.horizontal?(K=s,ot=-1*l,"above"==m?m="below":"below"==m&&(m="above"),at=m):(K=s,ot=l,at=m,nt=y);if("top"==at&&(at="above"),V&&(lt=e.xaxis.categories[lt]),G&&(tt=e.yaxis.categories[tt]),!(lt<e.xaxis.min||lt>e.xaxis.max||tt<e.yaxis.min||tt>e.yaxis.max)){if(!1!==ht)st=ht;else{if(0===(st=null==(st=e.bars.horizontal?lt:tt)?"":st)&&(U||T))continue;!1!==S&&(st=parseFloat(st).toFixed(S))}st=r(st=""+(st=e.valueLabels.valueLabelFunc?e.valueLabels.valueLabelFunc({series:e,seriesIndex:t,index:O}):st)),M&&st==L&&O!=e.data.length-1||(e.bars.horizontal&&(_.font=w,ct=C||z?10:6,Math.abs(e.xaxis.p2c(lt)-e.xaxis.p2c(0))<_.measureText(st).width+Math.abs(K)+ct)&&"outside"!=nt&&(K*=-1,nt="outside"),Y&&(st=st.toString().replace(".",",")),ht=0,T&&(dt[lt]||(dt[lt]=0),dt[lt]=(ht=dt[lt])+tt),J=e.xaxis.p2c(lt)+Q.getPlotOffset().left,tt=e.yaxis.p2c(tt+ht)+Q.getPlotOffset().top,(!M||20<Math.abs(tt-W)||A<J)&&(A=J+8*(L=st).length,W=tt,e.bars.horizontal?(it=tt,ut="middle",0<=lt?"outside"==nt?(ft="left",K+=4):"insideMax"==nt?(ft="right",K-=4):"insideCenter"==nt?(ft="center",J=Q.getPlotOffset().left+e.xaxis.p2c(0)+(e.xaxis.p2c(lt)-e.xaxis.p2c(0))/2+K):"insideZero"==nt&&(ft="left",J=Q.getPlotOffset().left+e.xaxis.p2c(0)+3+K):"outside"==nt?(ft="right",K-=4):"insideMax"==nt?(ft="left",K+=4):"insideCenter"==nt?(ft="center",J=Q.getPlotOffset().left+e.xaxis.p2c(0)+(e.xaxis.p2c(lt)-e.xaxis.p2c(0))/2+K):"insideZero"==nt&&(ft="right",J=Q.getPlotOffset().left+e.xaxis.p2c(0)-4+K),Z=J+K):("bottom"==at?(ut="bottom",tt=Q.getPlotOffset().top+Q.height()):"middle"==at?(ut="middle",ht=Q.getPlotOffset().top+Q.height(),tt=(ht+tt)/2):"below"==at?(ut="top",ot=ot+4+pt):"above"==at&&(ut="bottom",ot=ot-2-pt),Z=J+K,it=tt+ot,tt<=0&&(it+=16),ft=J>=Q.width()+Q.getPlotOffset().left?(Z=Q.width()+Q.getPlotOffset().left+K-3,"right"):v),_.font=w,(C||z)&&((lt=_.measureText(st).width+5)%2==1&&lt++,ht=parseInt(w,10)+7,"top"==ut?(et=it,it+=3):"bottom"==ut?(et=it-ht-2,it-=2):"middle"==ut&&(et=it-(ht+1)/2,it+=1),"right"==ft?($=Z-lt+1,Z-=2):"left"==ft?($=Z,Z+=3):$=Z-lt/2,_.shadowOffsetX=0,_.shadowOffsetY=0,_.shadowBlur=0,C&&(_.strokeStyle=X,_.strokeRect($,et,lt,ht)),z)&&(_.fillStyle=B,_.fillRect($,et,lt,ht)),_.fillStyle=R,E?(_.shadowOffsetX=0,_.shadowOffsetY=0,_.shadowBlur=1.5,_.shadowColor=q):_.shadowBlur=0,_.textAlign=ft,_.textBaseline=ut,_.fillText(st,Z,it)))}}}})})},options:{series:{valueLabels:{show:!1,showTextLabel:!1,showMaxValue:!1,showMinValue:!1,showLastValue:!1,labelFormatter:function(t){return t},align:"center",valign:"above",valignMin:"below",valignMax:"above",horizAlign:"insideMax",xoffset:0,yoffset:0,useDecimalComma:!1,decimals:!1,hideZero:!1,hideSame:!1,reverseAlignBelowZero:!1,showShadow:!1,shadowColor:!1,useBackground:!1,backgroundColor:"#cccccc",fontcolor:"#222222",useBorder:!1,borderColor:"#999999"}}},name:"valueLabels",version:"2.0.0"})}(jQuery),function(o){function h(){return document.createElement("canvas").getContext&&"function"==typeof document.createElement("canvas").getContext("2d").fillText}function c(){var t=document.createElement("div");return void 0!==t.style.MozTransition||void 0!==t.style.OTransition||void 0!==t.style.webkitTransition||void 0!==t.style.transition}function n(t,e,i,o,a){this.axisName=t,this.position=e,this.padding=i,this.plot=o,this.opts=a,this.width=0,this.height=0}function u(t,e,i,o,a){n.prototype.constructor.call(this,t,e,i,o,a)}function p(t,e,i,o,a){n.prototype.constructor.call(this,t,e,i,o,a),this.elem=null}function d(t,e,i,o,a){p.prototype.constructor.call(this,t,e,i,o,a)}function f(t,e,i,o,a){d.prototype.constructor.call(this,t,e,i,o,a),this.requiresResize=!1}n.prototype.cleanup=function(){},((u.prototype=new n).constructor=u).prototype.calculateSize=function(){this.opts.axisLabelFontSizePixels||(this.opts.axisLabelFontSizePixels=14),this.opts.axisLabelFontFamily||(this.opts.axisLabelFontFamily="sans-serif");this.opts.axisLabelFontSizePixels,this.padding,this.opts.axisLabelFontSizePixels,this.padding;"left"==this.position||"right"==this.position?(this.width=this.opts.axisLabelFontSizePixels+this.padding,this.height=0):(this.width=0,this.height=this.opts.axisLabelFontSizePixels+this.padding)},u.prototype.draw=function(t){this.opts.axisLabelColour||(this.opts.axisLabelColour="black");var e,i,o=this.plot.getCanvas().getContext("2d"),a=(o.save(),o.font=this.opts.axisLabelFontSizePixels+"px "+this.opts.axisLabelFontFamily,o.fillStyle=this.opts.axisLabelColour,o.measureText(this.opts.axisLabel).width),n=this.opts.axisLabelFontSizePixels,r=0;"top"==this.position?(e=t.left+t.width/2-a/2,i=t.top+.72*n):"bottom"==this.position?(e=t.left+t.width/2-a/2,i=t.top+t.height-.72*n):"left"==this.position?(e=t.left+.72*n,i=t.height/2+t.top+a/2,r=-Math.PI/2):"right"==this.position&&(e=t.left+t.width-.72*n,i=t.height/2+t.top-a/2,r=Math.PI/2),o.translate(e,i),o.rotate(r),o.fillText(this.opts.axisLabel,0,0),o.restore()},((p.prototype=new n).constructor=p).prototype.calculateSize=function(){var t=o('<div class="axisLabels" style="position:absolute;">'+this.opts.axisLabel+"</div>");this.plot.getPlaceholder().append(t),this.labelWidth=t.outerWidth(!0),this.labelHeight=t.outerHeight(!0),t.remove(),this.width=this.height=0,"left"==this.position||"right"==this.position?this.width=this.labelWidth+this.padding:this.height=this.labelHeight+this.padding},p.prototype.cleanup=function(){this.elem&&this.elem.remove()},p.prototype.draw=function(t){this.plot.getPlaceholder().find("#"+this.axisName+"Label").remove(),this.elem=o('<div id="'+this.axisName+'Label" " class="axisLabels" style="position:absolute;">'+this.opts.axisLabel+"</div>"),this.plot.getPlaceholder().append(this.elem),"top"==this.position?(this.elem.css("left",t.left+t.width/2-this.labelWidth/2+"px"),this.elem.css("top",t.top+"px")):"bottom"==this.position?(this.elem.css("left",t.left+t.width/2-this.labelWidth/2+"px"),this.elem.css("top",t.top+t.height-this.labelHeight+"px")):"left"==this.position?(this.elem.css("top",t.top+t.height/2-this.labelHeight/2+"px"),this.elem.css("left",t.left+"px")):"right"==this.position&&(this.elem.css("top",t.top+t.height/2-this.labelHeight/2+"px"),this.elem.css("left",t.left+t.width-this.labelWidth+"px"))},((d.prototype=new p).constructor=d).prototype.calculateSize=function(){p.prototype.calculateSize.call(this),this.width=this.height=0,"left"==this.position||"right"==this.position?this.width=this.labelHeight+this.padding:this.height=this.labelHeight+this.padding},d.prototype.transforms=function(t,e,i){var o,a={"-moz-transform":"","-webkit-transform":"","-o-transform":"","-ms-transform":""},n=(0==e&&0==i||(a["-moz-transform"]+=e=" translate("+e+"px, "+i+"px)",a["-webkit-transform"]+=e,a["-o-transform"]+=e,a["-ms-transform"]+=e),0!=t&&(a["-moz-transform"]+=i=" rotate("+t+"deg)",a["-webkit-transform"]+=i,a["-o-transform"]+=i,a["-ms-transform"]+=i),"top: 0; left: 0; ");for(o in a)a[o]&&(n+=o+":"+a[o]+";");return n+=";"},d.prototype.calculateOffsets=function(t){var e={x:0,y:0,degrees:0};return"bottom"==this.position?(e.x=t.left+t.width/2-this.labelWidth/2,e.y=t.top+t.height-this.labelHeight):"top"==this.position?(e.x=t.left+t.width/2-this.labelWidth/2,e.y=t.top):"left"==this.position?(e.degrees=-90,e.x=t.left-this.labelWidth/2+this.labelHeight/2,e.y=t.height/2+t.top):"right"==this.position&&(e.degrees=90,e.x=t.left+t.width-this.labelWidth/2-this.labelHeight/2,e.y=t.height/2+t.top),e.x=Math.round(e.x),e.y=Math.round(e.y),e},d.prototype.draw=function(t){this.plot.getPlaceholder().find("."+this.axisName+"Label").remove();t=this.calculateOffsets(t);this.elem=o('<div class="axisLabels '+this.axisName+'Label" style="position:absolute; '+this.transforms(t.degrees,t.x,t.y)+'">'+this.opts.axisLabel+"</div>"),this.plot.getPlaceholder().append(this.elem)},((f.prototype=new d).constructor=f).prototype.transforms=function(t,e,i){var o="";if(0!=t){for(var a=t/90;a<0;)a+=4;o+=" filter: progid:DXImageTransform.Microsoft.BasicImage(rotation="+a+"); ",this.requiresResize="right"==this.position}return 0!=e&&(o+="left: "+e+"px; "),0!=i&&(o+="top: "+i+"px; "),o},f.prototype.calculateOffsets=function(t){var e=d.prototype.calculateOffsets.call(this,t);return"top"==this.position?e.y=t.top+1:"left"==this.position?(e.x=t.left,e.y=t.height/2+t.top-this.labelWidth/2):"right"==this.position&&(e.x=t.left+t.width-this.labelHeight,e.y=t.height/2+t.top-this.labelWidth/2),e},f.prototype.draw=function(t){d.prototype.draw.call(this,t),this.requiresResize&&(this.elem=this.plot.getPlaceholder().find("."+this.axisName+"Label"),this.elem.css("width",this.labelWidth),this.elem.css("height",this.labelHeight))},o.plot.plugins.push({init:function(t){t.hooks.processOptions.push(function(t,e){var i,l;e.axisLabels.show&&(i=!1,l={},t.hooks.draw.push(function(r,t){var s=!1;i?(i=!1,o.each(r.getAxes(),function(t,e){var i=e.options||r.getOptions()[t];i&&i.axisLabel&&e.show&&l[t].draw(e.box)})):(o.each(r.getAxes(),function(t,e){var i,o,a,n=e.options||r.getOptions()[t];t in l&&(e.labelHeight=e.labelHeight-l[t].height,e.labelWidth=e.labelWidth-l[t].width,n.labelHeight=e.labelHeight,n.labelWidth=e.labelWidth,l[t].cleanup(),delete l[t]),n&&n.axisLabel&&e.show&&(s=!0,o=null,o=n.axisLabelUseHtml||"Microsoft Internet Explorer"!=navigator.appName?n.axisLabelUseHtml||!c()&&!h()&&!n.axisLabelUseCanvas?p:n.axisLabelUseCanvas||!c()?u:d:(i=navigator.userAgent,a=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"),9<=(rv=null!=a.exec(i)?parseFloat(RegExp.$1):rv)&&!n.axisLabelUseCanvas&&!n.axisLabelUseHtml?d:n.axisLabelUseCanvas||n.axisLabelUseHtml?n.axisLabelUseCanvas?u:p:f),a=void 0===n.axisLabelPadding?2:n.axisLabelPadding,l[t]=new o(t,e.position,a,r,n),l[t].calculateSize(),n.labelHeight=e.labelHeight+l[t].height,n.labelWidth=e.labelWidth+l[t].width)}),s&&(i=!0,r.setupGrid(),r.draw()))}))})},options:{axisLabels:{show:!0}},name:"axisLabels",version:"2.0"})}(jQuery),angular.module("angular-flot",[]).directive("flot",function(){return{restrict:"EA",template:"<div></div>",scope:{dataset:"=",options:"=",callback:"="},link:function(e,t,i){var o,a,n,r=null,s=i.width||"100%",i=i.height||"100%";if((null!=(n=e.options)&&null!=(n=n.legend)?n.container:void 0)instanceof jQuery)throw'Please use a jQuery expression string with the "legend.container" option.';return e.dataset||(e.dataset=[]),e.options||(e.options={legend:{show:!1}}),(a=$(t.children()[0])).css({width:s,height:i}),o=function(){var t=$.plot(a,e.dataset,e.options);return e.callback&&e.callback(t),t},e.$watch("dataset",function(t){return r?(r.setData(t),r.setupGrid(),r.draw()):r=o()},!0),e.$watch("options",function(){return r=o()},!0)}}});