forked from HumbleSoftware/Flotr2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflotr2.min.js
23 lines (22 loc) · 109 KB
/
flotr2.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*!
* Bean - copyright (c) Jacob Thornton 2011-2012
* https://github.com/fat/bean
* MIT license
*/
(function(e,t,n){typeof module!="undefined"&&module.exports?module.exports=n():typeof define=="function"&&define.amd?define(n):t[e]=n()})("bean",this,function(e,t){e=e||"bean",t=t||this;var n=window,r=t[e],i=/[^\.]*(?=\..*)\.|.*/,s=/\..*/,o="addEventListener",u="removeEventListener",a=document||{},f=a.documentElement||{},l=f[o],c=l?o:"attachEvent",h={},p=Array.prototype.slice,d=function(e,t){return e.split(t||" ")},v=function(e){return typeof e=="string"},m=function(e){return typeof e=="function"},g="click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll ",y="show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinputreadystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ",b=function(e,t,n){for(n=0;n<t.length;n++)t[n]&&(e[t[n]]=1);return e}({},d(g+(l?y:""))),w=function(){var e="compareDocumentPosition"in f?function(e,t){return t.compareDocumentPosition&&(t.compareDocumentPosition(e)&16)===16}:"contains"in f?function(e,t){return t=t.nodeType===9||t===window?f:t,t!==e&&t.contains(e)}:function(e,t){while(e=e.parentNode)if(e===t)return 1;return 0},t=function(t){var n=t.relatedTarget;return n?n!==this&&n.prefix!=="xul"&&!/document/.test(this.toString())&&!e(n,this):n==null};return{mouseenter:{base:"mouseover",condition:t},mouseleave:{base:"mouseout",condition:t},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),E=function(){var e=d("altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which propertyName"),t=e.concat(d("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement")),r=t.concat(d("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis")),i=e.concat(d("char charCode key keyCode keyIdentifier keyLocation location")),s=e.concat(d("data")),o=e.concat(d("touches targetTouches changedTouches scale rotation")),u=e.concat(d("data origin source")),l=e.concat(d("state")),c=/over|out/,h=[{reg:/key/i,fix:function(e,t){return t.keyCode=e.keyCode||e.which,i}},{reg:/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,fix:function(e,n,r){n.rightClick=e.which===3||e.button===2,n.pos={x:0,y:0};if(e.pageX||e.pageY)n.clientX=e.pageX,n.clientY=e.pageY;else if(e.clientX||e.clientY)n.clientX=e.clientX+a.body.scrollLeft+f.scrollLeft,n.clientY=e.clientY+a.body.scrollTop+f.scrollTop;return c.test(r)&&(n.relatedTarget=e.relatedTarget||e[(r=="mouseover"?"from":"to")+"Element"]),t}},{reg:/mouse.*(wheel|scroll)/i,fix:function(){return r}},{reg:/^text/i,fix:function(){return s}},{reg:/^touch|^gesture/i,fix:function(){return o}},{reg:/^message$/i,fix:function(){return u}},{reg:/^popstate$/i,fix:function(){return l}},{reg:/.*/,fix:function(){return e}}],p={},v=function(e,t,r){if(!arguments.length)return;e=e||((t.ownerDocument||t.document||t).parentWindow||n).event,this.originalEvent=e,this.isNative=r,this.isBean=!0;if(!e)return;var i=e.type,s=e.target||e.srcElement,o,u,a,f,l;this.target=s&&s.nodeType===3?s.parentNode:s;if(r){l=p[i];if(!l)for(o=0,u=h.length;o<u;o++)if(h[o].reg.test(i)){p[i]=l=h[o].fix;break}f=l(e,this,i);for(o=f.length;o--;)!((a=f[o])in this)&&a in e&&(this[a]=e[a])}};return v.prototype.preventDefault=function(){this.originalEvent.preventDefault?this.originalEvent.preventDefault():this.originalEvent.returnValue=!1},v.prototype.stopPropagation=function(){this.originalEvent.stopPropagation?this.originalEvent.stopPropagation():this.originalEvent.cancelBubble=!0},v.prototype.stop=function(){this.preventDefault(),this.stopPropagation(),this.stopped=!0},v.prototype.stopImmediatePropagation=function(){this.originalEvent.stopImmediatePropagation&&this.originalEvent.stopImmediatePropagation(),this.isImmediatePropagationStopped=function(){return!0}},v.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()},v.prototype.clone=function(e){var t=new v(this,this.element,this.isNative);return t.currentTarget=e,t},v}(),S=function(e,t){return!l&&!t&&(e===a||e===n)?f:e},x=function(){var e=function(e,t,n,r){var i=function(n,i){return t.apply(e,r?p.call(i,n?0:1).concat(r):i)},s=function(n,r){return t.__beanDel?t.__beanDel.ft(n.target,e):r},o=n?function(e){var t=s(e,this);if(n.apply(t,arguments))return e&&(e.currentTarget=t),i(e,arguments)}:function(e){return t.__beanDel&&(e=e.clone(s(e))),i(e,arguments)};return o.__beanDel=t.__beanDel,o},t=function(t,n,r,i,s,o,u){var a=w[n],f;n=="unload"&&(r=A(O,t,n,r,i)),a&&(a.condition&&(r=e(t,r,a.condition,o)),n=a.base||n),this.isNative=f=b[n]&&!!t[c],this.customType=!l&&!f&&n,this.element=t,this.type=n,this.original=i,this.namespaces=s,this.eventType=l||f?n:"propertychange",this.target=S(t,f),this[c]=!!this.target[c],this.root=u,this.handler=e(t,r,null,o)};return t.prototype.inNamespaces=function(e){var t,n,r=0;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)e[t]==this.namespaces[n]&&r++;return e.length===r},t.prototype.matches=function(e,t,n){return this.element===e&&(!t||this.original===t)&&(!n||this.handler===n)},t}(),T=function(){var e={},t=function(n,r,i,s,o,u){var a=o?"r":"$";if(!r||r=="*")for(var f in e)f.charAt(0)==a&&t(n,f.substr(1),i,s,o,u);else{var l=0,c,h=e[a+r],p=n=="*";if(!h)return;for(c=h.length;l<c;l++)if((p||h[l].matches(n,i,s))&&!u(h[l],h,l,r))return}},n=function(t,n,r,i){var s,o=e[(i?"r":"$")+n];if(o)for(s=o.length;s--;)if(!o[s].root&&o[s].matches(t,r,null))return!0;return!1},r=function(e,n,r,i){var s=[];return t(e,n,r,null,i,function(e){return s.push(e)}),s},i=function(t){var n=!t.root&&!this.has(t.element,t.type,null,!1),r=(t.root?"r":"$")+t.type;return(e[r]||(e[r]=[])).push(t),n},s=function(n){t(n.element,n.type,null,n.handler,n.root,function(t,n,r){return n.splice(r,1),t.removed=!0,n.length===0&&delete e[(t.root?"r":"$")+t.type],!1})},o=function(){var t,n=[];for(t in e)t.charAt(0)=="$"&&(n=n.concat(e[t]));return n};return{has:n,get:r,put:i,del:s,entries:o}}(),N,C=function(e){arguments.length?N=e:N=a.querySelectorAll?function(e,t){return t.querySelectorAll(e)}:function(){throw new Error("Bean: No selector engine installed")}},k=function(e,t){if(!l&&t&&e&&e.propertyName!="_on"+t)return;var n=T.get(this,t||e.type,null,!1),r=n.length,i=0;e=new E(e,this,!0),t&&(e.type=t);for(;i<r&&!e.isImmediatePropagationStopped();i++)n[i].removed||n[i].handler.call(this,e)},L=l?function(e,t,n){e[n?o:u](t,k,!1)}:function(e,t,n,r){var i;n?(T.put(i=new x(e,r||t,function(t){k.call(e,t,r)},k,null,null,!0)),r&&e["_on"+r]==null&&(e["_on"+r]=0),i.target.attachEvent("on"+i.eventType,i.handler)):(i=T.get(e,r||t,k,!0)[0],i&&(i.target.detachEvent("on"+i.eventType,i.handler),T.del(i)))},A=function(e,t,n,r,i){return function(){r.apply(this,arguments),e(t,n,i)}},O=function(e,t,n,r){var i=t&&t.replace(s,""),o=T.get(e,i,null,!1),u={},a,f;for(a=0,f=o.length;a<f;a++)(!n||o[a].original===n)&&o[a].inNamespaces(r)&&(T.del(o[a]),!u[o[a].eventType]&&o[a][c]&&(u[o[a].eventType]={t:o[a].eventType,c:o[a].type}));for(a in u)T.has(e,u[a].t,null,!1)||L(e,u[a].t,!1,u[a].c)},M=function(e,t){var n=function(t,n){var r,i=v(e)?N(e,n):e;for(;t&&t!==n;t=t.parentNode)for(r=i.length;r--;)if(i[r]===t)return t},r=function(e){var r=n(e.target,this);r&&t.apply(r,arguments)};return r.__beanDel={ft:n,selector:e},r},_=l?function(e,t,r){var i=a.createEvent(e?"HTMLEvents":"UIEvents");i[e?"initEvent":"initUIEvent"](t,!0,!0,n,1),r.dispatchEvent(i)}:function(e,t,n){n=S(n,e),e?n.fireEvent("on"+t,a.createEventObject()):n["_on"+t]++},D=function(e,t,n){var r=v(t),o,u,a,f;if(r&&t.indexOf(" ")>0){t=d(t);for(f=t.length;f--;)D(e,t[f],n);return e}u=r&&t.replace(s,""),u&&w[u]&&(u=w[u].base);if(!t||r){if(a=r&&t.replace(i,""))a=d(a,".");O(e,u,n,a)}else if(m(t))O(e,null,t);else for(o in t)t.hasOwnProperty(o)&&D(e,o,t[o]);return e},P=function(e,t,n,r){var o,u,a,f,l,v,g;if(n===undefined&&typeof t=="object"){for(u in t)t.hasOwnProperty(u)&&P.call(this,e,u,t[u]);return}m(n)?(l=p.call(arguments,3),r=o=n):(o=r,l=p.call(arguments,4),r=M(n,o,N)),a=d(t),this===h&&(r=A(D,e,t,r,o));for(f=a.length;f--;)g=T.put(v=new x(e,a[f].replace(s,""),r,o,d(a[f].replace(i,""),"."),l,!1)),v[c]&&g&&L(e,v.eventType,!0,v.customType);return e},H=function(e,t,n,r){return P.apply(null,v(n)?[e,n,t,r].concat(arguments.length>3?p.call(arguments,5):[]):p.call(arguments))},B=function(){return P.apply(h,arguments)},j=function(e,t,n){var r=d(t),o,u,a,f,l;for(o=r.length;o--;){t=r[o].replace(s,"");if(f=r[o].replace(i,""))f=d(f,".");if(!f&&!n&&e[c])_(b[t],t,e);else{l=T.get(e,t,null,!1),n=[!1].concat(n);for(u=0,a=l.length;u<a;u++)l[u].inNamespaces(f)&&l[u].handler.apply(e,n)}}return e},F=function(e,t,n){var r=T.get(t,n,null,!1),i=r.length,s=0,o,u;for(;s<i;s++)r[s].original&&(o=[e,r[s].type],(u=r[s].handler.__beanDel)&&o.push(u.selector),o.push(r[s].original),P.apply(null,o));return e},I={on:P,add:H,one:B,off:D,remove:D,clone:F,fire:j,setSelectorEngine:C,noConflict:function(){return t[e]=r,this}};if(n.attachEvent){var q=function(){var e,t=T.entries();for(e in t)t[e].type&&t[e].type!=="unload"&&D(t[e].element,t[e].type);n.detachEvent("onunload",q),n.CollectGarbage&&n.CollectGarbage()};n.attachEvent("onunload",q)}return C(),I});
// Underscore.js 1.4.4
// ===================
// > http://underscorejs.org
// > (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
// > Underscore may be freely distributed under the MIT license.
// Baseline setup
// --------------
(function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.4.4";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else for(var o in e)if(x.has(e,o)&&t.call(r,e[o],o,e)===n)return};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r[r.length]=t.call(n,e,i,s)}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?null:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},x.shuffle=function(e){var t,n=0,r=[];return T(e,function(e){t=x.random(n++),r[n-1]=r[t],r[t]=e}),r};var k=function(e){return x.isFunction(e)?e:function(t){return t[e]}};x.sortBy=function(e,t,n){var r=k(t);return x.pluck(x.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index<t.index?-1:1}),"value")};var L=function(e,t,n,r){var i={},s=k(t||x.identity);return T(e,function(t,o){var u=s.call(n,t,o,e);r(i,u,t)}),i};x.groupBy=function(e,t,n){return L(e,t,n,function(e,t,n){(x.has(e,t)?e[t]:e[t]=[]).push(n)})},x.countBy=function(e,t,n){return L(e,t,n,function(e,t){x.has(e,t)||(e[t]=0),e[t]++})},x.sortedIndex=function(e,t,n,r){n=n==null?x.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},x.toArray=function(e){return e?x.isArray(e)?u.call(e):e.length===+e.length?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return e==null?0:e.length===+e.length?e.length:x.keys(e).length},x.first=x.head=x.take=function(e,t,n){return e==null?void 0:t!=null&&!n?u.call(e,0,t):e[0]},x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},x.last=function(e,t,n){return e==null?void 0:t!=null&&!n?u.call(e,Math.max(e.length-t,0)):e[e.length-1]},x.rest=x.tail=x.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},x.compact=function(e){return x.filter(e,x.identity)};var A=function(e,t,n){return T(e,function(e){x.isArray(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n};x.flatten=function(e,t){return A(e,t,[])},x.without=function(e){return x.difference(e,u.call(arguments,1))},x.uniq=x.unique=function(e,t,n,r){x.isFunction(t)&&(r=n,n=t,t=!1);var i=n?x.map(e,n,r):e,s=[],o=[];return T(i,function(n,r){if(t?!r||o[o.length-1]!==n:!x.contains(o,n))o.push(n),s.push(e[r])}),s},x.union=function(){return x.uniq(a.apply(r,arguments))},x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=u.call(arguments),t=x.max(x.pluck(e,"length")),n=new Array(t);for(var r=0;r<t;r++)n[r]=x.pluck(e,""+r);return n},x.object=function(e,t){if(e==null)return{};var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},x.indexOf=function(e,t,n){if(e==null)return-1;var r=0,i=e.length;if(n){if(typeof n!="number")return r=x.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(y&&e.indexOf===y)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},x.lastIndexOf=function(e,t,n){if(e==null)return-1;var r=n!=null;if(b&&e.lastIndexOf===b)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1},x.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s},x.bind=function(e,t){if(e.bind===S&&S)return S.apply(e,u.call(arguments,1));var n=u.call(arguments,2);return function(){return e.apply(t,n.concat(u.call(arguments)))}},x.partial=function(e){var t=u.call(arguments,1);return function(){return e.apply(this,t.concat(u.call(arguments)))}},x.bindAll=function(e){var t=u.call(arguments,1);return t.length===0&&(t=x.functions(e)),T(t,function(t){e[t]=x.bind(e[t],e)}),e},x.memoize=function(e,t){var n={};return t||(t=x.identity),function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))},x.throttle=function(e,t){var n,r,i,s,o=0,u=function(){o=new Date,i=null,s=e.apply(n,r)};return function(){var a=new Date,f=t-(a-o);return n=this,r=arguments,f<=0?(clearTimeout(i),i=null,o=a,s=e.apply(n,r)):i||(i=setTimeout(u,f)),s}},x.debounce=function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},x.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},x.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&(t[t.length]=n);return t},x.values=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push(e[n]);return t},x.pairs=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push([n,e[n]]);return t},x.invert=function(e){var t={};for(var n in e)x.has(e,n)&&(t[e[n]]=n);return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]==null&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var O=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=O(e[o],t[o],n,r)))break}else{var a=e.constructor,l=t.constructor;if(a!==l&&!(x.isFunction(a)&&a instanceof a&&x.isFunction(l)&&l instanceof l))return!1;for(var c in e)if(x.has(e,c)){o++;if(!(u=x.has(t,c)&&O(e[c],t[c],n,r)))break}if(u){for(c in t)if(x.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};x.isEqual=function(e,t){return O(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(e);for(var i=0;i<e;i++)r[i]=t.call(n,i);return r},x.random=function(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=x.invert(M.escape);var _={escape:new RegExp("["+x.keys(M.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(M.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(_[e],function(t){return M[e][t]})}}),x.result=function(e,t){if(e==null)return null;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),j.call(this,n.apply(x,e))}})};var D=0;x.uniqueId=function(e){var t=++D+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var P=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||P).source,(n.interpolate||P).source,(n.evaluate||P).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(B,function(e){return"\\"+H[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var j=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],j.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return j.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
/**
* Flotr2 (c) 2012 Carl Sutherland
* MIT License
* Special thanks to:
* Flotr: http://code.google.com/p/flotr/ (fork)
* Flot: https://github.com/flot/flot (original fork)
*/
(function(){var e=this,t=this.Flotr,n;n={_:_,bean:bean,isIphone:/iphone/i.test(navigator.userAgent),isIE:navigator.appVersion.indexOf("MSIE")!=-1?parseFloat(navigator.appVersion.split("MSIE")[1]):!1,graphTypes:{},plugins:{},addType:function(e,t){n.graphTypes[e]=t,n.defaultOptions[e]=t.options||{},n.defaultOptions.defaultType=n.defaultOptions.defaultType||e},addPlugin:function(e,t){n.plugins[e]=t,n.defaultOptions[e]=t.options||{}},draw:function(e,t,r,i){return i=i||n.Graph,new i(e,t,r)},merge:function(e,t){var r,i,s=t||{};for(r in e)i=e[r],i&&typeof i=="object"?i.constructor===Array?s[r]=this._.clone(i):i.constructor!==RegExp&&!this._.isElement(i)&&!i.jquery?s[r]=n.merge(i,t?t[r]:undefined):s[r]=i:s[r]=i;return s},clone:function(e){return n.merge(e,{})},getTickSize:function(e,t,r,i){var s=(r-t)/e,o=n.getMagnitude(s),u=10,a=s/o;return a<1.5?u=1:a<2.25?u=2:a<3?u=i===0?2:2.5:a<7.5&&(u=5),u*o},defaultTickFormatter:function(e,t){return e+""},defaultTrackFormatter:function(e){return"("+e.x+", "+e.y+")"},engineeringNotation:function(e,t,n){var r=["Y","Z","E","P","T","G","M","k",""],i=["y","z","a","f","p","n","µ","m",""],s=r.length;n=n||1e3,t=Math.pow(10,t||2);if(e===0)return 0;if(e>1)while(s--&&e>=n)e/=n;else{r=i,s=r.length;while(s--&&e<1)e*=n}return Math.round(e*t)/t+r[s]},getMagnitude:function(e){return Math.pow(10,Math.floor(Math.log(e)/Math.LN10))},toPixel:function(e){return Math.floor(e)+.5},toRad:function(e){return-e*(Math.PI/180)},floorInBase:function(e,t){return t*Math.floor(e/t)},drawText:function(e,t,r,i,s){if(!e.fillText){e.drawText(t,r,i,s);return}s=this._.extend({size:n.defaultOptions.fontSize,color:"#000000",textAlign:"left",textBaseline:"bottom",weight:1,angle:0,fontFamily:"sans-serif"},s),e.save(),e.translate(r,i),e.rotate(s.angle),e.fillStyle=s.color,e.font=(s.weight>1?"bold ":"")+s.size*1.3+"px "+s.fontFamily,e.textAlign=s.textAlign,e.textBaseline=s.textBaseline,e.fillText(t,0,0),e.restore()},getBestTextAlign:function(e,t){return t=t||{textAlign:"center",textBaseline:"middle"},e+=n.getTextAngleFromAlign(t),Math.abs(Math.cos(e))>.01&&(t.textAlign=Math.cos(e)>0?"right":"left"),Math.abs(Math.sin(e))>.01&&(t.textBaseline=Math.sin(e)>0?"top":"bottom"),t},alignTable:{"right middle":0,"right top":Math.PI/4,"center top":Math.PI/2,"left top":3*(Math.PI/4),"left middle":Math.PI,"left bottom":-3*(Math.PI/4),"center bottom":-Math.PI/2,"right bottom":-Math.PI/4,"center middle":0},getTextAngleFromAlign:function(e){return n.alignTable[e.textAlign+" "+e.textBaseline]||0},noConflict:function(){return e.Flotr=t,this}},e.Flotr=n})(),Flotr.defaultOptions={colors:["#00A8F0","#C0D800","#CB4B4B","#4DA74D","#9440ED"],ieBackgroundColor:"#FFFFFF",title:null,subtitle:null,shadowSize:4,defaultType:null,HtmlText:!0,fontColor:"#545454",fontSize:7.5,fontFamily:"sans-serif",resolution:1,parseFloat:!0,preventDefault:!0,xaxis:{ticks:null,minorTicks:null,showLabels:!0,showMinorLabels:!1,labelsAngle:0,title:null,titleAngle:0,noTicks:5,minorTickFreq:null,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscale:!1,autoscaleMargin:0,color:null,mode:"normal",timeFormat:null,timeMode:"UTC",timeUnit:"millisecond",scaling:"linear",base:Math.E,titleAlign:"center",margin:!0},x2axis:{},yaxis:{ticks:null,minorTicks:null,showLabels:!0,showMinorLabels:!1,labelsAngle:0,title:null,titleAngle:90,noTicks:5,minorTickFreq:null,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscale:!1,autoscaleMargin:0,color:null,scaling:"linear",base:Math.E,titleAlign:"center",margin:!0},y2axis:{titleAngle:270},grid:{color:"#545454",backgroundColor:null,backgroundImage:null,watermarkAlpha:.4,tickColor:"#DDDDDD",labelMargin:3,verticalLines:!0,minorVerticalLines:null,horizontalLines:!0,minorHorizontalLines:null,outlineWidth:1,outline:"nsew",circular:!1},mouse:{track:!1,trackAll:!1,position:"se",relative:!1,trackFormatter:Flotr.defaultTrackFormatter,margin:5,lineColor:"#FF3F19",trackDecimals:1,sensibility:2,trackY:!0,radius:3,fillColor:null,fillOpacity:.4}},function(){function t(e,t,n,r){this.rgba=["r","g","b","a"];var i=4;while(-1<--i)this[this.rgba[i]]=arguments[i]||(i==3?1:0);this.normalize()}var e=Flotr._,n={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]};t.prototype={scale:function(t,n,r,i){var s=4;while(-1<--s)e.isUndefined(arguments[s])||(this[this.rgba[s]]*=arguments[s]);return this.normalize()},alpha:function(t){return!e.isUndefined(t)&&!e.isNull(t)&&(this.a=t),this.normalize()},clone:function(){return new t(this.r,this.b,this.g,this.a)},limit:function(e,t,n){return Math.max(Math.min(e,n),t)},normalize:function(){var e=this.limit;return this.r=e(parseInt(this.r,10),0,255),this.g=e(parseInt(this.g,10),0,255),this.b=e(parseInt(this.b,10),0,255),this.a=e(this.a,0,1),this},distance:function(e){if(!e)return;e=new t.parse(e);var n=0,r=3;while(-1<--r)n+=Math.abs(this[this.rgba[r]]-e[this.rgba[r]]);return n},toString:function(){return this.a>=1?"rgb("+[this.r,this.g,this.b].join(",")+")":"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"},contrast:function(){var e=1-(.299*this.r+.587*this.g+.114*this.b)/255;return e<.5?"#000000":"#ffffff"}},e.extend(t,{parse:function(e){if(e instanceof t)return e;var r;if(r=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))return new t(parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16));if(r=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))return new t(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10));if(r=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))return new t(parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16));if(r=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return new t(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4]));if(r=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(e))return new t(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55);if(r=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return new t(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55,parseFloat(r[4]));var i=(e+"").replace(/^\s*([\S\s]*?)\s*$/,"$1").toLowerCase();return i=="transparent"?new t(255,255,255,0):(r=n[i])?new t(r[0],r[1],r[2]):new t(0,0,0,0)},processColor:function(n,r){var i=r.opacity;if(!n)return"rgba(0, 0, 0, 0)";if(n instanceof t)return n.alpha(i).toString();if(e.isString(n))return t.parse(n).alpha(i).toString();var s=n.colors?n:{colors:n};if(!r.ctx)return e.isArray(s.colors)?t.parse(e.isArray(s.colors[0])?s.colors[0][1]:s.colors[0]).alpha(i).toString():"rgba(0, 0, 0, 0)";s=e.extend({start:"top",end:"bottom"},s),/top/i.test(s.start)&&(r.x1=0),/left/i.test(s.start)&&(r.y1=0),/bottom/i.test(s.end)&&(r.x2=0),/right/i.test(s.end)&&(r.y2=0);var o,u,a,f=r.ctx.createLinearGradient(r.x1,r.y1,r.x2,r.y2);for(o=0;o<s.colors.length;o++)u=s.colors[o],e.isArray(u)?(a=u[0],u=u[1]):a=o/(s.colors.length-1),f.addColorStop(a,t.parse(u).alpha(i));return f}}),Flotr.Color=t}(),Flotr.Date={set:function(e,t,n,r){n=n||"UTC",t="set"+(n==="UTC"?"UTC":"")+t,e[t](r)},get:function(e,t,n){return n=n||"UTC",t="get"+(n==="UTC"?"UTC":"")+t,e[t]()},format:function(e,t,n){function s(e){return e+="",e.length==1?"0"+e:e}if(!e)return;var r=this.get,i={h:r(e,"Hours",n).toString(),H:s(r(e,"Hours",n)),M:s(r(e,"Minutes",n)),S:s(r(e,"Seconds",n)),s:r(e,"Milliseconds",n),d:r(e,"Date",n).toString(),m:(r(e,"Month",n)+1).toString(),y:r(e,"FullYear",n).toString(),b:Flotr.Date.monthNames[r(e,"Month",n)]},o=[],u,a=!1;for(var f=0;f<t.length;++f)u=t.charAt(f),a?(o.push(i[u]||u),a=!1):u=="%"?a=!0:o.push(u);return o.join("")},getFormat:function(e,t){var n=Flotr.Date.timeUnits;return e<n.second?"%h:%M:%S.%s":e<n.minute?"%h:%M:%S":e<n.day?t<2*n.day?"%h:%M":"%b %d %h:%M":e<n.month?"%b %d":e<n.year?t<n.year?"%b":"%b %y":"%y"},formatter:function(e,t){var n=t.options,r=Flotr.Date.timeUnits[n.timeUnit],i=new Date(e*r);if(t.options.timeFormat)return Flotr.Date.format(i,n.timeFormat,n.timeMode);var s=(t.max-t.min)*r,o=t.tickSize*Flotr.Date.timeUnits[t.tickUnit];return Flotr.Date.format(i,Flotr.Date.getFormat(o,s),n.timeMode)},generator:function(e){function y(e){t(m,e,o,Flotr.floorInBase(n(m,e,o),h))}var t=this.set,n=this.get,r=this.timeUnits,i=this.spec,s=e.options,o=s.timeMode,u=r[s.timeUnit],a=e.min*u,f=e.max*u,l=(f-a)/s.noTicks,c=[],h=e.tickSize,p,d,v,m;d=s.tickFormatter===Flotr.defaultTickFormatter?this.formatter:s.tickFormatter;for(v=0;v<i.length-1;++v){m=i[v][0]*r[i[v][1]];if(l<(m+i[v+1][0]*r[i[v+1][1]])/2&&m>=h)break}h=i[v][0],p=i[v][1],p=="year"&&(h=Flotr.getTickSize(s.noTicks*r.year,a,f,0),h==.5&&(p="month",h=6)),e.tickUnit=p,e.tickSize=h;var g=h*r[p];m=new Date(a);switch(p){case"millisecond":y("Milliseconds");break;case"second":y("Seconds");break;case"minute":y("Minutes");break;case"hour":y("Hours");break;case"month":y("Month");break;case"year":y("FullYear")}g>=r.second&&t(m,"Milliseconds",o,0),g>=r.minute&&t(m,"Seconds",o,0),g>=r.hour&&t(m,"Minutes",o,0),g>=r.day&&t(m,"Hours",o,0),g>=r.day*4&&t(m,"Date",o,1),g>=r.year&&t(m,"Month",o,0);var b=0,w=NaN,E;do{E=w,w=m.getTime(),c.push({v:w/u,label:d(w/u,e)});if(p=="month")if(h<1){t(m,"Date",o,1);var S=m.getTime();t(m,"Month",o,n(m,"Month",o)+1);var x=m.getTime();m.setTime(w+b*r.hour+(x-S)*h),b=n(m,"Hours",o),t(m,"Hours",o,0)}else t(m,"Month",o,n(m,"Month",o)+h);else p=="year"?t(m,"FullYear",o,n(m,"FullYear",o)+h):m.setTime(w+g)}while(w<f&&w!=E);return c},timeUnits:{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,year:31556952e3},spec:[[1,"millisecond"],[20,"millisecond"],[50,"millisecond"],[100,"millisecond"],[200,"millisecond"],[500,"millisecond"],[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},function(){function t(e){return e&&e.jquery?e[0]:e}var e=Flotr._;Flotr.DOM={addClass:function(n,r){n=t(n);var i=n.className?n.className:"";if(e.include(i.split(/\s+/g),r))return;n.className=(i?i+" ":"")+r},create:function(e){return document.createElement(e)},node:function(e){var t=Flotr.DOM.create("div"),n;t.innerHTML=e,n=t.children[0];var r=navigator.userAgent,i=Flotr.isIE||(new RegExp(/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i)).test(r)||(new RegExp(/(edge)\/((\d+)?[\w\.]+)/i)).test(r);return i||(t.innerHTML=""),n},empty:function(e){e=t(e),e.innerHTML=""},remove:function(e){e=t(e),e.parentNode.removeChild(e)},hide:function(e){e=t(e),Flotr.DOM.setStyles(e,{display:"none"})},insert:function(n,r){n=t(n),e.isString(r)?n.innerHTML+=r:e.isElement(r)&&n.appendChild(r)},opacity:function(e,n){e=t(e),e.style.opacity=n},position:function(e,n){return e=t(e),e.offsetParent?(n=this.position(e.offsetParent),n.left+=e.offsetLeft,n.top+=e.offsetTop,n):{left:e.offsetLeft||0,top:e.offsetTop||0}},removeClass:function(n,r){var i=n.className?n.className:"";n=t(n),n.className=e.filter(i.split(/\s+/g),function(e){if(e!=r)return!0}).join(" ")},setStyles:function(n,r){n=t(n),e.each(r,function(e,t){n.style[t]=e})},show:function(e){e=t(e),Flotr.DOM.setStyles(e,{display:""})},size:function(e){return e=t(e),{height:e.offsetHeight,width:e.offsetWidth}}}}(),function(){var e=Flotr,t=e.bean;e.EventAdapter={observe:function(e,n,r){return t.add(e,n,r),this},fire:function(e,n,r){return t.fire(e,n,r),typeof Prototype!="undefined"&&Event.fire(e,n,r),this},stopObserving:function(e,n,r){return t.remove(e,n,r),this},eventPointer:function(t){if(!e._.isUndefined(t.touches)&&t.touches.length>0)return{x:t.touches[0].pageX,y:t.touches[0].pageY};if(!e._.isUndefined(t.changedTouches)&&t.changedTouches.length>0)return{x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY};if(t.pageX||t.pageY)return{x:t.pageX,y:t.pageY};if(t.clientX||t.clientY)return{x:t.clientX+(window.pageXOffset!==undefined?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft),y:t.clientY+(window.pageYOffset!==undefined?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)}}}}(),function(){var e=Flotr,t=e.DOM,n=e._,r=function(e){this.o=e};r.prototype={dimensions:function(e,t,n,r){return e?this.o.html?this.html(e,this.o.element,n,r):this.canvas(e,t):{width:0,height:0}},canvas:function(t,n){if(!this.o.textEnabled)return;n=n||{};var r=this.measureText(t,n),i=r.width,s=n.size||e.defaultOptions.fontSize,o=n.angle||0,u=Math.cos(o),a=Math.sin(o),f=2,l=6,c;return c={width:Math.abs(u*i)+Math.abs(a*s)+f,height:Math.abs(a*i)+Math.abs(u*s)+l},c},html:function(e,n,r,i){var s=t.create("div");return t.setStyles(s,{position:"absolute",top:"-10000px"}),t.insert(s,'<div style="'+r+'" class="'+i+' flotr-dummy-div">'+e+"</div>"),t.insert(this.o.element,s),t.size(s)},measureText:function(t,r){var i=this.o.ctx,s;return!i.fillText||e.isIphone&&i.measure?{width:i.measure(t,r)}:(r=n.extend({size:e.defaultOptions.fontSize,weight:1,angle:0,fontFamiliy:"sans-serif"},r),i.save(),i.font=(r.weight>1?"bold ":"")+r.size*1.3+"px "+r.fontFamily,s=i.measureText(t),i.restore(),s)}},Flotr.Text=r}(),function(){function i(e,n,r){return t.observe.apply(this,arguments),this._handles.push(arguments),this}var e=Flotr.DOM,t=Flotr.EventAdapter,n=Flotr._,r=Flotr;Graph=function(e,i,s){this._setEl(e),this._initMembers(),this._initPlugins(),t.fire(this.el,"flotr:beforeinit",[this]),this.data=i,this.series=r.Series.getSeries(i),this._initOptions(s),this._initGraphTypes(),this._initCanvas(),this._text=new r.Text({element:this.el,ctx:this.ctx,html:this.options.HtmlText,textEnabled:this.textEnabled}),t.fire(this.el,"flotr:afterconstruct",[this]),this._initEvents(),this.findDataRanges(),this.calculateSpacing(),this.draw(n.bind(function(){t.fire(this.el,"flotr:afterinit",[this])},this))},Graph.prototype={destroy:function(){t.fire(this.el,"flotr:destroy"),n.each(this._handles,function(e){t.stopObserving.apply(this,e)}),this._handles=[],this.el.graph=null},observe:i,_observe:i,processColor:function(e,t){var i={x1:0,y1:0,x2:this.plotWidth,y2:this.plotHeight,opacity:1,ctx:this.ctx};return n.extend(i,t),r.Color.processColor(e,i)},findDataRanges:function(){var e=this.axes,t,i,s;n.each(this.series,function(e){s=e.getRange(),s&&(t=e.xaxis,i=e.yaxis,t.datamin=Math.min(s.xmin,t.datamin),t.datamax=Math.max(s.xmax,t.datamax),i.datamin=Math.min(s.ymin,i.datamin),i.datamax=Math.max(s.ymax,i.datamax),t.used=t.used||s.xused,i.used=i.used||s.yused)},this),!e.x.used&&!e.x2.used&&(e.x.used=!0),!e.y.used&&!e.y2.used&&(e.y.used=!0),n.each(e,function(e){e.calculateRange()});var o=n.keys(r.graphTypes),u=!1;n.each(this.series,function(e){if(e.hide)return;n.each(o,function(t){e[t]&&e[t].show&&(this.extendRange(t,e),u=!0)},this),u||this.extendRange(this.options.defaultType,e)},this)},extendRange:function(e,t){this[e].extendRange&&this[e].extendRange(t,t.data,t[e],this[e]),this[e].extendYRange&&this[e].extendYRange(t.yaxis,t.data,t[e],this[e]),this[e].extendXRange&&this[e].extendXRange(t.xaxis,t.data,t[e],this[e])},calculateSpacing:function(){var e=this.axes,t=this.options,i=this.series,s=t.grid.labelMargin,o=this._text,u=e.x,a=e.x2,f=e.y,l=e.y2,c=t.grid.outlineWidth,h,p,d,v;n.each(e,function(e){e.calculateTicks(),e.calculateTextDimensions(o,t)}),v=o.dimensions(t.title||"ABC",{size:t.fontSize*1.5},"font-size:1em;font-weight:bold;","flotr-title"),t.title?this.titleHeight=v.height:this.titleHeight=t.fontSize/r.defaultOptions.fontSize*5,v=o.dimensions(t.subtitle,{size:t.fontSize},"font-size:smaller;","flotr-subtitle"),this.subtitleHeight=v.height;for(p=0;p<t.length;++p)i[p].points.show&&(c=Math.max(c,i[p].points.radius+i[p].points.lineWidth/2));var m=this.plotOffset;u.options.margin===!1?(m.bottom=0,m.top=0):u.options.margin===!0?(m.bottom+=(t.grid.circular?0:u.used&&u.options.showLabels?u.maxLabel.height+s:0)+(u.used&&u.options.title?u.titleSize.height+s:0)+c,m.top+=(t.grid.circular?0:a.used&&a.options.showLabels?a.maxLabel.height+s:0)+(a.used&&a.options.title?a.titleSize.height+s:0)+this.subtitleHeight+this.titleHeight+c):(m.bottom=u.options.margin,m.top=u.options.margin),f.options.margin===!1?(m.left=0,m.right=0):f.options.margin===!0?(m.left+=(t.grid.circular?0:f.used&&f.options.showLabels?f.maxLabel.width+s:0)+(f.used&&f.options.title?f.titleSize.width+s:0)+c,m.right+=(t.grid.circular?0:l.used&&l.options.showLabels?l.maxLabel.width+s:0)+(l.used&&l.options.title?l.titleSize.width+s:0)+c):(m.left=f.options.margin,m.right=f.options.margin),m.top=Math.floor(m.top),this.plotWidth=this.canvasWidth-m.left-m.right,this.plotHeight=this.canvasHeight-m.bottom-m.top,u.length=a.length=this.plotWidth,f.length=l.length=this.plotHeight,f.offset=l.offset=this.plotHeight,u.setScale(),a.setScale(),f.setScale(),l.setScale()},draw:function(e){var n=this.ctx,r;t.fire(this.el,"flotr:beforedraw",[this.series,this]);if(this.series.length){n.save(),n.translate(this.plotOffset.left,this.plotOffset.top);for(r=0;r<this.series.length;r++)this.series[r].hide||this.drawSeries(this.series[r]);n.restore(),this.clip()}t.fire(this.el,"flotr:afterdraw",[this.series,this]),e&&e()},drawSeries:function(e){function t(e,t){var n=this.getOptions(e,t);this[t].draw(n)}var i=!1;e=e||this.series,n.each(r.graphTypes,function(n,r){e[r]&&e[r].show&&this[r]&&(i=!0,t.call(this,e,r))},this),i||t.call(this,e,this.options.defaultType)},getOptions:function(e,t){var n=e[t],i=this[t],s=e.xaxis,o=e.yaxis,u={context:this.ctx,width:this.plotWidth,height:this.plotHeight,fontSize:this.options.fontSize,fontColor:this.options.fontColor,textEnabled:this.textEnabled,htmlText:this.options.HtmlText,text:this._text,element:this.el,data:e.data,color:e.color,shadowSize:e.shadowSize,xScale:s.d2p,yScale:o.d2p,xInverse:s.p2d,yInverse:o.p2d};return u=r.merge(n,u),u.fillStyle=this.processColor(n.fillColor||e.color,{opacity:n.fillOpacity}),u},getEventPosition:function(n){var r=document,i=r.body,s=r.documentElement,o=this.axes,u=this.plotOffset,a=this.lastMousePos,f=t.eventPointer(n),l=f.x-a.pageX,c=f.y-a.pageY,h,p,d,v=window.pageXOffset!==undefined?window.pageXOffset:(s||i.parentNode||i).scrollLeft,m=window.pageYOffset!==undefined?window.pageYOffset:(s||i.parentNode||i).scrollTop;return"ontouchstart"in this.el?(h=e.position(this.overlay),p=f.x-h.left-u.left,d=f.y-h.top-u.top):(h=this.overlay.getBoundingClientRect(),p=n.clientX-h.left-u.left-v,d=n.clientY-h.top-u.top-m),{x:o.x.p2d(p),x2:o.x2.p2d(p),y:o.y.p2d(d),y2:o.y2.p2d(d),relX:p,relY:d,dX:l,dY:c,absX:f.x,absY:f.y,pageX:f.x,pageY:f.y}},clickHandler:function(e){if(this.ignoreClick)return this.ignoreClick=!1,this.ignoreClick;t.fire(this.el,"flotr:click",[this.getEventPosition(e),this])},mouseMoveHandler:function(e){if(this.mouseDownMoveHandler)return;var n=this.getEventPosition(e);t.fire(this.el,"flotr:mousemove",[e,n,this]),this.lastMousePos=n},mouseDownHandler:function(e){if(this.mouseUpHandler)return;this.mouseUpHandler=n.bind(function(e){t.stopObserving(document,"mouseup",this.mouseUpHandler),t.stopObserving(document,"mousemove",this.mouseDownMoveHandler),this.mouseDownMoveHandler=null,this.mouseUpHandler=null,t.fire(this.el,"flotr:mouseup",[e,this])},this),this.mouseDownMoveHandler=n.bind(function(n){var r=this.getEventPosition(n);t.fire(this.el,"flotr:mousemove",[e,r,this]),this.lastMousePos=r},this),t.observe(document,"mouseup",this.mouseUpHandler),t.observe(document,"mousemove",this.mouseDownMoveHandler),t.fire(this.el,"flotr:mousedown",[e,this]),this.ignoreClick=!1},drawTooltip:function(t,n,r,i){var s=this.getMouseTrack(),o="opacity:0.7;background-color:#000;color:#fff;display:none;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;",u=i.position,a=i.margin,f=this.plotOffset;n!==null&&r!==null?(i.relative?(u.charAt(0)=="n"?o+="bottom:"+(a-f.top-r+this.canvasHeight)+"px;top:auto;":u.charAt(0)=="s"&&(o+="top:"+(a+f.top+r)+"px;bottom:auto;"),u.charAt(1)=="e"?o+="left:"+(a+f.left+n)+"px;right:auto;":u.charAt(1)=="w"&&(o+="right:"+(a-f.left-n+this.canvasWidth)+"px;left:auto;")):(u.charAt(0)=="n"?o+="top:"+(a+f.top)+"px;bottom:auto;":u.charAt(0)=="s"&&(o+="bottom:"+(a+f.bottom)+"px;top:auto;"),u.charAt(1)=="e"?o+="right:"+(a+f.right)+"px;left:auto;":u.charAt(1)=="w"&&(o+="left:"+(a+f.left)+"px;right:auto;")),s.style.cssText=o,e.empty(s),e.insert(s,t),e.show(s)):e.hide(s)},clip:function(e){var t=this.plotOffset,n=this.canvasWidth,i=this.canvasHeight;e=e||this.ctx;if(r.isIE&&r.isIE<9&&!r.isFlashCanvas){if(e===this.octx)return;e.save(),e.fillStyle=this.processColor(this.options.ieBackgroundColor),e.fillRect(0,0,n,t.top),e.fillRect(0,0,t.left,i),e.fillRect(0,i-t.bottom,n,t.bottom),e.fillRect(n-t.right,0,t.right,i),e.restore()}else e.clearRect(0,0,n,t.top),e.clearRect(0,0,t.left,i),e.clearRect(0,i-t.bottom,n,t.bottom),e.clearRect(n-t.right,0,t.right,i)},_initMembers:function(){this._handles=[],this.lastMousePos={pageX:null,pageY:null},this.plotOffset={left:0,right:0,top:0,bottom:0},this.ignoreClick=!0,this.prevHit=null},_initGraphTypes:function(){n.each(r.graphTypes,function(e,t){this[t]=r.clone(e)},this)},_initEvents:function(){var e=this.el,r,i,s;"ontouchstart"in e?(r=n.bind(function(n){s=!0,t.stopObserving(document,"touchend",r),t.fire(e,"flotr:mouseup",[n,this]),this.multitouches=null,i||this.clickHandler(n)},this),this.observe(this.overlay,"touchstart",n.bind(function(n){i=!1,s=!1,this.ignoreClick=!1,n.touches&&n.touches.length>1&&(this.multitouches=n.touches),t.fire(e,"flotr:mousedown",[n,this]),this.observe(document,"touchend",r)},this)),this.observe(this.overlay,"touchmove",n.bind(function(n){var r=this.getEventPosition(n);this.options.preventDefault&&n.preventDefault(),i=!0,this.multitouches||n.touches&&n.touches.length>1?this.multitouches=n.touches:s||t.fire(e,"flotr:mousemove",[n,r,this]),this.lastMousePos=r},this))):this.observe(this.overlay,"mousedown",n.bind(this.mouseDownHandler,this)).observe(e,"mousemove",n.bind(this.mouseMoveHandler,this)).observe(this.overlay,"click",n.bind(this.clickHandler,this)).observe(e,"mouseout",function(n){t.fire(e,"flotr:mouseout",n)})},_initCanvas:function(){function l(i,s){return i||(i=e.create("canvas"),typeof FlashCanvas!="undefined"&&typeof i.getContext=="function"&&(FlashCanvas.initElement(i),this.isFlashCanvas=!0),i.className="flotr-"+s,i.style.cssText="position:absolute;left:0px;top:0px;",e.insert(t,i)),n.each(a,function(t,n){e.show(i);if(s=="canvas"&&i.getAttribute(n)===t)return;i.setAttribute(n,t*r.resolution),i.style[n]=t+"px"}),i.context_=null,i}function c(e){window.G_vmlCanvasManager&&window.G_vmlCanvasManager.initElement(e);var t=e.getContext("2d");return window.G_vmlCanvasManager||t.scale(r.resolution,r.resolution),t}var t=this.el,r=this.options,i=t.children,s=[],o,u,a,f;for(u=i.length;u--;)o=i[u],!this.canvas&&o.className==="flotr-canvas"?this.canvas=o:!this.overlay&&o.className==="flotr-overlay"?this.overlay=o:s.push(o);for(u=s.length;u--;)t.removeChild(s[u]);e.setStyles(t,{position:"relative"}),a={},a.width=t.clientWidth,a.height=t.clientHeight;if(a.width<=0||a.height<=0||r.resolution<=0)throw"Invalid dimensions for plot, width = "+a.width+", height = "+a.height+", resolution = "+r.resolution;this.canvas=l(this.canvas,"canvas"),this.overlay=l(this.overlay,"overlay"),this.ctx=c(this.canvas),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.octx=c(this.overlay),this.octx.clearRect(0,0,this.overlay.width,this.overlay.height),this.canvasHeight=a.height,this.canvasWidth=a.width,this.textEnabled=!!this.ctx.drawText||!!this.ctx.fillText},_initPlugins:function(){n.each(r.plugins,function(e,t){n.each(e.callbacks,function(e,t){this.observe(this.el,t,n.bind(e,this))},this),this[t]=r.clone(e),n.each(this[t],function(e,r){n.isFunction(e)&&(this[t][r]=n.bind(e,this))},this)},this)},_initOptions:function(e){var i=r.clone(r.defaultOptions);i.x2axis=n.extend(n.clone(i.xaxis),i.x2axis),i.y2axis=n.extend(n.clone(i.yaxis),i.y2axis),this.options=r.merge(e||{},i),this.options.grid.minorVerticalLines===null&&this.options.xaxis.scaling==="logarithmic"&&(this.options.grid.minorVerticalLines=!0),this.options.grid.minorHorizontalLines===null&&this.options.yaxis.scaling==="logarithmic"&&(this.options.grid.minorHorizontalLines=!0),t.fire(this.el,"flotr:afterinitoptions",[this]),this.axes=r.Axis.getAxes(this.options);var s=[],o=[],u=this.series.length,a=this.series.length,f=this.options.colors,l=[],c=0,h,p,d,v;for(p=a-1;p>-1;--p)h=this.series[p].color,h&&(--a,n.isNumber(h)?s.push(h):l.push(r.Color.parse(h)));for(p=s.length-1;p>-1;--p)a=Math.max(a,s[p]+1);for(p=0;o.length<a;){h=f.length==p?new r.Color(100,100,100):r.Color.parse(f[p]);var m=c%2==1?-1:1,g=1+m*Math.ceil(c/2)*.2;h.scale(g,g,g),o.push(h),++p>=f.length&&(p=0,++c)}for(p=0,d=0;p<u;++p){v=this.series[p],v.color?n.isNumber(v.color)&&(v.color=o[v.color].toString()):v.color=o[d++].toString(),v.xaxis||(v.xaxis=this.axes.x),v.xaxis==1?v.xaxis=this.axes.x:v.xaxis==2&&(v.xaxis=this.axes.x2),v.yaxis||(v.yaxis=this.axes.y),v.yaxis==1?v.yaxis=this.axes.y:v.yaxis==2&&(v.yaxis=this.axes.y2);for(var y in r.graphTypes)v[y]=n.extend(n.clone(this.options[y]),v[y]);v.mouse=n.extend(n.clone(this.options.mouse),v.mouse),n.isUndefined(v.shadowSize)&&(v.shadowSize=this.options.shadowSize)}},_setEl:function(e){if(!e)throw"The target container doesn't exist";if(e.graph instanceof Graph)e.graph.destroy();else if(!e.clientWidth)throw"The target container must be visible";e.graph=this,this.el=e}},Flotr.Graph=Graph}(),function(){function n(t){this.orientation=1,this.offset=0,this.datamin=Number.MAX_VALUE,this.datamax=-Number.MAX_VALUE,e.extend(this,t)}function r(e,t){return e=Math.log(Math.max(e,Number.MIN_VALUE)),t!==Math.E&&(e/=Math.log(t)),e}function s(e,t){return t===Math.E?Math.exp(e):Math.pow(t,e)}var e=Flotr._,t="logarithmic";n.prototype={setScale:function(){var e=this.length,n=this.max,i=this.min,o=this.offset,u=this.orientation,a=this.options,f=a.scaling===t,l;f?l=e/(r(n,a.base)-r(i,a.base)):l=e/(n-i),this.scale=l,f?(this.d2p=function(e){return o+u*(r(e,a.base)-r(i,a.base))*l},this.p2d=function(e){return s((o+u*e)/l+r(i,a.base),a.base)}):(this.d2p=function(e){return o+u*(e-i)*l},this.p2d=function(e){return(o+u*e)/l+i})},calculateTicks:function(){var t=this.options;this.ticks=[],this.minorTicks=[],t.ticks?(this._cleanUserTicks(t.ticks,this.ticks),this._cleanUserTicks(t.minorTicks||[],this.minorTicks)):t.mode=="time"?this._calculateTimeTicks():t.scaling==="logarithmic"?this._calculateLogTicks():this._calculateTicks(),e.each(this.ticks,function(e){e.label+=""}),e.each(this.minorTicks,function(e){e.label+=""})},calculateRange:function(){if(!this.used)return;var e=this,t=e.options,n=t.min!==null?t.min:e.datamin,r=t.max!==null?t.max:e.datamax,i=t.autoscaleMargin;t.scaling=="logarithmic"&&(n<=0&&(n=e.datamin),r<=0&&(r=n));if(r==n){var s=r?.01:1;t.min===null&&(n-=s),t.max===null&&(r+=s)}if(t.scaling==="logarithmic"){n<0&&(n=r/t.base);var o=Math.log(r);t.base!=Math.E&&(o/=Math.log(t.base)),o=Math.ceil(o);var u=Math.log(n);t.base!=Math.E&&(u/=Math.log(t.base)),u=Math.ceil(u),e.tickSize=Flotr.getTickSize(t.noTicks,u,o,t.tickDecimals===null?0:t.tickDecimals),t.minorTickFreq===null&&(o-u>10?t.minorTickFreq=0:o-u>5?t.minorTickFreq=2:t.minorTickFreq=5)}else e.tickSize=Flotr.getTickSize(t.noTicks,n,r,t.tickDecimals);e.min=n,e.max=r,t.min===null&&t.autoscale&&(e.min-=e.tickSize*i,e.min<0&&e.datamin>=0&&(e.min=0),e.min=e.tickSize*Math.floor(e.min/e.tickSize)),t.max===null&&t.autoscale&&(e.max+=e.tickSize*i,e.max>0&&e.datamax<=0&&e.datamax!=e.datamin&&(e.max=0),e.max=e.tickSize*Math.ceil(e.max/e.tickSize)),e.min==e.max&&(e.max=e.min+1)},calculateTextDimensions:function(e,t){var n="",r,i;if(this.options.showLabels)for(i=0;i<this.ticks.length;++i)r=this.ticks[i].label.length,r>n.length&&(n=this.ticks[i].label);this.maxLabel=e.dimensions(n,{size:t.fontSize*1.2,fontFamily:t.fontFamily,angle:Flotr.toRad(this.options.labelsAngle)},"font-size:smaller;","flotr-grid-label"),this.titleSize=e.dimensions(this.options.title,{size:t.fontSize*1.2,fontFamily:t.fontFamily,angle:Flotr.toRad(this.options.titleAngle)},"font-weight:bold;","flotr-axis-title")},_cleanUserTicks:function(t,n){var r=this,i=this.options,s,o,u,a;e.isFunction(t)&&(t=t({min:r.min,max:r.max}));for(o=0;o<t.length;++o)a=t[o],typeof a=="object"?(s=a[0],u=a.length>1?a[1]:i.tickFormatter(s,{min:r.min,max:r.max})):(s=a,u=i.tickFormatter(s,{min:this.min,max:this.max})),n[o]={v:s,label:u}},_calculateTimeTicks:function(){this.ticks=Flotr.Date.generator(this)},_calculateLogTicks:function(){var e=this,t=e.options,n,r,s=Math.log(e.max);t.base!=Math.E&&(s/=Math.log(t.base)),s=Math.ceil(s);var o=Math.log(e.min);t.base!=Math.E&&(o/=Math.log(t.base)),o=Math.ceil(o);for(i=o;i<s;i+=e.tickSize){r=t.base==Math.E?Math.exp(i):Math.pow(t.base,i);var u=r*(t.base==Math.E?Math.exp(e.tickSize):Math.pow(t.base,e.tickSize)),a=(u-r)/t.minorTickFreq;e.ticks.push({v:r,label:t.tickFormatter(r,{min:e.min,max:e.max})});for(n=r+a;n<u;n+=a)e.minorTicks.push({v:n,label:t.tickFormatter(n,{min:e.min,max:e.max})})}r=t.base==Math.E?Math.exp(i):Math.pow(t.base,i),e.ticks.push({v:r,label:t.tickFormatter(r,{min:e.min,max:e.max})})},_calculateTicks:function(){var e=this,t=e.options,n=e.tickSize,r=e.min,i=e.max,s=n*Math.ceil(r/n),o,u,a,f,l,c;t.minorTickFreq&&(u=n/t.minorTickFreq);for(l=0;(a=f=s+l*n)<=i;++l){o=t.tickDecimals,o===null&&(o=1-Math.floor(Math.log(n)/Math.LN10)),o<0&&(o=0),a=a.toFixed(o),e.ticks.push({v:a,label:t.tickFormatter(a,{min:e.min,max:e.max})});if(t.minorTickFreq)for(c=0;c<t.minorTickFreq&&l*n+c*u<i;++c)a=f+c*u,e.minorTicks.push({v:a,label:t.tickFormatter(a,{min:e.min,max:e.max})})}}},e.extend(n,{getAxes:function(e){return{x:new n({options:e.xaxis,n:1,length:this.plotWidth}),x2:new n({options:e.x2axis,n:2,length:this.plotWidth}),y:new n({options:e.yaxis,n:1,length:this.plotHeight,offset:this.plotHeight,orientation:-1}),y2:new n({options:e.y2axis,n:2,length:this.plotHeight,offset:this.plotHeight,orientation:-1})}}}),Flotr.Axis=n}(),function(){function t(t){e.extend(this,t)}var e=Flotr._;t.prototype={getRange:function(){var e=this.data,t=e.length,n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=-Number.MAX_VALUE,o=!1,u=!1,a,f,l;if(t<0||this.hide)return!1;for(l=0;l<t;l++)a=e[l][0],f=e[l][1],a!==null&&(a<n&&(n=a,o=!0),a>i&&(i=a,o=!0)),f!==null&&(f<r&&(r=f,u=!0),f>s&&(s=f,u=!0));return{xmin:n,xmax:i,ymin:r,ymax:s,xused:o,yused:u}}},e.extend(t,{getSeries:function(n){return e.map(n,function(n){var r;return n.data?(r=new t,e.extend(r,n)):r=new t({data:n}),r})}}),Flotr.Series=t}(),Flotr.addType("lines",{options:{show:!1,lineWidth:2,fill:!1,fillBorder:!1,fillColor:null,fillOpacity:.4,steps:!1,stacked:!1},stack:{values:[]},draw:function(e){var t=e.context,n=e.lineWidth,r=e.shadowSize,i;t.save(),t.lineJoin="round",r&&(t.lineWidth=r/2,i=n/2+t.lineWidth/2,t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,i+r/2,!1),t.strokeStyle="rgba(0,0,0,0.2)",this.plot(e,i,!1)),t.lineWidth=n,t.strokeStyle=e.color,this.plot(e,0,!0),t.restore()},plot:function(e,t,n){function S(){!t&&e.fill&&d&&(v=o(d[0]),r.fillStyle=e.fillStyle,r.lineTo(m,p),r.lineTo(v,p),r.lineTo(v,u(d[1])),r.fill(),e.fillBorder&&r.stroke())}var r=e.context,i=e.width,s=e.height,o=e.xScale,u=e.yScale,a=e.data,f=e.stacked?this.stack:!1,l=a.length-1,c=null,h=null,p=u(0),d=null,v,m,g,y,b,w,E;if(l<1)return;r.beginPath();for(E=0;E<l;++E){if(a[E][1]===null||a[E+1][1]===null){e.fill&&E>0&&a[E][1]!==null&&(r.stroke(),S(),d=null,r.closePath(),r.beginPath());continue}v=o(a[E][0]),m=o(a[E+1][0]),d===null&&(d=a[E]),f?(b=f.values[a[E][0]]||0,w=f.values[a[E+1][0]]||f.values[a[E][0]]||0,g=u(a[E][1]+b),y=u(a[E+1][1]+w),n&&(a[E].y0=b,f.values[a[E][0]]=a[E][1]+b,E==l-1&&(a[E+1].y0=w,f.values[a[E+1][0]]=a[E+1][1]+w))):(g=u(a[E][1]),y=u(a[E+1][1]));if(g>s&&y>s||g<0&&y<0||v<0&&m<0||v>i&&m>i)continue;(c!=v||h!=g+t)&&r.moveTo(v,g+t),c=m,h=y+t,e.steps?(r.lineTo(c+t/2,g+t),r.lineTo(c+t/2,h)):r.lineTo(c,h)}(!e.fill||e.fill&&!e.fillBorder)&&r.stroke(),S(),r.closePath()},extendYRange:function(e,t,n,r){var i=e.options;if(n.stacked&&(!i.max&&i.max!==0||!i.min&&i.min!==0)){var s=e.max,o=e.min,u=r.positiveSums||{},a=r.negativeSums||{},f,l;for(l=0;l<t.length;l++)f=t[l][0]+"",t[l][1]>0?(u[f]=(u[f]||0)+t[l][1],s=Math.max(s,u[f])):(a[f]=(a[f]||0)+t[l][1],o=Math.min(o,a[f]));r.negativeSums=a,r.positiveSums=u,e.max=s,e.min=o}n.steps&&(this.hit=function(e){var t=e.data,n=e.args,r=e.yScale,i=n[0],s=t.length,o=n[1],u=e.xInverse(i.relX),a=i.relY,f;for(f=0;f<s-1;f++)if(u>=t[f][0]&&u<=t[f+1][0]){Math.abs(r(t[f][1])-a)<8&&(o.x=t[f][0],o.y=t[f][1],o.index=f,o.seriesIndex=e.index);break}},this.drawHit=function(e){var t=e.context,n=e.args,r=e.data,i=e.xScale,s=n.index,o=i(n.x),u=e.yScale(n.y),a;r.length-1>s&&(a=e.xScale(r[s+1][0]),t.save(),t.strokeStyle=e.color,t.lineWidth=e.lineWidth,t.beginPath(),t.moveTo(o,u),t.lineTo(a,u),t.stroke(),t.closePath(),t.restore())},this.clearHit=function(e){var t=e.context,n=e.args,r=e.data,i=e.xScale,s=e.lineWidth,o=n.index,u=i(n.x),a=e.yScale(n.y),f;r.length-1>o&&(f=e.xScale(r[o+1][0]),t.clearRect(u-s,a-s,f-u+2*s,2*s))})}}),Flotr.addType("bars",{options:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,fillOpacity:.4,horizontal:!1,stacked:!1,centered:!0,topPadding:.1,grouped:!1},stack:{positive:[],negative:[],_positive:[],_negative:[]},draw:function(e){var t=e.context;this.current+=1,t.save(),t.lineJoin="miter",t.lineWidth=e.lineWidth,t.strokeStyle=e.color,e.fill&&(t.fillStyle=e.fillStyle),this.plot(e),t.restore()},plot:function(e){var t=e.data,n=e.context,r=e.shadowSize,i,s,o,u,a,f;if(t.length<1)return;this.translate(n,e.horizontal);for(i=0;i<t.length;i++){s=this.getBarGeometry(t[i][0],t[i][1],e);if(s===null)continue;o=s.left,u=s.top,a=s.width,f=s.height,e.fill&&n.fillRect(o,u,a,f),r&&(n.save(),n.fillStyle="rgba(0,0,0,0.05)",n.fillRect(o+r,u+r,a,f),n.restore()),e.lineWidth&&n.strokeRect(o,u,a,f)}},translate:function(e,t){t&&(e.rotate(-Math.PI/2),e.scale(-1,1))},getBarGeometry:function(e,t,n){var r=n.horizontal,i=n.barWidth,s=n.centered,o=n.stacked?this.stack:!1,u=n.lineWidth,a=s?i/2:0,f=r?n.yScale:n.xScale,l=r?n.xScale:n.yScale,c=r?t:e,h=r?e:t,p=0,d,v,m,g,y;return n.grouped&&(this.current/this.groups,c-=a,i/=this.groups,a=i/2,c=c+i*this.current-a),o&&(d=h>0?o.positive:o.negative,p=d[c]||p,d[c]=p+h),v=f(c-a),m=f(c+i-a),g=l(h+p),y=l(p),y<0&&(y=0),e===null||t===null?null:{x:c,y:h,xScale:f,yScale:l,top:g,left:Math.min(v,m)-u/2,width:Math.abs(m-v)-u,height:y-g}},hit:function(e){var t=e.data,n=e.args,r=n[0],i=n[1],s=e.xInverse(r.relX),o=e.yInverse(r.relY),u=this.getBarGeometry(s,o,e),a=u.width/2,f=u.left,l=u.y,c,h;for(h=t.length;h--;)c=this.getBarGeometry(t[h][0],t[h][1],e),(l>0&&l<c.y||l<0&&l>c.y)&&Math.abs(f-c.left)<a&&(i.x=t[h][0],i.y=t[h][1],i.index=h,i.seriesIndex=e.index)},drawHit:function(e){var t=e.context,n=e.args,r=this.getBarGeometry(n.x,n.y,e),i=r.left,s=r.top,o=r.width,u=r.height;t.save(),t.strokeStyle=e.color,t.lineWidth=e.lineWidth,this.translate(t,e.horizontal),t.beginPath(),t.moveTo(i,s+u),t.lineTo(i,s),t.lineTo(i+o,s),t.lineTo(i+o,s+u),e.fill&&(t.fillStyle=e.fillStyle,t.fill()),t.stroke(),t.closePath(),t.restore()},clearHit:function(e){var t=e.context,n=e.args,r=this.getBarGeometry(n.x,n.y,e),i=r.left,s=r.width,o=r.top,u=r.height,a=2*e.lineWidth;t.save(),this.translate(t,e.horizontal),t.clearRect(i-a,Math.min(o,o+u)-a,s+2*a,Math.abs(u)+2*a),t.restore()},extendXRange:function(e,t,n,r){this._extendRange(e,t,n,r),this.groups=this.groups+1||1,this.current=0},extendYRange:function(e,t,n,r){this._extendRange(e,t,n,r)},_extendRange:function(e,t,n,r){var i=e.options.max;if(_.isNumber(i)||_.isString(i))return;var s=e.min,o=e.max,u=n.horizontal,a=e.orientation,f=this.positiveSums||{},l=this.negativeSums||{},c,h,p,d;(a==1&&!u||a==-1&&u)&&n.centered&&(o=Math.max(e.datamax+n.barWidth,o),s=Math.min(e.datamin-n.barWidth,s));if(n.stacked&&(a==1&&u||a==-1&&!u))for(d=t.length;d--;)c=t[d][a==1?1:0]+"",h=t[d][a==1?0:1],h>0?(f[c]=(f[c]||0)+h,o=Math.max(o,f[c])):(l[c]=(l[c]||0)+h,s=Math.min(s,l[c]));(a==1&&u||a==-1&&!u)&&n.topPadding&&(e.max===e.datamax||n.stacked&&this.stackMax!==o)&&(o+=n.topPadding*(o-s)),this.stackMin=s,this.stackMax=o,this.negativeSums=l,this.positiveSums=f,e.max=o,e.min=s}}),Flotr.addType("bubbles",{options:{show:!1,lineWidth:2,fill:!0,fillOpacity:.4,baseRadius:2},draw:function(e){var t=e.context,n=e.shadowSize;t.save(),t.lineWidth=e.lineWidth,t.fillStyle="rgba(0,0,0,0.05)",t.strokeStyle="rgba(0,0,0,0.05)",this.plot(e,n/2),t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,n/4),t.strokeStyle=e.color,t.fillStyle=e.fillStyle,this.plot(e),t.restore()},plot:function(e,t){var n=e.data,r=e.context,i,s,o,u,a;t=t||0;for(s=0;s<n.length;++s)i=this.getGeometry(n[s],e),r.beginPath(),r.arc(i.x+t,i.y+t,i.z,0,2*Math.PI,!0),r.stroke(),e.fill&&r.fill(),r.closePath()},getGeometry:function(e,t){return{x:t.xScale(e[0]),y:t.yScale(e[1]),z:e[2]*t.baseRadius}},hit:function(e){var t=e.data,n=e.args,r=n[0],s=n[1],o=r.relX,u=r.relY,a,f,l,c;s.best=s.best||Number.MAX_VALUE;for(i=t.length;i--;)f=this.getGeometry(t[i],e),l=f.x-o,c=f.y-u,a=Math.sqrt(l*l+c*c),a<f.z&&f.z<s.best&&(s.x=t[i][0],s.y=t[i][1],s.index=i,s.seriesIndex=e.index,s.best=f.z)},drawHit:function(e){var t=e.context,n=this.getGeometry(e.data[e.args.index],e);t.save(),t.lineWidth=e.lineWidth,t.fillStyle=e.fillStyle,t.strokeStyle=e.color,t.beginPath(),t.arc(n.x,n.y,n.z,0,2*Math.PI,!0),t.fill(),t.stroke(),t.closePath(),t.restore()},clearHit:function(e){var t=e.context,n=this.getGeometry(e.data[e.args.index],e),r=n.z+e.lineWidth;t.save(),t.clearRect(n.x-r,n.y-r,2*r,2*r),t.restore()}}),Flotr.addType("candles",{options:{show:!1,lineWidth:1,wickLineWidth:1,candleWidth:.6,fill:!0,upFillColor:"#00A8F0",downFillColor:"#CB4B4B",fillOpacity:.5,barcharts:!1},draw:function(e){var t=e.context;t.save(),t.lineJoin="miter",t.lineCap="butt",t.lineWidth=e.wickLineWidth||e.lineWidth,this.plot(e),t.restore()},plot:function(e){var t=e.data,n=e.context,r=e.xScale,i=e.yScale,s=e.candleWidth/2,o=e.shadowSize,u=e.lineWidth,a=e.wickLineWidth,f=a%2/2,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N;if(t.length<1)return;for(N=0;N<t.length;N++){c=t[N],h=c[0],d=c[1],v=c[2],m=c[3],g=c[4],y=r(h-s),b=r(h+s),w=i(m),E=i(v),S=i(Math.min(d,g)),x=i(Math.max(d,g)),l=e[d>g?"downFillColor":"upFillColor"],e.fill&&!e.barcharts&&(n.fillStyle="rgba(0,0,0,0.05)",n.fillRect(y+o,x+o,b-y,S-x),n.save(),n.globalAlpha=e.fillOpacity,n.fillStyle=l,n.fillRect(y,x+u,b-y,S-x),n.restore());if(u||a)h=Math.floor((y+b)/2)+f,n.strokeStyle=l,n.beginPath(),e.barcharts?(n.moveTo(h,Math.floor(E+u)),n.lineTo(h,Math.floor(w+u)),T=d<g,n.moveTo(T?b:y,Math.floor(x+u)),n.lineTo(h,Math.floor(x+u)),n.moveTo(h,Math.floor(S+u)),n.lineTo(T?y:b,Math.floor(S+u))):(n.strokeRect(y,x+u,b-y,S-x),n.moveTo(h,Math.floor(x+u)),n.lineTo(h,Math.floor(E+u)),n.moveTo(h,Math.floor(S+u)),n.lineTo(h,Math.floor(w+u))),n.closePath(),n.stroke()}},hit:function(e){var t=e.xScale,n=e.yScale,r=e.data,i=e.args,s=i[0],o=e.candleWidth/2,u=i[1],a=s.relX,f=s.relY,l=r.length,c,h,p,d,v,m,g,y;for(c=0;c<l;c++){h=r[c],p=h[2],d=h[3],v=t(h[0]-o),m=t(h[0]+o),y=n(d),g=n(p);if(a>v&&a<m&&f>g&&f<y){u.x=h[0],u.index=c,u.seriesIndex=e.index;return}}},drawHit:function(e){var t=e.context;t.save(),this.plot(_.defaults({fill:!!e.fillColor,upFillColor:e.color,downFillColor:e.color,data:[e.data[e.args.index]]},e)),t.restore()},clearHit:function(e){var t=e.args,n=e.context,r=e.xScale,i=e.yScale,s=e.lineWidth,o=e.candleWidth/2,u=e.data[t.index],a=r(u[0]-o)-s,f=r(u[0]+o)+s,l=i(u[2]),c=i(u[3])+s;n.clearRect(a,l,f-a,c-l)},extendXRange:function(e,t,n){e.options.max===null&&(e.max=Math.max(e.datamax+.5,e.max),e.min=Math.min(e.datamin-.5,e.min))}}),Flotr.addType("gantt",{options:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,fillOpacity:.4,centered:!0},draw:function(e){var t=this.ctx,n=e.gantt.barWidth,r=Math.min(e.gantt.lineWidth,n);t.save(),t.translate(this.plotOffset.left,this.plotOffset.top),t.lineJoin="miter",t.lineWidth=r,t.strokeStyle=e.color,t.save(),this.gantt.plotShadows(e,n,0,e.gantt.fill),t.restore();if(e.gantt.fill){var i=e.gantt.fillColor||e.color;t.fillStyle=this.processColor(i,{opacity:e.gantt.fillOpacity})}this.gantt.plot(e,n,0,e.gantt.fill),t.restore()},plot:function(e,t,n,r){var i=e.data;if(i.length<1)return;var s=e.xaxis,o=e.yaxis,u=this.ctx,a;for(a=0;a<i.length;a++){var f=i[a][0],l=i[a][1],c=i[a][2],h=!0,p=!0,d=!0;if(l===null||c===null)continue;var v=l,m=l+c,g=f-(e.gantt.centered?t/2:0),y=f+t-(e.gantt.centered?t/2:0);if(m<s.min||v>s.max||y<o.min||g>o.max)continue;v<s.min&&(v=s.min,h=!1),m>s.max&&(m=s.max,s.lastSerie!=e&&(p=!1)),g<o.min&&(g=o.min),y>o.max&&(y=o.max,o.lastSerie!=e&&(p=!1)),r&&(u.beginPath(),u.moveTo(s.d2p(v),o.d2p(g)+n),u.lineTo(s.d2p(v),o.d2p(y)+n),u.lineTo(s.d2p(m),o.d2p(y)+n),u.lineTo(s.d2p(m),o.d2p(g)+n),u.fill(),u.closePath()),e.gantt.lineWidth&&(h||d||p)&&(u.beginPath(),u.moveTo(s.d2p(v),o.d2p(g)+n),u[h?"lineTo":"moveTo"](s.d2p(v),o.d2p(y)+n),u[p?"lineTo":"moveTo"](s.d2p(m),o.d2p(y)+n),u[d?"lineTo":"moveTo"](s.d2p(m),o.d2p(g)+n),u.stroke(),u.closePath())}},plotShadows:function(e,t,n){var r=e.data;if(r.length<1)return;var i,s,o,u,a=e.xaxis,f=e.yaxis,l=this.ctx,c=this.options.shadowSize;for(i=0;i<r.length;i++){s=r[i][0],o=r[i][1],u=r[i][2];if(o===null||u===null)continue;var h=o,p=o+u,d=s-(e.gantt.centered?t/2:0),v=s+t-(e.gantt.centered?t/2:0);if(p<a.min||h>a.max||v<f.min||d>f.max)continue;h<a.min&&(h=a.min),p>a.max&&(p=a.max),d<f.min&&(d=f.min),v>f.max&&(v=f.max);var m=a.d2p(p)-a.d2p(h)-(a.d2p(p)+c<=this.plotWidth?0:c),g=f.d2p(d)-f.d2p(v)-(f.d2p(d)+c<=this.plotHeight?0:c);l.fillStyle="rgba(0,0,0,0.05)",l.fillRect(Math.min(a.d2p(h)+c,this.plotWidth),Math.min(f.d2p(v)+c,this.plotHeight),m,g)}},extendXRange:function(e){if(e.options.max===null){var t=e.min,n=e.max,r,i,s,o,u,a={},f={},l=null;for(r=0;r<this.series.length;++r){o=this.series[r],u=o.gantt;if(u.show&&o.xaxis==e){for(i=0;i<o.data.length;i++)u.show&&(y=o.data[i][0]+"",a[y]=Math.max(a[y]||0,o.data[i][1]+o.data[i][2]),l=o);for(i in a)n=Math.max(a[i],n)}}e.lastSerie=l,e.max=n,e.min=t}},extendYRange:function(e){if(e.options.max===null){var t=Number.MIN_VALUE,n=Number.MAX_VALUE,r,i,s,o,u={},a={},f=null;for(r=0;r<this.series.length;++r){s=this.series[r],o=s.gantt;if(o.show&&!s.hide&&s.yaxis==e){var l=Number.MIN_VALUE,c=Number.MAX_VALUE;for(i=0;i<s.data.length;i++)l=Math.max(l,s.data[i][0]),c=Math.min(c,s.data[i][0]);o.centered?(t=Math.max(l+.5,t),n=Math.min(c-.5,n)):(t=Math.max(l+1,t),n=Math.min(c,n)),o.barWidth+l>t&&(t=e.max+o.barWidth)}}e.lastSerie=f,e.max=t,e.min=n,e.tickSize=Flotr.getTickSize(e.options.noTicks,n,t,e.options.tickDecimals)}}}),function(){function e(e){return typeof e=="object"&&e.constructor&&(Image?!0:e.constructor===Image)}Flotr.defaultMarkerFormatter=function(e){return Math.round(e.y*100)/100+""},Flotr.addType("markers",{options:{show:!1,lineWidth:1,color:"#000000",fill:!1,fillColor:"#FFFFFF",fillOpacity:.4,stroke:!1,position:"ct",verticalMargin:0,labelFormatter:Flotr.defaultMarkerFormatter,fontSize:Flotr.defaultOptions.fontSize,stacked:!1,stackingType:"b",horizontal:!1},stack:{positive:[],negative:[],values:[]},draw:function(e){function h(e,t){return o=r.negative[e]||0,s=r.positive[e]||0,t>0?(r.positive[e]=o+t,o+t):(r.negative[e]=s+t,s+t)}var t=e.data,n=e.context,r=e.stacked?e.stack:!1,i=e.stackingType,s,o,u,a,f,l,c;n.save(),n.lineJoin="round",n.lineWidth=e.lineWidth,n.strokeStyle="rgba(0,0,0,0.5)",n.fillStyle=e.fillStyle;for(a=0;a<t.length;++a)f=t[a][0],l=t[a][1],r&&(i=="b"?e.horizontal?l=h(l,f):f=h(f,l):i=="a"&&(u=r.values[f]||0,r.values[f]=u+l,l=u+l)),c=e.labelFormatter({x:f,y:l,index:a,data:t}),this.plot(e.xScale(f),e.yScale(l),c,e);n.restore()},plot:function(t,n,r,i){var s=i.context;if(e(r)&&!r.complete)throw"Marker image not loaded.";this._plot(t,n,r,i)},_plot:function(t,n,r,i){var s=i.context,o=2,u=t,a=n,f;e(r)?f={height:r.height,width:r.width}:f=i.text.canvas(r),f.width=Math.floor(f.width+o*2),f.height=Math.floor(f.height+o*2),i.position.indexOf("c")!=-1?u-=f.width/2+o:i.position.indexOf("l")!=-1&&(u-=f.width),i.position.indexOf("m")!=-1?a-=f.height/2+o:i.position.indexOf("t")!=-1?a-=f.height+i.verticalMargin:a+=i.verticalMargin,u=Math.floor(u)+.5,a=Math.floor(a)+.5,i.fill&&s.fillRect(u,a,f.width,f.height),i.stroke&&s.strokeRect(u,a,f.width,f.height),e(r)?s.drawImage(r,parseInt(u+o,10),parseInt(a+o,10)):Flotr.drawText(s,r,u+o,a+o,{textBaseline:"top",textAlign:"left",size:i.fontSize,color:i.color,fontFamily:i.fontFamily})}})}(),function(){var e=Flotr._;Flotr.defaultPieLabelFormatter=function(e,t){return e===0?"NaN%":(100*t/e).toFixed(2)+"%"},Flotr.addType("pie",{options:{show:!1,lineWidth:1,fill:!0,fillColor:null,fillOpacity:.6,explode:6,sizeRatio:.6,startAngle:Math.PI/4,labelFormatter:Flotr.defaultPieLabelFormatter,pie3D:!1,pie3DviewAngle:Math.PI/2*.8,pie3DspliceThickness:20,epsilon:.1},draw:function(e){var t=e.data,n=e.context,r=e.lineWidth,i=e.shadowSize,s=e.sizeRatio,o=e.height,u=e.width,a=e.explode,f=e.color,l=e.fill,c=e.fillStyle,h=Math.min(u,o)*s/2,p=t[0][1],d=[],v=1,m=this.total?Math.PI*2*p/this.total:0,g=this.startAngle||2*Math.PI*e.startAngle,y=g+m,b=g+m/2,w=e.labelFormatter(this.total,p),E=a+h+4,S=Math.cos(b)*E,x=Math.sin(b)*E,T=S<0?"right":"left",N=x>0?"top":"bottom",C,k,L;n.save(),n.translate(u/2,o/2),n.scale(1,v),k=Math.cos(b)*a,L=Math.sin(b)*a,C={size:e.fontSize*1.2,color:e.fontColor,weight:1.5};if(!this.total){C.textAlign=T,C.textBaseline=N,Flotr.drawText(n,"NaN%",0,0,C),n.restore();return}i>0&&(this.plotSlice(k+i,L+i,h,g,y,n),l&&(n.fillStyle="rgba(0,0,0,0.1)",n.fill())),this.plotSlice(k,L,h,g,y,n),l&&(n.fillStyle=c,n.fill()),n.lineWidth=r,n.strokeStyle=f,n.stroke(),C={size:e.fontSize*1.2,color:e.fontColor,weight:1.5,fontFamily:e.fontFamily},w&&(e.htmlText||!e.textEnabled?(divStyle="position:absolute;"+N+":"+(o/2+(N==="top"?x:-x))+"px;",divStyle+=T+":"+(u/2+(T==="right"?-S:S))+"px;",d.push('<div style="',divStyle,'" class="flotr-grid-label">',w,"</div>")):(C.textAlign=T,C.textBaseline=N,Flotr.drawText(n,w,S,x,C)));if(e.htmlText||!e.textEnabled){var A=Flotr.DOM.node('<div style="color:'+e.fontColor+'" class="flotr-labels"></div>');Flotr.DOM.insert(A,d.join("")),Flotr.DOM.insert(e.element,A)}n.restore(),this.total&&(this.startAngle=y,this.slices=this.slices||[],this.slices.push({radius:h,x:k,y:L,explode:a,start:g,end:y}))},plotSlice:function(e,t,n,r,i,s){s.beginPath(),s.moveTo(e,t),s.arc(e,t,n,r,i,!1),s.lineTo(e,t),s.closePath()},hit:function(e){if(!this.total)return;var t=e.data[0],n=e.args,r=e.index,i=n[0],s=n[1],o=this.slices[r],u=i.relX-e.width/2,a=i.relY-e.height/2,f=Math.sqrt(u*u+a*a),l=Math.atan(a/u),c=Math.PI*2,h=o.explode||e.explode,p=o.start%c,d=o.end%c,v=e.epsilon;u<0?l+=Math.PI:u>0&&a<0&&(l+=c),f<o.radius+h&&f>h&&(l>p&&l<d||p>d&&(l<d||l>p)||p===d&&(o.start===o.end&&Math.abs(l-p)<v||o.start!==o.end&&Math.abs(l-p)>v))&&(s.x=t[0],s.y=t[1],s.sAngle=p,s.eAngle=d,s.index=0,s.seriesIndex=r,s.fraction=this.total?t[1]/this.total:NULL)},drawHit:function(e){var t=e.context,n=this.slices[e.args.seriesIndex];t.save(),t.translate(e.width/2,e.height/2),this.plotSlice(n.x,n.y,n.radius,n.start,n.end,t),t.stroke(),t.restore()},clearHit:function(e){var t=e.context,n=this.slices[e.args.seriesIndex],r=2*e.lineWidth,i=n.radius+r;t.save(),t.translate(e.width/2,e.height/2),t.clearRect(n.x-i,n.y-i,2*i+r,2*i+r),t.restore()},extendYRange:function(e,t){this.total=(this.total||0)+t[0][1]}})}(),Flotr.addType("points",{options:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#FFFFFF",fillOpacity:1,hitRadius:null},draw:function(e){var t=e.context,n=e.lineWidth,r=e.shadowSize;t.save(),r>0&&(t.lineWidth=r/2,t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,r/2+t.lineWidth/2),t.strokeStyle="rgba(0,0,0,0.2)",this.plot(e,t.lineWidth/2)),t.lineWidth=e.lineWidth,t.strokeStyle=e.color,e.fill&&(t.fillStyle=e.fillStyle),this.plot(e),t.restore()},plot:function(e,t){var n=e.data,r=e.context,i=e.xScale,s=e.yScale,o,u,a;for(o=n.length-1;o>-1;--o){a=n[o][1];if(a===null)continue;u=i(n[o][0]),a=s(a);if(u<0||u>e.width||a<0||a>e.height)continue;r.beginPath(),t?r.arc(u,a+t,e.radius,0,Math.PI,!1):(r.arc(u,a,e.radius,0,2*Math.PI,!0),e.fill&&r.fill()),r.stroke(),r.closePath()}}}),Flotr.addType("radar",{options:{show:!1,lineWidth:2,fill:!0,fillOpacity:.4,radiusRatio:.9,sensibility:2},draw:function(e){var t=e.context,n=e.shadowSize;t.save(),t.translate(e.width/2,e.height/2),t.lineWidth=e.lineWidth,t.fillStyle="rgba(0,0,0,0.05)",t.strokeStyle="rgba(0,0,0,0.05)",this.plot(e,n/2),t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,n/4),t.strokeStyle=e.color,t.fillStyle=e.fillStyle,this.plot(e),t.restore()},plot:function(e,t){var n=e.data,r=e.context,i=Math.min(e.height,e.width)*e.radiusRatio/2,s=2*Math.PI/n.length,o=-Math.PI/2,u,a;t=t||0,r.beginPath();for(u=0;u<n.length;++u)a=n[u][1]/this.max,r[u===0?"moveTo":"lineTo"](Math.cos(u*s+o)*i*a+t,Math.sin(u*s+o)*i*a+t);r.closePath(),e.fill&&r.fill(),r.stroke()},getGeometry:function(e,t){var n=Math.min(t.height,t.width)*t.radiusRatio/2,r=2*Math.PI/t.data.length,i=-Math.PI/2,s=e[1]/this.max;return{x:Math.cos(e[0]*r+i)*n*s+t.width/2,y:Math.sin(e[0]*r+i)*n*s+t.height/2}},hit:function(e){var t=e.args,n=t[0],r=t[1],i=n.relX,s=n.relY,o,u,a,f;for(var l=0;l<r.series.length;l++){var c=r.series[l],h=c.data;for(var p=h.length;p--;){u=this.getGeometry(h[p],e),a=u.x-i,f=u.y-s,o=Math.sqrt(a*a+f*f);if(o<e.sensibility*2)return r.x=h[p][0],r.y=h[p][1],r.index=p,r.seriesIndex=l,r}}},drawHit:function(e){var t=2*Math.PI/e.data.length,n=-Math.PI/2,r=Math.min(e.height,e.width)*e.radiusRatio/2,i=e.args.series,s=i.points.hitRadius||i.points.radius||i.mouse.radius,o=e.context;o.translate(e.width/2,e.height/2);var u=e.args.index,a=e.data[u][1]/this.max,f=Math.cos(u*t+n)*r*a,l=Math.sin(u*t+n)*r*a;o.beginPath(),o.arc(f,l,s,0,2*Math.PI,!0),o.closePath(),o.stroke()},clearHit:function(e){var t=2*Math.PI/e.data.length,n=-Math.PI/2,r=Math.min(e.height,e.width)*e.radiusRatio/2,i=e.context,s=e.args.series,o=s.points?s.points.lineWidth:1;offset=(s.points.hitRadius||s.points.radius||s.mouse.radius)+o,i.translate(e.width/2,e.height/2);var u=e.args.index,a=e.data[u][1]/this.max,f=Math.cos(u*t+n)*r*a,l=Math.sin(u*t+n)*r*a;i.clearRect(f-offset,l-offset,offset*2,offset*2)},extendYRange:function(e,t){this.max=Math.max(e.max,this.max||-Number.MAX_VALUE)}}),Flotr.addType("timeline",{options:{show:!1,lineWidth:1,barWidth:.2,fill:!0,fillColor:null,fillOpacity:.4,centered:!0},draw:function(e){var t=e.context;t.save(),t.lineJoin="miter",t.lineWidth=e.lineWidth,t.strokeStyle=e.color,t.fillStyle=e.fillStyle,this.plot(e),t.restore()},plot:function(e){var t=e.data,n=e.context,r=e.xScale,i=e.yScale,s=e.barWidth,o=e.lineWidth,u;Flotr._.each(t,function(e){var t=e[0],u=e[1],a=e[2],f=s,l=Math.ceil(r(t)),c=Math.ceil(r(t+a))-l,h=Math.round(i(u)),p=Math.round(i(u-f))-h,d=l-o/2,v=Math.round(h-p/2)-o/2;n.strokeRect(d,v,c,p),n.fillRect(d,v,c,p)})},extendRange:function(e){var t=e.data,n=e.xaxis,r=e.yaxis,i=e.timeline.barWidth;n.options.min===null&&(n.min=n.datamin-i/2);if(n.options.max===null){var s=n.max;Flotr._.each(t,function(e){s=Math.max(s,e[0]+e[2])},this),n.max=s+i/2}r.options.min===null&&(r.min=r.datamin-i),r.options.min===null&&(r.max=r.datamax+i)}}),function(){var e=Flotr.DOM;Flotr.addPlugin("crosshair",{options:{mode:null,color:"#FF0000",hideCursor:!0},callbacks:{"flotr:mousemove":function(e,t){this.options.crosshair.mode&&(this.crosshair.clearCrosshair(),this.crosshair.drawCrosshair(t))}},drawCrosshair:function(t){var n=this.octx,r=this.options.crosshair,i=this.plotOffset,s=i.left+Math.round(t.relX)+.5,o=i.top+Math.round(t.relY)+.5;if(t.relX<0||t.relY<0||t.relX>this.plotWidth||t.relY>this.plotHeight){this.el.style.cursor=null,e.removeClass(this.el,"flotr-crosshair");return}r.hideCursor&&(this.el.style.cursor="none",e.addClass(this.el,"flotr-crosshair")),n.save(),n.strokeStyle=r.color,n.lineWidth=1,n.beginPath(),r.mode.indexOf("x")!=-1&&(n.moveTo(s,i.top),n.lineTo(s,i.top+this.plotHeight)),r.mode.indexOf("y")!=-1&&(n.moveTo(i.left,o),n.lineTo(i.left+this.plotWidth,o)),n.stroke(),n.restore()},clearCrosshair:function(){var e=this.plotOffset,t=this.lastMousePos,n=this.octx;t&&(n.clearRect(Math.round(t.relX)+e.left,e.top,1,this.plotHeight+1),n.clearRect(e.left,Math.round(t.relY)+e.top,this.plotWidth+1,1))}})}(),function(){function n(e,t,n,r,i,s){var o="image/"+e,u=n.getImageData(0,0,r,i),a=new Image;return n.save(),n.globalCompositeOperation="destination-over",n.fillStyle=s,n.fillRect(0,0,r,i),a.src=t.toDataURL(o),n.restore(),n.clearRect(0,0,r,i),n.putImageData(u,0,0),a}var e=Flotr.DOM,t=Flotr._;Flotr.addPlugin("download",{saveImage:function(r,i,s,o){var u=this.options.grid,a;if(Flotr.isIE&&Flotr.isIE<9)return a="<html><body>"+this.canvas.firstChild.innerHTML+"</body></html>",window.open().document.write(a);if(r!=="jpeg"&&r!=="png")return;a=n(r,this.canvas,this.ctx,this.canvasWidth,this.canvasHeight,u&&u.backgroundColor||"#ffffff");if(!t.isElement(a)||!o){var f=navigator.userAgent,l=Flotr.isIE||(new RegExp(/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i)).test(f)||(new RegExp(/(edge)\/((\d+)?[\w\.]+)/i)).test(f);return l?window.open("about:blank").document.body.innerHTML='<img src="'+a.src+'">':window.open(a.src)}this.download.restoreCanvas(),e.hide(this.canvas),e.hide(this.overlay),e.setStyles({position:"absolute"}),e.insert(this.el,a),this.saveImageElement=a},restoreCanvas:function(){e.show(this.canvas),e.show(this.overlay),this.saveImageElement&&this.el.removeChild(this.saveImageElement),this.saveImageElement=null}})}(),function(){var e=Flotr.EventAdapter,t=Flotr._;Flotr.addPlugin("graphGrid",{callbacks:{"flotr:beforedraw":function(){this.graphGrid.drawGrid()},"flotr:afterdraw":function(){this.graphGrid.drawOutline()}},drawGrid:function(){function v(e){for(p=0;p<e.length;++p){var t=e[p].v/c.max;for(d=0;d<=w;++d)n[d===0?"moveTo":"lineTo"](Math.cos(d*S+x)*b*t,Math.sin(d*S+x)*b*t)}}function m(e,r){t.each(t.pluck(e,"v"),function(e){if(e<=c.min||e>=c.max||(e==c.min||e==c.max)&&i.outlineWidth)return;r(Math.floor(c.d2p(e))+n.lineWidth/2)})}function g(e){n.moveTo(e,0),n.lineTo(e,f)}function y(e){n.moveTo(0,e),n.lineTo(l,e)}var n=this.ctx,r=this.options,i=r.grid,s=i.verticalLines,o=i.horizontalLines,u=i.minorVerticalLines,a=i.minorHorizontalLines,f=this.plotHeight,l=this.plotWidth,c,h,p,d;(s||u||o||a)&&e.fire(this.el,"flotr:beforegrid",[this.axes.x,this.axes.y,r,this]),n.save(),n.lineWidth=1,n.strokeStyle=i.tickColor;if(i.circular){n.translate(this.plotOffset.left+l/2,this.plotOffset.top+f/2);var b=Math.min(f,l)*r.radar.radiusRatio/2,w=this.axes.x.ticks.length,S=2*(Math.PI/w),x=-Math.PI/2;n.beginPath(),c=this.axes.y,o&&v(c.ticks),a&&v(c.minorTicks),s&&t.times(w,function(e){n.moveTo(0,0),n.lineTo(Math.cos(e*S+x)*b,Math.sin(e*S+x)*b)}),n.stroke()}else n.translate(this.plotOffset.left,this.plotOffset.top),i.backgroundColor&&(n.fillStyle=this.processColor(i.backgroundColor,{x1:0,y1:0,x2:l,y2:f}),n.fillRect(0,0,l,f)),n.beginPath(),c=this.axes.x,s&&m(c.ticks,g),u&&m(c.minorTicks,g),c=this.axes.y,o&&m(c.ticks,y),a&&m(c.minorTicks,y),n.stroke();n.restore(),(s||u||o||a)&&e.fire(this.el,"flotr:aftergrid",[this.axes.x,this.axes.y,r,this])},drawOutline:function(){var e=this,t=e.options,n=t.grid,r=n.outline,s=e.ctx,o=n.backgroundImage,u=e.plotOffset,a=u.left,f=u.top,l=e.plotWidth,c=e.plotHeight,h,p,d,v,m,g;if(!n.outlineWidth)return;s.save();if(n.circular){s.translate(a+l/2,f+c/2);var y=Math.min(c,l)*t.radar.radiusRatio/2,b=this.axes.x.ticks.length,w=2*(Math.PI/b),E=-Math.PI/2;s.beginPath(),s.lineWidth=n.outlineWidth,s.strokeStyle=n.color,s.lineJoin="round";for(i=0;i<=b;++i)s[i===0?"moveTo":"lineTo"](Math.cos(i*w+E)*y,Math.sin(i*w+E)*y);s.stroke()}else{s.translate(a,f);var S=n.outlineWidth,x=.5-S+(S+1)%2/2,T="lineTo",N="moveTo";s.lineWidth=S,s.strokeStyle=n.color,s.lineJoin="miter",s.beginPath(),s.moveTo(x,x),l-=S/2%1,c+=S/2,s[r.indexOf("n")!==-1?T:N](l,x),s[r.indexOf("e")!==-1?T:N](l,c),s[r.indexOf("s")!==-1?T:N](x,c),s[r.indexOf("w")!==-1?T:N](x,x),s.stroke(),s.closePath()}s.restore(),o&&(d=o.src||o,v=(parseInt(o.left,10)||0)+u.left,m=(parseInt(o.top,10)||0)+u.top,p=new Image,p.onload=function(){s.save(),o.alpha&&(s.globalAlpha=o.alpha),s.globalCompositeOperation="destination-over",s.drawImage(p,0,0,p.width,p.height,v,m,l,c),s.restore()},p.src=d)}})}(),function(){var e=Flotr.DOM,t=Flotr._,n=Flotr,r="opacity:0.7;background-color:#000;color:#fff;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;";Flotr.addPlugin("hit",{callbacks:{"flotr:mousemove":function(e,t){this.hit.track(t)},"flotr:click":function(e){var n=this.hit.track(e);n&&!t.isUndefined(n.index)&&(e.hit=n)},"flotr:mouseout":function(e){e.relatedTarget!==this.mouseTrack&&this.hit.clearHit()},"flotr:destroy":function(){this.options.mouse.container&&e.remove(this.mouseTrack),this.mouseTrack=null}},track:function(e){if(this.options.mouse.track||t.any(this.series,function(e){return e.mouse&&e.mouse.track}))return this.hit.hit(e)},executeOnType:function(e,r,i){function u(e,u){t.each(t.keys(n.graphTypes),function(t){e[t]&&e[t].show&&!e.hide&&this[t][r]&&(o=this.getOptions(e,t),o.fill=!!e.mouse.fillColor,o.fillStyle=this.processColor(e.mouse.fillColor||"#ffffff",{opacity:e.mouse.fillOpacity}),o.color=e.mouse.lineColor,o.context=this.octx,o.index=u,i&&(o.args=i),this[t][r].call(this[t],o),s=!0)},this)}var s=!1,o;return t.isArray(e)||(e=[e]),t.each(e,u,this),s},drawHit:function(e){var t=this.octx,n=e.series;if(n.mouse.lineColor){t.save(),t.lineWidth=n.points?n.points.lineWidth:1,t.strokeStyle=n.mouse.lineColor,t.fillStyle=this.processColor(n.mouse.fillColor||"#ffffff",{opacity:n.mouse.fillOpacity}),t.translate(this.plotOffset.left,this.plotOffset.top);if(!this.hit.executeOnType(n,"drawHit",e)){var r=e.xaxis,i=e.yaxis;t.beginPath(),t.arc(r.d2p(e.x),i.d2p(e.y),n.points.hitRadius||n.points.radius||n.mouse.radius,0,2*Math.PI,!0),t.fill(),t.stroke(),t.closePath()}t.restore(),this.clip(t)}this.prevHit=e},clearHit:function(){var t=this.prevHit,n=this.octx,r=this.plotOffset;n.save(),n.translate(r.left,r.top);if(t){if(!this.hit.executeOnType(t.series,"clearHit",this.prevHit)){var i=t.series,s=i.points?i.points.lineWidth:1;offset=(i.points.hitRadius||i.points.radius||i.mouse.radius)+s,n.clearRect(t.xaxis.d2p(t.x)-offset,t.yaxis.d2p(t.y)-offset,offset*2,offset*2)}e.hide(this.mouseTrack),this.prevHit=null}n.restore()},hit:function(e){var n=this.options,r=this.prevHit,i,s,o,u,a,f,l,c,h;if(this.series.length===0)return;h={relX:e.relX,relY:e.relY,absX:e.absX,absY:e.absY,series:this.series};if(n.mouse.trackY&&!n.mouse.trackAll&&this.hit.executeOnType(this.series,"hit",[e,h])&&!t.isUndefined(h.seriesIndex))a=this.series[h.seriesIndex],h.series=a,h.mouse=a.mouse,h.xaxis=a.xaxis,h.yaxis=a.yaxis;else{i=this.hit.closest(e);if(i){i=n.mouse.trackY?i.point:i.x,u=i.seriesIndex,a=this.series[u],l=a.xaxis,c=a.yaxis,s=2*a.mouse.sensibility;if(n.mouse.trackAll||i.distanceX<s/l.scale&&(!n.mouse.trackY||i.distanceY<s/c.scale))h.series=a,h.xaxis=a.xaxis,h.yaxis=a.yaxis,h.mouse=a.mouse,h.x=i.x,h.y=i.y,h.dist=i.distance,h.index=i.dataIndex,h.seriesIndex=u}}if(!r||r.index!==h.index||r.seriesIndex!==h.seriesIndex)this.hit.clearHit(),h.series&&h.mouse&&h.mouse.track&&(this.hit.drawMouseTrack(h),this.hit.drawHit(h),Flotr.EventAdapter.fire(this.el,"flotr:hit",[h,this]));return h},closest:function(e){function E(e){e.distance=h,e.distanceX=p,e.distanceY=d,e.seriesIndex=b,e.dataIndex=w,e.x=g,e.y=y,f=!0}var t=this.series,n=this.options,r=e.relX,i=e.relY,s=Number.MAX_VALUE,o=Number.MAX_VALUE,u={},a={},f=!1,l,c,h,p,d,v,m,g,y,b,w;for(b=0;b<t.length;b++){l=t[b];if(l.hide===!0)continue;c=l.data,v=l.xaxis.p2d(r),m=l.yaxis.p2d(i);if(l.hide)continue;for(w=c.length;w--;){g=c[w][0],y=c[w][1],c[w].y0&&(y+=c[w].y0);if(g===null||y===null)continue;if(g<l.xaxis.min||g>l.xaxis.max)continue;p=Math.abs(g-v),d=Math.abs(y-m),h=p*p+d*d,h<s&&(s=h,E(u)),p<o&&(o=p,E(a))}}return f?{point:u,x:a}:!1},drawMouseTrack:function(n){var i="",s=n.series,o=n.mouse.position,u=n.mouse.margin,a=n.x,f=n.y,l=r,c=this.mouseTrack,h=this.plotOffset,p=h.left,d=h.right,v=h.bottom,m=h.top,g=n.mouse.trackDecimals,y=this.options,b=y.mouse.container,w=0,E=0,S,x,T;c||(c=e.node('<div class="flotr-mouse-value" style="'+l+'"></div>'),this.mouseTrack=c,e.insert(b||this.el,c));if(!g||g<0)g=0;a&&a.toFixed&&(a=a.toFixed(g)),f&&f.toFixed&&(f=f.toFixed(g)),T=n.mouse.trackFormatter({x:a,y:f,series:n.series,index:n.index,nearest:n,fraction:n.fraction});if(t.isNull(T)||t.isUndefined(T)){e.hide(c);return}c.innerHTML=T,e.show(c);if(!o)return;x=e.size(c),b&&(S=e.position(this.el),w=S.top,E=S.left);if(!n.mouse.relative)i+="top:",o.charAt(0)=="n"?i+=w+u+m:o.charAt(0)=="s"&&(i+=w-u+m+this.plotHeight-x.height),i+="px;bottom:auto;left:",o.charAt(1)=="e"?i+=E-u+p+this.plotWidth-x.width:o.charAt(1)=="w"&&(i+=E+u+p),i+="px;right:auto;";else if(s.pie&&s.pie.show){var N={x:this.plotWidth/2,y:this.plotHeight/2},C=Math.min(this.canvasWidth,this.canvasHeight)*s.pie.sizeRatio/2,k=n.sAngle<n.eAngle?(n.sAngle+n.eAngle)/2:(n.sAngle+n.eAngle+2*Math.PI)/2;i+="bottom:"+(u-m-N.y-Math.sin(k)*C/2+this.canvasHeight)+"px;top:auto;",i+="left:"+(u+p+N.x+Math.cos(k)*C/2)+"px;right:auto;"}else i+="top:",/n/.test(o)?i+=w-u+m+n.yaxis.d2p(n.y)-x.height:i+=w+u+m+n.yaxis.d2p(n.y),i+="px;bottom:auto;left:",/w/.test(o)?i+=E-u+p+n.xaxis.d2p(n.x)-x.width:i+=E+u+p+n.xaxis.d2p(n.x),i+="px;right:auto;";c.style.cssText=l+i,n.mouse.relative&&(/[ew]/.test(o)?/[ns]/.test(o)||(c.style.top=w+m+n.yaxis.d2p(n.y)-e.size(c).height/2+"px"):c.style.left=E+p+n.xaxis.d2p(n.x)-e.size(c).width/2+"px")}})}(),function(){function e(e,t){return e.which?e.which===1:e.button===0||e.button===1}function t(e,t){return Math.min(Math.max(0,e),t.plotWidth-1)}function n(e,t){return Math.min(Math.max(0,e),t.plotHeight)}var r=Flotr.DOM,i=Flotr.EventAdapter,s=Flotr._;Flotr.addPlugin("selection",{options:{pinchOnly:null,mode:null,color:"#B6D9FF",fps:20},callbacks:{"flotr:mouseup":function(e){var t=this.options.selection,n=this.selection,r=this.getEventPosition(e);if(!t||!t.mode)return;n.interval&&clearInterval(n.interval),this.multitouches?n.updateSelection():t.pinchOnly||n.setSelectionPos(n.selection.second,r),n.clearSelection(),n.selecting&&n.selectionIsSane()&&(n.drawSelection(),n.fireSelectEvent(),this.ignoreClick=!0)},"flotr:mousedown":function(t){var n=this.options.selection,r=this.selection,i=this.getEventPosition(t);if(!n||!n.mode)return;if(!n.mode||!e(t)&&s.isUndefined(t.touches))return;n.pinchOnly||r.setSelectionPos(r.selection.first,i),r.interval&&clearInterval(r.interval),this.lastMousePos.pageX=null,r.selecting=!1,r.interval=setInterval(s.bind(r.updateSelection,this),1e3/n.fps)},"flotr:destroy":function(e){clearInterval(this.selection.interval)}},getArea:function(){var e=this.selection.selection,t=this.axes,n=e.first,r=e.second,i,s,o,u;return i=t.x.p2d(e.first.x),s=t.x.p2d(e.second.x),o=t.y.p2d(e.first.y),u=t.y.p2d(e.second.y),{x1:Math.min(i,s),y1:Math.min(o,u),x2:Math.max(i,s),y2:Math.max(o,u),xfirst:i,xsecond:s,yfirst:o,ysecond:u}},selection:{first:{x:-1,y:-1},second:{x:-1,y:-1}},prevSelection:null,interval:null,fireSelectEvent:function(e){var t=this.selection.getArea();e=e||"select",t.selection=this.selection.selection,i.fire(this.el,"flotr:"+e,[t,this])},setSelection:function(e,r){var i=this.options,s=this.axes.x,o=this.axes.y,u=o.scale,a=s.scale,f=i.selection.mode.indexOf("x")!=-1,l=i.selection.mode.indexOf("y")!=-1,c=this.selection.selection;this.selection.clearSelection(),c.first.y=n(f&&!l?0:(o.max-e.y1)*u,this),c.second.y=n(f&&!l?this.plotHeight-1:(o.max-e.y2)*u,this),c.first.x=t(l&&!f?0:(e.x1-s.min)*a,this),c.second.x=t(l&&!f?this.plotWidth:(e.x2-s.min)*a,this),this.selection.drawSelection(),r||this.selection.fireSelectEvent()},setSelectionPos:function(e,r){var i=this.options.selection.mode,s=this.selection.selection;i.indexOf("x")==-1?e.x=e==s.first?0:this.plotWidth:e.x=t(r.relX,this),i.indexOf("y")==-1?e.y=e==s.first?0:this.plotHeight-1:e.y=n(r.relY,this)},drawSelection:function(){this.selection.fireSelectEvent("selecting");var e=this.selection.selection,t=this.octx,n=this.options,r=this.plotOffset,i=this.selection.prevSelection;if(i&&e.first.x==i.first.x&&e.first.y==i.first.y&&e.second.x==i.second.x&&e.second.y==i.second.y)return;t.save(),t.strokeStyle=this.processColor(n.selection.color,{opacity:.8}),t.lineWidth=1,t.lineJoin="miter",t.fillStyle=this.processColor(n.selection.color,{opacity:.4}),this.selection.prevSelection={first:{x:e.first.x,y:e.first.y},second:{x:e.second.x,y:e.second.y}};var s=Math.min(e.first.x,e.second.x),o=Math.min(e.first.y,e.second.y),u=Math.abs(e.second.x-e.first.x),a=Math.abs(e.second.y-e.first.y);t.fillRect(s+r.left+.5,o+r.top+.5,u,a),t.strokeRect(s+r.left+.5,o+r.top+.5,u,a),t.restore()},updateSelection:function(){if(!this.lastMousePos.pageX)return;this.selection.selecting=!0;if(this.multitouches)this.selection.setSelectionPos(this.selection.selection.first,this.getEventPosition(this.multitouches[0])),this.selection.setSelectionPos(this.selection.selection.second,this.getEventPosition(this.multitouches[1]));else{if(this.options.selection.pinchOnly)return;this.selection.setSelectionPos(this.selection.selection.second,this.lastMousePos)}this.selection.clearSelection(),this.selection.selectionIsSane()&&this.selection.drawSelection()},clearSelection:function(){if(!this.selection.prevSelection)return;var e=this.selection.prevSelection,t=1,n=this.plotOffset,r=Math.min(e.first.x,e.second.x),i=Math.min(e.first.y,e.second.y),s=Math.abs(e.second.x-e.first.x),o=Math.abs(e.second.y-e.first.y);this.octx.clearRect(r+n.left-t+.5,i+n.top-t,s+2*t+.5,o+2*t+.5),this.selection.prevSelection=null},selectionIsSane:function(){var e=this.selection.selection;return Math.abs(e.second.x-e.first.x)>=5||Math.abs(e.second.y-e.first.y)>=5}})}(),function(){var e=Flotr.DOM;Flotr.addPlugin("labels",{callbacks:{"flotr:afterdraw":function(){this.labels.draw()}},draw:function(){function b(e,t,r){var i=r?t.minorTicks:t.ticks,s=t.orientation===1,u=t.n===1,l,h;l={color:t.options.color||d.grid.color,angle:Flotr.toRad(t.options.labelsAngle),textBaseline:"middle",fontFamily:d.fontFamily};for(c=0;c<i.length&&(r?t.options.showMinorLabels:t.options.showLabels);++c){n=i[c],n.label+="";if(!n.label||!n.label.length)continue;x=Math.cos(c*a+f)*o,y=Math.sin(c*a+f)*o,l.textAlign=s?Math.abs(x)<.1?"center":x<0?"right":"left":"left",Flotr.drawText(v,n.label,s?x:3,s?y:-(t.ticks[c].v/t.max)*(o-d.fontSize),l)}}function w(e,t,r,i){function f(e){return e.options.showLabels&&e.used}function l(e,t,n,r){return e.plotOffset.left+(t?r:n?-d.grid.labelMargin:d.grid.labelMargin+e.plotWidth)}function h(e,t,n,r){return e.plotOffset.top+(t?d.grid.labelMargin:r)+(t&&n?e.plotHeight:0)}var s=t.orientation===1,o=t.n===1,u,a;u={color:t.options.color||d.grid.color,textAlign:r,textBaseline:i,angle:Flotr.toRad(t.options.labelsAngle),fontFamily:d.fontFamily,size:d.fontSize},u=Flotr.getBestTextAlign(u.angle,u);for(c=0;c<t.ticks.length&&f(t);++c){n=t.ticks[c];if(!n.label||!n.label.length)continue;a=t.d2p(n.v);if(a<0||a>(s?e.plotWidth:e.plotHeight))continue;Flotr.drawText(v,n.label,l(e,s,o,a),h(e,s,o,a),u),!s&&!o&&(v.save(),v.strokeStyle=u.color,v.beginPath(),v.moveTo(e.plotOffset.left+e.plotWidth-8,e.plotOffset.top+t.d2p(n.v)),v.lineTo(e.plotOffset.left+e.plotWidth,e.plotOffset.top+t.d2p(n.v)),v.stroke(),v.restore())}}function E(e,t){var r=t.orientation===1,i=t.n===1,o="",u,a,f,l=e.plotOffset;!r&&!i&&(v.save(),v.strokeStyle=t.options.color||d.grid.color,v.beginPath());if(t.options.showLabels&&(i?!0:t.used))for(c=0;c<t.ticks.length;++c){n=t.ticks[c];if(!n.label||!n.label.length||(r?l.left:l.top)+t.d2p(n.v)<0||(r?l.left:l.top)+t.d2p(n.v)>(r?e.canvasWidth:e.canvasHeight))continue;f=l.top+(r?(i?1:-1)*(e.plotHeight+d.grid.labelMargin):t.d2p(n.v)-t.maxLabel.height/2),u=r?l.left+t.d2p(n.v)-s/2:0,o="",c===0?o=" first":c===t.ticks.length-1&&(o=" last"),o+=r?" flotr-grid-label-x":" flotr-grid-label-y",h+=['<div style="position:absolute; text-align:'+(r?"center":"right")+"; ","top:"+f+"px; ",(!r&&!i?"right:":"left:")+u+"px; ","width:"+(r?s:(i?l.left:l.right)-d.grid.labelMargin)+"px; ",t.options.color?"color:"+t.options.color+"; ":" ",'" class="flotr-grid-label'+o+'">'+n.label+"</div>"].join(" "),!r&&!i&&(v.moveTo(l.left+e.plotWidth-8,l.top+t.d2p(n.v)),v.lineTo(l.left+e.plotWidth,l.top+t.d2p(n.v)))}}var t,n,r,i,s,o,u,a,f,l,c,h="",p=0,d=this.options,v=this.ctx,m=this.axes,g={size:d.fontSize};for(c=0;c<m.x.ticks.length;++c)m.x.ticks[c].label&&++p;s=this.plotWidth/p,d.grid.circular&&(v.save(),v.translate(this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+this.plotHeight/2),o=this.plotHeight*d.radar.radiusRatio/2+d.fontSize,u=this.axes.x.ticks.length,a=2*(Math.PI/u),f=-Math.PI/2,b(this,m.x,!1),b(this,m.x,!0),b(this,m.y,!1),b(this,m.y,!0),v.restore()),!d.HtmlText&&this.textEnabled?(w(this,m.x,"center","top"),w(this,m.x2,"center","bottom"),w(this,m.y,"right","middle"),w(this,m.y2,"left","middle")):(m.x.options.showLabels||m.x2.options.showLabels||m.y.options.showLabels||m.y2.options.showLabels)&&!d.grid.circular&&(h="",E(this,m.x),E(this,m.x2),E(this,m.y),E(this,m.y2),v.stroke(),v.restore(),l=e.create("div"),e.setStyles(l,{fontSize:"smaller",color:d.grid.color}),l.className="flotr-labels",e.insert(this.el,l),e.insert(l,h))}})}(),function(){var e=Flotr.DOM,t=Flotr._;Flotr.addPlugin("legend",{options:{show:!0,noColumns:1,labelFormatter:function(e){return e},labelBoxBorderColor:"#CCCCCC",labelBoxWidth:14,labelBoxHeight:10,labelBoxMargin:5,container:null,position:"nw",margin:5,backgroundColor:"#F0F0F0",backgroundOpacity:.85},callbacks:{"flotr:afterinit":function(){this.legend.insertLegend()},"flotr:destroy":function(){var t=this.legend.markup;t&&(this.legend.markup=null,e.remove(t))}},insertLegend:function(){if(!this.options.legend.show)return;var n=this.series,r=this.plotOffset,i=this.options,s=i.legend,o=[],u=!1,a=this.ctx,f=t.filter(n,function(e){return e.label&&!e.hide}).length,l=s.position,c=s.margin,h=s.backgroundOpacity,p,d,v;if(f){var m=s.labelBoxWidth,g=s.labelBoxHeight,y=s.labelBoxMargin,b=r.left+c,w=r.top+c,E=0,S={size:i.fontSize*1.1,color:i.grid.color,fontFamily:i.fontFamily};for(p=n.length-1;p>-1;--p){if(!n[p].label||n[p].hide)continue;d=s.labelFormatter(n[p].label),E=Math.max(E,this._text.measureText(d,S).width)}var x=Math.round(m+y*3+E),T=Math.round(f*(y+g)+y);!h&&h!==0&&(h=.1);if(!i.HtmlText&&this.textEnabled&&!s.container){l.charAt(0)=="s"&&(w=r.top+this.plotHeight-(c+T)),l.charAt(0)=="c"&&(w=r.top+this.plotHeight/2-(c+T/2)),l.charAt(1)=="e"&&(b=r.left+this.plotWidth-(c+x)),v=this.processColor(s.backgroundColor,{opacity:h}),a.fillStyle=v,a.fillRect(b,w,x,T),a.strokeStyle=s.labelBoxBorderColor,a.strokeRect(Flotr.toPixel(b),Flotr.toPixel(w),x,T);var N=b+y,C=w+y;for(p=0;p<n.length;p++){if(!n[p].label||n[p].hide)continue;d=s.labelFormatter(n[p].label),a.fillStyle=n[p].color,a.fillRect(N,C,m-1,g-1),a.strokeStyle=s.labelBoxBorderColor,a.lineWidth=1,a.strokeRect(Math.ceil(N)-1.5,Math.ceil(C)-1.5,m+2,g+2),Flotr.drawText(a,d,N+m+y,C+g,S),C+=g+y}}else{for(p=0;p<n.length;++p){if(!n[p].label||n[p].hide)continue;p%s.noColumns===0&&(o.push(u?"</tr><tr>":"<tr>"),u=!0);var k=n[p],L=s.labelBoxWidth,A=s.labelBoxHeight;d=s.labelFormatter(k.label),v="background-color:"+(k.bars&&k.bars.show&&k.bars.fillColor&&k.bars.fill?k.bars.fillColor:k.color)+";",o.push('<td class="flotr-legend-color-box">','<div style="border:1px solid ',s.labelBoxBorderColor,';padding:1px">','<div style="width:',L-1,"px;height:",A-1,"px;border:1px solid ",n[p].color,'">','<div style="width:',L,"px;height:",A,"px;",v,'"></div>',"</div>","</div>","</td>",'<td class="flotr-legend-label">',d,"</td>")}u&&o.push("</tr>");if(o.length>0){var O='<table style="font-size:smaller;color:'+i.grid.color+'">'+o.join("")+"</table>";if(s.container)typeof jQuery!="undefined"?jQuery(s.container).html(O):(O=e.node(O),this.legend.markup=O,e.insert(s.container,O));else{var M={position:"absolute",zIndex:"2",border:"1px solid "+s.labelBoxBorderColor};l.charAt(0)=="n"?(M.top=c+r.top+"px",M.bottom="auto"):l.charAt(0)=="c"?(M.top=c+(this.plotHeight-T)/2+"px",M.bottom="auto"):l.charAt(0)=="s"&&(M.bottom=c+r.bottom+"px",M.top="auto"),l.charAt(1)=="e"?(M.right=c+r.right+"px",M.left="auto"):l.charAt(1)=="w"&&(M.left=c+r.left+"px",M.right="auto");var P=e.create("div"),H;P.className="flotr-legend",e.setStyles(P,M),e.insert(P,O),e.insert(this.el,P);if(!h)return;var B=s.backgroundColor||i.grid.backgroundColor||"#ffffff";t.extend(M,e.size(P),{backgroundColor:B,zIndex:"",border:""}),M.width+="px",M.height+="px",P=e.create("div"),P.className="flotr-legend-bg",e.setStyles(P,M),e.opacity(P,h),e.insert(P," "),e.insert(this.el,P)}}}}}})}(),function(){if(typeof jQuery!="undefined"){var e=jQuery;Flotr.addPlugin("selectable_legend",{options:{show:!0,noColumns:1,labelFormatter:function(e){return e},labelBoxBorderColor:"#CCCCCC",labelBoxWidth:14,labelBoxHeight:10,labelBoxMargin:5,id:null,container:null,backgroundColor:"#F0F0F0",backgroundOpacity:.85,callback:null},callbacks:{"flotr:afterinit":function(){this.selectable_legend.insertLegend()}},insertLegend:function(){if(!this.options.selectable_legend.show&&!this.options.selectable_legend.container)return;var t=this.series,n=this.plotOffset,r=this.options,i=r.selectable_legend,s=[],o=!1,u=this.ctx,a=_.filter(t,function(e){return e.label}).length,f=i.position,l=i.margin,c=i.backgroundOpacity,h,p,d;if(a){var v=i.labelBoxWidth,m=i.labelBoxHeight,g=i.labelBoxMargin,y=n.left+l,b=n.top+l,w=0,E={size:r.fontSize*1.1,color:r.grid.color};for(h=t.length-1;h>-1;--h){if(!t[h].label)continue;p=i.labelFormatter(t[h].label),w=Math.max(w,this._text.measureText(p,E).width)}var S=Math.round(v+g*3+w),x=Math.round(a*(g+m)+g);!c&&c!==0&&(c=.1);for(h=0;h<t.length;++h){if(!t[h].label)continue;h%i.noColumns===0&&(s.push(o?"</tr><tr>":"<tr>"),o=!0);var T=t[h],N=i.labelBoxWidth,C=i.labelBoxHeight;p=i.labelFormatter(T.label),d="background-color:"+(T.bars&&T.bars.show&&T.bars.fillColor&&T.bars.fill?T.bars.fillColor:T.color)+";",i.callback&&(s.push('<td><input type="checkbox" class="flotr-legend-check-box" data-id="',h,'" data-container="',i.id?i.id:"",'"'),t[h].hide!==!0&&s.push(' checked="checked"'),s.push("/></td>")),s.push('<td class="flotr-legend-color-box">','<div style="border:1px solid ',i.labelBoxBorderColor,';padding:1px">'),s.push('<div style="width:',N-1,"px;height:",C-1,"px;border:1px solid ",t[h].color,'">','<div style="width:',N,"px;height:",C,"px;",d,'"></div>',"</div>","</div>","</td>",'<td class="flotr-legend-label">'),i.callback?s.push('<label for="flotr_scb_',i.id?i.id:"",h,'">',p,"</label>"):s.push(p),s.push("</td>")}o&&s.push("</tr>");if(s.length>0){var k='<table style="font-size:smaller;color:'+r.grid.color+'">'+s.join("")+"</table>";e(i.container).html(k),e(i.container).find(".flotr-legend-check-box").click(function(){var t=e(this);i.callback(t.data("id"),t)})}}}})}}(),function(){Flotr.addPlugin("separators",{options:{show:!1,lineWidth:2,yval:null,xval:null,xlabel:null,ylabel:null,xcolor:null,xfill:null,xfillopacity:.05,xorientation:0,ycolor:null,yfill:null,yfillopacity:.05,yorientation:0},callbacks:{"flotr:afterdraw":function(){try{this.separators.insertSeparator()}catch(e){}}},insertSeparator:function(){if(!this.options.separators.show)return;var e=this.options,t=this.ctx,n=this.plotWidth,r=this.plotHeight,i=this.plotOffset,s=this.options.separators,o,u,a,f,l,c,h,p,d,v;if(!this.series)return;for(l=0;l<this.series.length;l++)if(this.series[l].hide!==!0&&this.series[l].xaxis&&this.series[l].xaxis.d2p&&this.series[l].yaxis.d2p){o=this.series[l].xaxis.d2p,u=this.series[l].yaxis.d2p;break}if(!o)return;t.save(),t.lineJoin="round",t.lineWidth=s.lineWidth,s.xval&&(f=o(s.xval),f>=0&&f<=n&&(c=f+i.left,p=i.top,d=r+i.top,t.strokeStyle=s.xcolor||e.color,t.beginPath(),t.moveTo(c,p),t.lineTo(c,d),t.stroke(),t.closePath(),s.xfill&&s.xfillopacity&&(t.fillStyle=this.processColor(s.xfill,{opacity:s.xfillopacity}),s.xorientation===0?h=i.left:h=n+i.left,t.moveTo(h,p),t.lineTo(c,p),t.lineTo(c,d),t.lineTo(h,d),t.fill()),s.xlabel&&(v={size:e.fontSize,color:s.xcolor||e.color,textAlign:"center"},v.size*=1.2,v.textAlign="center",v.textBaseline="middle",v.angle=Flotr.toRad(90),Flotr.drawText(t,s.xlabel,c+8,(p+d+s.xlabel.length)/2,v),v=null))),s.yval&&(f=u(s.yval),f>=0&&f<=r&&(c=i.left,h=n+i.left,p=f+i.top,t.strokeStyle=s.ycolor||e.color,t.beginPath(),t.moveTo(c,p),t.lineTo(h,p),t.stroke(),t.closePath(),s.yfill&&s.yfillopacity&&(t.fillStyle=this.processColor(s.yfill,{opacity:s.yfillopacity}),s.yorientation===0?d=i.top+r:d=i.top,t.moveTo(c,d),t.lineTo(c,p),t.lineTo(h,p),t.lineTo(h,d),t.fill()),s.ylabel&&(v={size:e.fontSize,color:s.ycolor||e.color,textAlign:"center"},v.size*=1.2,v.textAlign="center",v.textBaseline="middle",v.angle=0,Flotr.drawText(t,s.ylabel,(c+h+s.ylabel.length)/2,p+8,v),v=null))),t.restore()}})}(),function(){function e(e){if(this.options.spreadsheet.tickFormatter)return this.options.spreadsheet.tickFormatter(e);var t=n.find(this.axes.x.ticks,function(t){return t.v==e});return t?t.label:e}var t=Flotr.DOM,n=Flotr._;Flotr.addPlugin("spreadsheet",{options:{show:!1,tabGraphLabel:"Graph",tabDataLabel:"Data",toolbarDownload:"Download CSV",toolbarSelectAll:"Select all",csvFileSeparator:",",decimalSeparator:".",tickFormatter:null,initialTab:"graph",sortFunc:null,xaxisLabel:null,csv_filename:null},callbacks:{"flotr:afterconstruct":function(){if(!this.options.spreadsheet.show)return;var e=this.spreadsheet,n=t.node('<div class="flotr-tabs-group" style="position:absolute;left:0px;width:'+this.canvasWidth+'px"></div>'),r=t.node('<div style="float:left" class="flotr-tab selected">'+this.options.spreadsheet.tabGraphLabel+"</div>"),i=t.node('<div style="float:left" class="flotr-tab">'+this.options.spreadsheet.tabDataLabel+"</div>"),s;e.tabsContainer=n,e.tabs={graph:r,data:i},t.insert(n,r),t.insert(n,i),t.insert(this.el,n),s=t.size(i).height+2,this.plotOffset.bottom+=s,t.setStyles(n,{top:this.canvasHeight-s+"px"}),this.observe(r,"click",function(){e.showTab("graph")}).observe(i,"click",function(){e.showTab("data")}),this.options.spreadsheet.initialTab!=="graph"&&e.showTab(this.options.spreadsheet.initialTab)}},loadDataGrid:function(){if(this.seriesData)return this.seriesData;var e=this.series,t={},r=this.options.xaxis&&this.options.xaxis.mode;n.each(e,function(e,i){n.each(e.data,function(e){var n=r==="time"?e[0].toLocaleString():e[0],s=e[1],o=t[n];if(o)o[i+1]=s;else{var u=[];u[0]=n,u[i+1]=s,t[n]=u}})});var i=n.isFunction(this.options.spreadsheet.sortFunc)&&this.options.spreadsheet.sortFunc||function(e,t){return parseInt(t,10)};return this.seriesData=n.sortBy(t,i),this.seriesData},constructDataGrid:function(){if(this.spreadsheet.datagrid)return this.spreadsheet.datagrid;var r=this.series,i=this.spreadsheet.loadDataGrid(),s=["<colgroup><col />"],o,u,a,f=this.options.xaxis&&this.options.xaxis.mode,l=['<table class="flotr-datagrid"><tr class="first-row">'];l.push("<th>"+(this.options.spreadsheet.xaxisLabel||" ")+"</th>"),n.each(r,function(e,t){l.push('<th scope="col">'+(e.label||String.fromCharCode(65+t))+"</th>"),s.push("<col />")}),l.push("</tr>"),n.each(i,function(t){l.push("<tr>"),n.times(r.length+1,function(r){var i="td",s=t[r],o=n.isUndefined(s)?"":Math.round(s*1e5)/1e5;if(r===0){i="th";var u=f==="time"?s.toLocaleString():e.call(this,o);u&&(o=u)}l.push("<"+i+(i=="th"?' scope="row"':"")+">"+o+"</"+i+">")},this),l.push("</tr>")},this),l.push("</table>"),s.push("</colgroup>"),a=t.node(l.join("")),o=t.node('<button type="button" class="flotr-datagrid-toolbar-button">'+this.options.spreadsheet.toolbarDownload+"</button>"),u=t.node('<button type="button" class="flotr-datagrid-toolbar-button btn-hidden">'+this.options.spreadsheet.toolbarSelectAll+"</button>"),this.observe(o,"click",n.bind(this.spreadsheet.downloadCSV,this)).observe(u,"click",n.bind(this.spreadsheet.selectAllData,this));var c=t.node('<div class="flotr-datagrid-toolbar"></div>');t.insert(c,o),t.insert(c,u);var h=this.canvasHeight-t.size(this.spreadsheet.tabsContainer).height-2,p=t.node('<div class="flotr-datagrid-container" style="position:absolute;left:0px;top:0px;width:'+this.canvasWidth+"px;height:"+h+'px;overflow:auto;"></div>');return t.insert(p,c),t.insert(p,a),t.insert(this.el,p),this.spreadsheet.datagrid=a,this.spreadsheet.container=p,a},showTab:function(e){if(this.spreadsheet.activeTab===e)return;switch(e){case"graph":t.hide(this.spreadsheet.container),t.removeClass(this.spreadsheet.tabs.data,"selected"),t.addClass(this.spreadsheet.tabs.graph,"selected");break;case"data":this.spreadsheet.datagrid||this.spreadsheet.constructDataGrid(),t.show(this.spreadsheet.container),t.addClass(this.spreadsheet.tabs.data,"selected"),t.removeClass(this.spreadsheet.tabs.graph,"selected");break;default:throw"Illegal tab name: "+e}this.spreadsheet.activeTab=e},selectAllData:function(){if(this.spreadsheet.tabs){var e,t,n,r,i=this.spreadsheet.constructDataGrid();return this.spreadsheet.showTab("data"),setTimeout(function(){(n=i.ownerDocument)&&(r=n.defaultView)&&r.getSelection&&n.createRange&&(e=window.getSelection())&&e.removeAllRanges?(t=n.createRange(),t.selectNode(i),e.removeAllRanges(),e.addRange(t)):document.body&&document.body.createTextRange&&(t=document.body.createTextRange())&&(t.moveToElementText(i),t.select())},0),!0}return!1},downloadCSV:function(){var t=this.options.spreadsheet.xaxisLabel?'"'+this.options.spreadsheet.xaxisLabel.replace(/\"/g,'\\"')+'"':"",r=this.series,i=this.options,s=this.spreadsheet.loadDataGrid(),o=encodeURIComponent(i.spreadsheet.csvFileSeparator);if(i.spreadsheet.decimalSeparator===i.spreadsheet.csvFileSeparator)throw"The decimal separator is the same as the column separator ("+i.spreadsheet.decimalSeparator+")";n.each(r,function(e,n){t+=o+'"'+(e.label||String.fromCharCode(65+n)).replace(/\"/g,'\\"')+'"'}),t+="%0D%0A",t+=n.reduce(s,function(t,n){var r=e.call(this,n[0])||"";r='"'+(r+"").replace(/\"/g,'\\"')+'"';var s=n.slice(1).join(o);return i.spreadsheet.decimalSeparator!=="."&&(s=s.replace(/\./g,i.spreadsheet.decimalSeparator)),t+r+o+s+"%0D%0A"},"",this),t=t.replace(new RegExp(o,"g"),decodeURIComponent(o)).replace(/%0A/g,"\n").replace(/%0D/g,"\r"),this.options.spreadsheet.csv_filename=(this.options.spreadsheet.csv_filename?this.options.spreadsheet.csv_filename.replace(/\s+/g,"_"):this.options.spreadsheet.csv_filename)||(this.options.spreadsheet.title?this.options.spreadsheet.title.replace(/\s+/g,"_").toLowerCase()+"_data.csv":"download.csv");if(navigator&&navigator.msSaveBlob){var u=new Blob([t],{type:"text/csv;charset=utf-8;"});navigator.msSaveBlob(u,this.options.spreadsheet.csv_filename)}else{var a=document.createElement("a");if(a.download!==undefined){var f;if(Blob&&URL&&URL.createObjectURL){var u=new Blob([t],{type:"text/csv;charset=utf-8;"});f=URL.createObjectURL(u)}else f="text/csv;charset=utf-8;"+encodeURIComponent(t);a.setAttribute("href",f),a.setAttribute("download",this.options.spreadsheet.csv_filename),a.style="visibility:hidden",document.body.appendChild(a),a.click(),document.body.removeChild(a)}else window.open("about:blank").document.write(t)}}})}(),function(){var e=Flotr.DOM;Flotr.addPlugin("titles",{callbacks:{"flotr:afterdraw":function(){this.titles.drawTitles()}},drawTitles:function(){var t,n=this.options,r=n.grid.labelMargin,i=this.ctx,s=this.axes;if(!n.HtmlText&&this.textEnabled){var o={size:n.fontSize,color:n.grid.color,textAlign:"center",fontFamily:n.fontFamily};n.subtitle&&Flotr.drawText(i,n.subtitle,this.plotOffset.left+this.plotWidth/2,this.titleHeight+this.subtitleHeight-2,o),o.weight=1.5,o.size*=1.5,n.title&&Flotr.drawText(i,n.title,this.plotOffset.left+this.plotWidth/2,this.titleHeight-2,o),o.weight=1.8,o.size*=.8,s.x.options.title&&s.x.used&&(o.textAlign=s.x.options.titleAlign||"center",o.textBaseline="top",o.angle=Flotr.toRad(s.x.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.x.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+s.x.maxLabel.height+this.plotHeight+2*r,o)),s.x2.options.title&&s.x2.used&&(o.textAlign=s.x2.options.titleAlign||"center",o.textBaseline="bottom",o.angle=Flotr.toRad(s.x2.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.x2.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top-s.x2.maxLabel.height-2*r,o)),s.y.options.title&&s.y.used&&(o.textAlign=s.y.options.titleAlign||"right",o.textBaseline="middle",o.angle=Flotr.toRad(s.y.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.y.options.title,this.plotOffset.left-s.y.maxLabel.width-2*r,this.plotOffset.top+this.plotHeight/2,o)),s.y2.options.title&&s.y2.used&&(o.textAlign=s.y2.options.titleAlign||"left",o.textBaseline="middle",o.angle=Flotr.toRad(s.y2.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.y2.options.title,this.plotOffset.left+this.plotWidth+s.y2.maxLabel.width+2*r,this.plotOffset.top+this.plotHeight/2,o))}else{t=[],n.title&&t.push('<div style="position:absolute;top:0;left:',this.plotOffset.left,"px;font-size:1em;font-weight:bold;text-align:center;width:",this.plotWidth,'px;" class="flotr-title">',n.title,"</div>"),n.subtitle&&t.push('<div style="position:absolute;top:',this.titleHeight,"px;left:",this.plotOffset.left,"px;font-size:smaller;text-align:center;width:",this.plotWidth,'px;" class="flotr-subtitle">',n.subtitle,"</div>"),t.push("</div>"),t.push('<div class="flotr-axis-title" style="font-weight:bold;">'),s.x.options.title&&s.x.used&&t.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight+n.grid.labelMargin+s.x.titleSize.height,"px;left:",this.plotOffset.left,"px;width:",this.plotWidth,"px;text-align:",s.x.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-x1">',s.x.options.title,"</div>"),s.x2.options.title&&s.x2.used&&t.push('<div style="position:absolute;top:0;left:',this.plotOffset.left,"px;width:",this.plotWidth,"px;text-align:",s.x2.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-x2">',s.x2.options.title,"</div>"),s.y.options.title&&s.y.used&&t.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight/2-s.y.titleSize.height/2,"px;left:0;text-align:",s.y.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-y1">',s.y.options.title,"</div>"),s.y2.options.title&&s.y2.used&&t.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight/2-s.y.titleSize.height/2,"px;right:0;text-align:",s.y2.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-y2">',s.y2.options.title,"</div>"),t=t.join("");var u=e.create("div");e.setStyles({color:n.grid.color}),u.className="flotr-titles",e.insert(this.el,u),e.insert(u,t)}}})}();