/* Javascript plotting library for jQuery, version 0.8.3. Copyright (c) 2007-2014 IOLA and Ole Laursen. Licensed under the MIT license. */ // first an inline dependency, jquery.colorhelpers.js, we inline it here // for convenience /* Plugin for jQuery for working with colors. * * Version 1.1. * * Inspiration from jQuery color animation plugin by John Resig. * * Released under the MIT license by Ole Laursen, October 2009. * * Examples: * * $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString() * var c = $.color.extract($("#mydiv"), 'background-color'); * console.log(c.r, c.g, c.b, c.a); * $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)" * * Note that .scale() and .add() return the same modified object * instead of making a new one. * * V. 1.1: Fix error handling so e.g. parsing an empty string does * produce a color rather than just crashing. */ (function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return valuemax?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/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(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/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(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery); !function(t){var i=Object.prototype.hasOwnProperty;function e(i,e){var o=e.children("."+i)[0];if(null==o&&((o=document.createElement("canvas")).className=i,t(o).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(e),!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(e.width(),e.height()),this.textContainer=null,this.text={},this._textCache={}}function o(i,o,n,a){var r=[],l={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},s=null,c=null,h=null,f=null,u=null,d=[],p=[],m={left:0,right:0,top:0,bottom:0},x=0,g=0,b={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},v=this;function k(t,i){i=[v].concat(i);for(var e=0;eo&&(o=n))}e<=o&&(e=o+1);var a,s=[],c=l.colors,h=c.length,f=0;for(i=0;i=0?f<.5?-f-.2:0:-f),s[i]=a.scale("rgb",1+f);var u,m=0;for(i=0;it.datamax&&e!=x&&(t.datamax=e)}for(t.each(M(),function(t,i){i.datamin=p,i.datamax=m,i.used=!1}),i=0;i0&&null!=l[o-s]&&l[o-s]!=l[o]&&l[o-s+1]!=l[o+1]){for(n=0;nW&&(W=c)),h.y&&(cS&&(S=c)));if(a.bars.show){var z;switch(a.bars.align){case"left":z=0;break;case"right":z=-a.bars.barWidth;break;default:z=-a.bars.barWidth/2}a.bars.horizontal?(C+=z,S+=z+a.bars.barWidth):(T+=z,W+=z+a.bars.barWidth)}g(a.xaxis,T,W),g(a.yaxis,C,S)}t.each(M(),function(t,i){i.datamin==p&&(i.datamin=null),i.datamax==m&&(i.datamax=null)})}()}function w(t,i){var e=t[i+"axis"];return"object"==typeof e&&(e=e.n),"number"!=typeof e&&(e=1),e}function M(){return t.grep(d.concat(p),function(t){return t})}function T(t){var i,e,o={};for(i=0;i=0&&(e=0),null==i.max&&(o+=n*r)>0&&null!=t.datamax&&t.datamax<=0&&(o=0))}t.min=e,t.max=o}(i)}),n){var h=t.grep(o,function(t){return t.show||t.reserveSpace});for(t.each(h,function(i,e){!function(i){var e,o=i.options;e="number"==typeof o.ticks&&o.ticks>0?o.ticks:.3*Math.sqrt("x"==i.direction?s.width:s.height);var n=(i.max-i.min)/e,a=-Math.floor(Math.log(n)/Math.LN10),r=o.tickDecimals;null!=r&&a>r&&(a=r);var l,c=Math.pow(10,-a),h=n/c;h<1.5?l=1:h<3?(l=2,h>2.25&&(null==r||a+1<=r)&&(l=2.5,++a)):l=h<7.5?5:10;l*=c,null!=o.minTickSize&&l0&&(null==o.min&&(i.min=Math.min(i.min,u[0])),null==o.max&&u.length>1&&(i.max=Math.max(i.max,u[u.length-1]))),i.tickGenerator=function(t){var i,e,o=[];for(e=0;e1&&/\..*0$/.test((x[1]-x[0]).toFixed(m))||(i.tickDecimals=m)}}}}(e),function(i){var e,o,n=i.options.ticks,a=[];null==n||"number"==typeof n&&n>0?a=i.tickGenerator(i):n&&(a=t.isFunction(n)?n(i):n);for(i.ticks=[],e=0;e1&&(r=l[1])):o=+l,null==r&&(r=i.tickFormatter(o,i)),isNaN(o)||i.ticks.push({v:o,label:r})}}(e),function(t,i){t.options.autoscaleMargin&&i.length>0&&(null==t.options.min&&(t.min=Math.min(t.min,i[0].v)),null==t.options.max&&i.length>1&&(t.max=Math.max(t.max,i[i.length-1].v)))}(e,e.ticks),function(t){for(var i=t.options,e=t.ticks||[],o=i.labelWidth||0,n=i.labelHeight||0,a=o||("x"==t.direction?Math.floor(s.width/(e.length||1)):null),r=t.direction+"Axis "+t.direction+t.n+"Axis",l="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+r,c=i.font||"flot-tick-label tickLabel",h=0;h=0;--e)S(h[e]);!function(){var i,e=l.grid.minBorderMargin;if(null==e)for(e=0,i=0;ii.max||("x"==i.direction?(a="center",o=m.left+i.p2c(e.v),"bottom"==i.position?n=l.top+l.padding:(n=l.top+l.height-l.padding,r="bottom")):(r="middle",n=m.top+i.p2c(e.v),"left"==i.position?(o=l.left+l.width-l.padding,a="right"):o=l.left+l.padding),s.addText(h,o,n,e.label,f,null,null,a,r))}),function(){null!=l.legend.container?t(l.legend.container).html(""):i.find(".legend").remove();if(!l.legend.show)return;for(var e,o,n=[],a=[],s=!1,c=l.legend.labelFormatter,h=0;h"),n.push(""),s=!0),n.push('
'+u.label+"")}s&&n.push("");if(0==n.length)return;var d=''+n.join("")+"
";if(null!=l.legend.container)t(l.legend.container).html(d);else{var p="",x=l.legend.position,g=l.legend.margin;null==g[0]&&(g=[g,g]),"n"==x.charAt(0)?p+="top:"+(g[1]+m.top)+"px;":"s"==x.charAt(0)&&(p+="bottom:"+(g[1]+m.bottom)+"px;"),"e"==x.charAt(1)?p+="right:"+(g[0]+m.right)+"px;":"w"==x.charAt(1)&&(p+="left:"+(g[0]+m.left)+"px;");var b=t('
'+d.replace('style="','style="position:absolute;'+p+";")+"
").appendTo(i);if(0!=l.legend.backgroundOpacity){var v=l.legend.backgroundColor;null==v&&((v=(v=l.grid.backgroundColor)&&"string"==typeof v?t.color.parse(v):t.color.extract(b,"background-color")).a=1,v=v.toString());var k=b.children();t('
').prependTo(b).css("opacity",l.legend.backgroundOpacity)}}}()}function A(){s.clear(),k(b.drawBackground,[f]);var t=l.grid;t.show&&t.backgroundColor&&(f.save(),f.translate(m.left,m.top),f.fillStyle=U(l.grid.backgroundColor,g,0,"rgba(255, 255, 255, 0)"),f.fillRect(0,0,x,g),f.restore()),t.show&&!t.aboveData&&I();for(var i=0;in){var s=o;o=n,n=s}return{from:o,to:n,axis:e}}function I(){var i,e,o,n;f.save(),f.translate(m.left,m.top);var a=l.grid.markings;if(a)for(t.isFunction(a)&&((e=v.getAxes()).xmin=e.xaxis.min,e.xmax=e.xaxis.max,e.ymin=e.yaxis.min,e.ymax=e.yaxis.max,a=a(e)),i=0;is.axis.max||c.toc.axis.max)){s.from=Math.max(s.from,s.axis.min),s.to=Math.min(s.to,s.axis.max),c.from=Math.max(c.from,c.axis.min),c.to=Math.min(c.to,c.axis.max);var h=s.from===s.to,u=c.from===c.to;if(!h||!u)if(s.from=Math.floor(s.axis.p2c(s.from)),s.to=Math.floor(s.axis.p2c(s.to)),c.from=Math.floor(c.axis.p2c(c.from)),c.to=Math.floor(c.axis.p2c(c.to)),h||u){var d=r.lineWidth||l.grid.markingsLineWidth,p=d%2?.5:0;f.beginPath(),f.strokeStyle=r.color||l.grid.markingsColor,f.lineWidth=d,h?(f.moveTo(s.to+p,c.from),f.lineTo(s.to+p,c.to)):(f.moveTo(s.from,c.to+p),f.lineTo(s.to,c.to+p)),f.stroke()}else f.fillStyle=r.color||l.grid.markingsColor,f.fillRect(s.from,c.to,s.to-s.from,c.from-c.to)}}e=M(),o=l.grid.borderWidth;for(var b=0;bC.max||"full"==S&&("object"==typeof o&&o[C.position]>0||o>0)&&(z==C.min||z==C.max)||("x"==C.direction?(k=C.p2c(z),T="full"==S?-g:S,"top"==C.position&&(T=-T)):(y=C.p2c(z),w="full"==S?-x:S,"left"==C.position&&(w=-w)),1==f.lineWidth&&("x"==C.direction?k=Math.floor(k)+.5:y=Math.floor(y)+.5),f.moveTo(k,y),f.lineTo(k+w,y+T))}f.stroke()}}o&&(n=l.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&&(f.strokeStyle=n.top,f.lineWidth=o.top,f.beginPath(),f.moveTo(0-o.left,0-o.top/2),f.lineTo(x,0-o.top/2),f.stroke()),o.right>0&&(f.strokeStyle=n.right,f.lineWidth=o.right,f.beginPath(),f.moveTo(x+o.right/2,0-o.top),f.lineTo(x+o.right/2,g),f.stroke()),o.bottom>0&&(f.strokeStyle=n.bottom,f.lineWidth=o.bottom,f.beginPath(),f.moveTo(x+o.right,g+o.bottom/2),f.lineTo(0,g+o.bottom/2),f.stroke()),o.left>0&&(f.strokeStyle=n.left,f.lineWidth=o.left,f.beginPath(),f.moveTo(0-o.left/2,g+o.bottom),f.lineTo(0-o.left/2,0),f.stroke())):(f.lineWidth=o,f.strokeStyle=l.grid.borderColor,f.strokeRect(-o/2,-o/2,x+o,g+o))),f.restore()}function N(t){t.lines.show&&function(t){function i(t,i,e,o,n){var a=t.points,r=t.pointsize,l=null,s=null;f.beginPath();for(var c=r;c=p&&u>n.max){if(p>n.max)continue;h=(n.max-u)/(p-u)*(d-h)+h,u=n.max}else if(p>=u&&p>n.max){if(u>n.max)continue;d=(n.max-u)/(p-u)*(d-h)+h,p=n.max}if(h<=d&&h=d&&h>o.max){if(d>o.max)continue;u=(o.max-h)/(d-h)*(p-u)+u,h=o.max}else if(d>=h&&d>o.max){if(h>o.max)continue;p=(o.max-h)/(d-h)*(p-u)+u,d=o.max}h==l&&u==s||f.moveTo(o.p2c(h)+i,n.p2c(u)+e),l=d,s=p,f.lineTo(o.p2c(d)+i,n.p2c(p)+e)}}f.stroke()}f.save(),f.translate(m.left,m.top),f.lineJoin="round";var e=t.lines.lineWidth,o=t.shadowSize;if(e>0&&o>0){f.lineWidth=o,f.strokeStyle="rgba(0,0,0,0.1)";var n=Math.PI/18;i(t.datapoints,Math.sin(n)*(e/2+o/2),Math.cos(n)*(e/2+o/2),t.xaxis,t.yaxis),f.lineWidth=o/2,i(t.datapoints,Math.sin(n)*(e/2+o/4),Math.cos(n)*(e/2+o/4),t.xaxis,t.yaxis)}f.lineWidth=e,f.strokeStyle=t.color;var a=O(t.lines,t.color,0,g);a&&(f.fillStyle=a,function(t,i,e){var o=t.points,n=t.pointsize,a=Math.min(Math.max(0,e.min),e.max),r=0,l=!1,s=1,c=0,h=0;for(;!(n>0&&r>o.length+n);){var u=o[(r+=n)-n],d=o[r-n+s],p=o[r],m=o[r+s];if(l){if(n>0&&null!=u&&null==p){h=r,n=-n,s=2;continue}if(n<0&&r==c+n){f.fill(),l=!1,s=1,r=c=h+(n=-n);continue}}if(null!=u&&null!=p){if(u<=p&&u=p&&u>i.max){if(p>i.max)continue;d=(i.max-u)/(p-u)*(m-d)+d,u=i.max}else if(p>=u&&p>i.max){if(u>i.max)continue;m=(i.max-u)/(p-u)*(m-d)+d,p=i.max}if(l||(f.beginPath(),f.moveTo(i.p2c(u),e.p2c(a)),l=!0),d>=e.max&&m>=e.max)f.lineTo(i.p2c(u),e.p2c(e.max)),f.lineTo(i.p2c(p),e.p2c(e.max));else if(d<=e.min&&m<=e.min)f.lineTo(i.p2c(u),e.p2c(e.min)),f.lineTo(i.p2c(p),e.p2c(e.min));else{var x=u,g=p;d<=m&&d=e.min?(u=(e.min-d)/(m-d)*(p-u)+u,d=e.min):m<=d&&m=e.min&&(p=(e.min-d)/(m-d)*(p-u)+u,m=e.min),d>=m&&d>e.max&&m<=e.max?(u=(e.max-d)/(m-d)*(p-u)+u,d=e.max):m>=d&&m>e.max&&d<=e.max&&(p=(e.max-d)/(m-d)*(p-u)+u,m=e.max),u!=x&&f.lineTo(i.p2c(x),e.p2c(d)),f.lineTo(i.p2c(u),e.p2c(d)),f.lineTo(i.p2c(p),e.p2c(m)),p!=g&&(f.lineTo(i.p2c(p),e.p2c(m)),f.lineTo(i.p2c(g),e.p2c(m)))}}}}(t.datapoints,t.xaxis,t.yaxis));e>0&&i(t.datapoints,0,0,t.xaxis,t.yaxis);f.restore()}(t),t.bars.show&&function(t){var i;switch(f.save(),f.translate(m.left,m.top),f.lineWidth=t.bars.lineWidth,f.strokeStyle=t.color,t.bars.align){case"left":i=0;break;case"right":i=-t.bars.barWidth;break;default:i=-t.bars.barWidth/2}var e=t.bars.fill?function(i,e){return O(t.bars,t.color,i,e)}:null;(function(i,e,o,n,a,r){for(var l=i.points,s=i.pointsize,c=0;ca.max||dr.max||(f.beginPath(),u=a.p2c(u),d=r.p2c(d)+o,"circle"==l?f.arc(u,d,i,0,n?Math.PI:2*Math.PI,!1):l(f,u,d,i,n),f.closePath(),e&&(f.fillStyle=e,f.fill()),f.stroke())}}f.save(),f.translate(m.left,m.top);var e=t.points.lineWidth,o=t.shadowSize,n=t.points.radius,a=t.points.symbol;0==e&&(e=1e-4);if(e>0&&o>0){var r=o/2;f.lineWidth=r,f.strokeStyle="rgba(0,0,0,0.1)",i(t.datapoints,n,null,r+r/2,!0,t.xaxis,t.yaxis,a),f.strokeStyle="rgba(0,0,0,0.2)",i(t.datapoints,n,null,r/2,!0,t.xaxis,t.yaxis,a)}f.lineWidth=e,f.strokeStyle=t.color,i(t.datapoints,n,O(t.points,t.color),0,!1,t.xaxis,t.yaxis,a),f.restore()}(t)}function D(t,i,e,o,n,a,r,l,s,c,h){var f,u,d,p,m,x,g,b,v;c?(b=x=g=!0,m=!1,p=i+o,d=i+n,(u=t)<(f=e)&&(v=u,u=f,f=v,m=!0,x=!1)):(m=x=g=!0,b=!1,f=t+o,u=t+n,(p=i)<(d=e)&&(v=p,p=d,d=v,b=!0,g=!1)),ur.max||pl.max||(fr.max&&(u=r.max,x=!1),dl.max&&(p=l.max,g=!1),f=r.p2c(f),d=l.p2c(d),u=r.p2c(u),p=l.p2c(p),a&&(s.fillStyle=a(d,p),s.fillRect(f,p,u-f,d-p)),h>0&&(m||x||g||b)&&(s.beginPath(),s.moveTo(f,d),m?s.lineTo(f,p):s.moveTo(f,p),g?s.lineTo(u,p):s.moveTo(u,p),x?s.lineTo(u,d):s.moveTo(u,d),b?s.lineTo(f,d):s.moveTo(f,d),s.stroke()))}function O(i,e,o,n){var a=i.fill;if(!a)return null;if(i.fillColor)return U(i.fillColor,o,n,e);var r=t.color.parse(e);return r.a="number"==typeof a?a:.4,r.normalize(),r.toString()}v.setData=y,v.setupGrid=z,v.draw=A,v.getPlaceholder=function(){return i},v.getCanvas=function(){return s.element},v.getPlotOffset=function(){return m},v.width=function(){return x},v.height=function(){return g},v.offset=function(){var t=h.offset();return t.left+=m.left,t.top+=m.top,t},v.getData=function(){return r},v.getAxes=function(){var i={};return t.each(d.concat(p),function(t,e){e&&(i[e.direction+(1!=e.n?e.n:"")+"axis"]=e)}),i},v.getXAxes=function(){return d},v.getYAxes=function(){return p},v.c2p=T,v.p2c=function(t){var i,e,o,n={};for(i=0;i=0;--o)if(e(r[o])){var f=r[o],u=f.xaxis,d=f.yaxis,p=f.datapoints.points,m=u.c2p(t),x=d.c2p(i),g=s/u.scale,b=s/d.scale;if(a=f.datapoints.pointsize,u.options.inverseTransform&&(g=Number.MAX_VALUE),d.options.inverseTransform&&(b=Number.MAX_VALUE),f.lines.show||f.points.show)for(n=0;ng||v-m<-g||k-x>b||k-x<-b)){var y=Math.abs(u.p2c(v)-t),w=Math.abs(d.p2c(k)-i),M=y*y+w*w;M=Math.min(W,v)&&x>=k+T&&x<=k+C:m>=v+T&&m<=v+C&&x>=Math.min(W,k)&&x<=Math.max(W,k))&&(h=[o,n/a])}}}return h?(o=h[0],n=h[1],a=r[o].datapoints.pointsize,{datapoint:r[o].datapoints.points.slice(n*a,(n+1)*a),dataIndex:n,series:r[o],seriesIndex:o}):null}(a,s,o);if(f&&(f.pageX=parseInt(f.series.xaxis.p2c(f.datapoint[0])+n.left+m.left,10),f.pageY=parseInt(f.series.yaxis.p2c(f.datapoint[1])+n.top+m.top,10)),l.grid.autoHighlight){for(var u=0;ua.max||nr.max)){var s=i.points.radius+i.points.lineWidth/2;u.lineWidth=s,u.strokeStyle=l;var c=1.5*s;o=a.p2c(o),n=r.p2c(n),u.beginPath(),"circle"==i.points.symbol?u.arc(o,n,c,0,2*Math.PI,!1):i.points.symbol(u,o,n,c,!1),u.closePath(),u.stroke()}}function q(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}u.lineWidth=i.bars.lineWidth,u.strokeStyle=n,D(e[0],e[1],e[2]||0,o,o+i.bars.barWidth,function(){return a},i.xaxis,i.yaxis,u,i.bars.horizontal,i.bars.lineWidth)}function U(i,e,o,n){if("string"==typeof i)return i;for(var a=f.createLinearGradient(0,o,0,e),r=0,l=i.colors.length;r").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},e.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,null==(l=this._textCache[i])&&(l=this._textCache[i]={}),null==(s=l[r])&&(s=l[r]={}),null==(c=s[e])){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},e.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})},e.prototype.removeText=function(t,e,o,n,a,r){if(null==n){var l=this._textCache[t];if(null!=l)for(var s in l)if(i.call(l,s)){var c=l[s];for(var h in c)if(i.call(c,h))for(var f=c[h].positions,u=0;d=f[u];u++)d.active=!1}}else{var d;for(f=this.getTextInfo(t,n,a,r).positions,u=0;d=f[u];u++)d.x==e&&d.y==o&&(d.active=!1)}},t.plot=function(i,e,n){return new o(t(i),e,n,t.plot.plugins)},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);