"),n.push(""),r=!0),n.push(' | '+h.label+" | ")}if(r&&n.push("
"),0!=n.length){var f='";if(null!=nt.legend.container)t(nt.legend.container).html(f);else{var u="",d=nt.legend.position,p=nt.legend.margin;null==p[0]&&(p=[p,p]),"n"==d.charAt(0)?u+="top:"+(p[1]+ut.top)+"px;":"s"==d.charAt(0)&&(u+="bottom:"+(p[1]+ut.bottom)+"px;"),"e"==d.charAt(1)?u+="right:"+(p[0]+ut.right)+"px;":"w"==d.charAt(1)&&(u+="left:"+(p[0]+ut.left)+"px;");var m=t(''+f.replace('style="','style="position:absolute;'+u+";")+"
").appendTo(e);if(0!=nt.legend.backgroundOpacity){var x=nt.legend.backgroundColor;null==x&&(x=nt.grid.backgroundColor,x=x&&"string"==typeof x?t.color.parse(x):t.color.extract(m,"background-color"),x.a=1,x=x.toString());var g=m.children();t('
').prependTo(m).css("opacity",nt.legend.backgroundOpacity)}}}}}function V(t,i,e){var o,n,a,r=nt.grid.mouseActiveRadius,l=r*r+1,s=null;for(o=ot.length-1;o>=0;--o)if(e(ot[o])){var c=ot[o],h=c.xaxis,f=c.yaxis,u=c.datapoints.points,d=h.c2p(t),p=f.c2p(i),m=r/h.scale,x=r/f.scale;if(a=c.datapoints.pointsize,h.options.inverseTransform&&(m=Number.MAX_VALUE),f.options.inverseTransform&&(x=Number.MAX_VALUE),c.lines.show||c.points.show)for(n=0;nm||-m>g-d||b-p>x||-x>b-p)){var v=Math.abs(h.p2c(g)-t),k=Math.abs(f.p2c(b)-i),y=v*v+k*k;l>y&&(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=Math.min(T,g)&&p>=b+w&&b+M>=p:d>=g+w&&g+M>=d&&p>=Math.min(T,b)&&p<=Math.max(T,b))&&(s=[o,n/a])}}}return s?(o=s[0],n=s[1],a=ot[o].datapoints.pointsize,{datapoint:ot[o].datapoints.points.slice(n*a,(n+1)*a),dataIndex:n,series:ot[o],seriesIndex:o}):null}function X(t){nt.grid.hoverable&&Q("plothover",t,function(t){return 0!=t.hoverable})}function Y(t){nt.grid.hoverable&&Q("plothover",t,function(t){return!1})}function q(t){Q("plotclick",t,function(t){return 0!=t.clickable})}function Q(t,i,o){var n=lt.offset(),a=i.pageX-n.left-ut.left,r=i.pageY-n.top-ut.top,l=p({left:a,top:r});l.pageX=i.pageX,l.pageY=i.pageY;var s=V(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)),nt.grid.autoHighlight){for(var c=0;ca.max||nr.max)){var s=i.points.radius+i.points.lineWidth/2;ct.lineWidth=s,ct.strokeStyle=l;var c=1.5*s;o=a.p2c(o),n=r.p2c(n),ct.beginPath(),"circle"==i.points.symbol?ct.arc(o,n,c,0,2*Math.PI,!1):i.points.symbol(ct,o,n,c,!1),ct.closePath(),ct.stroke()}}function it(i,e){var o,n="string"==typeof i.highlightColor?i.highlightColor:t.color.parse(i.color).scale("a",.5).toString(),a=n;switch(i.bars.align){case"left":o=0;break;case"right":o=-i.bars.barWidth;break;default:o=-i.bars.barWidth/2}ct.lineWidth=i.bars.lineWidth,ct.strokeStyle=n,E(e[0],e[1],e[2]||0,o,o+i.bars.barWidth,function(){return a},i.xaxis,i.yaxis,ct,i.bars.horizontal,i.bars.lineWidth)}function et(i,e,o,n){if("string"==typeof i)return i;for(var a=st.createLinearGradient(0,o,0,e),r=0,l=i.colors.length;l>r;++r){var s=i.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 ot=[],nt={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:{}},at=null,rt=null,lt=null,st=null,ct=null,ht=[],ft=[],ut={left:0,right:0,top:0,bottom:0},dt=0,pt=0,mt={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},xt=this;xt.setData=h,xt.setupGrid=W,xt.draw=P,xt.getPlaceholder=function(){return e},xt.getCanvas=function(){return at.element},xt.getPlotOffset=function(){return ut},xt.width=function(){return dt},xt.height=function(){return pt},xt.offset=function(){var t=lt.offset();return t.left+=ut.left,t.top+=ut.top,t},xt.getData=function(){return ot},xt.getAxes=function(){var i={};return t.each(ht.concat(ft),function(t,e){e&&(i[e.direction+(1!=e.n?e.n:"")+"axis"]=e)}),i},xt.getXAxes=function(){return ht},xt.getYAxes=function(){return ft},xt.c2p=p,xt.p2c=m,xt.getOptions=function(){return nt},xt.highlight=$,xt.unhighlight=K,xt.triggerRedrawOverlay=U,xt.pointOffset=function(t){return{left:parseInt(ht[u(t,"x")-1].p2c(+t.x)+ut.left,10),top:parseInt(ft[u(t,"y")-1].p2c(+t.y)+ut.top,10)}},xt.shutdown=y,xt.destroy=function(){y(),e.removeData("plot").empty(),ot=[],nt=null,at=null,rt=null,lt=null,st=null,ct=null,ht=[],ft=[],mt=null,gt=[],xt=null},xt.resize=function(){var t=e.width(),i=e.height();at.resize(t,i),rt.resize(t,i)},xt.hooks=mt,s(xt),c(a),v(),h(n),W(),P(),k();var gt=[],bt=null}function o(t,i){return i*Math.floor(t/i)}var n=Object.prototype.hasOwnProperty;t.fn.detach||(t.fn.detach=function(){return this.each(function(){this.parentNode&&this.parentNode.removeChild(this)})}),i.prototype.resize=function(t,i){if(0>=t||0>=i)throw new Error("Invalid dimensions for plot, width = "+t+", height = "+i);var e=this.element,o=this.context,n=this.pixelRatio;this.width!=t&&(e.width=t*n,e.style.width=t+"px",this.width=t),this.height!=i&&(e.height=i*n,e.style.height=i+"px",this.height=i),o.restore(),o.save(),o.scale(n,n)},i.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},i.prototype.render=function(){var t=this._textCache;for(var i in t)if(n.call(t,i)){var e=this.getTextLayer(i),o=t[i];e.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||(e.append(s.element),s.rendered=!0):(c.splice(h--,1),s.rendered&&s.element.detach());0==c.length&&delete r[l]}}e.show()}},i.prototype.getTextLayer=function(i){var e=this.text[i];return null==e&&(null==this.textContainer&&(this.textContainer=t("").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),e=this.text[i]=t("").addClass(i).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),e},i.prototype.getTextInfo=function(i,e,o,n,a){var r,l,s,c;if(e=""+e,r="object"==typeof o?o.style+" "+o.variant+" "+o.weight+" "+o.size+"px/"+o.lineHeight+"px "+o.family:o,l=this._textCache[i],null==l&&(l=this._textCache[i]={}),s=l[r],null==s&&(s=l[r]={}),c=s[e],null==c){var h=t("").html(e).css({position:"absolute","max-width":a,top:-9999}).appendTo(this.getTextLayer(i));"object"==typeof o?h.css({font:r,color:o.color}):"string"==typeof o&&h.addClass(o),c=s[e]={width:h.outerWidth(!0),height:h.outerHeight(!0),element:h,positions:[]},h.detach()}return c},i.prototype.addText=function(t,i,e,o,n,a,r,l,s){var c=this.getTextInfo(t,o,n,a,r),h=c.positions;"center"==l?i-=c.width/2:"right"==l&&(i-=c.width),"middle"==s?e-=c.height/2:"bottom"==s&&(e-=c.height);for(var f,u=0;f=h[u];u++)if(f.x==i&&f.y==e)return void(f.active=!0);f={active:!0,rendered:!1,element:h.length?c.element.clone():c.element,x:i,y:e},h.push(f),f.element.css({top:Math.round(e),left:Math.round(i),"text-align":l})},i.prototype.removeText=function(t,i,e,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 f,u=c[h].positions,d=0;f=u[d];d++)f.active=!1}}else for(var f,u=this.getTextInfo(t,o,a,r).positions,d=0;f=u[d];d++)f.x==i&&f.y==e&&(f.active=!1)},t.plot=function(i,o,n){var a=new e(t(i),o,n,t.plot.plugins);return a},t.plot.version="0.8.3",t.plot.plugins=[],t.fn.plot=function(i,e){return this.each(function(){t.plot(this,i,e)})}}(jQuery);