@ninjamsp/ninja-flot
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";!function(t){t.color={},t.color.make=function(e,i,o,n){var a={};return a.r=e||0,a.g=i||0,a.b=o||0,a.a=null!=n?n: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 a.a>=1?"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:e>i?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 t.color.make(a.r,a.b,a.g,a.a)},a.normalize()},t.color.extract=function(e,i){var o;do{if(""!=(o=e.css(i).toLowerCase())&&"transparent"!=o)break;e=e.parent()}while(e.length&&!t.nodeName(e.get(0),"body"));return"rgba(0, 0, 0, 0)"==o&&(o="transparent"),t.color.parse(o)},t.color.parse=function(i){var o,n=t.color.make;if(o=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(i))return n(parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10));if(o=/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(i))return n(parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),parseFloat(o[4]));if(o=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(i))return n(2.55*parseFloat(o[1]),2.55*parseFloat(o[2]),2.55*parseFloat(o[3]));if(o=/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(i))return n(2.55*parseFloat(o[1]),2.55*parseFloat(o[2]),2.55*parseFloat(o[3]),parseFloat(o[4]));if(o=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(i))return n(parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16));if(o=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(i))return n(parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16));var a=t.trim(i).toLowerCase();return"transparent"==a?n(255,255,255,0):(o=e[a]||[0,0,0],n(o[0],o[1],o[2]))};var e={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]}}($),function(t){function e(e,i){var o=i.children("."+e)[0];if(null==o&&(o=document.createElement("canvas"),o.className=e,t(o).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(i),!o.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.");o=window.G_vmlCanvasManager.initElement(o)}this.element=o;var n=this.context=o.getContext("2d"),a=window.devicePixelRatio||1,r=n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1;this.pixelRatio=a/r,this.resize(i.width(),i.height()),this.textContainer=null,this.text={},this._textCache={}}function i(i,n,a,r){function l(t,e){e=[pt].concat(e);for(var i=0;i<t.length;++i)t[i].apply(this,e)}function s(e){t.extend(!0,it,e),e&&e.colors&&(it.colors=e.colors),null==it.xaxis.color&&(it.xaxis.color=t.color.parse(it.grid.color).scale("a",.22).toString()),null==it.yaxis.color&&(it.yaxis.color=t.color.parse(it.grid.color).scale("a",.22).toString()),null==it.xaxis.tickColor&&(it.xaxis.tickColor=it.grid.tickColor||it.xaxis.color),null==it.yaxis.tickColor&&(it.yaxis.tickColor=it.grid.tickColor||it.yaxis.color),null==it.grid.borderColor&&(it.grid.borderColor=it.grid.color),null==it.grid.tickColor&&(it.grid.tickColor=t.color.parse(it.grid.color).scale("a",.22).toString());var o,n,a,r=i.css("font-size"),s=r?+r.replace("px",""):13,c={style:i.css("font-style"),size:Math.round(.8*s),variant:i.css("font-variant"),weight:i.css("font-weight"),family:i.css("font-family")};for(a=it.xaxes.length||1,o=0;o<a;++o)(n=it.xaxes[o])&&!n.tickColor&&(n.tickColor=n.color),n=t.extend(!0,{},it.xaxis,n),it.xaxes[o]=n,n.font&&(n.font=t.extend({},c,n.font),n.font.color||(n.font.color=n.color),n.font.lineHeight||(n.font.lineHeight=Math.round(1.15*n.font.size)));for(a=it.yaxes.length||1,o=0;o<a;++o)(n=it.yaxes[o])&&!n.tickColor&&(n.tickColor=n.color),n=t.extend(!0,{},it.yaxis,n),it.yaxes[o]=n,n.font&&(n.font=t.extend({},c,n.font),n.font.color||(n.font.color=n.color),n.font.lineHeight||(n.font.lineHeight=Math.round(1.15*n.font.size)));for(it.xaxis.noTicks&&null==it.xaxis.ticks&&(it.xaxis.ticks=it.xaxis.noTicks),it.yaxis.noTicks&&null==it.yaxis.ticks&&(it.yaxis.ticks=it.yaxis.noTicks),it.x2axis&&(it.xaxes[1]=t.extend(!0,{},it.xaxis,it.x2axis),it.xaxes[1].position="top",null==it.x2axis.min&&(it.xaxes[1].min=null),null==it.x2axis.max&&(it.xaxes[1].max=null)),it.y2axis&&(it.yaxes[1]=t.extend(!0,{},it.yaxis,it.y2axis),it.yaxes[1].position="right",null==it.y2axis.min&&(it.yaxes[1].min=null),null==it.y2axis.max&&(it.yaxes[1].max=null)),it.grid.coloredAreas&&(it.grid.markings=it.grid.coloredAreas),it.grid.coloredAreasColor&&(it.grid.markingsColor=it.grid.coloredAreasColor),it.lines&&t.extend(!0,it.series.lines,it.lines),it.points&&t.extend(!0,it.series.points,it.points),it.bars&&t.extend(!0,it.series.bars,it.bars),null!=it.shadowSize&&(it.series.shadowSize=it.shadowSize),null!=it.highlightColor&&(it.series.highlightColor=it.highlightColor),o=0;o<it.xaxes.length;++o)g(st,o+1).options=it.xaxes[o];for(o=0;o<it.yaxes.length;++o)g(ct,o+1).options=it.yaxes[o];for(var h in dt)it.hooks[h]&&it.hooks[h].length&&(dt[h]=dt[h].concat(it.hooks[h]));l(dt.processOptions,[it])}function c(t){et=u(t),x(),v()}function h(t){s(t)}function u(e){for(var i=[],o=0;o<e.length;++o){var n=t.extend(!0,{},it.series);null!=e[o].data?(n.data=e[o].data,delete e[o].data,t.extend(!0,n,e[o]),e[o].data=n.data):n.data=e[o],i.push(n)}return i}function f(t,e){var i=t[e+"axis"];return"object"==typeof i&&(i=i.n),"number"!=typeof i&&(i=1),i}function d(){return t.grep(st.concat(ct),function(t){return t})}function p(t){var e,i,o={};for(e=0;e<st.length;++e)(i=st[e])&&i.used&&(o["x"+i.n]=i.c2p(t.left));for(e=0;e<ct.length;++e)(i=ct[e])&&i.used&&(o["y"+i.n]=i.c2p(t.top));return void 0!==o.x1&&(o.x=o.x1),void 0!==o.y1&&(o.y=o.y1),o}function m(t){var e,i,o,n={};for(e=0;e<st.length;++e)if((i=st[e])&&i.used&&(o="x"+i.n,null==t[o]&&1==i.n&&(o="x"),null!=t[o])){n.left=i.p2c(t[o]);break}for(e=0;e<ct.length;++e)if((i=ct[e])&&i.used&&(o="y"+i.n,null==t[o]&&1==i.n&&(o="y"),null!=t[o])){n.top=i.p2c(t[o]);break}return n}function g(e,i){return e[i-1]||(e[i-1]={n:i,direction:e==st?"x":"y",options:t.extend(!0,{},e==st?it.xaxis:it.yaxis)}),e[i-1]}function x(){var e,i=et.length,o=-1;for(e=0;e<et.length;++e){var n=et[e].color;null!=n&&(i--,"number"==typeof n&&n>o&&(o=n))}i<=o&&(i=o+1);var a,r=[],l=it.colors,s=l.length,c=0;for(e=0;e<i;e++)a=t.color.parse(l[e%s]||"#666"),e%s==0&&e&&(c=c>=0?c<.5?-c-.2:0:-c),r[e]=a.scale("rgb",1+c);var h,u=0;for(e=0;e<et.length;++e){if(h=et[e],null==h.color?(h.color=r[u].toString(),++u):"number"==typeof h.color&&(h.color=r[h.color].toString()),null==h.lines.show){var d,p=!0;for(d in h)if(h[d]&&h[d].show){p=!1;break}p&&(h.lines.show=!0)}null==h.lines.zero&&(h.lines.zero=!!h.lines.fill),h.xaxis=g(st,f(h,"x")),h.yaxis=g(ct,f(h,"y"))}}function v(){function e(t,e,i){e<t.datamin&&e!=-v&&(t.datamin=e),i>t.datamax&&i!=v&&(t.datamax=i)}var i,o,n,a,r,s,c,h,u,f,p,m,g=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,v=Number.MAX_VALUE;for(t.each(d(),function(t,e){e.datamin=g,e.datamax=x,e.used=!1}),i=0;i<et.length;++i)r=et[i],r.datapoints={points:[]},l(dt.processRawData,[r,r.data,r.datapoints]);for(i=0;i<et.length;++i){if(r=et[i],p=r.data,!(m=r.datapoints.format)){if((m=[]).push({x:!0,number:!0,required:!0}),m.push({y:!0,number:!0,required:!0}),r.bars.show||r.lines.show&&r.lines.fill){var b=!!(r.bars.show&&r.bars.zero||r.lines.show&&r.lines.zero);m.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:b}),r.bars.horizontal&&(delete m[m.length-1].y,m[m.length-1].x=!0)}r.datapoints.format=m}if(null==r.datapoints.pointsize){r.datapoints.pointsize=m.length,c=r.datapoints.pointsize,s=r.datapoints.points;var k=r.lines.show&&r.lines.steps;for(r.xaxis.used=r.yaxis.used=!0,o=n=0;o<p.length;++o,n+=c){var y=null==(f=p[o]);if(!y)for(a=0;a<c;++a)h=f[a],(u=m[a])&&(u.number&&null!=h&&(h=+h,isNaN(h)?h=null:h==1/0?h=v:h==-1/0&&(h=-v)),null==h&&(u.required&&(y=!0),null!=u.defaultValue&&(h=u.defaultValue))),s[n+a]=h;if(y)for(a=0;a<c;++a)null!=(h=s[n+a])&&!1!==(u=m[a]).autoscale&&(u.x&&e(r.xaxis,h,h),u.y&&e(r.yaxis,h,h)),s[n+a]=null;else if(k&&n>0&&null!=s[n-c]&&s[n-c]!=s[n]&&s[n-c+1]!=s[n+1]){for(a=0;a<c;++a)s[n+c+a]=s[n+a];s[n+1]=s[n-c+1],n+=c}}}}for(i=0;i<et.length;++i)r=et[i],l(dt.processDatapoints,[r,r.datapoints]);for(i=0;i<et.length;++i){s=(r=et[i]).datapoints.points,c=r.datapoints.pointsize,m=r.datapoints.format;var w=g,M=g,T=x,z=x;for(o=0;o<s.length;o+=c)if(null!=s[o])for(a=0;a<c;++a)h=s[o+a],(u=m[a])&&!1!==u.autoscale&&h!=v&&h!=-v&&(u.x&&(h<w&&(w=h),h>T&&(T=h)),u.y&&(h<M&&(M=h),h>z&&(z=h)));if(r.bars.show){var S;switch(r.bars.align){case"left":S=0;break;case"right":S=-r.bars.barWidth;break;default:S=-r.bars.barWidth/2}r.bars.horizontal?(M+=S,z+=S+r.bars.barWidth):(w+=S,T+=S+r.bars.barWidth)}e(r.xaxis,w,T),e(r.yaxis,M,z)}t.each(d(),function(t,e){e.datamin==g&&(e.datamin=null),e.datamax==x&&(e.datamax=null)})}function b(){gt&&clearTimeout(gt),at.unbind("mousemove",G),at.unbind("mouseleave",B),at.unbind("click",_),l(dt.shutdown,[at])}function k(t){function e(t){return t}var i,o,n=t.options.transform||e,a=t.options.inverseTransform;"x"==t.direction?(i=t.scale=ut/Math.abs(n(t.max)-n(t.min)),o=Math.min(n(t.max),n(t.min))):(i=t.scale=ft/Math.abs(n(t.max)-n(t.min)),i=-i,o=Math.max(n(t.max),n(t.min))),t.p2c=n==e?function(t){return(t-o)*i}:function(t){return(n(t)-o)*i},t.c2p=a?function(t){return a(o+t/i)}:function(t){return o+t/i}}function y(t){for(var e=t.options,i=t.ticks||[],o=e.labelWidth||0,n=e.labelHeight||0,a=o||("x"==t.direction?Math.floor(ot.width/(i.length||1)):null),r=t.direction+"Axis "+t.direction+t.n+"Axis",l="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+r,s=e.font||"flot-tick-label tickLabel",c=0;c<i.length;++c){var h=i[c];if(h.label){var u=ot.getTextInfo(l,h.label,s,null,a);o=Math.max(o,u.width),n=Math.max(n,u.height)}}t.labelWidth=e.labelWidth||o,t.labelHeight=e.labelHeight||n}function w(e){var i=e.labelWidth,o=e.labelHeight,n=e.options.position,a="x"===e.direction,r=e.options.tickLength,l=it.grid.axisMargin,s=it.grid.labelMargin,c=!0,h=!0,u=!0,f=!1;t.each(a?st:ct,function(t,i){i&&(i.show||i.reserveSpace)&&(i===e?f=!0:i.options.position===n&&(f?h=!1:c=!1),f||(u=!1))}),h&&(l=0),null==r&&(r=u?"full":5),isNaN(+r)||(s+=+r),a?(o+=s,"bottom"==n?(ht.bottom+=o+l,e.box={top:ot.height-ht.bottom,height:o}):(e.box={top:ht.top+l,height:o},ht.top+=o+l)):(i+=s,"left"==n?(e.box={left:ht.left+l,width:i},ht.left+=i+l):(ht.right+=i+l,e.box={left:ot.width-ht.right,width:i})),e.position=n,e.tickLength=r,e.box.padding=s,e.innermost=c}function M(t){"x"==t.direction?(t.box.left=ht.left-t.labelWidth/2,t.box.width=ot.width-ht.left-ht.right+t.labelWidth):(t.box.top=ht.top-t.labelHeight/2,t.box.height=ot.height-ht.bottom-ht.top+t.labelHeight)}function T(){var e,i=it.grid.minBorderMargin;if(null==i)for(i=0,e=0;e<et.length;++e)i=Math.max(i,2*(et[e].points.radius+et[e].points.lineWidth/2));var o={left:i,right:i,top:i,bottom:i};t.each(d(),function(t,e){e.reserveSpace&&e.ticks&&e.ticks.length&&("x"===e.direction?(o.left=Math.max(o.left,e.labelWidth/2),o.right=Math.max(o.right,e.labelWidth/2)):(o.bottom=Math.max(o.bottom,e.labelHeight/2),o.top=Math.max(o.top,e.labelHeight/2)))}),ht.left=Math.ceil(Math.max(o.left,ht.left)),ht.right=Math.ceil(Math.max(o.right,ht.right)),ht.top=Math.ceil(Math.max(o.top,ht.top)),ht.bottom=Math.ceil(Math.max(o.bottom,ht.bottom))}function z(){var e,i=d(),o=it.grid.show;for(var n in ht){var a=it.grid.margin||0;ht[n]="number"==typeof a?a:a[n]||0}l(dt.processOffset,[ht]);for(var n in ht)"object"==typeof it.grid.borderWidth?ht[n]+=o?it.grid.borderWidth[n]:0:ht[n]+=o?it.grid.borderWidth:0;if(t.each(i,function(t,e){var i=e.options;e.show=null==i.show?e.used:i.show,e.reserveSpace=null==i.reserveSpace?e.show:i.reserveSpace,S(e)}),o){var r=t.grep(i,function(t){return t.show||t.reserveSpace});for(t.each(r,function(t,e){C(e),W(e),I(e,e.ticks),y(e)}),e=r.length-1;e>=0;--e)w(r[e]);T(),t.each(r,function(t,e){M(e)})}ut=ot.width-ht.left-ht.right,ft=ot.height-ht.bottom-ht.top,t.each(i,function(t,e){k(e)}),o&&P(),R()}function S(t){var e=t.options,i=+(null!=e.min?e.min:t.datamin),o=+(null!=e.max?e.max:t.datamax),n=o-i;if(0==n){var a=0==o?1:.01;null==e.min&&(i-=a),null!=e.max&&null==e.min||(o+=a)}else{var r=e.autoscaleMargin;null!=r&&(null==e.min&&(i-=n*r)<0&&null!=t.datamin&&t.datamin>=0&&(i=0),null==e.max&&(o+=n*r)>0&&null!=t.datamax&&t.datamax<=0&&(o=0))}t.min=i,t.max=o}function C(e){var i,n=e.options;i="number"==typeof n.ticks&&n.ticks>0?n.ticks:.3*Math.sqrt("x"==e.direction?ot.width:ot.height);var a=(e.max-e.min)/i,r=-Math.floor(Math.log(a)/Math.LN10),l=n.tickDecimals;null!=l&&r>l&&(r=l);var s,c=Math.pow(10,-r),h=a/c;if(h<1.5?s=1:h<3?(s=2,h>2.25&&(null==l||r+1<=l)&&(s=2.5,++r)):s=h<7.5?5:10,s*=c,null!=n.minTickSize&&s<n.minTickSize&&(s=n.minTickSize),e.delta=a,e.tickDecimals=Math.max(0,null!=l?l:r),e.tickSize=n.tickSize||s,"time"==n.mode&&!e.tickGenerator)throw new Error("Time mode requires the flot.time plugin.");if(e.tickGenerator||(e.tickGenerator=function(t){var e,i=[],n=o(t.min,t.tickSize),a=0,r=Number.NaN;do{e=r,r=n+a*t.tickSize,i.push(r),++a}while(r<t.max&&r!=e);return i},e.tickFormatter=function(t,e){var i=e.tickDecimals?Math.pow(10,e.tickDecimals):1,o=""+Math.round(t*i)/i;if(null!=e.tickDecimals){var n=o.indexOf("."),a=-1==n?0:o.length-n-1;if(a<e.tickDecimals)return(a?o:o+".")+(""+i).substr(1,e.tickDecimals-a)}return o}),t.isFunction(n.tickFormatter)&&(e.tickFormatter=function(t,e){return""+n.tickFormatter(t,e)}),null!=n.alignTicksWithAxis){var u=("x"==e.direction?st:ct)[n.alignTicksWithAxis-1];if(u&&u.used&&u!=e){var f=e.tickGenerator(e);if(f.length>0&&(null==n.min&&(e.min=Math.min(e.min,f[0])),null==n.max&&f.length>1&&(e.max=Math.max(e.max,f[f.length-1]))),e.tickGenerator=function(t){var e,i,o=[];for(i=0;i<u.ticks.length;++i)e=(u.ticks[i].v-u.min)/(u.max-u.min),e=t.min+e*(t.max-t.min),o.push(e);return o},!e.mode&&null==n.tickDecimals){var d=Math.max(0,1-Math.floor(Math.log(e.delta)/Math.LN10)),p=e.tickGenerator(e);p.length>1&&/\..*0$/.test((p[1]-p[0]).toFixed(d))||(e.tickDecimals=d)}}}}function W(e){var i=e.options.ticks,o=[];null==i||"number"==typeof i&&i>0?o=e.tickGenerator(e):i&&(o=t.isFunction(i)?i(e):i);var n,a;for(e.ticks=[],n=0;n<o.length;++n){var r=null,l=o[n];"object"==typeof l?(a=+l[0],l.length>1&&(r=l[1])):a=+l,null==r&&(r=e.tickFormatter(a,e)),isNaN(a)||e.ticks.push({v:a,label:r})}}function I(t,e){t.options.autoscaleMargin&&e.length>0&&(null==t.options.min&&(t.min=Math.min(t.min,e[0].v)),null==t.options.max&&e.length>1&&(t.max=Math.max(t.max,e[e.length-1].v)))}function F(){ot.clear(),l(dt.drawBackground,[rt]);var t=it.grid;t.show&&t.backgroundColor&&D(),t.show&&!t.aboveData&&N();for(var e=0;e<et.length;++e)l(dt.drawSeries,[rt,et[e]]),H(et[e]);l(dt.draw,[rt]),t.show&&t.aboveData&&N(),ot.render(),V()}function A(t,e){for(var i,o,n,a,r=d(),l=0;l<r.length;++l)if((i=r[l]).direction==e&&(a=e+i.n+"axis",t[a]||1!=i.n||(a=e+"axis"),t[a])){o=t[a].from,n=t[a].to;break}if(t[a]||(i="x"==e?st[0]:ct[0],o=t[e+"1"],n=t[e+"2"]),null!=o&&null!=n&&o>n){var s=o;o=n,n=s}return{from:o,to:n,axis:i}}function D(){rt.save(),rt.translate(ht.left,ht.top),rt.fillStyle=tt(it.grid.backgroundColor,ft,0,"rgba(255, 255, 255, 0)"),rt.fillRect(0,0,ut,ft),rt.restore()}function N(){var e,i,o,n;rt.save(),rt.translate(ht.left,ht.top);var a=it.grid.markings;if(a)for(t.isFunction(a)&&(i=pt.getAxes(),i.xmin=i.xaxis.min,i.xmax=i.xaxis.max,i.ymin=i.yaxis.min,i.ymax=i.yaxis.max,a=a(i)),e=0;e<a.length;++e){var r=a[e],l=A(r,"x"),s=A(r,"y");if(null==l.from&&(l.from=l.axis.min),null==l.to&&(l.to=l.axis.max),null==s.from&&(s.from=s.axis.min),null==s.to&&(s.to=s.axis.max),!(l.to<l.axis.min||l.from>l.axis.max||s.to<s.axis.min||s.from>s.axis.max)){l.from=Math.max(l.from,l.axis.min),l.to=Math.min(l.to,l.axis.max),s.from=Math.max(s.from,s.axis.min),s.to=Math.min(s.to,s.axis.max);var c=l.from===l.to,h=s.from===s.to;if(!c||!h)if(l.from=Math.floor(l.axis.p2c(l.from)),l.to=Math.floor(l.axis.p2c(l.to)),s.from=Math.floor(s.axis.p2c(s.from)),s.to=Math.floor(s.axis.p2c(s.to)),c||h){var u=r.lineWidth||it.grid.markingsLineWidth,f=u%2?.5:0;rt.beginPath(),rt.strokeStyle=r.color||it.grid.markingsColor,rt.lineWidth=u,c?(rt.moveTo(l.to+f,s.from),rt.lineTo(l.to+f,s.to)):(rt.moveTo(l.from,s.to+f),rt.lineTo(l.to,s.to+f)),rt.stroke()}else rt.fillStyle=r.color||it.grid.markingsColor,rt.fillRect(l.from,s.to,l.to-l.from,s.from-s.to)}}i=d(),o=it.grid.borderWidth;for(var p=0;p<i.length;++p){var m,g,x,v,b=i[p],k=b.box,y=b.tickLength;if(b.show&&0!=b.ticks.length){for(rt.lineWidth=1,"x"==b.direction?(m=0,g="full"==y?"top"==b.position?0:ft:k.top-ht.top+("top"==b.position?k.height:0)):(g=0,m="full"==y?"left"==b.position?0:ut:k.left-ht.left+("left"==b.position?k.width:0)),b.innermost||(rt.strokeStyle=b.options.color,rt.beginPath(),x=v=0,"x"==b.direction?x=ut+1:v=ft+1,1==rt.lineWidth&&("x"==b.direction?g=Math.floor(g)+.5:m=Math.floor(m)+.5),rt.moveTo(m,g),rt.lineTo(m+x,g+v),rt.stroke()),rt.strokeStyle=b.options.tickColor,rt.beginPath(),e=0;e<b.ticks.length;++e){var w=b.ticks[e].v;x=v=0,isNaN(w)||w<b.min||w>b.max||"full"==y&&("object"==typeof o&&o[b.position]>0||o>0)&&(w==b.min||w==b.max)||("x"==b.direction?(m=b.p2c(w),v="full"==y?-ft:y,"top"==b.position&&(v=-v)):(g=b.p2c(w),x="full"==y?-ut:y,"left"==b.position&&(x=-x)),1==rt.lineWidth&&("x"==b.direction?m=Math.floor(m)+.5:g=Math.floor(g)+.5),rt.moveTo(m,g),rt.lineTo(m+x,g+v))}rt.stroke()}}o&&(n=it.grid.borderColor,"object"==typeof o||"object"==typeof n?("object"!=typeof o&&(o={top:o,right:o,bottom:o,left:o}),"object"!=typeof n&&(n={top:n,right:n,bottom:n,left:n}),o.top>0&&(rt.strokeStyle=n.top,rt.lineWidth=o.top,rt.beginPath(),rt.moveTo(0-o.left,0-o.top/2),rt.lineTo(ut,0-o.top/2),rt.stroke()),o.right>0&&(rt.strokeStyle=n.right,rt.lineWidth=o.right,rt.beginPath(),rt.moveTo(ut+o.right/2,0-o.top),rt.lineTo(ut+o.right/2,ft),rt.stroke()),o.bottom>0&&(rt.strokeStyle=n.bottom,rt.lineWidth=o.bottom,rt.beginPath(),rt.moveTo(ut+o.right,ft+o.bottom/2),rt.lineTo(0,ft+o.bottom/2),rt.stroke()),o.left>0&&(rt.strokeStyle=n.left,rt.lineWidth=o.left,rt.beginPath(),rt.moveTo(0-o.left/2,ft+o.bottom),rt.lineTo(0-o.left/2,0),rt.stroke())):(rt.lineWidth=o,rt.strokeStyle=it.grid.borderColor,rt.strokeRect(-o/2,-o/2,ut+o,ft+o))),rt.restore()}function P(){t.each(d(),function(t,e){var i,o,n,a,r,l=e.box,s=e.direction+"Axis "+e.direction+e.n+"Axis",c="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+s,h=e.options.font||"flot-tick-label tickLabel";if(ot.removeText(c),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?(a="center",o=ht.left+e.p2c(i.v),"bottom"==e.position?n=l.top+l.padding:(n=l.top+l.height-l.padding,r="bottom")):(r="middle",n=ht.top+e.p2c(i.v),"left"==e.position?(o=l.left+l.width-l.padding,a="right"):o=l.left+l.padding),ot.addText(c,o,n,i.label,h,null,null,a,r))})}function H(t){t.lines.show&&O(t),t.bars.show&&Y(t),t.points.show&&q(t)}function O(t){function e(t,e,i,o,n){var a=t.points,r=t.pointsize,l=null,s=null;rt.beginPath();for(var c=r;c<a.length;c+=r){var h=a[c-r],u=a[c-r+1],f=a[c],d=a[c+1];if(null!=h&&null!=f){if(u<=d&&u<n.min){if(d<n.min)continue;h=(n.min-u)/(d-u)*(f-h)+h,u=n.min}else if(d<=u&&d<n.min){if(u<n.min)continue;f=(n.min-u)/(d-u)*(f-h)+h,d=n.min}if(u>=d&&u>n.max){if(d>n.max)continue;h=(n.max-u)/(d-u)*(f-h)+h,u=n.max}else if(d>=u&&d>n.max){if(u>n.max)continue;f=(n.max-u)/(d-u)*(f-h)+h,d=n.max}if(h<=f&&h<o.min){if(f<o.min)continue;u=(o.min-h)/(f-h)*(d-u)+u,h=o.min}else if(f<=h&&f<o.min){if(h<o.min)continue;d=(o.min-h)/(f-h)*(d-u)+u,f=o.min}if(h>=f&&h>o.max){if(f>o.max)continue;u=(o.max-h)/(f-h)*(d-u)+u,h=o.max}else if(f>=h&&f>o.max){if(h>o.max)continue;d=(o.max-h)/(f-h)*(d-u)+u,f=o.max}h==l&&u==s||rt.moveTo(o.p2c(h)+e,n.p2c(u)+i),l=f,s=d,rt.lineTo(o.p2c(f)+e,n.p2c(d)+i)}}rt.stroke()}rt.save(),rt.translate(ht.left,ht.top),rt.lineJoin="round";var i=t.lines.lineWidth,o=t.shadowSize;if(i>0&&o>0){rt.lineWidth=o,rt.strokeStyle="rgba(0,0,0,0.1)";var n=Math.PI/18;e(t.datapoints,Math.sin(n)*(i/2+o/2),Math.cos(n)*(i/2+o/2),t.xaxis,t.yaxis),rt.lineWidth=o/2,e(t.datapoints,Math.sin(n)*(i/2+o/4),Math.cos(n)*(i/2+o/4),t.xaxis,t.yaxis)}rt.lineWidth=i,rt.strokeStyle=t.color;var a=E(t.lines,t.color,0,ft);a&&(rt.fillStyle=a,function(t,e,i){for(var o=t.points,n=t.pointsize,a=Math.min(Math.max(0,i.min),i.max),r=0,l=!1,s=1,c=0,h=0;!(n>0&&r>o.length+n);){var u=o[(r+=n)-n],f=o[r-n+s],d=o[r],p=o[r+s];if(l){if(n>0&&null!=u&&null==d){h=r,n=-n,s=2;continue}if(n<0&&r==c+n){rt.fill(),l=!1,s=1,r=c=h+(n=-n);continue}}if(null!=u&&null!=d){if(u<=d&&u<e.min){if(d<e.min)continue;f=(e.min-u)/(d-u)*(p-f)+f,u=e.min}else if(d<=u&&d<e.min){if(u<e.min)continue;p=(e.min-u)/(d-u)*(p-f)+f,d=e.min}if(u>=d&&u>e.max){if(d>e.max)continue;f=(e.max-u)/(d-u)*(p-f)+f,u=e.max}else if(d>=u&&d>e.max){if(u>e.max)continue;p=(e.max-u)/(d-u)*(p-f)+f,d=e.max}if(l||(rt.beginPath(),rt.moveTo(e.p2c(u),i.p2c(a)),l=!0),f>=i.max&&p>=i.max)rt.lineTo(e.p2c(u),i.p2c(i.max)),rt.lineTo(e.p2c(d),i.p2c(i.max));else if(f<=i.min&&p<=i.min)rt.lineTo(e.p2c(u),i.p2c(i.min)),rt.lineTo(e.p2c(d),i.p2c(i.min));else{var m=u,g=d;f<=p&&f<i.min&&p>=i.min?(u=(i.min-f)/(p-f)*(d-u)+u,f=i.min):p<=f&&p<i.min&&f>=i.min&&(d=(i.min-f)/(p-f)*(d-u)+u,p=i.min),f>=p&&f>i.max&&p<=i.max?(u=(i.max-f)/(p-f)*(d-u)+u,f=i.max):p>=f&&p>i.max&&f<=i.max&&(d=(i.max-f)/(p-f)*(d-u)+u,p=i.max),u!=m&&rt.lineTo(e.p2c(m),i.p2c(f)),rt.lineTo(e.p2c(u),i.p2c(f)),rt.lineTo(e.p2c(d),i.p2c(p)),d!=g&&(rt.lineTo(e.p2c(d),i.p2c(p)),rt.lineTo(e.p2c(g),i.p2c(p)))}}}}(t.datapoints,t.xaxis,t.yaxis)),i>0&&e(t.datapoints,0,0,t.xaxis,t.yaxis),rt.restore()}function q(t){function e(t,e,i,o,n,a,r,l){for(var s=t.points,c=t.pointsize,h=0;h<s.length;h+=c){var u=s[h],f=s[h+1];null==u||u<a.min||u>a.max||f<r.min||f>r.max||(rt.beginPath(),u=a.p2c(u),f=r.p2c(f)+o,"circle"==l?rt.arc(u,f,e,0,n?Math.PI:2*Math.PI,!1):l(rt,u,f,e,n),rt.closePath(),i&&(rt.fillStyle=i,rt.fill()),rt.stroke())}}rt.save(),rt.translate(ht.left,ht.top);var i=t.points.lineWidth,o=t.shadowSize,n=t.points.radius,a=t.points.symbol;if(0==i&&(i=1e-4),i>0&&o>0){var r=o/2;rt.lineWidth=r,rt.strokeStyle="rgba(0,0,0,0.1)",e(t.datapoints,n,null,r+r/2,!0,t.xaxis,t.yaxis,a),rt.strokeStyle="rgba(0,0,0,0.2)",e(t.datapoints,n,null,r/2,!0,t.xaxis,t.yaxis,a)}rt.lineWidth=i,rt.strokeStyle=t.color,e(t.datapoints,n,E(t.points,t.color),0,!1,t.xaxis,t.yaxis,a),rt.restore()}function L(t,e,i,o,n,a,r,l,s,c,h){var u,f,d,p,m,g,x,v,b;c?(v=g=x=!0,m=!1,u=i,f=t,p=e+o,d=e+n,f<u&&(b=f,f=u,u=b,m=!0,g=!1)):(m=g=x=!0,v=!1,u=t+o,f=t+n,d=i,(p=e)<d&&(b=p,p=d,d=b,v=!0,x=!1)),f<r.min||u>r.max||p<l.min||d>l.max||(u<r.min&&(u=r.min,m=!1),f>r.max&&(f=r.max,g=!1),d<l.min&&(d=l.min,v=!1),p>l.max&&(p=l.max,x=!1),u=r.p2c(u),d=l.p2c(d),f=r.p2c(f),p=l.p2c(p),a&&(s.fillStyle=a(d,p),s.fillRect(u,p,f-u,d-p)),h>0&&(m||g||x||v)&&(s.beginPath(),s.moveTo(u,d),m?s.lineTo(u,p):s.moveTo(u,p),x?s.lineTo(f,p):s.moveTo(f,p),g?s.lineTo(f,d):s.moveTo(f,d),v?s.lineTo(u,d):s.moveTo(u,d),s.stroke()))}function Y(t){rt.save(),rt.translate(ht.left,ht.top),rt.lineWidth=t.bars.lineWidth,rt.strokeStyle=t.color;var e;switch(t.bars.align){case"left":e=0;break;case"right":e=-t.bars.barWidth;break;default:e=-t.bars.barWidth/2}var i=t.bars.fill?function(e,i){return E(t.bars,t.color,e,i)}:null;(function(e,i,o,n,a,r){for(var l=e.points,s=e.pointsize,c=0;c<l.length;c+=s)null!=l[c]&&L(l[c],l[c+1],l[c+2],i,o,n,a,r,rt,t.bars.horizontal,t.bars.lineWidth)})(t.datapoints,e,e+t.bars.barWidth,i,t.xaxis,t.yaxis),rt.restore()}function E(e,i,o,n){var a=e.fill;if(!a)return null;if(e.fillColor)return tt(e.fillColor,o,n,i);var r=t.color.parse(i);return r.a="number"==typeof a?a:.4,r.normalize(),r.toString()}function R(){if(null!=it.legend.container?t(it.legend.container).html(""):i.find(".legend").remove(),it.legend.show){for(var e,o,n=[],a=[],r=!1,l=it.legend.labelFormatter,s=0;s<et.length;++s)(e=et[s]).label&&(o=l?l(e.label,e):e.label)&&a.push({label:o,color:e.color});if(it.legend.sorted)if(t.isFunction(it.legend.sorted))a.sort(it.legend.sorted);else if("reverse"==it.legend.sorted)a.reverse();else{var c="descending"!=it.legend.sorted;a.sort(function(t,e){return t.label==e.label?0:t.label<e.label!=c?1:-1})}for(s=0;s<a.length;++s){var h=a[s];s%it.legend.noColumns==0&&(r&&n.push("</tr>"),n.push("<tr>"),r=!0),n.push('<td class="legendColorBox"><div style="border:1px solid '+it.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+h.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+h.label+"</td>")}if(r&&n.push("</tr>"),0!=n.length){var u='<table style="font-size:smaller;color:'+it.grid.color+'">'+n.join("")+"</table>";if(null!=it.legend.container)t(it.legend.container).html(u);else{var f="",d=it.legend.position,p=it.legend.margin;null==p[0]&&(p=[p,p]),"n"==d.charAt(0)?f+="top:"+(p[1]+ht.top)+"px;":"s"==d.charAt(0)&&(f+="bottom:"+(p[1]+ht.bottom)+"px;"),"e"==d.charAt(1)?f+="right:"+(p[0]+ht.right)+"px;":"w"==d.charAt(1)&&(f+="left:"+(p[0]+ht.left)+"px;");var m=t('<div class="legend">'+u.replace('style="','style="position:absolute;'+f+";")+"</div>").appendTo(i);if(0!=it.legend.backgroundOpacity){var g=it.legend.backgroundColor;null==g&&(g=it.grid.backgroundColor,g=g&&"string"==typeof g?t.color.parse(g):t.color.extract(m,"background-color"),g.a=1,g=g.toString());var x=m.children();t('<div style="position:absolute;width:'+x.width()+"px;height:"+x.height()+"px;"+f+"background-color:"+g+';"> </div>').prependTo(m).css("opacity",it.legend.backgroundOpacity)}}}}}function j(t,e,i){var o,n,a,r=it.grid.mouseActiveRadius,l=r*r+1,s=null;for(o=et.length-1;o>=0;--o)if(i(et[o])){var c=et[o],h=c.xaxis,u=c.yaxis,f=c.datapoints.points,d=h.c2p(t),p=u.c2p(e),m=r/h.scale,g=r/u.scale;if(a=c.datapoints.pointsize,h.options.inverseTransform&&(m=Number.MAX_VALUE),u.options.inverseTransform&&(g=Number.MAX_VALUE),c.lines.show||c.points.show)for(n=0;n<f.length;n+=a){var x=f[n],v=f[n+1];if(null!=x&&!(x-d>m||x-d<-m||v-p>g||v-p<-g)){var b=Math.abs(h.p2c(x)-t),k=Math.abs(u.p2c(v)-e),y=b*b+k*k;y<l&&(l=y,s=[o,n/a])}}if(c.bars.show&&!s){var w,M;switch(c.bars.align){case"left":w=0;break;case"right":w=-c.bars.barWidth;break;default:w=-c.bars.barWidth/2}for(M=w+c.bars.barWidth,n=0;n<f.length;n+=a){var x=f[n],v=f[n+1],T=f[n+2];null!=x&&(et[o].bars.horizontal?d<=Math.max(T,x)&&d>=Math.min(T,x)&&p>=v+w&&p<=v+M:d>=x+w&&d<=x+M&&p>=Math.min(T,v)&&p<=Math.max(T,v))&&(s=[o,n/a])}}}return s?(o=s[0],n=s[1],a=et[o].datapoints.pointsize,{datapoint:et[o].datapoints.points.slice(n*a,(n+1)*a),dataIndex:n,series:et[o],seriesIndex:o}):null}function G(t){it.grid.hoverable&&X("plothover",t,function(t){return 0!=t.hoverable})}function B(t){it.grid.hoverable&&X("plothover",t,function(t){return!1})}function _(t){X("plotclick",t,function(t){return 0!=t.clickable})}function X(t,e,o){var n=at.offset(),a=e.pageX-n.left-ht.left,r=e.pageY-n.top-ht.top,l=p({left:a,top:r});l.pageX=e.pageX,l.pageY=e.pageY;var s=j(a,r,o);if(s&&(s.pageX=parseInt(s.series.xaxis.p2c(s.datapoint[0])+n.left+ht.left,10),s.pageY=parseInt(s.series.yaxis.p2c(s.datapoint[1])+n.top+ht.top,10)),it.grid.autoHighlight){for(var c=0;c<mt.length;++c){var h=mt[c];h.auto!=t||s&&h.series==s.series&&h.point[0]==s.datapoint[0]&&h.point[1]==s.datapoint[1]||$(h.series,h.point)}s&&Q(s.series,s.datapoint,t)}i.trigger(t,[l,s])}function V(){var t=it.interaction.redrawOverlayInterval;return-1==t?void J():void(gt||(gt=setTimeout(J,t)))}function J(){gt=null,lt.save(),nt.clear(),lt.translate(ht.left,ht.top);var t,e;for(t=0;t<mt.length;++t)e=mt[t],e.series.bars.show?Z(e.series,e.point):K(e.series,e.point);lt.restore(),l(dt.drawOverlay,[lt])}function Q(t,e,i){if("number"==typeof t&&(t=et[t]),"number"==typeof e){var o=t.datapoints.pointsize;e=t.datapoints.points.slice(o*e,o*(e+1))}var n=U(t,e);-1==n?(mt.push({series:t,point:e,auto:i}),V()):i||(mt[n].auto=!1)}function $(t,e){if(null==t&&null==e)return mt=[],void V();if("number"==typeof t&&(t=et[t]),"number"==typeof e){var i=t.datapoints.pointsize;e=t.datapoints.points.slice(i*e,i*(e+1))}var o=U(t,e);-1!=o&&(mt.splice(o,1),V())}function U(t,e){for(var i=0;i<mt.length;++i){var o=mt[i];if(o.series==t&&o.point[0]==e[0]&&o.point[1]==e[1])return i}return-1}function K(e,i){var o=i[0],n=i[1],a=e.xaxis,r=e.yaxis,l="string"==typeof e.highlightColor?e.highlightColor:t.color.parse(e.color).scale("a",.5).toString();if(!(o<a.min||o>a.max||n<r.min||n>r.max)){var s=e.points.radius+e.points.lineWidth/2;lt.lineWidth=s,lt.strokeStyle=l;var c=1.5*s;o=a.p2c(o),n=r.p2c(n),lt.beginPath(),"circle"==e.points.symbol?lt.arc(o,n,c,0,2*Math.PI,!1):e.points.symbol(lt,o,n,c,!1),lt.closePath(),lt.stroke()}}function Z(e,i){var o,n="string"==typeof e.highlightColor?e.highlightColor:t.color.parse(e.color).scale("a",.5).toString(),a=n;switch(e.bars.align){case"left":o=0;break;case"right":o=-e.bars.barWidth;break;default:o=-e.bars.barWidth/2}lt.lineWidth=e.bars.lineWidth,lt.strokeStyle=n,L(i[0],i[1],i[2]||0,o,o+e.bars.barWidth,function(){return a},e.xaxis,e.yaxis,lt,e.bars.horizontal,e.bars.lineWidth)}function tt(e,i,o,n){if("string"==typeof e)return e;for(var a=rt.createLinearGradient(0,o,0,i),r=0,l=e.colors.length;r<l;++r){var s=e.colors[r];if("string"!=typeof s){var c=t.color.parse(n);null!=s.brightness&&(c=c.scale("rgb",s.brightness)),null!=s.opacity&&(c.a*=s.opacity),s=c.toString()}a.addColorStop(r/(l-1),s)}return a}var et=[],it={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:{}},ot=null,nt=null,at=null,rt=null,lt=null,st=[],ct=[],ht={left:0,right:0,top:0,bottom:0},ut=0,ft=0,dt={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},pt=this;pt.setData=c,pt.setOptions=h,pt.setupGrid=z,pt.draw=F,pt.getPlaceholder=function(){return i},pt.getCanvas=function(){return ot.element},pt.getPlotOffset=function(){return ht},pt.width=function(){return ut},pt.height=function(){return ft},pt.offset=function(){var t=at.offset();return t.left+=ht.left,t.top+=ht.top,t},pt.getData=function(){return et},pt.getAxes=function(){var e={};return t.each(st.concat(ct),function(t,i){i&&(e[i.direction+(1!=i.n?i.n:"")+"axis"]=i)}),e},pt.getXAxes=function(){return st},pt.getYAxes=function(){return ct},pt.c2p=p,pt.p2c=m,pt.getOptions=function(){return it},pt.highlight=Q,pt.unhighlight=$,pt.triggerRedrawOverlay=V,pt.pointOffset=function(t){return{left:parseInt(st[f(t,"x")-1].p2c(+t.x)+ht.left,10),top:parseInt(ct[f(t,"y")-1].p2c(+t.y)+ht.top,10)}},pt.shutdown=b,pt.destroy=function(){b(),i.removeData("plot").empty(),et=[],it=null,ot=null,nt=null,at=null,rt=null,lt=null,st=[],ct=[],dt=null,mt=[],pt=null},pt.resize=function(){var t=i.width(),e=i.height();ot.resize(t,e),nt.resize(t,e)},pt.hooks=dt,function(){for(var i={Canvas:e},o=0;o<r.length;++o){var n=r[o];n.init(pt,i),n.options&&t.extend(!0,it,n.options)}}(),s(a),function(){i.css("padding",0).children().filter(function(){return!t(this).hasClass("flot-overlay")&&!t(this).hasClass("flot-base")}).remove(),"static"==i.css("position")&&i.css("position","relative"),ot=new e("flot-base",i),nt=new e("flot-overlay",i),rt=ot.context,lt=nt.context,at=t(nt.element).unbind();var o=i.data("plot");o&&(o.shutdown(),nt.clear()),i.data("plot",pt)}(),c(n),z(),F(),function(){it.grid.hoverable&&(at.mousemove(G),at.bind("mouseleave",B)),it.grid.clickable&&at.click(_),l(dt.bindEvents,[at])}();var mt=[],gt=null}function o(t,e){return e*Math.floor(t/e)}var n=Object.prototype.hasOwnProperty;t.fn.detach||(t.fn.detach=function(){return this.each(function(){this.parentNode&&this.parentNode.removeChild(this)})}),e.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,n=this.pixelRatio;this.width!=t&&(i.width=t*n,i.style.width=t+"px",this.width=t),this.height!=e&&(i.height=e*n,i.style.height=e+"px",this.height=e),o.restore(),o.save(),o.scale(n,n)},e.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},e.prototype.render=function(){var t=this._textCache;for(var e in t)if(n.call(t,e)){var i=this.getTextLayer(e),o=t[e];i.hide();for(var a in o)if(n.call(o,a)){var r=o[a];for(var l in r)if(n.call(r,l)){for(var s,c=r[l].positions,h=0;s=c[h];h++)s.active?s.rendered||(i.append(s.element),s.rendered=!0):(c.splice(h--,1),s.rendered&&s.element.detach());0==c.length&&delete r[l]}}i.show()}},e.prototype.getTextLayer=function(e){var i=this.text[e];return null==i&&(null==this.textContainer&&(this.textContainer=t("<div class='flot-text'></div>").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),i=this.text[e]=t("<div></div>").addClass(e).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),i},e.prototype.getTextInfo=function(e,i,o,n,a){var r,l,s,c;if(i=""+i,r="object"==typeof o?o.style+" "+o.variant+" "+o.weight+" "+o.size+"px/"+o.lineHeight+"px "+o.family:o,null==(l=this._textCache[e])&&(l=this._textCache[e]={}),null==(s=l[r])&&(s=l[r]={}),null==(c=s[i])){var h=t("<div></div>").html(i).css({position:"absolute","max-width":a,top:-9999}).appendTo(this.getTextLayer(e));"object"==typeof o?h.css({font:r,color:o.color}):"string"==typeof o&&h.addClass(o),c=s[i]={width:h.outerWidth(!0),height:h.outerHeight(!0),element:h,positions:[]},h.detach()}return c},e.prototype.addText=function(t,e,i,o,n,a,r,l,s){var c=this.getTextInfo(t,o,n,a,r),h=c.positions;"center"==l?e-=c.width/2:"right"==l&&(e-=c.width),"middle"==s?i-=c.height/2:"bottom"==s&&(i-=c.height);for(var u,f=0;u=h[f];f++)if(u.x==e&&u.y==i)return void(u.active=!0);u={active:!0,rendered:!1,element:h.length?c.element.clone():c.element,x:e,y:i},h.push(u),u.element.css({top:Math.round(i),left:Math.round(e),"text-align":l})},e.prototype.removeText=function(t,e,i,o,a,r){if(null==o){var l=this._textCache[t];if(null!=l)for(var s in l)if(n.call(l,s)){var c=l[s];for(var h in c)if(n.call(c,h))for(var u=c[h].positions,f=0;d=u[f];f++)d.active=!1}}else for(var d,u=this.getTextInfo(t,o,a,r).positions,f=0;d=u[f];f++)d.x==e&&d.y==i&&(d.active=!1)},t.plot=function(e,o,n){return new i(t(e),o,n,t.plot.plugins)},t.plot.version="0.8.3",t.plot.plugins=[],t.fn.plot=function(e,i){return this.each(function(){t.plot(this,e,i)})}}($),function(t){var e={tooltip:!1,tooltipOpts:{content:"%s | X: %x | Y: %y.2",dateFormat:"%y-%0m-%0d",shifts:{x:10,y:20},defaultTheme:!0}},i=function(e){var i={x:0,y:0},o=e.getOptions(),n=function(t){i.x=t.x,i.y=t.y},a=function(t){var e={x:0,y:0};e.x=t.pageX,e.y=t.pageY,n(e)},r=function(e){var i=new Date(e);return t.plot.formatDate(i,o.tooltipOpts.dateFormat)};e.hooks.bindEvents.push(function(e,n){var s,c=o.tooltipOpts,h=e.getPlaceholder();!1!==o.tooltip&&(t("#flotTip").length>0?s=t("#flotTip"):((s=t("<div />").attr("id","flotTip")).appendTo("body").hide().css({position:"absolute"}),c.defaultTheme&&s.css({background:"#fff","z-index":"100",padding:"0.4em 0.6em","border-radius":"0.5em","font-size":"0.8em",border:"1px solid #111"})),t(h).bind("plothover",function(t,e,n){if(n){var a;a="time"===o.xaxis.mode||"time"===o.xaxes[0].mode?l(c.content,n,r):l(c.content,n),s.html(a).css({left:i.x+c.shifts.x,top:i.y+c.shifts.y}).show()}else s.hide().html("")}),n.mousemove(a))});var l=function(t,e,i){var o=/%p\.{0,1}(\d{0,})/,n=/%s/,a=/%x\.{0,1}(\d{0,})/,r=/%y\.{0,1}(\d{0,})/;return void 0!==e.series.percent&&(t=s(o,t,e.series.percent)),void 0!==e.series.label&&(t=t.replace(n,e.series.label)),"function"==typeof i?t=t.replace(a,i(e.series.data[e.dataIndex][0])):"number"==typeof e.series.data[e.dataIndex][0]&&(t=s(a,t,e.series.data[e.dataIndex][0])),"number"==typeof e.series.data[e.dataIndex][1]&&(t=s(r,t,e.series.data[e.dataIndex][1])),t},s=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}};t.plot.plugins.push({init:i,options:e,name:"tooltip",version:"0.4.4"})}($),function(t,e,i){"$:nomunge";function o(){n=e[l](function(){a.each(function(){var e=t(this),i=e.width(),o=e.height(),n=t.data(this,c);i===n.w&&o===n.h||e.trigger(s,[n.w=i,n.h=o])}),o()},r[h])}var n,a=t([]),r=t.resize=t.extend(t.resize,{}),l="setTimeout",s="resize",c=s+"-special-event",h="delay";r[h]=250,r.throttleWindow=!0,t.event.special[s]={setup:function(){if(!r.throttleWindow&&this[l])return!1;var e=t(this);a=a.add(e),t.data(this,c,{w:e.width(),h:e.height()}),1===a.length&&o()},teardown:function(){if(!r.throttleWindow&&this[l])return!1;var e=t(this);a=a.not(e),e.removeData(c),a.length||clearTimeout(n)},add:function(e){function o(e,o,a){var r=t(this),l=t.data(this,c);l.w=o!==i?o:r.width(),l.h=a!==i?a:r.height(),n.apply(this,arguments)}if(!r.throttleWindow&&this[l])return!1;var n;if(t.isFunction(e))return n=e,o;n=e.handler,e.handler=o}}}(jQuery,void 0),function(t){function e(t){function e(){var e=t.getPlaceholder();0!=e.width()&&0!=e.height()&&(t.resize(),t.setupGrid(),t.draw())}function i(t,i){t.getPlaceholder().resize(e)}function o(t,i){t.getPlaceholder().unbind("resize",e)}t.hooks.bindEvents.push(i),t.hooks.shutdown.push(o)}var i={};t.plot.plugins.push({init:e,options:i,name:"resize",version:"1.0"})}(jQuery),function(t){function e(t){function e(t,e){for(var i=null,o=0;o<e.length&&t!=e[o];++o)e[o].stack==t.stack&&(i=e[o]);return i}function i(t,i,o){if(null!=i.stack&&!1!==i.stack){var n=e(i,t.getData());if(n){for(var a,r,l,s,c,h,u,f,d=o.pointsize,p=o.points,m=n.datapoints.pointsize,g=n.datapoints.points,x=[],v=i.lines.show,b=i.bars.horizontal,k=d>2&&(b?o.format[2].x:o.format[2].y),y=v&&i.lines.steps,w=!0,M=b?1:0,T=b?0:1,z=0,S=0;;){if(z>=p.length)break;if(u=x.length,null==p[z]){for(f=0;f<d;++f)x.push(p[z+f]);z+=d}else if(S>=g.length){if(!v)for(f=0;f<d;++f)x.push(p[z+f]);z+=d}else if(null==g[S]){for(f=0;f<d;++f)x.push(null);w=!0,S+=m}else{if(a=p[z+M],r=p[z+T],s=g[S+M],c=g[S+T],h=0,a==s){for(f=0;f<d;++f)x.push(p[z+f]);x[u+T]+=c,h=c,z+=d,S+=m}else if(a>s){if(v&&z>0&&null!=p[z-d]){for(l=r+(p[z-d+T]-r)*(s-a)/(p[z-d+M]-a),x.push(s),x.push(l+c),f=2;f<d;++f)x.push(p[z+f]);h=c}S+=m}else{if(w&&v){z+=d;continue}for(f=0;f<d;++f)x.push(p[z+f]);v&&S>0&&null!=g[S-m]&&(h=c+(g[S-m+T]-c)*(a-s)/(g[S-m+M]-s)),x[u+T]+=h,z+=d}w=!1,u!=x.length&&k&&(x[u+2]+=h)}if(y&&u!=x.length&&u>0&&null!=x[u]&&x[u]!=x[u-d]&&x[u+1]!=x[u-d+1]){for(f=0;f<d;++f)x[u+d+f]=x[u+f];x[u+1]=x[u-d+1]}}o.points=x}}}t.hooks.processDatapoints.push(i)}var i={series:{stack:null}};t.plot.plugins.push({init:e,options:i,name:"stack",version:"1.2"})}(jQuery),function(t){function e(t,e){return e*Math.floor(t/e)}function i(t,e,i,o){if("function"==typeof t.strftime)return t.strftime(e);var n=function(t,e){return t=""+t,e=""+(null==e?"0":e),1==t.length?e+t:t},a=[],r=!1,l=t.getHours(),s=l<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"]);var c;c=l>12?l-12:0==l?12:l;for(var h=0;h<e.length;++h){var u=e.charAt(h);if(r){switch(u){case"a":u=""+o[t.getDay()];break;case"b":u=""+i[t.getMonth()];break;case"d":u=n(t.getDate());break;case"e":u=n(t.getDate()," ");break;case"H":u=n(l);break;case"I":u=n(c);break;case"l":u=n(c," ");break;case"m":u=n(t.getMonth()+1);break;case"M":u=n(t.getMinutes());break;case"q":u=""+(Math.floor(t.getMonth()/3)+1);break;case"S":u=n(t.getSeconds());break;case"y":u=n(t.getFullYear()%100);break;case"Y":u=""+t.getFullYear();break;case"p":u=s?"am":"pm";break;case"P":u=s?"AM":"PM";break;case"w":u=""+t.getDay()}a.push(u),r=!1}else"%"==u?r=!0:a.push(u)}return a.join("")}function o(t){function e(t,e,i,o){t[e]=function(){return i[o].apply(i,arguments)}}var i={date:t};void 0!=t.strftime&&e(i,"strftime",t,"strftime"),e(i,"getTime",t,"getTime"),e(i,"setTime",t,"setTime");for(var o=["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds"],n=0;n<o.length;n++)e(i,"get"+o[n],t,"getUTC"+o[n]),e(i,"set"+o[n],t,"setUTC"+o[n]);return i}function n(t,e){if("browser"==e.timezone)return new Date(t);if(e.timezone&&"utc"!=e.timezone){if("undefined"!=typeof timezoneJS&&void 0!==timezoneJS.Date){var i=new timezoneJS.Date;return i.setTimezone(e.timezone),i.setTime(t),i}return o(new Date(t))}return o(new Date(t))}function a(o){o.hooks.processDatapoints.push(function(o,a,r){t.each(o.getAxes(),function(t,o){var a=o.options;"time"==a.mode&&(o.tickGenerator=function(t){var i=[],o=n(t.min,a),r=0,s=a.tickSize&&"quarter"===a.tickSize[1]||a.minTickSize&&"quarter"===a.minTickSize[1]?h:c;null!=a.minTickSize&&(r="number"==typeof a.tickSize?a.tickSize:a.minTickSize[0]*l[a.minTickSize[1]]);for(var u=0;u<s.length-1&&!(t.delta<(s[u][0]*l[s[u][1]]+s[u+1][0]*l[s[u+1][1]])/2&&s[u][0]*l[s[u][1]]>=r);++u);var f=s[u][0],d=s[u][1];if("year"==d){if(null!=a.minTickSize&&"year"==a.minTickSize[1])f=Math.floor(a.minTickSize[0]);else{var p=Math.pow(10,Math.floor(Math.log(t.delta/l.year)/Math.LN10)),m=t.delta/l.year/p;f=m<1.5?1:m<3?2:m<7.5?5:10,f*=p}f<1&&(f=1)}t.tickSize=a.tickSize||[f,d];var g=t.tickSize[0];d=t.tickSize[1];var x=g*l[d];"second"==d?o.setSeconds(e(o.getSeconds(),g)):"minute"==d?o.setMinutes(e(o.getMinutes(),g)):"hour"==d?o.setHours(e(o.getHours(),g)):"month"==d?o.setMonth(e(o.getMonth(),g)):"quarter"==d?o.setMonth(3*e(o.getMonth()/3,g)):"year"==d&&o.setFullYear(e(o.getFullYear(),g)),o.setMilliseconds(0),x>=l.minute?o.setSeconds(0):x>=l.hour?o.setMinutes(0):x>=l.day?o.setHours(0):x>=4*l.day?o.setDate(1):x>=2*l.month?o.setMonth(e(o.getMonth(),3)):x>=2*l.quarter?o.setMonth(e(o.getMonth(),6)):x>=l.year&&o.setMonth(0);var v,b=0,k=Number.NaN;do{if(v=k,k=o.getTime(),i.push(k),"month"==d||"quarter"==d)if(g<1){o.setDate(1);var y=o.getTime();o.setMonth(o.getMonth()+("quarter"==d?3:1));var w=o.getTime();o.setTime(k+b*l.hour+(w-y)*g),b=o.getHours(),o.setHours(0)}else o.setMonth(o.getMonth()+g*("quarter"==d?3:1));else"year"==d?o.setFullYear(o.getFullYear()+g):o.setTime(k+x)}while(k<t.max&&k!=v);return i},o.tickFormatter=function(t,e){var o=n(t,e.options);if(null!=a.timeformat)return i(o,a.timeformat,a.monthNames,a.dayNames);var r=e.options.tickSize&&"quarter"==e.options.tickSize[1]||e.options.minTickSize&&"quarter"==e.options.minTickSize[1],s=e.tickSize[0]*l[e.tickSize[1]],c=e.max-e.min,h=a.twelveHourClock?" %p":"",u=a.twelveHourClock?"%I":"%H";return i(o,s<l.minute?u+":%M:%S"+h:s<l.day?c<2*l.day?u+":%M"+h:"%b %d "+u+":%M"+h:s<l.month?"%b %d":r&&s<l.quarter||!r&&s<l.year?c<l.year?"%b":"%b %Y":r&&s<l.year?c<l.year?"Q%q":"Q%q %Y":"%Y",a.monthNames,a.dayNames)})})})}var r={},l={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},s=[[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"]],c=s.concat([[3,"month"],[6,"month"],[1,"year"]]),h=s.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);t.plot.plugins.push({init:a,options:r,name:"time",version:"1.0"}),t.plot.formatDate=i}(jQuery)}(); | ||
!function(){"use strict";!function(t){t.color={},t.color.make=function(e,i,o,n){var a={};return a.r=e||0,a.g=i||0,a.b=o||0,a.a=null!=n?n: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 a.a>=1?"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:e>i?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 t.color.make(a.r,a.b,a.g,a.a)},a.normalize()},t.color.extract=function(e,i){var o;do{if(""!=(o=e.css(i).toLowerCase())&&"transparent"!=o)break;e=e.parent()}while(e.length&&!t.nodeName(e.get(0),"body"));return"rgba(0, 0, 0, 0)"==o&&(o="transparent"),t.color.parse(o)},t.color.parse=function(i){var o,n=t.color.make;if(o=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(i))return n(parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10));if(o=/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(i))return n(parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),parseFloat(o[4]));if(o=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(i))return n(2.55*parseFloat(o[1]),2.55*parseFloat(o[2]),2.55*parseFloat(o[3]));if(o=/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(i))return n(2.55*parseFloat(o[1]),2.55*parseFloat(o[2]),2.55*parseFloat(o[3]),parseFloat(o[4]));if(o=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(i))return n(parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16));if(o=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(i))return n(parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16));var a=t.trim(i).toLowerCase();return"transparent"==a?n(255,255,255,0):(o=e[a]||[0,0,0],n(o[0],o[1],o[2]))};var e={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]}}($),function(t){function e(e,i){var o=i.children("."+e)[0];if(null==o&&(o=document.createElement("canvas"),o.className=e,t(o).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(i),!o.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.");o=window.G_vmlCanvasManager.initElement(o)}this.element=o;var n=this.context=o.getContext("2d"),a=window.devicePixelRatio||1,r=n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1;this.pixelRatio=a/r,this.resize(i.width(),i.height()),this.textContainer=null,this.text={},this._textCache={}}function i(i,n,a,r){function l(t,e){e=[pt].concat(e);for(var i=0;i<t.length;++i)t[i].apply(this,e)}function s(e){t.extend(!0,it,e),e&&e.colors&&(it.colors=e.colors),null==it.xaxis.color&&(it.xaxis.color=t.color.parse(it.grid.color).scale("a",.22).toString()),null==it.yaxis.color&&(it.yaxis.color=t.color.parse(it.grid.color).scale("a",.22).toString()),null==it.xaxis.tickColor&&(it.xaxis.tickColor=it.grid.tickColor||it.xaxis.color),null==it.yaxis.tickColor&&(it.yaxis.tickColor=it.grid.tickColor||it.yaxis.color),null==it.grid.borderColor&&(it.grid.borderColor=it.grid.color),null==it.grid.tickColor&&(it.grid.tickColor=t.color.parse(it.grid.color).scale("a",.22).toString());var o,n,a,r=i.css("font-size"),s=r?+r.replace("px",""):13,c={style:i.css("font-style"),size:Math.round(.8*s),variant:i.css("font-variant"),weight:i.css("font-weight"),family:i.css("font-family")};for(a=it.xaxes.length||1,o=0;o<a;++o)(n=it.xaxes[o])&&!n.tickColor&&(n.tickColor=n.color),n=t.extend(!0,{},it.xaxis,n),it.xaxes[o]=n,n.font&&(n.font=t.extend({},c,n.font),n.font.color||(n.font.color=n.color),n.font.lineHeight||(n.font.lineHeight=Math.round(1.15*n.font.size)));for(a=it.yaxes.length||1,o=0;o<a;++o)(n=it.yaxes[o])&&!n.tickColor&&(n.tickColor=n.color),n=t.extend(!0,{},it.yaxis,n),it.yaxes[o]=n,n.font&&(n.font=t.extend({},c,n.font),n.font.color||(n.font.color=n.color),n.font.lineHeight||(n.font.lineHeight=Math.round(1.15*n.font.size)));for(it.xaxis.noTicks&&null==it.xaxis.ticks&&(it.xaxis.ticks=it.xaxis.noTicks),it.yaxis.noTicks&&null==it.yaxis.ticks&&(it.yaxis.ticks=it.yaxis.noTicks),it.x2axis&&(it.xaxes[1]=t.extend(!0,{},it.xaxis,it.x2axis),it.xaxes[1].position="top",null==it.x2axis.min&&(it.xaxes[1].min=null),null==it.x2axis.max&&(it.xaxes[1].max=null)),it.y2axis&&(it.yaxes[1]=t.extend(!0,{},it.yaxis,it.y2axis),it.yaxes[1].position="right",null==it.y2axis.min&&(it.yaxes[1].min=null),null==it.y2axis.max&&(it.yaxes[1].max=null)),it.grid.coloredAreas&&(it.grid.markings=it.grid.coloredAreas),it.grid.coloredAreasColor&&(it.grid.markingsColor=it.grid.coloredAreasColor),it.lines&&t.extend(!0,it.series.lines,it.lines),it.points&&t.extend(!0,it.series.points,it.points),it.bars&&t.extend(!0,it.series.bars,it.bars),null!=it.shadowSize&&(it.series.shadowSize=it.shadowSize),null!=it.highlightColor&&(it.series.highlightColor=it.highlightColor),o=0;o<it.xaxes.length;++o)g(st,o+1).options=it.xaxes[o];for(o=0;o<it.yaxes.length;++o)g(ct,o+1).options=it.yaxes[o];for(var u in dt)it.hooks[u]&&it.hooks[u].length&&(dt[u]=dt[u].concat(it.hooks[u]));l(dt.processOptions,[it])}function c(t){et=h(t),x(),v()}function u(t){s(t)}function h(e){for(var i=[],o=0;o<e.length;++o){var n=t.extend(!0,{},it.series);null!=e[o].data?(n.data=e[o].data,delete e[o].data,t.extend(!0,n,e[o]),e[o].data=n.data):n.data=e[o],i.push(n)}return i}function f(t,e){var i=t[e+"axis"];return"object"==typeof i&&(i=i.n),"number"!=typeof i&&(i=1),i}function d(){return t.grep(st.concat(ct),function(t){return t})}function p(t){var e,i,o={};for(e=0;e<st.length;++e)(i=st[e])&&i.used&&(o["x"+i.n]=i.c2p(t.left));for(e=0;e<ct.length;++e)(i=ct[e])&&i.used&&(o["y"+i.n]=i.c2p(t.top));return void 0!==o.x1&&(o.x=o.x1),void 0!==o.y1&&(o.y=o.y1),o}function m(t){var e,i,o,n={};for(e=0;e<st.length;++e)if((i=st[e])&&i.used&&(o="x"+i.n,null==t[o]&&1==i.n&&(o="x"),null!=t[o])){n.left=i.p2c(t[o]);break}for(e=0;e<ct.length;++e)if((i=ct[e])&&i.used&&(o="y"+i.n,null==t[o]&&1==i.n&&(o="y"),null!=t[o])){n.top=i.p2c(t[o]);break}return n}function g(e,i){return e[i-1]||(e[i-1]={n:i,direction:e==st?"x":"y",options:t.extend(!0,{},e==st?it.xaxis:it.yaxis)}),e[i-1]}function x(){var e,i=et.length,o=-1;for(e=0;e<et.length;++e){var n=et[e].color;null!=n&&(i--,"number"==typeof n&&n>o&&(o=n))}i<=o&&(i=o+1);var a,r=[],l=it.colors,s=l.length,c=0;for(e=0;e<i;e++)a=t.color.parse(l[e%s]||"#666"),e%s==0&&e&&(c=c>=0?c<.5?-c-.2:0:-c),r[e]=a.scale("rgb",1+c);var u,h=0;for(e=0;e<et.length;++e){if(u=et[e],null==u.color?(u.color=r[h].toString(),++h):"number"==typeof u.color&&(u.color=r[u.color].toString()),null==u.lines.show){var d,p=!0;for(d in u)if(u[d]&&u[d].show){p=!1;break}p&&(u.lines.show=!0)}null==u.lines.zero&&(u.lines.zero=!!u.lines.fill),u.xaxis=g(st,f(u,"x")),u.yaxis=g(ct,f(u,"y"))}}function v(){function e(t,e,i){e<t.datamin&&e!=-v&&(t.datamin=e),i>t.datamax&&i!=v&&(t.datamax=i)}var i,o,n,a,r,s,c,u,h,f,p,m,g=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,v=Number.MAX_VALUE;for(t.each(d(),function(t,e){e.datamin=g,e.datamax=x,e.used=!1}),i=0;i<et.length;++i)r=et[i],r.datapoints={points:[]},l(dt.processRawData,[r,r.data,r.datapoints]);for(i=0;i<et.length;++i){if(r=et[i],p=r.data,!(m=r.datapoints.format)){if((m=[]).push({x:!0,number:!0,required:!0}),m.push({y:!0,number:!0,required:!0}),r.bars.show||r.lines.show&&r.lines.fill){var b=!!(r.bars.show&&r.bars.zero||r.lines.show&&r.lines.zero);m.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:b}),r.bars.horizontal&&(delete m[m.length-1].y,m[m.length-1].x=!0)}r.datapoints.format=m}if(null==r.datapoints.pointsize){r.datapoints.pointsize=m.length,c=r.datapoints.pointsize,s=r.datapoints.points;var k=r.lines.show&&r.lines.steps;for(r.xaxis.used=r.yaxis.used=!0,o=n=0;o<p.length;++o,n+=c){var y=null==(f=p[o]);if(!y)for(a=0;a<c;++a)u=f[a],(h=m[a])&&(h.number&&null!=u&&(u=+u,isNaN(u)?u=null:u==1/0?u=v:u==-1/0&&(u=-v)),null==u&&(h.required&&(y=!0),null!=h.defaultValue&&(u=h.defaultValue))),s[n+a]=u;if(y)for(a=0;a<c;++a)null!=(u=s[n+a])&&!1!==(h=m[a]).autoscale&&(h.x&&e(r.xaxis,u,u),h.y&&e(r.yaxis,u,u)),s[n+a]=null;else if(k&&n>0&&null!=s[n-c]&&s[n-c]!=s[n]&&s[n-c+1]!=s[n+1]){for(a=0;a<c;++a)s[n+c+a]=s[n+a];s[n+1]=s[n-c+1],n+=c}}}}for(i=0;i<et.length;++i)r=et[i],l(dt.processDatapoints,[r,r.datapoints]);for(i=0;i<et.length;++i){s=(r=et[i]).datapoints.points,c=r.datapoints.pointsize,m=r.datapoints.format;var w=g,M=g,T=x,z=x;for(o=0;o<s.length;o+=c)if(null!=s[o])for(a=0;a<c;++a)u=s[o+a],(h=m[a])&&!1!==h.autoscale&&u!=v&&u!=-v&&(h.x&&(u<w&&(w=u),u>T&&(T=u)),h.y&&(u<M&&(M=u),u>z&&(z=u)));if(r.bars.show){var S;switch(r.bars.align){case"left":S=0;break;case"right":S=-r.bars.barWidth;break;default:S=-r.bars.barWidth/2}r.bars.horizontal?(M+=S,z+=S+r.bars.barWidth):(w+=S,T+=S+r.bars.barWidth)}e(r.xaxis,w,T),e(r.yaxis,M,z)}t.each(d(),function(t,e){e.datamin==g&&(e.datamin=null),e.datamax==x&&(e.datamax=null)})}function b(){gt&&clearTimeout(gt),at.unbind("mousemove",G),at.unbind("mouseleave",B),at.unbind("click",_),l(dt.shutdown,[at])}function k(t){function e(t){return t}var i,o,n=t.options.transform||e,a=t.options.inverseTransform;"x"==t.direction?(i=t.scale=ht/Math.abs(n(t.max)-n(t.min)),o=Math.min(n(t.max),n(t.min))):(i=t.scale=ft/Math.abs(n(t.max)-n(t.min)),i=-i,o=Math.max(n(t.max),n(t.min))),t.p2c=n==e?function(t){return(t-o)*i}:function(t){return(n(t)-o)*i},t.c2p=a?function(t){return a(o+t/i)}:function(t){return o+t/i}}function y(t){for(var e=t.options,i=t.ticks||[],o=e.labelWidth||0,n=e.labelHeight||0,a=o||("x"==t.direction?Math.floor(ot.width/(i.length||1)):null),r=t.direction+"Axis "+t.direction+t.n+"Axis",l="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+r,s=e.font||"flot-tick-label tickLabel",c=0;c<i.length;++c){var u=i[c];if(u.label){var h=ot.getTextInfo(l,u.label,s,null,a);o=Math.max(o,h.width),n=Math.max(n,h.height)}}t.labelWidth=e.labelWidth||o,t.labelHeight=e.labelHeight||n}function w(e){var i=e.labelWidth,o=e.labelHeight,n=e.options.position,a="x"===e.direction,r=e.options.tickLength,l=it.grid.axisMargin,s=it.grid.labelMargin,c=!0,u=!0,h=!0,f=!1;t.each(a?st:ct,function(t,i){i&&(i.show||i.reserveSpace)&&(i===e?f=!0:i.options.position===n&&(f?u=!1:c=!1),f||(h=!1))}),u&&(l=0),null==r&&(r=h?"full":5),isNaN(+r)||(s+=+r),a?(o+=s,"bottom"==n?(ut.bottom+=o+l,e.box={top:ot.height-ut.bottom,height:o}):(e.box={top:ut.top+l,height:o},ut.top+=o+l)):(i+=s,"left"==n?(e.box={left:ut.left+l,width:i},ut.left+=i+l):(ut.right+=i+l,e.box={left:ot.width-ut.right,width:i})),e.position=n,e.tickLength=r,e.box.padding=s,e.innermost=c}function M(t){"x"==t.direction?(t.box.left=ut.left-t.labelWidth/2,t.box.width=ot.width-ut.left-ut.right+t.labelWidth):(t.box.top=ut.top-t.labelHeight/2,t.box.height=ot.height-ut.bottom-ut.top+t.labelHeight)}function T(){var e,i=it.grid.minBorderMargin;if(null==i)for(i=0,e=0;e<et.length;++e)i=Math.max(i,2*(et[e].points.radius+et[e].points.lineWidth/2));var o={left:i,right:i,top:i,bottom:i};t.each(d(),function(t,e){e.reserveSpace&&e.ticks&&e.ticks.length&&("x"===e.direction?(o.left=Math.max(o.left,e.labelWidth/2),o.right=Math.max(o.right,e.labelWidth/2)):(o.bottom=Math.max(o.bottom,e.labelHeight/2),o.top=Math.max(o.top,e.labelHeight/2)))}),ut.left=Math.ceil(Math.max(o.left,ut.left)),ut.right=Math.ceil(Math.max(o.right,ut.right)),ut.top=Math.ceil(Math.max(o.top,ut.top)),ut.bottom=Math.ceil(Math.max(o.bottom,ut.bottom))}function z(){var e,i=d(),o=it.grid.show;for(var n in ut){var a=it.grid.margin||0;ut[n]="number"==typeof a?a:a[n]||0}l(dt.processOffset,[ut]);for(var n in ut)"object"==typeof it.grid.borderWidth?ut[n]+=o?it.grid.borderWidth[n]:0:ut[n]+=o?it.grid.borderWidth:0;if(t.each(i,function(t,e){var i=e.options;e.show=null==i.show?e.used:i.show,e.reserveSpace=null==i.reserveSpace?e.show:i.reserveSpace,S(e)}),o){var r=t.grep(i,function(t){return t.show||t.reserveSpace});for(t.each(r,function(t,e){C(e),W(e),I(e,e.ticks),y(e)}),e=r.length-1;e>=0;--e)w(r[e]);T(),t.each(r,function(t,e){M(e)})}ht=ot.width-ut.left-ut.right,ft=ot.height-ut.bottom-ut.top,t.each(i,function(t,e){k(e)}),o&&P(),R()}function S(t){var e=t.options,i=+(null!=e.min?e.min:t.datamin),o=+(null!=e.max?e.max:t.datamax),n=o-i;if(0==n){var a=0==o?1:.01;null==e.min&&(i-=a),null!=e.max&&null==e.min||(o+=a)}else{var r=e.autoscaleMargin;null!=r&&(null==e.min&&(i-=n*r)<0&&null!=t.datamin&&t.datamin>=0&&(i=0),null==e.max&&(o+=n*r)>0&&null!=t.datamax&&t.datamax<=0&&(o=0))}t.min=i,t.max=o}function C(e){var i,n=e.options;i="number"==typeof n.ticks&&n.ticks>0?n.ticks:.3*Math.sqrt("x"==e.direction?ot.width:ot.height);var a=(e.max-e.min)/i,r=-Math.floor(Math.log(a)/Math.LN10),l=n.tickDecimals;null!=l&&r>l&&(r=l);var s,c=Math.pow(10,-r),u=a/c;if(u<1.5?s=1:u<3?(s=2,u>2.25&&(null==l||r+1<=l)&&(s=2.5,++r)):s=u<7.5?5:10,s*=c,null!=n.minTickSize&&s<n.minTickSize&&(s=n.minTickSize),e.delta=a,e.tickDecimals=Math.max(0,null!=l?l:r),e.tickSize=n.tickSize||s,"time"==n.mode&&!e.tickGenerator)throw new Error("Time mode requires the flot.time plugin.");if(e.tickGenerator||(e.tickGenerator=function(t){var e,i=[],n=o(t.min,t.tickSize),a=0,r=Number.NaN;do{e=r,r=n+a*t.tickSize,i.push(r),++a}while(r<t.max&&r!=e);return i},e.tickFormatter=function(t,e){var i=e.tickDecimals?Math.pow(10,e.tickDecimals):1,o=""+Math.round(t*i)/i;if(null!=e.tickDecimals){var n=o.indexOf("."),a=-1==n?0:o.length-n-1;if(a<e.tickDecimals)return(a?o:o+".")+(""+i).substr(1,e.tickDecimals-a)}return o}),t.isFunction(n.tickFormatter)&&(e.tickFormatter=function(t,e){return""+n.tickFormatter(t,e)}),null!=n.alignTicksWithAxis){var h=("x"==e.direction?st:ct)[n.alignTicksWithAxis-1];if(h&&h.used&&h!=e){var f=e.tickGenerator(e);if(f.length>0&&(null==n.min&&(e.min=Math.min(e.min,f[0])),null==n.max&&f.length>1&&(e.max=Math.max(e.max,f[f.length-1]))),e.tickGenerator=function(t){var e,i,o=[];for(i=0;i<h.ticks.length;++i)e=(h.ticks[i].v-h.min)/(h.max-h.min),e=t.min+e*(t.max-t.min),o.push(e);return o},!e.mode&&null==n.tickDecimals){var d=Math.max(0,1-Math.floor(Math.log(e.delta)/Math.LN10)),p=e.tickGenerator(e);p.length>1&&/\..*0$/.test((p[1]-p[0]).toFixed(d))||(e.tickDecimals=d)}}}}function W(e){var i=e.options.ticks,o=[];null==i||"number"==typeof i&&i>0?o=e.tickGenerator(e):i&&(o=t.isFunction(i)?i(e):i);var n,a;for(e.ticks=[],n=0;n<o.length;++n){var r=null,l=o[n];"object"==typeof l?(a=+l[0],l.length>1&&(r=l[1])):a=+l,null==r&&(r=e.tickFormatter(a,e)),isNaN(a)||e.ticks.push({v:a,label:r})}}function I(t,e){t.options.autoscaleMargin&&e.length>0&&(null==t.options.min&&(t.min=Math.min(t.min,e[0].v)),null==t.options.max&&e.length>1&&(t.max=Math.max(t.max,e[e.length-1].v)))}function F(){ot.clear(),l(dt.drawBackground,[rt]);var t=it.grid;t.show&&t.backgroundColor&&D(),t.show&&!t.aboveData&&N();for(var e=0;e<et.length;++e)l(dt.drawSeries,[rt,et[e]]),H(et[e]);l(dt.draw,[rt]),t.show&&t.aboveData&&N(),ot.render(),V()}function A(t,e){for(var i,o,n,a,r=d(),l=0;l<r.length;++l)if((i=r[l]).direction==e&&(a=e+i.n+"axis",t[a]||1!=i.n||(a=e+"axis"),t[a])){o=t[a].from,n=t[a].to;break}if(t[a]||(i="x"==e?st[0]:ct[0],o=t[e+"1"],n=t[e+"2"]),null!=o&&null!=n&&o>n){var s=o;o=n,n=s}return{from:o,to:n,axis:i}}function D(){rt.save(),rt.translate(ut.left,ut.top),rt.fillStyle=tt(it.grid.backgroundColor,ft,0,"rgba(255, 255, 255, 0)"),rt.fillRect(0,0,ht,ft),rt.restore()}function N(){var e,i,o,n;rt.save(),rt.translate(ut.left,ut.top);var a=it.grid.markings;if(a)for(t.isFunction(a)&&(i=pt.getAxes(),i.xmin=i.xaxis.min,i.xmax=i.xaxis.max,i.ymin=i.yaxis.min,i.ymax=i.yaxis.max,a=a(i)),e=0;e<a.length;++e){var r=a[e],l=A(r,"x"),s=A(r,"y");if(null==l.from&&(l.from=l.axis.min),null==l.to&&(l.to=l.axis.max),null==s.from&&(s.from=s.axis.min),null==s.to&&(s.to=s.axis.max),!(l.to<l.axis.min||l.from>l.axis.max||s.to<s.axis.min||s.from>s.axis.max)){l.from=Math.max(l.from,l.axis.min),l.to=Math.min(l.to,l.axis.max),s.from=Math.max(s.from,s.axis.min),s.to=Math.min(s.to,s.axis.max);var c=l.from===l.to,u=s.from===s.to;if(!c||!u)if(l.from=Math.floor(l.axis.p2c(l.from)),l.to=Math.floor(l.axis.p2c(l.to)),s.from=Math.floor(s.axis.p2c(s.from)),s.to=Math.floor(s.axis.p2c(s.to)),c||u){var h=r.lineWidth||it.grid.markingsLineWidth,f=h%2?.5:0;rt.beginPath(),rt.strokeStyle=r.color||it.grid.markingsColor,rt.lineWidth=h,c?(rt.moveTo(l.to+f,s.from),rt.lineTo(l.to+f,s.to)):(rt.moveTo(l.from,s.to+f),rt.lineTo(l.to,s.to+f)),rt.stroke()}else rt.fillStyle=r.color||it.grid.markingsColor,rt.fillRect(l.from,s.to,l.to-l.from,s.from-s.to)}}i=d(),o=it.grid.borderWidth;for(var p=0;p<i.length;++p){var m,g,x,v,b=i[p],k=b.box,y=b.tickLength;if(b.show&&0!=b.ticks.length){for(rt.lineWidth=1,"x"==b.direction?(m=0,g="full"==y?"top"==b.position?0:ft:k.top-ut.top+("top"==b.position?k.height:0)):(g=0,m="full"==y?"left"==b.position?0:ht:k.left-ut.left+("left"==b.position?k.width:0)),b.innermost||(rt.strokeStyle=b.options.color,rt.beginPath(),x=v=0,"x"==b.direction?x=ht+1:v=ft+1,1==rt.lineWidth&&("x"==b.direction?g=Math.floor(g)+.5:m=Math.floor(m)+.5),rt.moveTo(m,g),rt.lineTo(m+x,g+v),rt.stroke()),rt.strokeStyle=b.options.tickColor,rt.beginPath(),e=0;e<b.ticks.length;++e){var w=b.ticks[e].v;x=v=0,isNaN(w)||w<b.min||w>b.max||"full"==y&&("object"==typeof o&&o[b.position]>0||o>0)&&(w==b.min||w==b.max)||("x"==b.direction?(m=b.p2c(w),v="full"==y?-ft:y,"top"==b.position&&(v=-v)):(g=b.p2c(w),x="full"==y?-ht:y,"left"==b.position&&(x=-x)),1==rt.lineWidth&&("x"==b.direction?m=Math.floor(m)+.5:g=Math.floor(g)+.5),rt.moveTo(m,g),rt.lineTo(m+x,g+v))}rt.stroke()}}o&&(n=it.grid.borderColor,"object"==typeof o||"object"==typeof n?("object"!=typeof o&&(o={top:o,right:o,bottom:o,left:o}),"object"!=typeof n&&(n={top:n,right:n,bottom:n,left:n}),o.top>0&&(rt.strokeStyle=n.top,rt.lineWidth=o.top,rt.beginPath(),rt.moveTo(0-o.left,0-o.top/2),rt.lineTo(ht,0-o.top/2),rt.stroke()),o.right>0&&(rt.strokeStyle=n.right,rt.lineWidth=o.right,rt.beginPath(),rt.moveTo(ht+o.right/2,0-o.top),rt.lineTo(ht+o.right/2,ft),rt.stroke()),o.bottom>0&&(rt.strokeStyle=n.bottom,rt.lineWidth=o.bottom,rt.beginPath(),rt.moveTo(ht+o.right,ft+o.bottom/2),rt.lineTo(0,ft+o.bottom/2),rt.stroke()),o.left>0&&(rt.strokeStyle=n.left,rt.lineWidth=o.left,rt.beginPath(),rt.moveTo(0-o.left/2,ft+o.bottom),rt.lineTo(0-o.left/2,0),rt.stroke())):(rt.lineWidth=o,rt.strokeStyle=it.grid.borderColor,rt.strokeRect(-o/2,-o/2,ht+o,ft+o))),rt.restore()}function P(){t.each(d(),function(t,e){var i,o,n,a,r,l=e.box,s=e.direction+"Axis "+e.direction+e.n+"Axis",c="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+s,u=e.options.font||"flot-tick-label tickLabel";if(ot.removeText(c),e.show&&0!=e.ticks.length)for(var h=0;h<e.ticks.length;++h)!(i=e.ticks[h]).label||i.v<e.min||i.v>e.max||("x"==e.direction?(a="center",o=ut.left+e.p2c(i.v),"bottom"==e.position?n=l.top+l.padding:(n=l.top+l.height-l.padding,r="bottom")):(r="middle",n=ut.top+e.p2c(i.v),"left"==e.position?(o=l.left+l.width-l.padding,a="right"):o=l.left+l.padding),ot.addText(c,o,n,i.label,u,null,null,a,r))})}function H(t){t.lines.show&&O(t),t.bars.show&&Y(t),t.points.show&&q(t)}function O(t){function e(t,e,i,o,n){var a=t.points,r=t.pointsize,l=null,s=null;rt.beginPath();for(var c=r;c<a.length;c+=r){var u=a[c-r],h=a[c-r+1],f=a[c],d=a[c+1];if(null!=u&&null!=f){if(h<=d&&h<n.min){if(d<n.min)continue;u=(n.min-h)/(d-h)*(f-u)+u,h=n.min}else if(d<=h&&d<n.min){if(h<n.min)continue;f=(n.min-h)/(d-h)*(f-u)+u,d=n.min}if(h>=d&&h>n.max){if(d>n.max)continue;u=(n.max-h)/(d-h)*(f-u)+u,h=n.max}else if(d>=h&&d>n.max){if(h>n.max)continue;f=(n.max-h)/(d-h)*(f-u)+u,d=n.max}if(u<=f&&u<o.min){if(f<o.min)continue;h=(o.min-u)/(f-u)*(d-h)+h,u=o.min}else if(f<=u&&f<o.min){if(u<o.min)continue;d=(o.min-u)/(f-u)*(d-h)+h,f=o.min}if(u>=f&&u>o.max){if(f>o.max)continue;h=(o.max-u)/(f-u)*(d-h)+h,u=o.max}else if(f>=u&&f>o.max){if(u>o.max)continue;d=(o.max-u)/(f-u)*(d-h)+h,f=o.max}u==l&&h==s||rt.moveTo(o.p2c(u)+e,n.p2c(h)+i),l=f,s=d,rt.lineTo(o.p2c(f)+e,n.p2c(d)+i)}}rt.stroke()}rt.save(),rt.translate(ut.left,ut.top),rt.lineJoin="round";var i=t.lines.lineWidth,o=t.shadowSize;if(i>0&&o>0){rt.lineWidth=o,rt.strokeStyle="rgba(0,0,0,0.1)";var n=Math.PI/18;e(t.datapoints,Math.sin(n)*(i/2+o/2),Math.cos(n)*(i/2+o/2),t.xaxis,t.yaxis),rt.lineWidth=o/2,e(t.datapoints,Math.sin(n)*(i/2+o/4),Math.cos(n)*(i/2+o/4),t.xaxis,t.yaxis)}rt.lineWidth=i,rt.strokeStyle=t.color;var a=E(t.lines,t.color,0,ft);a&&(rt.fillStyle=a,function(t,e,i){for(var o=t.points,n=t.pointsize,a=Math.min(Math.max(0,i.min),i.max),r=0,l=!1,s=1,c=0,u=0;!(n>0&&r>o.length+n);){var h=o[(r+=n)-n],f=o[r-n+s],d=o[r],p=o[r+s];if(l){if(n>0&&null!=h&&null==d){u=r,n=-n,s=2;continue}if(n<0&&r==c+n){rt.fill(),l=!1,s=1,r=c=u+(n=-n);continue}}if(null!=h&&null!=d){if(h<=d&&h<e.min){if(d<e.min)continue;f=(e.min-h)/(d-h)*(p-f)+f,h=e.min}else if(d<=h&&d<e.min){if(h<e.min)continue;p=(e.min-h)/(d-h)*(p-f)+f,d=e.min}if(h>=d&&h>e.max){if(d>e.max)continue;f=(e.max-h)/(d-h)*(p-f)+f,h=e.max}else if(d>=h&&d>e.max){if(h>e.max)continue;p=(e.max-h)/(d-h)*(p-f)+f,d=e.max}if(l||(rt.beginPath(),rt.moveTo(e.p2c(h),i.p2c(a)),l=!0),f>=i.max&&p>=i.max)rt.lineTo(e.p2c(h),i.p2c(i.max)),rt.lineTo(e.p2c(d),i.p2c(i.max));else if(f<=i.min&&p<=i.min)rt.lineTo(e.p2c(h),i.p2c(i.min)),rt.lineTo(e.p2c(d),i.p2c(i.min));else{var m=h,g=d;f<=p&&f<i.min&&p>=i.min?(h=(i.min-f)/(p-f)*(d-h)+h,f=i.min):p<=f&&p<i.min&&f>=i.min&&(d=(i.min-f)/(p-f)*(d-h)+h,p=i.min),f>=p&&f>i.max&&p<=i.max?(h=(i.max-f)/(p-f)*(d-h)+h,f=i.max):p>=f&&p>i.max&&f<=i.max&&(d=(i.max-f)/(p-f)*(d-h)+h,p=i.max),h!=m&&rt.lineTo(e.p2c(m),i.p2c(f)),rt.lineTo(e.p2c(h),i.p2c(f)),rt.lineTo(e.p2c(d),i.p2c(p)),d!=g&&(rt.lineTo(e.p2c(d),i.p2c(p)),rt.lineTo(e.p2c(g),i.p2c(p)))}}}}(t.datapoints,t.xaxis,t.yaxis)),i>0&&e(t.datapoints,0,0,t.xaxis,t.yaxis),rt.restore()}function q(t){function e(t,e,i,o,n,a,r,l){for(var s=t.points,c=t.pointsize,u=0;u<s.length;u+=c){var h=s[u],f=s[u+1];null==h||h<a.min||h>a.max||f<r.min||f>r.max||(rt.beginPath(),h=a.p2c(h),f=r.p2c(f)+o,"circle"==l?rt.arc(h,f,e,0,n?Math.PI:2*Math.PI,!1):l(rt,h,f,e,n),rt.closePath(),i&&(rt.fillStyle=i,rt.fill()),rt.stroke())}}rt.save(),rt.translate(ut.left,ut.top);var i=t.points.lineWidth,o=t.shadowSize,n=t.points.radius,a=t.points.symbol;if(0==i&&(i=1e-4),i>0&&o>0){var r=o/2;rt.lineWidth=r,rt.strokeStyle="rgba(0,0,0,0.1)",e(t.datapoints,n,null,r+r/2,!0,t.xaxis,t.yaxis,a),rt.strokeStyle="rgba(0,0,0,0.2)",e(t.datapoints,n,null,r/2,!0,t.xaxis,t.yaxis,a)}rt.lineWidth=i,rt.strokeStyle=t.color,e(t.datapoints,n,E(t.points,t.color),0,!1,t.xaxis,t.yaxis,a),rt.restore()}function L(t,e,i,o,n,a,r,l,s,c,u){var h,f,d,p,m,g,x,v,b;c?(v=g=x=!0,m=!1,h=i,f=t,p=e+o,d=e+n,f<h&&(b=f,f=h,h=b,m=!0,g=!1)):(m=g=x=!0,v=!1,h=t+o,f=t+n,d=i,(p=e)<d&&(b=p,p=d,d=b,v=!0,x=!1)),f<r.min||h>r.max||p<l.min||d>l.max||(h<r.min&&(h=r.min,m=!1),f>r.max&&(f=r.max,g=!1),d<l.min&&(d=l.min,v=!1),p>l.max&&(p=l.max,x=!1),h=r.p2c(h),d=l.p2c(d),f=r.p2c(f),p=l.p2c(p),a&&(s.fillStyle=a(d,p),s.fillRect(h,p,f-h,d-p)),u>0&&(m||g||x||v)&&(s.beginPath(),s.moveTo(h,d),m?s.lineTo(h,p):s.moveTo(h,p),x?s.lineTo(f,p):s.moveTo(f,p),g?s.lineTo(f,d):s.moveTo(f,d),v?s.lineTo(h,d):s.moveTo(h,d),s.stroke()))}function Y(t){rt.save(),rt.translate(ut.left,ut.top),rt.lineWidth=t.bars.lineWidth,rt.strokeStyle=t.color;var e;switch(t.bars.align){case"left":e=0;break;case"right":e=-t.bars.barWidth;break;default:e=-t.bars.barWidth/2}var i=t.bars.fill?function(e,i){return E(t.bars,t.color,e,i)}:null;(function(e,i,o,n,a,r){for(var l=e.points,s=e.pointsize,c=0;c<l.length;c+=s)null!=l[c]&&L(l[c],l[c+1],l[c+2],i,o,n,a,r,rt,t.bars.horizontal,t.bars.lineWidth)})(t.datapoints,e,e+t.bars.barWidth,i,t.xaxis,t.yaxis),rt.restore()}function E(e,i,o,n){var a=e.fill;if(!a)return null;if(e.fillColor)return tt(e.fillColor,o,n,i);var r=t.color.parse(i);return r.a="number"==typeof a?a:.4,r.normalize(),r.toString()}function R(){if(null!=it.legend.container?t(it.legend.container).html(""):i.find(".legend").remove(),it.legend.show){for(var e,o,n=[],a=[],r=!1,l=it.legend.labelFormatter,s=0;s<et.length;++s)(e=et[s]).label&&(o=l?l(e.label,e):e.label)&&a.push({label:o,color:e.color});if(it.legend.sorted)if(t.isFunction(it.legend.sorted))a.sort(it.legend.sorted);else if("reverse"==it.legend.sorted)a.reverse();else{var c="descending"!=it.legend.sorted;a.sort(function(t,e){return t.label==e.label?0:t.label<e.label!=c?1:-1})}for(s=0;s<a.length;++s){var u=a[s];s%it.legend.noColumns==0&&(r&&n.push("</tr>"),n.push("<tr>"),r=!0),n.push('<td class="legendColorBox"><div style="border:1px solid '+it.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+u.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+u.label+"</td>")}if(r&&n.push("</tr>"),0!=n.length){var h='<table style="font-size:smaller;color:'+it.grid.color+'">'+n.join("")+"</table>";if(null!=it.legend.container)t(it.legend.container).html(h);else{var f="",d=it.legend.position,p=it.legend.margin;null==p[0]&&(p=[p,p]),"n"==d.charAt(0)?f+="top:"+(p[1]+ut.top)+"px;":"s"==d.charAt(0)&&(f+="bottom:"+(p[1]+ut.bottom)+"px;"),"e"==d.charAt(1)?f+="right:"+(p[0]+ut.right)+"px;":"w"==d.charAt(1)&&(f+="left:"+(p[0]+ut.left)+"px;");var m=t('<div class="legend">'+h.replace('style="','style="position:absolute;'+f+";")+"</div>").appendTo(i);if(0!=it.legend.backgroundOpacity){var g=it.legend.backgroundColor;null==g&&(g=it.grid.backgroundColor,g=g&&"string"==typeof g?t.color.parse(g):t.color.extract(m,"background-color"),g.a=1,g=g.toString());var x=m.children();t('<div style="position:absolute;width:'+x.width()+"px;height:"+x.height()+"px;"+f+"background-color:"+g+';"> </div>').prependTo(m).css("opacity",it.legend.backgroundOpacity)}}}}}function j(t,e,i){var o,n,a,r=it.grid.mouseActiveRadius,l=r*r+1,s=null;for(o=et.length-1;o>=0;--o)if(i(et[o])){var c=et[o],u=c.xaxis,h=c.yaxis,f=c.datapoints.points,d=u.c2p(t),p=h.c2p(e),m=r/u.scale,g=r/h.scale;if(a=c.datapoints.pointsize,u.options.inverseTransform&&(m=Number.MAX_VALUE),h.options.inverseTransform&&(g=Number.MAX_VALUE),c.lines.show||c.points.show)for(n=0;n<f.length;n+=a){var x=f[n],v=f[n+1];if(null!=x&&!(x-d>m||x-d<-m||v-p>g||v-p<-g)){var b=Math.abs(u.p2c(x)-t),k=Math.abs(h.p2c(v)-e),y=b*b+k*k;y<l&&(l=y,s=[o,n/a])}}if(c.bars.show&&!s){var w,M;switch(c.bars.align){case"left":w=0;break;case"right":w=-c.bars.barWidth;break;default:w=-c.bars.barWidth/2}for(M=w+c.bars.barWidth,n=0;n<f.length;n+=a){var x=f[n],v=f[n+1],T=f[n+2];null!=x&&(et[o].bars.horizontal?d<=Math.max(T,x)&&d>=Math.min(T,x)&&p>=v+w&&p<=v+M:d>=x+w&&d<=x+M&&p>=Math.min(T,v)&&p<=Math.max(T,v))&&(s=[o,n/a])}}}return s?(o=s[0],n=s[1],a=et[o].datapoints.pointsize,{datapoint:et[o].datapoints.points.slice(n*a,(n+1)*a),dataIndex:n,series:et[o],seriesIndex:o}):null}function G(t){it.grid.hoverable&&X("plothover",t,function(t){return 0!=t.hoverable})}function B(t){it.grid.hoverable&&X("plothover",t,function(t){return!1})}function _(t){X("plotclick",t,function(t){return 0!=t.clickable})}function X(t,e,o){var n=at.offset(),a=e.pageX-n.left-ut.left,r=e.pageY-n.top-ut.top,l=p({left:a,top:r});l.pageX=e.pageX,l.pageY=e.pageY;var s=j(a,r,o);if(s&&(s.pageX=parseInt(s.series.xaxis.p2c(s.datapoint[0])+n.left+ut.left,10),s.pageY=parseInt(s.series.yaxis.p2c(s.datapoint[1])+n.top+ut.top,10)),it.grid.autoHighlight){for(var c=0;c<mt.length;++c){var u=mt[c];u.auto!=t||s&&u.series==s.series&&u.point[0]==s.datapoint[0]&&u.point[1]==s.datapoint[1]||$(u.series,u.point)}s&&Q(s.series,s.datapoint,t)}i.trigger(t,[l,s])}function V(){var t=it.interaction.redrawOverlayInterval;return-1==t?void J():void(gt||(gt=setTimeout(J,t)))}function J(){gt=null,lt.save(),nt.clear(),lt.translate(ut.left,ut.top);var t,e;for(t=0;t<mt.length;++t)e=mt[t],e.series.bars.show?Z(e.series,e.point):K(e.series,e.point);lt.restore(),l(dt.drawOverlay,[lt])}function Q(t,e,i){if("number"==typeof t&&(t=et[t]),"number"==typeof e){var o=t.datapoints.pointsize;e=t.datapoints.points.slice(o*e,o*(e+1))}var n=U(t,e);-1==n?(mt.push({series:t,point:e,auto:i}),V()):i||(mt[n].auto=!1)}function $(t,e){if(null==t&&null==e)return mt=[],void V();if("number"==typeof t&&(t=et[t]),"number"==typeof e){var i=t.datapoints.pointsize;e=t.datapoints.points.slice(i*e,i*(e+1))}var o=U(t,e);-1!=o&&(mt.splice(o,1),V())}function U(t,e){for(var i=0;i<mt.length;++i){var o=mt[i];if(o.series==t&&o.point[0]==e[0]&&o.point[1]==e[1])return i}return-1}function K(e,i){var o=i[0],n=i[1],a=e.xaxis,r=e.yaxis,l="string"==typeof e.highlightColor?e.highlightColor:t.color.parse(e.color).scale("a",.5).toString();if(!(o<a.min||o>a.max||n<r.min||n>r.max)){var s=e.points.radius+e.points.lineWidth/2;lt.lineWidth=s,lt.strokeStyle=l;var c=1.5*s;o=a.p2c(o),n=r.p2c(n),lt.beginPath(),"circle"==e.points.symbol?lt.arc(o,n,c,0,2*Math.PI,!1):e.points.symbol(lt,o,n,c,!1),lt.closePath(),lt.stroke()}}function Z(e,i){var o,n="string"==typeof e.highlightColor?e.highlightColor:t.color.parse(e.color).scale("a",.5).toString(),a=n;switch(e.bars.align){case"left":o=0;break;case"right":o=-e.bars.barWidth;break;default:o=-e.bars.barWidth/2}lt.lineWidth=e.bars.lineWidth,lt.strokeStyle=n,L(i[0],i[1],i[2]||0,o,o+e.bars.barWidth,function(){return a},e.xaxis,e.yaxis,lt,e.bars.horizontal,e.bars.lineWidth)}function tt(e,i,o,n){if("string"==typeof e)return e;for(var a=rt.createLinearGradient(0,o,0,i),r=0,l=e.colors.length;r<l;++r){var s=e.colors[r];if("string"!=typeof s){var c=t.color.parse(n);null!=s.brightness&&(c=c.scale("rgb",s.brightness)),null!=s.opacity&&(c.a*=s.opacity),s=c.toString()}a.addColorStop(r/(l-1),s)}return a}var et=[],it={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:{}},ot=null,nt=null,at=null,rt=null,lt=null,st=[],ct=[],ut={left:0,right:0,top:0,bottom:0},ht=0,ft=0,dt={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},pt=this;pt.setData=c,pt.setOptions=u,pt.setupGrid=z,pt.draw=F,pt.getPlaceholder=function(){return i},pt.getCanvas=function(){return ot.element},pt.getPlotOffset=function(){return ut},pt.width=function(){return ht},pt.height=function(){return ft},pt.offset=function(){var t=at.offset();return t.left+=ut.left,t.top+=ut.top,t},pt.getData=function(){return et},pt.getAxes=function(){var e={};return t.each(st.concat(ct),function(t,i){i&&(e[i.direction+(1!=i.n?i.n:"")+"axis"]=i)}),e},pt.getXAxes=function(){return st},pt.getYAxes=function(){return ct},pt.c2p=p,pt.p2c=m,pt.getOptions=function(){return it},pt.highlight=Q,pt.unhighlight=$,pt.triggerRedrawOverlay=V,pt.pointOffset=function(t){return{left:parseInt(st[f(t,"x")-1].p2c(+t.x)+ut.left,10),top:parseInt(ct[f(t,"y")-1].p2c(+t.y)+ut.top,10)}},pt.shutdown=b,pt.destroy=function(){b(),i.removeData("plot").empty(),et=[],it=null,ot=null,nt=null,at=null,rt=null,lt=null,st=[],ct=[],dt=null,mt=[],pt=null},pt.resize=function(){var t=i.width(),e=i.height();ot.resize(t,e),nt.resize(t,e)},pt.hooks=dt,function(){for(var i={Canvas:e},o=0;o<r.length;++o){var n=r[o];n.init(pt,i),n.options&&t.extend(!0,it,n.options)}}(),s(a),function(){i.css("padding",0).children().filter(function(){return!t(this).hasClass("flot-overlay")&&!t(this).hasClass("flot-base")}).remove(),"static"==i.css("position")&&i.css("position","relative"),ot=new e("flot-base",i),nt=new e("flot-overlay",i),rt=ot.context,lt=nt.context,at=t(nt.element).unbind();var o=i.data("plot");o&&(o.shutdown(),nt.clear()),i.data("plot",pt)}(),c(n),z(),F(),function(){it.grid.hoverable&&(at.mousemove(G),at.bind("mouseleave",B)),it.grid.clickable&&at.click(_),l(dt.bindEvents,[at])}();var mt=[],gt=null}function o(t,e){return e*Math.floor(t/e)}var n=Object.prototype.hasOwnProperty;t.fn.detach||(t.fn.detach=function(){return this.each(function(){this.parentNode&&this.parentNode.removeChild(this)})}),e.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,n=this.pixelRatio;this.width!=t&&(i.width=t*n,i.style.width=t+"px",this.width=t),this.height!=e&&(i.height=e*n,i.style.height=e+"px",this.height=e),o.restore(),o.save(),o.scale(n,n)},e.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},e.prototype.render=function(){var t=this._textCache;for(var e in t)if(n.call(t,e)){var i=this.getTextLayer(e),o=t[e];i.hide();for(var a in o)if(n.call(o,a)){var r=o[a];for(var l in r)if(n.call(r,l)){for(var s,c=r[l].positions,u=0;s=c[u];u++)s.active?s.rendered||(i.append(s.element),s.rendered=!0):(c.splice(u--,1),s.rendered&&s.element.detach());0==c.length&&delete r[l]}}i.show()}},e.prototype.getTextLayer=function(e){var i=this.text[e];return null==i&&(null==this.textContainer&&(this.textContainer=t("<div class='flot-text'></div>").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),i=this.text[e]=t("<div></div>").addClass(e).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),i},e.prototype.getTextInfo=function(e,i,o,n,a){var r,l,s,c;if(i=""+i,r="object"==typeof o?o.style+" "+o.variant+" "+o.weight+" "+o.size+"px/"+o.lineHeight+"px "+o.family:o,null==(l=this._textCache[e])&&(l=this._textCache[e]={}),null==(s=l[r])&&(s=l[r]={}),null==(c=s[i])){var u=t("<div></div>").html(i).css({position:"absolute","max-width":a,top:-9999}).appendTo(this.getTextLayer(e));"object"==typeof o?u.css({font:r,color:o.color}):"string"==typeof o&&u.addClass(o),c=s[i]={width:u.outerWidth(!0),height:u.outerHeight(!0),element:u,positions:[]},u.detach()}return c},e.prototype.addText=function(t,e,i,o,n,a,r,l,s){var c=this.getTextInfo(t,o,n,a,r),u=c.positions;"center"==l?e-=c.width/2:"right"==l&&(e-=c.width),"middle"==s?i-=c.height/2:"bottom"==s&&(i-=c.height);for(var h,f=0;h=u[f];f++)if(h.x==e&&h.y==i)return void(h.active=!0);h={active:!0,rendered:!1,element:u.length?c.element.clone():c.element,x:e,y:i},u.push(h),h.element.css({top:Math.round(i),left:Math.round(e),"text-align":l})},e.prototype.removeText=function(t,e,i,o,a,r){if(null==o){var l=this._textCache[t];if(null!=l)for(var s in l)if(n.call(l,s)){var c=l[s];for(var u in c)if(n.call(c,u))for(var h=c[u].positions,f=0;d=h[f];f++)d.active=!1}}else for(var d,h=this.getTextInfo(t,o,a,r).positions,f=0;d=h[f];f++)d.x==e&&d.y==i&&(d.active=!1)},t.plot=function(e,o,n){return new i(t(e),o,n,t.plot.plugins)},t.plot.version="0.8.3",t.plot.plugins=[],t.fn.plot=function(e,i){return this.each(function(){t.plot(this,e,i)})}}($),function(t){var e={tooltip:!1,tooltipOpts:{content:"%s | X: %x | Y: %y.2",dateFormat:"%y-%0m-%0d",shifts:{x:10,y:20},defaultTheme:!0}},i=function(e){var i={x:0,y:0},o=e.getOptions(),n=function(t){i.x=t.x,i.y=t.y},a=function(t){var e={x:0,y:0};e.x=t.pageX,e.y=t.pageY,n(e)},r=function(e){var i=new Date(e);return t.plot.formatDate(i,o.tooltipOpts.dateFormat)};e.hooks.bindEvents.push(function(e,n){var s,c=o.tooltipOpts,u=e.getPlaceholder();!1!==o.tooltip&&(t("#flotTip").length>0?s=t("#flotTip"):((s=t("<div />").attr("id","flotTip")).appendTo("body").hide().css({position:"absolute"}),c.defaultTheme&&s.css({background:"#fff","z-index":"100",padding:"0.4em 0.6em","border-radius":"0.5em","font-size":"0.8em",border:"1px solid #111"})),t(u).bind("plothover",function(t,e,n){if(n){var a;a="time"===o.xaxis.mode||"time"===o.xaxes[0].mode?l(c.content,n,r):l(c.content,n),s.html(a).css({left:i.x+c.shifts.x,top:i.y+c.shifts.y}).show()}else s.hide().html("")}),n.mousemove(a))});var l=function(t,e,i){var o=/%p\.{0,1}(\d{0,})/,n=/%s/,a=/%x\.{0,1}(\d{0,})/,r=/%y\.{0,1}(\d{0,})/;return void 0!==e.series.percent&&(t=s(o,t,e.series.percent)),void 0!==e.series.label&&(t=t.replace(n,e.series.label)),"function"==typeof i?t=t.replace(a,i(e.series.data[e.dataIndex][0])):"number"==typeof e.series.data[e.dataIndex][0]&&(t=s(a,t,e.series.data[e.dataIndex][0])),"number"==typeof e.series.data[e.dataIndex][1]&&(t=s(r,t,e.series.data[e.dataIndex][1])),t},s=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}};t.plot.plugins.push({init:i,options:e,name:"tooltip",version:"0.4.4"})}($),function(t,e,i){"$:nomunge";function o(){n=e.setTimeout(function(){a.each(function(){var e=t(this),i=e.width(),o=e.height(),n=t.data(this,s);i===n.w&&o===n.h||e.trigger(l,[n.w=i,n.h=o])}),o()},r[c])}var n,a=t([]),r=t.resize=t.extend(t.resize,{}),l="resize",s=l+"-special-event",c="delay";r[c]=250,r.throttleWindow=!0,t.event.special[l]={setup:function(){if(!r.throttleWindow&&this.setTimeout)return!1;var e=t(this);a=a.add(e),t.data(this,s,{w:e.width(),h:e.height()}),1===a.length&&o()},teardown:function(){if(!r.throttleWindow&&this.setTimeout)return!1;var e=t(this);a=a.not(e),e.removeData(s),a.length||clearTimeout(n)},add:function(e){function o(e,o,a){var r=t(this),l=t.data(this,s);l.w=o!==i?o:r.width(),l.h=a!==i?a:r.height(),n.apply(this,arguments)}if(!r.throttleWindow&&this.setTimeout)return!1;var n;if(t.isFunction(e))return n=e,o;n=e.handler,e.handler=o}}}(jQuery,void 0),function(t){function e(t){function e(){var e=t.getPlaceholder();0!=e.width()&&0!=e.height()&&(t.resize(),t.setupGrid(),t.draw())}function i(t,i){t.getPlaceholder().resize(e)}function o(t,i){t.getPlaceholder().unbind("resize",e)}t.hooks.bindEvents.push(i),t.hooks.shutdown.push(o)}var i={};t.plot.plugins.push({init:e,options:i,name:"resize",version:"1.0"})}(jQuery),function(t){function e(t){function e(t,e){for(var i=null,o=0;o<e.length&&t!=e[o];++o)e[o].stack==t.stack&&(i=e[o]);return i}function i(t,i,o){if(null!=i.stack&&!1!==i.stack){var n=e(i,t.getData());if(n){for(var a,r,l,s,c,u,h,f,d=o.pointsize,p=o.points,m=n.datapoints.pointsize,g=n.datapoints.points,x=[],v=i.lines.show,b=i.bars.horizontal,k=d>2&&(b?o.format[2].x:o.format[2].y),y=v&&i.lines.steps,w=!0,M=b?1:0,T=b?0:1,z=0,S=0;;){if(z>=p.length)break;if(h=x.length,null==p[z]){for(f=0;f<d;++f)x.push(p[z+f]);z+=d}else if(S>=g.length){if(!v)for(f=0;f<d;++f)x.push(p[z+f]);z+=d}else if(null==g[S]){for(f=0;f<d;++f)x.push(null);w=!0,S+=m}else{if(a=p[z+M],r=p[z+T],s=g[S+M],c=g[S+T],u=0,a==s){for(f=0;f<d;++f)x.push(p[z+f]);x[h+T]+=c,u=c,z+=d,S+=m}else if(a>s){if(v&&z>0&&null!=p[z-d]){for(l=r+(p[z-d+T]-r)*(s-a)/(p[z-d+M]-a),x.push(s),x.push(l+c),f=2;f<d;++f)x.push(p[z+f]);u=c}S+=m}else{if(w&&v){z+=d;continue}for(f=0;f<d;++f)x.push(p[z+f]);v&&S>0&&null!=g[S-m]&&(u=c+(g[S-m+T]-c)*(a-s)/(g[S-m+M]-s)),x[h+T]+=u,z+=d}w=!1,h!=x.length&&k&&(x[h+2]+=u)}if(y&&h!=x.length&&h>0&&null!=x[h]&&x[h]!=x[h-d]&&x[h+1]!=x[h-d+1]){for(f=0;f<d;++f)x[h+d+f]=x[h+f];x[h+1]=x[h-d+1]}}o.points=x}}}t.hooks.processDatapoints.push(i)}var i={series:{stack:null}};t.plot.plugins.push({init:e,options:i,name:"stack",version:"1.2"})}(jQuery),function(t){function e(t,e){return e*Math.floor(t/e)}function i(t,e,i,o){if("function"==typeof t.strftime)return t.strftime(e);var n=function(t,e){return t=""+t,e=""+(null==e?"0":e),1==t.length?e+t:t},a=[],r=!1,l=t.getHours(),s=l<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"]);var c;c=l>12?l-12:0==l?12:l;for(var u=0;u<e.length;++u){var h=e.charAt(u);if(r){switch(h){case"a":h=""+o[t.getDay()];break;case"b":h=""+i[t.getMonth()];break;case"d":h=n(t.getDate());break;case"e":h=n(t.getDate()," ");break;case"H":h=n(l);break;case"I":h=n(c);break;case"l":h=n(c," ");break;case"m":h=n(t.getMonth()+1);break;case"M":h=n(t.getMinutes());break;case"q":h=""+(Math.floor(t.getMonth()/3)+1);break;case"S":h=n(t.getSeconds());break;case"y":h=n(t.getFullYear()%100);break;case"Y":h=""+t.getFullYear();break;case"p":h=s?"am":"pm";break;case"P":h=s?"AM":"PM";break;case"w":h=""+t.getDay()}a.push(h),r=!1}else"%"==h?r=!0:a.push(h)}return a.join("")}function o(t){function e(t,e,i,o){t[e]=function(){return i[o].apply(i,arguments)}}var i={date:t};void 0!=t.strftime&&e(i,"strftime",t,"strftime"),e(i,"getTime",t,"getTime"),e(i,"setTime",t,"setTime");for(var o=["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds"],n=0;n<o.length;n++)e(i,"get"+o[n],t,"getUTC"+o[n]),e(i,"set"+o[n],t,"setUTC"+o[n]);return i}function n(t,e){if("browser"==e.timezone)return new Date(t);if(e.timezone&&"utc"!=e.timezone){if("undefined"!=typeof timezoneJS&&void 0!==timezoneJS.Date){var i=new timezoneJS.Date;return i.setTimezone(e.timezone),i.setTime(t),i}return o(new Date(t))}return o(new Date(t))}function a(o){o.hooks.processDatapoints.push(function(o,a,r){t.each(o.getAxes(),function(t,o){var a=o.options;"time"==a.mode&&(o.tickGenerator=function(t){var i=[],o=n(t.min,a),r=0,s=a.tickSize&&"quarter"===a.tickSize[1]||a.minTickSize&&"quarter"===a.minTickSize[1]?u:c;null!=a.minTickSize&&(r="number"==typeof a.tickSize?a.tickSize:a.minTickSize[0]*l[a.minTickSize[1]]);for(var h=0;h<s.length-1&&!(t.delta<(s[h][0]*l[s[h][1]]+s[h+1][0]*l[s[h+1][1]])/2&&s[h][0]*l[s[h][1]]>=r);++h);var f=s[h][0],d=s[h][1];if("year"==d){if(null!=a.minTickSize&&"year"==a.minTickSize[1])f=Math.floor(a.minTickSize[0]);else{var p=Math.pow(10,Math.floor(Math.log(t.delta/l.year)/Math.LN10)),m=t.delta/l.year/p;f=m<1.5?1:m<3?2:m<7.5?5:10,f*=p}f<1&&(f=1)}t.tickSize=a.tickSize||[f,d];var g=t.tickSize[0];d=t.tickSize[1];var x=g*l[d];"second"==d?o.setSeconds(e(o.getSeconds(),g)):"minute"==d?o.setMinutes(e(o.getMinutes(),g)):"hour"==d?o.setHours(e(o.getHours(),g)):"month"==d?o.setMonth(e(o.getMonth(),g)):"quarter"==d?o.setMonth(3*e(o.getMonth()/3,g)):"year"==d&&o.setFullYear(e(o.getFullYear(),g)),o.setMilliseconds(0),x>=l.minute?o.setSeconds(0):x>=l.hour?o.setMinutes(0):x>=l.day?o.setHours(0):x>=4*l.day?o.setDate(1):x>=2*l.month?o.setMonth(e(o.getMonth(),3)):x>=2*l.quarter?o.setMonth(e(o.getMonth(),6)):x>=l.year&&o.setMonth(0);var v,b=0,k=Number.NaN;do{if(v=k,k=o.getTime(),i.push(k),"month"==d||"quarter"==d)if(g<1){o.setDate(1);var y=o.getTime();o.setMonth(o.getMonth()+("quarter"==d?3:1));var w=o.getTime();o.setTime(k+b*l.hour+(w-y)*g),b=o.getHours(),o.setHours(0)}else o.setMonth(o.getMonth()+g*("quarter"==d?3:1));else"year"==d?o.setFullYear(o.getFullYear()+g):o.setTime(k+x)}while(k<t.max&&k!=v);return i},o.tickFormatter=function(t,e){var o=n(t,e.options);if(null!=a.timeformat)return i(o,a.timeformat,a.monthNames,a.dayNames);var r=e.options.tickSize&&"quarter"==e.options.tickSize[1]||e.options.minTickSize&&"quarter"==e.options.minTickSize[1],s=e.tickSize[0]*l[e.tickSize[1]],c=e.max-e.min,u=a.twelveHourClock?" %p":"",h=a.twelveHourClock?"%I":"%H";return i(o,s<l.minute?h+":%M:%S"+u:s<l.day?c<2*l.day?h+":%M"+u:"%b %d "+h+":%M"+u:s<l.month?"%b %d":r&&s<l.quarter||!r&&s<l.year?c<l.year?"%b":"%b %Y":r&&s<l.year?c<l.year?"Q%q":"Q%q %Y":"%Y",a.monthNames,a.dayNames)})})})}var r={},l={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},s=[[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"]],c=s.concat([[3,"month"],[6,"month"],[1,"year"]]),u=s.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);t.plot.plugins.push({init:a,options:r,name:"time",version:"1.0"}),t.plot.formatDate=i}(jQuery)}(); |
{ | ||
"name": "@ninjamsp/ninja-flot", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"main": "bundle.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
45957