From 84d1f96da0ee2cc5fb3990cc497caefb363fa133 Mon Sep 17 00:00:00 2001 From: jly8866 <164473279@qq.com> Date: Mon, 19 Jun 2017 14:30:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 39 ++- archer/settings.py | 3 +- debug.sh | 2 +- sql/static/hightcharts/highcharts.js | 383 --------------------------- startup.sh | 2 +- 5 files changed, 39 insertions(+), 390 deletions(-) delete mode 100644 sql/static/hightcharts/highcharts.js diff --git a/README.md b/README.md index 2b342087..f7fc5baa 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,37 @@ cd archer && python3 manage.py createsuperuser
8. 启动:
用django内置runserver启动服务,需要修改debug.sh里的ip和port
cd archer && bash debug.sh
-如果要用gunicorn启动服务的话,可以使用pip3 install gunicorn安装并用startup.sh启动,但需要配合nginx处理静态资源. +如果要用gunicorn启动服务的话,可以使用pip3 install gunicorn安装并用startup.sh启动,但需要配合nginx处理静态资源.
+ 8.1 gunicorn的安装配置示例:
+ pip3 install gunicorn
+ cat startup.sh #gunicorn启动脚本
+ #!/bin/bash
+ settings=${1:-"archer.settings"}
+ ip=${2:-"192.168.1.21"}
+ port=${3:-9124} #记住这个端口,配置nginx或apache代理时,指向的是这个端口
+ gunicorn -w 4 --env DJANGO_SETTINGS_MODULE=${settings} --error-logfile=/tmp/archer.err -b ${ip}:${port} archer.wsgi:application --timeout 1200 -D #timeout要根据实际情况来设置,单位为秒,如果要对大表进行操作,这个值要适当加大
+
+ 8.2 nginx配置示例
+ cat nginx.conf
+ #部分省略
+ server {
+ listen 9123; #监听端口
+ server_name archer;
+ client_header_timeout 1200; #超时时间与gunicorn超时时间设置一致
+ client_body_timeout 1200;
+ proxy_read_timeout 1200;
+ location / {
+ proxy_set_header Host $http_host; #proxy_set_header 这3条配置必填
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_pass http://192.168.1.21:9124;
+ }
+ location /static {
+ alias /app/archer/archer/sql/static; #此处指向static目录的绝对路径,以便nginx收集静态资源
+ }
+}
+ #部分省略
+
9. 创建archer系统登录用户:
使用浏览器(推荐chrome或火狐)访问debug.sh里的地址:http://X.X.X.X:port/admin/sql/users/ ,如果未登录需要用到步骤7创建的admin系统用户来登录。
点击右侧Add users,用户名密码自定义,至少创建一个工程师和一个审核人(步骤7创建的用户也可以登录)后续新的工程师和审核人用户请用LDAP导入sql_users表或django admin增加
@@ -98,7 +128,9 @@ cd archer && bash debug.sh
6. 用户、集群、工单管理:
![image](https://github.com/jly8866/archer/raw/master/screenshots/adminsqlusers.png)
7. 工单统计图表:
-![image](https://github.com/jly8866/archer/raw/master/screenshots/charts.png)
+![image](https://github.com/jly8866/archer/raw/master/screenshots/charts.png)

+8.pt-OSC进度条,以及中止pt-OSC进程按钮:
+![image](https://raw.githubusercontent.com/johnliu2008/archer/master/screenshots/osc_progress.png)
### 联系方式: QQ群:524233225 @@ -109,4 +141,5 @@ QQ群:524233225 ![image](https://github.com/jly8866/archer/raw/master/screenshots/bugs/bug2.png)
原因:python3的pymysql模块会向inception发送SHOW WARNINGS语句,导致inception返回一个"Must start as begin statement"错误被archer捕捉到报在日志里.
解决:如果实在忍受不了,请修改/path/to/python3/lib/python3.4/site-packages/pymysql/cursors.py:338行,将self._show_warnings()这一句注释掉,换成pass,如下:
-![image](https://github.com/jly8866/archer/raw/master/screenshots/bugs/bug3.png) +![image](https://github.com/jly8866/archer/raw/master/screenshots/bugs/bug3.png)
+但是此方法有副作用,会导致所有调用该pymysql模块的程序不能show warnings,因此强烈推荐使用virtualenv或venv环境! diff --git a/archer/settings.py b/archer/settings.py index 58b185b2..2f53216a 100644 --- a/archer/settings.py +++ b/archer/settings.py @@ -136,7 +136,6 @@ MAIL_REVIEW_FROM_ADDR='archer@xxx.com' #发件人,也是登录SMTP server需要提供的用户名 MAIL_REVIEW_FROM_PASSWORD='' #发件人邮箱密码,如果为空则不需要login SMTP server MAIL_REVIEW_DBA_ADDR=['zhangsan@abc.com', 'lisi01@abc.com'] #DBA地址,执行完毕会发邮件给DBA,以list形式保存 - #是否过滤【DROP DATABASE】|【DROP TABLE】|【TRUNCATE PARTITION】|【TRUNCATE TABLE】等高危DDL操作: #on是开,会首先用正则表达式匹配sqlContent,如果匹配到高危DDL操作,则判断为“自动审核不通过”;off是关,直接将所有的SQL语句提交给inception,对于上述高危DDL操作,只备份元数据 -CRITICAL_DDL_ON_OFF='off' \ No newline at end of file +CRITICAL_DDL_ON_OFF='off' diff --git a/debug.sh b/debug.sh index ef567887..63be902d 100755 --- a/debug.sh +++ b/debug.sh @@ -1,3 +1,3 @@ #!/bin/bash -python3 manage.py runserver 172.16.5.10:9123 +python3 manage.py runserver 0.0.0.0:9123 diff --git a/sql/static/hightcharts/highcharts.js b/sql/static/hightcharts/highcharts.js deleted file mode 100644 index 33285c38..00000000 --- a/sql/static/hightcharts/highcharts.js +++ /dev/null @@ -1,383 +0,0 @@ -/* - Highcharts JS v5.0.3 (2016-11-18) - - (c) 2009-2016 Torstein Honsi - - License: www.highcharts.com/license -*/ -(function(M,a){"object"===typeof module&&module.exports?module.exports=M.document?a(M):a:M.Highcharts=a(M)})("undefined"!==typeof window?window:this,function(M){M=function(){var a=window,C=a.document,A=a.navigator&&a.navigator.userAgent||"",D=C&&C.createElementNS&&!!C.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,F=/(edge|msie|trident)/i.test(A)&&!window.opera,k=!D,d=/Firefox/.test(A),g=d&&4>parseInt(A.split("Firefox/")[1],10);return a.Highcharts?a.Highcharts.error(16,!0):{product:"Highcharts", -version:"5.0.3",deg2rad:2*Math.PI/360,doc:C,hasBidiBug:g,hasTouch:C&&void 0!==C.documentElement.ontouchstart,isMS:F,isWebKit:/AppleWebKit/.test(A),isFirefox:d,isTouchDevice:/(Mobile|Android|Windows Phone)/.test(A),SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:D,vml:k,win:a,charts:[],marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){}}}();(function(a){var C=[],A=a.charts,D=a.doc,F=a.win;a.error=function(a,d){a="Highcharts error #"+ -a+": www.highcharts.com/errors/"+a;if(d)throw Error(a);F.console&&console.log(a)};a.Fx=function(a,d,g){this.options=d;this.elem=a;this.prop=g};a.Fx.prototype={dSetter:function(){var a=this.paths[0],d=this.paths[1],g=[],u=this.now,l=a.length,t;if(1===u)g=this.toD;else if(l===d.length&&1>u)for(;l--;)t=parseFloat(a[l]),g[l]=isNaN(t)?a[l]:u*parseFloat(d[l]-t)+t;else g=d;this.elem.attr("d",g)},update:function(){var a=this.elem,d=this.prop,g=this.now,u=this.options.step;if(this[d+"Setter"])this[d+"Setter"](); -else a.attr?a.element&&a.attr(d,g):a.style[d]=g+this.unit;u&&u.call(a,g,this)},run:function(a,d,g){var k=this,l=function(a){return l.stopped?!1:k.step(a)},t;this.startTime=+new Date;this.start=a;this.end=d;this.unit=g;this.now=this.start;this.pos=0;l.elem=this.elem;l()&&1===C.push(l)&&(l.timerId=setInterval(function(){for(t=0;t=t+this.startTime){this.now=this.end;this.pos=1;this.update();a=n[this.prop]=!0;for(f in n)!0!==n[f]&&(a=!1);a&&l&&l.call(g);g=!1}else this.pos=k.easing((d-this.startTime)/t),this.now=this.start+(this.end-this.start)*this.pos,this.update(),g=!0;return g},initPath:function(k,d,g){function u(a){for(m=a.length;m--;)"M"!==a[m]&&"L"!==a[m]||a.splice(m+1,0,a[m+1],a[m+2],a[m+1],a[m+2])}function l(a,b){for(;a.lengthn?"AM":"PM",P:12>n?"am":"pm",S:r(l.getSeconds()),L:r(Math.round(d%1E3),3)},a.dateFormats);for(t in u)for(;-1!==k.indexOf("%"+t);)k= -k.replace("%"+t,"function"===typeof u[t]?u[t](d):u[t]);return g?k.substr(0,1).toUpperCase()+k.substr(1):k};a.formatSingle=function(k,d){var g=/\.([0-9])/,u=a.defaultOptions.lang;/f$/.test(k)?(g=(g=k.match(g))?g[1]:-1,null!==d&&(d=a.numberFormat(d,g,u.decimalPoint,-1=g&&(d=[1/g])));for(u=0;u=k||!l&&t<=(d[u]+(d[u+1]||d[u]))/ -2);u++);return n*g};a.stableSort=function(a,d){var g=a.length,k,l;for(l=0;lg&&(g=a[d]);return g};a.destroyObjectProperties=function(a,d){for(var g in a)a[g]&&a[g]!==d&&a[g].destroy&&a[g].destroy(),delete a[g]};a.discardElement=function(k){var d= -a.garbageBin;d||(d=a.createElement("div"));k&&d.appendChild(k);d.innerHTML=""};a.correctFloat=function(a,d){return parseFloat(a.toPrecision(d||14))};a.setAnimation=function(k,d){d.renderer.globalAnimation=a.pick(k,d.options.chart.animation,!0)};a.animObject=function(k){return a.isObject(k)?a.merge(k):{duration:k?500:0}};a.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:24192E5,year:314496E5};a.numberFormat=function(k,d,g,u){k=+k||0;d=+d;var l=a.defaultOptions.lang, -t=(k.toString().split(".")[1]||"").length,n,f,h=Math.abs(k);-1===d?d=Math.min(t,20):a.isNumber(d)||(d=2);n=String(a.pInt(h.toFixed(d)));f=3k?"-":"")+(f?n.substr(0,f)+u:"");k+=n.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+u);d&&(u=Math.abs(h-n+Math.pow(10,-Math.max(d,t)-1)),k+=g+u.toFixed(d).slice(2));return k};Math.easeInOutSine=function(a){return-.5*(Math.cos(Math.PI*a)-1)};a.getStyle=function(k,d){return"width"===d?Math.min(k.offsetWidth, -k.scrollWidth)-a.getStyle(k,"padding-left")-a.getStyle(k,"padding-right"):"height"===d?Math.min(k.offsetHeight,k.scrollHeight)-a.getStyle(k,"padding-top")-a.getStyle(k,"padding-bottom"):(k=F.getComputedStyle(k,void 0))&&a.pInt(k.getPropertyValue(d))};a.inArray=function(a,d){return d.indexOf?d.indexOf(a):[].indexOf.call(d,a)};a.grep=function(a,d){return[].filter.call(a,d)};a.map=function(a,d){for(var g=[],k=0,l=a.length;kd;d++)u[d]+=k(255*a),0>u[d]&&(u[d]=0),255B.width)B={width:0,height:0}}else B=this.htmlGetBBox();z.isSVG&&(a=B.width, -z=B.height,b&&c&&"11px"===c.fontSize&&"16.9"===z.toPrecision(3)&&(B.height=z=14),p&&(B.width=Math.abs(z*Math.sin(e))+Math.abs(a*Math.cos(e)),B.height=Math.abs(z*Math.cos(e))+Math.abs(a*Math.sin(e))));if(r&&0]*>/g,"")))},textSetter:function(a){a!==this.textStr&&(delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this))},fillSetter:function(a,b,p){"string"===typeof a?p.setAttribute(b, -a):a&&this.colorGradient(a,b,p)},visibilitySetter:function(a,b,p){"inherit"===a?p.removeAttribute(b):p.setAttribute(b,a)},zIndexSetter:function(a,b){var p=this.renderer,e=this.parentGroup,B=(e||p).element||p.box,z,y=this.element,c;z=this.added;var q;t(a)&&(y.zIndex=a,a=+a,this[b]===a&&(z=!1),this[b]=a);if(z){(a=this.zIndex)&&e&&(e.handleZ=!0);b=B.childNodes;for(q=0;qa||!t(a)&&t(z)||0>a&&!t(z)&&B!==p.box)&&(B.insertBefore(y,e),c=!0);c||B.appendChild(y)}return c}, -_defaultSetter:function(a,b,p){p.setAttribute(b,a)}};C.prototype.yGetter=C.prototype.xGetter;C.prototype.translateXSetter=C.prototype.translateYSetter=C.prototype.rotationSetter=C.prototype.verticalAlignSetter=C.prototype.scaleXSetter=C.prototype.scaleYSetter=function(a,b){this[b]=a;this.doTransform=!0};C.prototype["stroke-widthSetter"]=C.prototype.strokeSetter=function(a,b,p){this[b]=a;this.stroke&&this["stroke-width"]?(C.prototype.fillSetter.call(this,this.stroke,"stroke",p),p.setAttribute("stroke-width", -this["stroke-width"]),this.hasStroke=!0):"stroke-width"===b&&0===a&&this.hasStroke&&(p.removeAttribute("stroke"),this.hasStroke=!1)};A=a.SVGRenderer=function(){this.init.apply(this,arguments)};A.prototype={Element:C,SVG_NS:y,init:function(a,b,p,e,y,c){var B;e=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"}).css(this.getStyle(e));B=e.element;a.appendChild(B);-1===a.innerHTML.indexOf("xmlns")&&k(B,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=B;this.boxWrapper=e;this.alignedObjects= -[];this.url=(I||L)&&h.getElementsByTagName("base").length?O.location.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(h.createTextNode("Created with Highcharts 5.0.3"));this.defs=this.createElement("defs").add();this.allowHTML=c;this.forExport=y;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(b,p,!1);var z;I&&a.getBoundingClientRect&&(b=function(){u(a,{left:0,top:0});z=a.getBoundingClientRect(); -u(a,{left:Math.ceil(z.left)-z.left+"px",top:Math.ceil(z.top)-z.top+"px"})},b(),this.unSubPixelFix=D(O,"resize",b))},getStyle:function(a){return this.style=H({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},setStyle:function(a){this.boxWrapper.css(this.getStyle(a))},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();f(this.gradients||{});this.gradients= -null;a&&(this.defs=a.destroy());this.unSubPixelFix&&this.unSubPixelFix();return this.alignedObjects=null},createElement:function(a){var b=new this.Element;b.init(this,a);return b},draw:J,getRadialAttr:function(a,b){return{cx:a[0]-a[2]/2+b.cx*a[2],cy:a[1]-a[2]/2+b.cy*a[2],r:b.r*a[2]}},buildText:function(a){for(var b=a.element,c=this,B=c.forExport,q=w(a.textStr,"").toString(),f=-1!==q.indexOf("\x3c"),m=b.childNodes,x,r,l,d,E=k(b,"x"),G=a.styles,t=a.textWidth,n=G&&G.lineHeight,g=G&&G.textOutline,L=G&& -"ellipsis"===G.textOverflow,O=m.length,P=t&&!a.added&&this.box,H=function(a){var p;p=/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:G&&G.fontSize||c.style.fontSize||12;return n?K(n):c.fontMetrics(p,a.getAttribute("style")?a:b).h};O--;)b.removeChild(m[O]);f||g||L||t||-1!==q.indexOf(" ")?(x=/<.*class="([^"]+)".*>/,r=/<.*style="([^"]+)".*>/,l=/<.*href="(http[^"]+)".*>/,P&&P.appendChild(b),q=f?q.replace(/<(b|strong)>/g,'\x3cspan style\x3d"font-weight:bold"\x3e').replace(/<(i|em)>/g,'\x3cspan style\x3d"font-style:italic"\x3e').replace(//g,"\x3c/span\x3e").split(//g):[q],q=e(q,function(a){return""!==a}),v(q,function(e,z){var q,f=0;e=e.replace(/^\s+|\s+$/g,"").replace(//g,"\x3c/span\x3e|||");q=e.split("|||");v(q,function(e){if(""!==e||1===q.length){var m={},w=h.createElementNS(c.SVG_NS,"tspan"),v,S;x.test(e)&&(v=e.match(x)[1],k(w,"class",v));r.test(e)&&(S=e.match(r)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),k(w,"style",S));l.test(e)&&!B&&(k(w, -"onclick",'location.href\x3d"'+e.match(l)[1]+'"'),u(w,{cursor:"pointer"}));e=(e.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"\x3c").replace(/>/g,"\x3e");if(" "!==e){w.appendChild(h.createTextNode(e));f?m.dx=0:z&&null!==E&&(m.x=E);k(w,m);b.appendChild(w);!f&&z&&(!p&&B&&u(w,{display:"block"}),k(w,"dy",H(w)));if(t){m=e.replace(/([^\^])-/g,"$1- ").split(" ");v="nowrap"===G.whiteSpace;for(var K=1t,void 0===d&&(d=g),L&&d?(J/=2,""===Q||!g&&.5>J?m=[]:(Q=e.substring(0,Q.length+(g?-1:1)*Math.ceil(J)),m=[Q+(3t&&(t=n)),m.length&&w.appendChild(h.createTextNode(m.join(" ").replace(/- /g, -"-")));a.rotation=P}f++}}})}),d&&a.attr("title",a.textStr),P&&P.removeChild(b),g&&a.applyTextOutline&&a.applyTextOutline(g)):b.appendChild(h.createTextNode(q.replace(/</g,"\x3c").replace(/>/g,"\x3e")))},getContrast:function(a){a=g(a).rgba;return 510p?y>b+q&&yf?y>b+q&&ye&&f>a+q&&fy&&f>a+q&&fa?a+3:Math.round(1.2*a);return{h:b,b:Math.round(.8*b),f:a}},rotCorr:function(a, -b,p){var e=a;b&&p&&(e=Math.max(e*Math.cos(b*n),4));return{x:-a/3*Math.sin(b*n),y:e}},label:function(a,b,p,e,y,c,q,f,m){var x=this,z=x.g("button"!==m&&"label"),w=z.text=x.text("",0,0,q).attr({zIndex:1}),h,r,l=0,d=3,B=0,g,K,n,L,O,P={},k,J,S=/^url\((.*?)\)$/.test(e),I=S,N,u,R,Q;m&&z.addClass("highcharts-"+m);I=S;N=function(){return(k||0)%2/2};u=function(){var a=w.element.style,b={};r=(void 0===g||void 0===K||O)&&t(w.textStr)&&w.getBBox();z.width=(g||r.width||0)+2*d+B;z.height=(K||r.height||0)+2*d;J= -d+x.fontMetrics(a&&a.fontSize,w).b;I&&(h||(z.box=h=x.symbols[e]||S?x.symbol(e):x.rect(),h.addClass(("button"===m?"":"highcharts-label-box")+(m?" highcharts-"+m+"-box":"")),h.add(z),a=N(),b.x=a,b.y=(f?-J:0)+a),b.width=Math.round(z.width),b.height=Math.round(z.height),h.attr(H(b,P)),P={})};R=function(){var a=B+d,b;b=f?0:J;t(g)&&r&&("center"===O||"right"===O)&&(a+={center:.5,right:1}[O]*(g-r.width));if(a!==w.x||b!==w.y)w.attr("x",a),void 0!==b&&w.attr("y",b);w.x=a;w.y=b};Q=function(a,b){h?h.attr(a,b): -P[a]=b};z.onAdd=function(){w.add(z);z.attr({text:a||0===a?a:"",x:b,y:p});h&&t(y)&&z.attr({anchorX:y,anchorY:c})};z.widthSetter=function(a){g=a};z.heightSetter=function(a){K=a};z["text-alignSetter"]=function(a){O=a};z.paddingSetter=function(a){t(a)&&a!==d&&(d=z.padding=a,R())};z.paddingLeftSetter=function(a){t(a)&&a!==B&&(B=a,R())};z.alignSetter=function(a){a={left:0,center:.5,right:1}[a];a!==l&&(l=a,r&&z.attr({x:n}))};z.textSetter=function(a){void 0!==a&&w.textSetter(a);u();R()};z["stroke-widthSetter"]= -function(a,b){a&&(I=!0);k=this["stroke-width"]=a;Q(b,a)};z.strokeSetter=z.fillSetter=z.rSetter=function(a,b){"fill"===b&&a&&(I=!0);Q(b,a)};z.anchorXSetter=function(a,b){y=a;Q(b,Math.round(a)-N()-n)};z.anchorYSetter=function(a,b){c=a;Q(b,a-L)};z.xSetter=function(a){z.x=a;l&&(a-=l*((g||r.width)+2*d));n=Math.round(a);z.attr("translateX",n)};z.ySetter=function(a){L=z.y=Math.round(a);z.attr("translateY",L)};var T=z.css;return H(z,{css:function(a){if(a){var b={};a=E(a);v(z.textProps,function(p){void 0!== -a[p]&&(b[p]=a[p],delete a[p])});w.css(b)}return T.call(z,a)},getBBox:function(){return{width:r.width+2*d,height:r.height+2*d,x:r.x-d,y:r.y-d}},shadow:function(a){a&&(u(),h&&h.shadow(a));return z},destroy:function(){G(z.element,"mouseenter");G(z.element,"mouseleave");w&&(w=w.destroy());h&&(h=h.destroy());C.prototype.destroy.call(z);z=x=u=R=Q=null}})}};a.Renderer=A})(M);(function(a){var C=a.attr,A=a.createElement,D=a.css,F=a.defined,k=a.each,d=a.extend,g=a.isFirefox,u=a.isMS,l=a.isWebKit,t=a.pInt,n= -a.SVGRenderer,f=a.win,h=a.wrap;d(a.SVGElement.prototype,{htmlCss:function(a){var f=this.element;if(f=a&&"SPAN"===f.tagName&&a.width)delete a.width,this.textWidth=f,this.updateTransform();a&&"ellipsis"===a.textOverflow&&(a.whiteSpace="nowrap",a.overflow="hidden");this.styles=d(this.styles,a);D(this.element,a);return this},htmlGetBBox:function(){var a=this.element;"text"===a.nodeName&&(a.style.position="absolute");return{x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var a= -this.renderer,f=this.element,c=this.translateX||0,e=this.translateY||0,m=this.x||0,h=this.y||0,d=this.textAlign||"left",b={left:0,center:.5,right:1}[d],q=this.styles;D(f,{marginLeft:c,marginTop:e});this.shadows&&k(this.shadows,function(a){D(a,{marginLeft:c+1,marginTop:e+1})});this.inverted&&k(f.childNodes,function(b){a.invertChild(b,f)});if("SPAN"===f.tagName){var x=this.rotation,g=t(this.textWidth),E=q&&q.whiteSpace,n=[x,d,f.innerHTML,this.textWidth,this.textAlign].join();n!==this.cTT&&(q=a.fontMetrics(f.style.fontSize).b, -F(x)&&this.setSpanRotation(x,b,q),D(f,{width:"",whiteSpace:E||"nowrap"}),f.offsetWidth>g&&/[ \-]/.test(f.textContent||f.innerText)&&D(f,{width:g+"px",display:"block",whiteSpace:E||"normal"}),this.getSpanCorrection(f.offsetWidth,q,b,x,d));D(f,{left:m+(this.xCorr||0)+"px",top:h+(this.yCorr||0)+"px"});l&&(q=f.offsetHeight);this.cTT=n}}else this.alignOnAdd=!0},setSpanRotation:function(a,h,c){var e={},m=u?"-ms-transform":l?"-webkit-transform":g?"MozTransform":f.opera?"-o-transform":"";e[m]=e.transform= -"rotate("+a+"deg)";e[m+(g?"Origin":"-origin")]=e.transformOrigin=100*h+"% "+c+"px";D(this.element,e)},getSpanCorrection:function(a,f,c){this.xCorr=-a*c;this.yCorr=-f}});d(n.prototype,{html:function(a,f,c){var e=this.createElement("span"),m=e.element,r=e.renderer,l=r.isSVG,b=function(a,b){k(["opacity","visibility"],function(e){h(a,e+"Setter",function(a,e,c,q){a.call(this,e,c,q);b[c]=e})})};e.textSetter=function(a){a!==m.innerHTML&&delete this.bBox;m.innerHTML=this.textStr=a;e.htmlUpdateTransform()}; -l&&b(e,e.element.style);e.xSetter=e.ySetter=e.alignSetter=e.rotationSetter=function(a,b){"align"===b&&(b="textAlign");e[b]=a;e.htmlUpdateTransform()};e.attr({text:a,x:Math.round(f),y:Math.round(c)}).css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize,position:"absolute"});m.style.whiteSpace="nowrap";e.css=e.htmlCss;l&&(e.add=function(a){var c,f=r.box.parentNode,q=[];if(this.parentGroup=a){if(c=a.div,!c){for(;a;)q.push(a),a=a.parentGroup;k(q.reverse(),function(a){var e,q=C(a.element, -"class");q&&(q={className:q});c=a.div=a.div||A("div",q,{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px",display:a.display,opacity:a.opacity,pointerEvents:a.styles&&a.styles.pointerEvents},c||f);e=c.style;d(a,{translateXSetter:function(b,c){e.left=b+"px";a[c]=b;a.doTransform=!0},translateYSetter:function(b,c){e.top=b+"px";a[c]=b;a.doTransform=!0}});b(a,e)})}}else c=f;c.appendChild(m);e.added=!0;e.alignOnAdd&&e.htmlUpdateTransform();return e});return e}})})(M);(function(a){var C, -A,D=a.createElement,F=a.css,k=a.defined,d=a.deg2rad,g=a.discardElement,u=a.doc,l=a.each,t=a.erase,n=a.extend;C=a.extendClass;var f=a.isArray,h=a.isNumber,v=a.isObject,H=a.merge;A=a.noop;var c=a.pick,e=a.pInt,m=a.SVGElement,r=a.SVGRenderer,I=a.win;a.svg||(A={docMode8:u&&8===u.documentMode,init:function(a,e){var b=["\x3c",e,' filled\x3d"f" stroked\x3d"f"'],c=["position: ","absolute",";"],f="div"===e;("shape"===e||f)&&c.push("left:0;top:0;width:1px;height:1px;");c.push("visibility: ",f?"hidden":"visible"); -b.push(' style\x3d"',c.join(""),'"/\x3e');e&&(b=f||"span"===e||"img"===e?b.join(""):a.prepVML(b),this.element=D(b));this.renderer=a},add:function(a){var b=this.renderer,e=this.element,c=b.box,f=a&&a.inverted,c=a?a.element||a:c;a&&(this.parentGroup=a);f&&b.invertChild(e,c);c.appendChild(e);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform();if(this.onAdd)this.onAdd();this.className&&this.attr("class",this.className);return this},updateTransform:m.prototype.htmlUpdateTransform, -setSpanRotation:function(){var a=this.rotation,e=Math.cos(a*d),c=Math.sin(a*d);F(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11\x3d",e,", M12\x3d",-c,", M21\x3d",c,", M22\x3d",e,", sizingMethod\x3d'auto expand')"].join(""):"none"})},getSpanCorrection:function(a,e,f,m,h){var b=m?Math.cos(m*d):1,q=m?Math.sin(m*d):0,x=c(this.elemHeight,this.element.offsetHeight),r;this.xCorr=0>b&&-a;this.yCorr=0>q&&-x;r=0>b*q;this.xCorr+=q*e*(r?1-f:f);this.yCorr-=b*e*(m?r?f:1-f:1);h&&"left"!== -h&&(this.xCorr-=a*f*(0>b?-1:1),m&&(this.yCorr-=x*f*(0>q?-1:1)),F(this.element,{textAlign:h}))},pathToVML:function(a){for(var b=a.length,e=[];b--;)h(a[b])?e[b]=Math.round(10*a[b])-5:"Z"===a[b]?e[b]="x":(e[b]=a[b],!a.isArc||"wa"!==a[b]&&"at"!==a[b]||(e[b+5]===e[b+7]&&(e[b+7]+=a[b+7]>a[b+5]?1:-1),e[b+6]===e[b+8]&&(e[b+8]+=a[b+8]>a[b+6]?1:-1)));return e.join(" ")||"x"},clip:function(a){var b=this,e;a?(e=a.members,t(e,b),e.push(b),b.destroyClip=function(){t(e,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(), -a={clip:b.docMode8?"inherit":"rect(auto)"});return b.css(a)},css:m.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&g(a)},destroy:function(){this.destroyClip&&this.destroyClip();return m.prototype.destroy.apply(this)},on:function(a,e){this.element["on"+a]=function(){var a=I.event;a.target=a.srcElement;e(a)};return this},cutOffPath:function(a,c){var b;a=a.split(/[ ,]/);b=a.length;if(9===b||11===b)a[b-4]=a[b-2]=e(a[b-2])-10*c;return a.join(" ")},shadow:function(a,f,m){var b=[],q,h=this.element, -w=this.renderer,r,x=h.style,d,p=h.path,y,l,g,B;p&&"string"!==typeof p.value&&(p="x");l=p;if(a){g=c(a.width,3);B=(a.opacity||.15)/g;for(q=1;3>=q;q++)y=2*g+1-2*q,m&&(l=this.cutOffPath(p.value,y+.5)),d=['\x3cshape isShadow\x3d"true" strokeweight\x3d"',y,'" filled\x3d"false" path\x3d"',l,'" coordsize\x3d"10 10" style\x3d"',h.style.cssText,'" /\x3e'],r=D(w.prepVML(d),null,{left:e(x.left)+c(a.offsetX,1),top:e(x.top)+c(a.offsetY,1)}),m&&(r.cutOff=y+1),d=['\x3cstroke color\x3d"',a.color||"#000000",'" opacity\x3d"', -B*q,'"/\x3e'],D(w.prepVML(d),null,null,r),f?f.element.appendChild(r):h.parentNode.insertBefore(r,h),b.push(r);this.shadows=b}return this},updateShadows:A,setAttr:function(a,e){this.docMode8?this.element[a]=e:this.element.setAttribute(a,e)},classSetter:function(a){(this.added?this.element:this).className=a},dashstyleSetter:function(a,e,c){(c.getElementsByTagName("stroke")[0]||D(this.renderer.prepVML(["\x3cstroke/\x3e"]),null,null,c))[e]=a||"solid";this[e]=a},dSetter:function(a,e,c){var b=this.shadows; -a=a||[];this.d=a.join&&a.join(" ");c.path=a=this.pathToVML(a);if(b)for(c=b.length;c--;)b[c].path=b[c].cutOff?this.cutOffPath(a,b[c].cutOff):a;this.setAttr(e,a)},fillSetter:function(a,e,c){var b=c.nodeName;"SPAN"===b?c.style.color=a:"IMG"!==b&&(c.filled="none"!==a,this.setAttr("fillcolor",this.renderer.color(a,c,e,this)))},"fill-opacitySetter":function(a,e,c){D(this.renderer.prepVML(["\x3c",e.split("-")[0],' opacity\x3d"',a,'"/\x3e']),null,null,c)},opacitySetter:A,rotationSetter:function(a,e,c){c= -c.style;this[e]=c[e]=a;c.left=-Math.round(Math.sin(a*d)+1)+"px";c.top=Math.round(Math.cos(a*d))+"px"},strokeSetter:function(a,e,c){this.setAttr("strokecolor",this.renderer.color(a,c,e,this))},"stroke-widthSetter":function(a,e,c){c.stroked=!!a;this[e]=a;h(a)&&(a+="px");this.setAttr("strokeweight",a)},titleSetter:function(a,e){this.setAttr(e,a)},visibilitySetter:function(a,e,c){"inherit"===a&&(a="visible");this.shadows&&l(this.shadows,function(b){b.style[e]=a});"DIV"===c.nodeName&&(a="hidden"===a?"-999em": -0,this.docMode8||(c.style[e]=a?"visible":"hidden"),e="top");c.style[e]=a},xSetter:function(a,e,c){this[e]=a;"x"===e?e="left":"y"===e&&(e="top");this.updateClipping?(this[e]=a,this.updateClipping()):c.style[e]=a},zIndexSetter:function(a,e,c){c.style[e]=a}},A["stroke-opacitySetter"]=A["fill-opacitySetter"],a.VMLElement=A=C(m,A),A.prototype.ySetter=A.prototype.widthSetter=A.prototype.heightSetter=A.prototype.xSetter,A={Element:A,isIE8:-1L[0]&&b.push([1,L[1]]);l(b,function(b,e){h.test(b[1])?(q=a.color(b[1]),p=q.get("rgb"),y=q.get("a")):(p=b[1],y=1);I.push(100*b[0]+"% "+p);e?(z=y,n=p):(B=y,v=p)});if("fill"===c)if("gradient"===d)c=g.x1||g[0]||0,b=g.y1||g[1]||0,t=g.x2||g[2]||0,g=g.y2||g[3]||0,k='angle\x3d"'+(90-180*Math.atan((g-b)/(t-c))/Math.PI)+'"',H();else{var x=g.r,u=2*x,A=2*x,C=g.cx,F=g.cy,V=e.radialReference,U,x=function(){V&&(U=f.getBBox(),C+=(V[0]- -U.x)/U.width-.5,F+=(V[1]-U.y)/U.height-.5,u*=V[2]/U.width,A*=V[2]/U.height);k='src\x3d"'+a.getOptions().global.VMLRadialGradientURL+'" size\x3d"'+u+","+A+'" origin\x3d"0.5,0.5" position\x3d"'+C+","+F+'" color2\x3d"'+v+'" ';H()};f.added?x():f.onAdd=x;x=n}else x=p}else h.test(b)&&"IMG"!==e.tagName?(q=a.color(b),f[c+"-opacitySetter"](q.get("a"),c,e),x=q.get("rgb")):(x=e.getElementsByTagName(c),x.length&&(x[0].opacity=1,x[0].type="solid"),x=b);return x},prepVML:function(a){var b=this.isIE8;a=a.join(""); -b?(a=a.replace("/\x3e",' xmlns\x3d"urn:schemas-microsoft-com:vml" /\x3e'),a=-1===a.indexOf('style\x3d"')?a.replace("/\x3e",' style\x3d"display:inline-block;behavior:url(#default#VML);" /\x3e'):a.replace('style\x3d"','style\x3d"display:inline-block;behavior:url(#default#VML);')):a=a.replace("\x3c","\x3chcv:");return a},text:r.prototype.html,path:function(a){var b={coordsize:"10 10"};f(a)?b.d=a:v(a)&&n(b,a);return this.createElement("shape").attr(b)},circle:function(a,e,c){var b=this.symbol("circle"); -v(a)&&(c=a.r,e=a.y,a=a.x);b.isCircle=!0;b.r=c;return b.attr({x:a,y:e})},g:function(a){var b;a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a});return this.createElement("div").attr(b)},image:function(a,e,c,f,m){var b=this.createElement("img").attr({src:a});1c&&l-e*mh&&(q=Math.round((f-l)/Math.cos(c*u)));else if(f=l+(1-e)*m,l-e*mh&&(I=h-a.x+I*e,b=-1),I=Math.min(r, -I),II||g.autoRotation&&(k.styles||{}).width)q=I;q&&(x.width=q,(g.options.labels.style||{}).textOverflow||(x.textOverflow="ellipsis"),k.css(x))},getPosition:function(a,d,g,f){var h=this.axis,l=h.chart,n=f&&l.oldChartHeight||l.chartHeight;return{x:a?h.translate(d+g,null,null,f)+h.transB:h.left+h.offset+(h.opposite?(f&&l.oldChartWidth||l.chartWidth)-h.right-h.left:0),y:a?n-h.bottom+h.offset-(h.opposite?h.height:0):n-h.translate(d+g,null, -null,f)-h.transB}},getLabelPosition:function(a,d,g,f,h,v,k,c){var e=this.axis,m=e.transA,r=e.reversed,l=e.staggerLines,b=e.tickRotCorr||{x:0,y:0},q=h.y;A(q)||(q=0===e.side?g.rotation?-8:-g.getBBox().height:2===e.side?b.y+8:Math.cos(g.rotation*u)*(b.y-g.getBBox(!1,0).height/2));a=a+h.x+b.x-(v&&f?v*m*(r?-1:1):0);d=d+q-(v&&!f?v*m*(r?1:-1):0);l&&(g=k/(c||1)%l,e.opposite&&(g=l-g-1),d+=e.labelOffset/l*g);return{x:a,y:Math.round(d)}},getMarkPath:function(a,d,g,f,h,v){return v.crispLine(["M",a,d,"L",a+(h? -0:-g),d+(h?g:0)],f)},render:function(a,k,n){var f=this.axis,h=f.options,l=f.chart.renderer,t=f.horiz,c=this.type,e=this.label,m=this.pos,r=h.labels,I=this.gridLine,b=c?c+"Tick":"tick",q=f.tickSize(b),x=this.mark,L=!x,E=r.step,u={},w=!0,K=f.tickmarkOffset,G=this.getPosition(t,m,K,k),N=G.x,G=G.y,p=t&&N===f.pos+f.len||!t&&G===f.pos?-1:1,y=c?c+"Grid":"grid",P=h[y+"LineWidth"],O=h[y+"LineColor"],B=h[y+"LineDashStyle"],y=d(h[b+"Width"],!c&&f.isXAxis?1:0),b=h[b+"Color"];n=d(n,1);this.isActive=!0;I||(u.stroke= -O,u["stroke-width"]=P,B&&(u.dashstyle=B),c||(u.zIndex=1),k&&(u.opacity=0),this.gridLine=I=l.path().attr(u).addClass("highcharts-"+(c?c+"-":"")+"grid-line").add(f.gridGroup));if(!k&&I&&(m=f.getPlotLinePath(m+K,I.strokeWidth()*p,k,!0)))I[this.isNew?"attr":"animate"]({d:m,opacity:n});q&&(f.opposite&&(q[0]=-q[0]),L&&(this.mark=x=l.path().addClass("highcharts-"+(c?c+"-":"")+"tick").add(f.axisGroup),x.attr({stroke:b,"stroke-width":y})),x[L?"attr":"animate"]({d:this.getMarkPath(N,G,q[0],x.strokeWidth()* -p,t,l),opacity:n}));e&&F(N)&&(e.xy=G=this.getLabelPosition(N,G,e,t,r,K,a,E),this.isFirst&&!this.isLast&&!d(h.showFirstLabel,1)||this.isLast&&!this.isFirst&&!d(h.showLastLabel,1)?w=!1:!t||f.isRadial||r.step||r.rotation||k||0===n||this.handleOverflow(G),E&&a%E&&(w=!1),w&&F(G.y)?(G.opacity=n,e[this.isNew?"attr":"animate"](G)):(g(e),e.attr("y",-9999)),this.isNew=!1)},destroy:function(){D(this,this.axis)}}})(M);(function(a){var C=a.addEvent,A=a.animObject,D=a.arrayMax,F=a.arrayMin,k=a.AxisPlotLineOrBandExtension, -d=a.color,g=a.correctFloat,u=a.defaultOptions,l=a.defined,t=a.deg2rad,n=a.destroyObjectProperties,f=a.each,h=a.error,v=a.extend,H=a.fireEvent,c=a.format,e=a.getMagnitude,m=a.grep,r=a.inArray,I=a.isArray,b=a.isNumber,q=a.isString,x=a.merge,L=a.normalizeTickInterval,E=a.pick,J=a.PlotLineOrBand,w=a.removeEvent,K=a.splat,G=a.syncTimeout,N=a.Tick;a.Axis=function(){this.init.apply(this,arguments)};a.Axis.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M", -hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,labels:{enabled:!0,style:{color:"#666666",cursor:"default",fontSize:"11px"},x:0},minPadding:.01,maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",title:{align:"middle",style:{color:"#666666"}},type:"linear",minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb", -lineWidth:1,gridLineColor:"#e6e6e6",tickColor:"#ccd6eb"},defaultYAxisOptions:{endOnTick:!0,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},maxPadding:.05,minPadding:.05,startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return a.numberFormat(this.total,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"#000000",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},defaultLeftAxisOptions:{labels:{x:-15},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15}, -title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},init:function(a,b){var e=b.isX;this.chart=a;this.horiz=a.inverted?!e:e;this.isXAxis=e;this.coll=this.coll||(e?"xAxis":"yAxis");this.opposite=b.opposite;this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(b);var p=this.options,c=p.type;this.labelFormatter=p.labels.formatter||this.defaultLabelFormatter; -this.userOptions=b;this.minPixelPadding=0;this.reversed=p.reversed;this.visible=!1!==p.visible;this.zoomEnabled=!1!==p.zoomEnabled;this.hasNames="category"===c||!0===p.categories;this.categories=p.categories||this.hasNames;this.names=this.names||[];this.isLog="logarithmic"===c;this.isDatetimeAxis="datetime"===c;this.isLinked=l(p.linkedTo);this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=p.minRange||p.maxZoom; -this.range=p.range;this.offset=p.offset||0;this.stacks={};this.oldStacks={};this.stacksTouched=0;this.min=this.max=null;this.crosshair=E(p.crosshair,K(a.options.tooltip.crosshairs)[e?0:1],!1);var f;b=this.options.events;-1===r(this,a.axes)&&(e?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];a.inverted&&e&&void 0===this.reversed&&(this.reversed=!0);this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(f in b)C(this,f,b[f]); -this.isLog&&(this.val2lin=this.log2lin,this.lin2val=this.lin2log)},setOptions:function(a){this.options=x(this.defaultOptions,"yAxis"===this.coll&&this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],x(u[this.coll],a))},defaultLabelFormatter:function(){var b=this.axis,e=this.value,f=b.categories,m=this.dateTimeLabelFormat,h=u.lang,z=h.numericSymbols,h=h.numericSymbolMagnitude||1E3,d=z&&z.length,r,q=b.options.labels.format, -b=b.isLog?e:b.tickInterval;if(q)r=c(q,this);else if(f)r=e;else if(m)r=a.dateFormat(m,e);else if(d&&1E3<=b)for(;d--&&void 0===r;)f=Math.pow(h,d+1),b>=f&&0===10*e%f&&null!==z[d]&&0!==e&&(r=a.numberFormat(e/f,-1)+z[d]);void 0===r&&(r=1E4<=Math.abs(e)?a.numberFormat(e,-1):a.numberFormat(e,-1,void 0,""));return r},getSeriesExtremes:function(){var a=this,e=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.buildStacks&&a.buildStacks();f(a.series,function(c){if(c.visible|| -!e.options.chart.ignoreHiddenSeries){var p=c.options,f=p.threshold,y;a.hasVisibleSeries=!0;a.isLog&&0>=f&&(f=null);if(a.isXAxis)p=c.xData,p.length&&(c=F(p),b(c)||c instanceof Date||(p=m(p,function(a){return b(a)}),c=F(p)),a.dataMin=Math.min(E(a.dataMin,p[0]),c),a.dataMax=Math.max(E(a.dataMax,p[0]),D(p)));else if(c.getExtremes(),y=c.dataMax,c=c.dataMin,l(c)&&l(y)&&(a.dataMin=Math.min(E(a.dataMin,c),c),a.dataMax=Math.max(E(a.dataMax,y),y)),l(f)&&(a.threshold=f),!p.softThreshold||a.isLog)a.softThreshold= -!1}})},translate:function(a,e,c,f,m,z){var p=this.linkedParent||this,y=1,h=0,d=f?p.oldTransA:p.transA;f=f?p.oldMin:p.min;var r=p.minPixelPadding;m=(p.isOrdinal||p.isBroken||p.isLog&&m)&&p.lin2val;d||(d=p.transA);c&&(y*=-1,h=p.len);p.reversed&&(y*=-1,h-=y*(p.sector||p.len));e?(a=(a*y+h-r)/d+f,m&&(a=p.lin2val(a))):(m&&(a=p.val2lin(a)),a=y*(a-f)*d+h+y*r+(b(z)?d*z:0));return a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a- -(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,e,c,f,m){var p=this.chart,y=this.left,h=this.top,d,r,q=c&&p.oldChartHeight||p.chartHeight,w=c&&p.oldChartWidth||p.chartWidth,g;d=this.transB;var x=function(a,b,e){if(ae)f?a=Math.min(Math.max(b,a),e):g=!0;return a};m=E(m,this.translate(a,null,null,c));a=c=Math.round(m+d);d=r=Math.round(q-m-d);b(m)?this.horiz?(d=h,r=q-this.bottom,a=c=x(a,y,y+this.width)):(a=y,c=w-this.right,d=r=x(d,h,h+this.height)):g=!0;return g&&!f?null:p.renderer.crispLine(["M", -a,d,"L",c,r],e||1)},getLinearTickPositions:function(a,e,c){var p,f=g(Math.floor(e/a)*a),y=g(Math.ceil(c/a)*a),m=[];if(e===c&&b(e))return[e];for(e=f;e<=y;){m.push(e);e=g(e+a);if(e===p)break;p=e}return m},getMinorTickPositions:function(){var a=this.options,b=this.tickPositions,e=this.minorTickInterval,c=[],f,m=this.pointRangePadding||0;f=this.min-m;var m=this.max+m,d=m-f;if(d&&d/e=this.minRange,d,h,r,q,g,w;this.isXAxis&&void 0===this.minRange&&!this.isLog&&(l(a.min)||l(a.max)?this.minRange=null:(f(this.series,function(a){q=a.xData;for(h=g=a.xIncrement? -1:q.length-1;0=t?(u=t,k=0):c.dataMax<=t&&(N=t,G=0)),c.min=E(J,u,c.dataMin),c.max=E(A,N,c.dataMax));d&&(!a&&0>=Math.min(c.min, -E(c.dataMin,c.min))&&h(10,1),c.min=g(r(c.min),15),c.max=g(r(c.max),15));c.range&&l(c.max)&&(c.userMin=c.min=J=Math.max(c.min,c.minFromRange()),c.userMax=A=c.max,c.range=null);H(c,"foundExtremes");c.beforePadding&&c.beforePadding();c.adjustForMinRange();!(K||c.axisPointRange||c.usePercentage||x)&&l(c.min)&&l(c.max)&&(r=c.max-c.min)&&(!l(J)&&k&&(c.min-=r*k),!l(A)&&G&&(c.max+=r*G));b(m.floor)?c.min=Math.max(c.min,m.floor):b(m.softMin)&&(c.min=Math.min(c.min,m.softMin));b(m.ceiling)?c.max=Math.min(c.max, -m.ceiling):b(m.softMax)&&(c.max=Math.max(c.max,m.softMax));I&&l(c.dataMin)&&(t=t||0,!l(J)&&c.min=t?c.min=t:!l(A)&&c.max>t&&c.dataMax<=t&&(c.max=t));c.tickInterval=c.min===c.max||void 0===c.min||void 0===c.max?1:x&&!v&&n===c.linkedParent.options.tickPixelInterval?v=c.linkedParent.tickInterval:E(v,this.tickAmount?(c.max-c.min)/Math.max(this.tickAmount-1,1):void 0,K?1:(c.max-c.min)*n/Math.max(c.len,n));q&&!a&&f(c.series,function(a){a.processData(c.min!==c.oldMin||c.max!==c.oldMax)});c.setAxisTranslation(!0); -c.beforeSetTickPositions&&c.beforeSetTickPositions();c.postProcessTickInterval&&(c.tickInterval=c.postProcessTickInterval(c.tickInterval));c.pointRange&&!v&&(c.tickInterval=Math.max(c.pointRange,c.tickInterval));a=E(m.minTickInterval,c.isDatetimeAxis&&c.closestPointRange);!v&&c.tickIntervalc.tickInterval&&1E3c.max)),!!this.tickAmount));this.tickAmount||(c.tickInterval= -c.unsquish());this.setTickPositions()},setTickPositions:function(){var a=this.options,b,e=a.tickPositions,c=a.tickPositioner,f=a.startOnTick,m=a.endOnTick,d;this.tickmarkOffset=this.categories&&"between"===a.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval="auto"===a.minorTickInterval&&this.tickInterval?this.tickInterval/5:a.minorTickInterval;this.tickPositions=b=e&&e.slice();!b&&(b=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,a.units), -this.min,this.max,a.startOfWeek,this.ordinalPositions,this.closestPointRange,!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max),b.length>this.len&&(b=[b[0],b.pop()]),this.tickPositions=b,c&&(c=c.apply(this,[this.min,this.max])))&&(this.tickPositions=b=c);this.isLinked||(this.trimTicks(b,f,m),this.min===this.max&&l(this.min)&&!this.tickAmount&&(d=!0,this.min-=.5,this.max+=.5),this.single=d,e||c||this.adjustTickAmount())}, -trimTicks:function(a,b,e){var c=a[0],p=a[a.length-1],f=this.minPointOffset||0;if(b)this.min=c;else for(;this.min-f>a[0];)a.shift();if(e)this.max=p;else for(;this.max+fb&&(this.finalTickAmt=b,b=5);this.tickAmount=b},adjustTickAmount:function(){var a=this.tickInterval,b=this.tickPositions,e=this.tickAmount,c=this.finalTickAmt,f=b&&b.length;if(fe&&(this.tickInterval*= -2,this.setTickPositions());if(l(c)){for(a=e=b.length;a--;)(3===c&&1===a%2||2>=c&&0=p&&(b=p)),this.displayBtn=void 0!==a||void 0!==b,this.setExtremes(a,b,!1,void 0,{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,e=b.offsetLeft||0,c=this.horiz,f=E(b.width,a.plotWidth-e+(b.offsetRight||0)),m=E(b.height,a.plotHeight),d=E(b.top,a.plotTop),b=E(b.left,a.plotLeft+e),e=/%$/;e.test(m)&&(m=Math.round(parseFloat(m)/ -100*a.plotHeight));e.test(d)&&(d=Math.round(parseFloat(d)/100*a.plotHeight+a.plotTop));this.left=b;this.top=d;this.width=f;this.height=m;this.bottom=a.chartHeight-m-d;this.right=a.chartWidth-f-b;this.len=Math.max(c?f:m,0);this.pos=c?b:d},getExtremes:function(){var a=this.isLog,b=this.lin2log;return{min:a?g(b(this.min)):this.min,max:a?g(b(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,e=this.lin2log, -c=b?e(this.min):this.min,b=b?e(this.max):this.max;null===a?a=c:c>a?a=c:ba?"right":195a?"left":"center"},tickSize:function(a){var b=this.options,e=b[a+"Length"],c=E(b[a+"Width"],"tick"===a&&this.isXAxis?1:0);if(c&&e)return"inside"===b[a+"Position"]&&(e=-e),[e,c]},labelMetrics:function(){return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize, -this.ticks[0]&&this.ticks[0].label)},unsquish:function(){var a=this.options.labels,b=this.horiz,e=this.tickInterval,c=e,m=this.len/(((this.categories?1:0)+this.max-this.min)/e),d,h=a.rotation,r=this.labelMetrics(),w,q=Number.MAX_VALUE,g,x=function(a){a/=m||1;a=1=a)w=x(Math.abs(r.h/Math.sin(t*a))),b=w+Math.abs(a/360),b(e.step||0)&&!e.rotation&&(this.staggerLines||1)*a.plotWidth/c||!b&&(f&&f-a.spacing[3]||.33*a.chartWidth)},renderUnsquish:function(){var a=this.chart,b=a.renderer,e=this.tickPositions,c=this.ticks,m=this.options.labels,d=this.horiz,h=this.getSlotWidth(),r=Math.max(1, -Math.round(h-2*(m.padding||5))),w={},g=this.labelMetrics(),l=m.style&&m.style.textOverflow,G,v=0,k,n;q(m.rotation)||(w.rotation=m.rotation||0);f(e,function(a){(a=c[a])&&a.labelLength>v&&(v=a.labelLength)});this.maxLabelLength=v;if(this.autoRotation)v>r&&v>g.h?w.rotation=this.labelRotation:this.labelRotation=0;else if(h&&(G={width:r+"px"},!l))for(G.textOverflow="clip",k=e.length;!d&&k--;)if(n=e[k],r=c[n].label)r.styles&&"ellipsis"===r.styles.textOverflow?r.css({textOverflow:"clip"}):c[n].labelLength> -h&&r.css({width:h+"px"}),r.getBBox().height>this.len/e.length-(g.h-g.f)&&(r.specCss={textOverflow:"ellipsis"});w.rotation&&(G={width:(v>.5*a.chartHeight?.33*a.chartHeight:a.chartHeight)+"px"},l||(G.textOverflow="ellipsis"));if(this.labelAlign=m.align||this.autoLabelAlign(this.labelRotation))w.align=this.labelAlign;f(e,function(a){var b=(a=c[a])&&a.label;b&&(b.attr(w),G&&b.css(x(G,b.specCss)),delete b.specCss,a.rotation=w.rotation)});this.tickRotCorr=b.rotCorr(g.b,this.labelRotation||0,0!==this.side)}, -hasData:function(){return this.hasVisibleSeries||l(this.min)&&l(this.max)&&!!this.tickPositions},getOffset:function(){var a=this,b=a.chart,e=b.renderer,c=a.options,m=a.tickPositions,d=a.ticks,h=a.horiz,r=a.side,w=b.inverted?[1,0,3,2][r]:r,g,q,x=0,G,v=0,k=c.title,n=c.labels,K=0,t=a.opposite,I=b.axisOffset,b=b.clipOffset,L=[-1,1,1,-1][r],u,H=c.className,J=a.axisParent,A=this.tickSize("tick");g=a.hasData();a.showAxis=q=g||E(c.showEmpty,!0);a.staggerLines=a.horiz&&n.staggerLines;a.axisGroup||(a.gridGroup= -e.g("grid").attr({zIndex:c.gridZIndex||1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+(H||"")).add(J),a.axisGroup=e.g("axis").attr({zIndex:c.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(H||"")).add(J),a.labelGroup=e.g("axis-labels").attr({zIndex:n.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels "+(H||"")).add(J));if(g||a.isLinked)f(m,function(b){d[b]?d[b].addLabel():d[b]=new N(a,b)}),a.renderUnsquish(),!1===n.reserveSpace||0!==r&&2!==r&&{1:"left",3:"right"}[r]!== -a.labelAlign&&"center"!==a.labelAlign||f(m,function(a){K=Math.max(d[a].getLabelSize(),K)}),a.staggerLines&&(K*=a.staggerLines,a.labelOffset=K*(a.opposite?-1:1));else for(u in d)d[u].destroy(),delete d[u];k&&k.text&&!1!==k.enabled&&(a.axisTitle||((u=k.textAlign)||(u=(h?{low:"left",middle:"center",high:"right"}:{low:t?"right":"left",middle:"center",high:t?"left":"right"})[k.align]),a.axisTitle=e.text(k.text,0,0,k.useHTML).attr({zIndex:7,rotation:k.rotation||0,align:u}).addClass("highcharts-axis-title").css(k.style).add(a.axisGroup), -a.axisTitle.isNew=!0),q&&(x=a.axisTitle.getBBox()[h?"height":"width"],G=k.offset,v=l(G)?0:E(k.margin,h?5:10)),a.axisTitle[q?"show":"hide"](!0));a.renderLine();a.offset=L*E(c.offset,I[r]);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};e=0===r?-a.labelMetrics().h:2===r?a.tickRotCorr.y:0;v=Math.abs(K)+v;K&&(v=v-e+L*(h?E(n.y,a.tickRotCorr.y+8*L):n.x));a.axisTitleMargin=E(G,v);I[r]=Math.max(I[r],a.axisTitleMargin+x+L*a.offset,v,g&&m.length&&A?A[0]:0);c=c.offset?0:2*Math.floor(a.axisLine.strokeWidth()/2);b[w]= -Math.max(b[w],c)},getLinePath:function(a){var b=this.chart,e=this.opposite,c=this.offset,f=this.horiz,m=this.left+(e?this.width:0)+c,c=b.chartHeight-this.bottom-(e?this.height:0)+c;e&&(a*=-1);return b.renderer.crispLine(["M",f?this.left:m,f?c:this.top,"L",f?b.chartWidth-this.right:m,f?c:b.chartHeight-this.bottom],a)},renderLine:function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.axisLine.attr({stroke:this.options.lineColor, -"stroke-width":this.options.lineWidth,zIndex:7}))},getTitlePosition:function(){var a=this.horiz,b=this.left,e=this.top,c=this.len,f=this.options.title,m=a?b:e,d=this.opposite,h=this.offset,r=f.x||0,w=f.y||0,g=this.chart.renderer.fontMetrics(f.style&&f.style.fontSize,this.axisTitle).f,c={low:m+(a?0:c),middle:m+c/2,high:m+(a?c:0)}[f.align],b=(a?e+this.height:b)+(a?1:-1)*(d?-1:1)*this.axisTitleMargin+(2===this.side?g:0);return{x:a?c+r:b+(d?this.width:0)+h+r,y:a?b+w-(d?this.height:0)+h:c+w}},render:function(){var a= -this,e=a.chart,c=e.renderer,m=a.options,d=a.isLog,h=a.lin2log,r=a.isLinked,w=a.tickPositions,g=a.axisTitle,q=a.ticks,x=a.minorTicks,l=a.alternateBands,v=m.stackLabels,k=m.alternateGridColor,n=a.tickmarkOffset,K=a.axisLine,E=e.hasRendered&&b(a.oldMin),t=a.showAxis,I=A(c.globalAnimation),L,u;a.labelEdge.length=0;a.overlap=!1;f([q,x,l],function(a){for(var b in a)a[b].isActive=!1});if(a.hasData()||r)a.minorTickInterval&&!a.categories&&f(a.getMinorTickPositions(),function(b){x[b]||(x[b]=new N(a,b,"minor")); -E&&x[b].isNew&&x[b].render(null,!0);x[b].render(null,!1,1)}),w.length&&(f(w,function(b,e){if(!r||b>=a.min&&b<=a.max)q[b]||(q[b]=new N(a,b)),E&&q[b].isNew&&q[b].render(e,!0,.1),q[b].render(e)}),n&&(0===a.min||a.single)&&(q[-1]||(q[-1]=new N(a,-1,null,!0)),q[-1].render(-1))),k&&f(w,function(b,c){u=void 0!==w[c+1]?w[c+1]+n:a.max-n;0===c%2&&b=f.second?0:L*Math.floor(b.getMilliseconds()/L));if(x>=f.second)b[A.hcSetSeconds](x>=f.minute?0:L*Math.floor(b.getSeconds()/ -L));if(x>=f.minute)b[A.hcSetMinutes](x>=f.hour?0:L*Math.floor(b[A.hcGetMinutes]()/L));if(x>=f.hour)b[A.hcSetHours](x>=f.day?0:L*Math.floor(b[A.hcGetHours]()/L));if(x>=f.day)b[A.hcSetDate](x>=f.month?1:L*Math.floor(b[A.hcGetDate]()/L));x>=f.month&&(b[A.hcSetMonth](x>=f.year?0:L*Math.floor(b[A.hcGetMonth]()/L)),h=b[A.hcGetFullYear]());if(x>=f.year)b[A.hcSetFullYear](h-h%L);if(x===f.week)b[A.hcSetDate](b[A.hcGetDate]()-b[A.hcGetDay]()+n(c,1));h=b[A.hcGetFullYear]();c=b[A.hcGetMonth]();var u=b[A.hcGetDate](), -w=b[A.hcGetHours]();if(A.hcTimezoneOffset||A.hcGetTimezoneOffset)E=(!r||!!A.hcGetTimezoneOffset)&&(t-v>4*f.month||l(v)!==l(t)),b=b.getTime(),b=new A(b+l(b));r=b.getTime();for(v=1;rg&&(!l||m<=u)&&void 0!==m&&v.push(m),m>u&&(r=!0),m=e;else g=f(g),u= -f(u),a=d[l?"minorTickInterval":"tickInterval"],a=k("auto"===a?null:a,this._minorAutoInterval,d.tickPixelInterval/(l?5:1)*(u-g)/((l?n/this.tickPositions.length:n)||1)),a=F(a,null,A(a)),v=D(this.getLinearTickPositions(a,g,u),h),l||(this._minorAutoInterval=a/5);l||(this.tickInterval=a);return v};C.prototype.log2lin=function(a){return Math.log(a)/Math.LN10};C.prototype.lin2log=function(a){return Math.pow(10,a)}})(M);(function(a){var C=a.dateFormat,A=a.each,D=a.extend,F=a.format,k=a.isNumber,d=a.map,g= -a.merge,u=a.pick,l=a.splat,t=a.stop,n=a.syncTimeout,f=a.timeUnits;a.Tooltip=function(){this.init.apply(this,arguments)};a.Tooltip.prototype={init:function(a,f){this.chart=a;this.options=f;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.split=f.split&&!a.inverted;this.shared=f.shared||this.split},cleanSplit:function(a){A(this.chart.series,function(f){var d=f&&f.tt;d&&(!d.isActive||a?f.tt=d.destroy():d.isActive=!1)})},getLabel:function(){var a=this.chart.renderer,f=this.options;this.label|| -(this.split?this.label=a.g("tooltip"):(this.label=a.label("",0,0,f.shape||"callout",null,null,f.useHTML,null,"tooltip").attr({padding:f.padding,r:f.borderRadius}),this.label.attr({fill:f.backgroundColor,"stroke-width":f.borderWidth}).css(f.style).shadow(f.shadow)),this.label.attr({zIndex:8}).add());return this.label},update:function(a){this.destroy();this.init(this.chart,g(!0,this.options,a))},destroy:function(){this.label&&(this.label=this.label.destroy());this.split&&this.tt&&(this.cleanSplit(this.chart, -!0),this.tt=this.tt.destroy());clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,f,d,c){var e=this,m=e.now,r=!1!==e.options.animation&&!e.isHidden&&(1g-r?g:g-r);else if(w)m[a]=Math.max(d,f+r+c>b?f:f+r);else return!1},k=function(a,b,c,f){var d;fb-e?d=!1:m[a]=fb-c/2?b-c-2:f-c/2;return d},n=function(a){var c=b;b=g;g=c;h=a},w=function(){!1!==l.apply(0,b)?!1!==k.apply(0,g)||h||(n(!0),w()):h?m.x=m.y=0:(n(!0),w())};(c.inverted||1w&&(r=!1);a=(f.series&&f.series.yAxis&&f.series.yAxis.pos)+(f.plotY||0);a-=e.plotTop;c.push({target:f.isHeader?e.plotHeight+b:a,rank:f.isHeader?1:0,size:x.tt.getBBox().height+1,point:f,x:w,tt:l})});this.cleanSplit(); -a.distribute(c,e.plotHeight+b);A(c,function(a){var b=a.point;a.tt.attr({visibility:void 0===a.pos?"hidden":"inherit",x:r||b.isHeader?a.x:b.plotX+e.plotLeft+u(g.distance,16),y:a.pos+e.plotTop,anchorX:b.plotX+e.plotLeft,anchorY:b.isHeader?a.pos+e.plotTop-15:b.plotY+e.plotTop})})},updatePosition:function(a){var f=this.chart,d=this.getLabel(),d=(this.options.positioner||this.getPosition).call(this,d.width,d.height,a);this.move(Math.round(d.x),Math.round(d.y||0),a.plotX+f.plotLeft,a.plotY+f.plotTop)}, -getXDateFormat:function(a,d,g){var c;d=d.dateTimeLabelFormats;var e=g&&g.closestPointRange,m,r={millisecond:15,second:12,minute:9,hour:6,day:3},h,b="millisecond";if(e){h=C("%m-%d %H:%M:%S.%L",a.x);for(m in f){if(e===f.week&&+C("%w",a.x)===g.options.startOfWeek&&"00:00:00.000"===h.substr(6)){m="week";break}if(f[m]>e){m=b;break}if(r[m]&&h.substr(r[m])!=="01-01 00:00:00.000".substr(r[m]))break;"week"!==m&&(b=m)}m&&(c=d[m])}else c=d.day;return c||d.year},tooltipFooterHeaderFormatter:function(a,f){var d= -f?"footer":"header";f=a.series;var c=f.tooltipOptions,e=c.xDateFormat,m=f.xAxis,r=m&&"datetime"===m.options.type&&k(a.key),d=c[d+"Format"];r&&!e&&(e=this.getXDateFormat(a,c,m));r&&e&&(d=d.replace("{point.key}","{point.key:"+e+"}"));return F(d,{point:a,series:f})},bodyFormatter:function(a){return d(a,function(a){var f=a.series.tooltipOptions;return(f.pointFormatter||a.point.tooltipFormatter).call(a.point,f.pointFormat)})}}})(M);(function(a){var C=a.addEvent,A=a.attr,D=a.charts,F=a.color,k=a.css,d= -a.defined,g=a.doc,u=a.each,l=a.extend,t=a.fireEvent,n=a.offset,f=a.pick,h=a.removeEvent,v=a.splat,H=a.Tooltip,c=a.win;a.Pointer=function(a,c){this.init(a,c)};a.Pointer.prototype={init:function(a,c){this.options=c;this.chart=a;this.runChartClick=c.chart.events&&!!c.chart.events.click;this.pinchDown=[];this.lastValidTouch={};H&&c.tooltip.enabled&&(a.tooltip=new H(a,c.tooltip),this.followTouchMove=f(c.tooltip.followTouchMove,!0));this.setDOMEvents()},zoomOption:function(a){var c=this.chart,e=c.options.chart, -d=e.zoomType||"",c=c.inverted;/touch/.test(a.type)&&(d=f(e.pinchType,d));this.zoomX=a=/x/.test(d);this.zoomY=d=/y/.test(d);this.zoomHor=a&&!c||d&&c;this.zoomVert=d&&!c||a&&c;this.hasZoom=a||d},normalize:function(a,f){var e,m;a=a||c.event;a.target||(a.target=a.srcElement);m=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;f||(this.chartPosition=f=n(this.chart.container));void 0===m.pageX?(e=Math.max(a.x,a.clientX-f.left),f=a.y):(e=m.pageX-f.left,f=m.pageY-f.top);return l(a,{chartX:Math.round(e), -chartY:Math.round(f)})},getCoordinates:function(a){var c={xAxis:[],yAxis:[]};u(this.chart.axes,function(e){c[e.isXAxis?"xAxis":"yAxis"].push({axis:e,value:e.toValue(a[e.horiz?"chartX":"chartY"])})});return c},runPointActions:function(c){var e=this.chart,d=e.series,h=e.tooltip,b=h?h.shared:!1,q=!0,l=e.hoverPoint,k=e.hoverSeries,n,t,w,K=[],G;if(!b&&!k)for(n=0;nc.series.index?-1:1}));if(b)for(n=K.length;n--;)(K[n].x!==K[0].x||K[n].series.noSharedTooltip)&&K.splice(n,1);if(K[0]&&(K[0]!==this.prevKDPoint||h&&h.isHidden)){if(b&& -!K[0].series.noSharedTooltip){for(n=0;ng+k&&(f=g+k),bl+w&&(b=l+w),this.hasDragged=Math.sqrt(Math.pow(t-f,2)+Math.pow(p-b,2)),10E.max&&(d=E.max-b,p=!0);p?(K-=.8*(K-h[c][0]),J||(N-=.8*(N-h[c][1])),l()):h[c]=[K,N];u||(f[c]=q-t,f[r]=b);f=u?1/x:x;n[r]=b;n[c]=d;k[u?a?"scaleY":"scaleX":"scale"+e]=x;k["translate"+e]=f* -t+(K-f*w)},pinch:function(a){var g=this,l=g.chart,t=g.pinchDown,n=a.touches,f=n.length,h=g.lastValidTouch,v=g.hasZoom,H=g.selectionMarker,c={},e=1===f&&(g.inClass(a.target,"highcharts-tracker")&&l.runTrackerClick||g.runChartClick),m={};1f-6&&d(K||c.chartWidth- -2*v-p-d.x)&&(this.itemX=p,this.itemY+=N+this.lastLineHeight+G,this.lastLineHeight=0);this.maxItemWidth=Math.max(this.maxItemWidth,b);this.lastItemY=N+this.itemY+G;this.lastLineHeight=Math.max(g,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];h?this.itemX+=b:(this.itemY+=N+g+G,this.lastLineHeight=g);this.offsetWidth=K||Math.max((h?this.itemX-p-u:b)+v,this.offsetWidth)},getAllItems:function(){var a=[];d(this.chart.series,function(c){var e=c&&c.options;c&&n(e.showInLegend,k(e.linkedTo)? -!1:void 0,!0)&&(a=a.concat(c.legendItems||("point"===e.legendType?c.data:c)))});return a},adjustMargins:function(a,e){var c=this.chart,f=this.options,h=f.align.charAt(0)+f.verticalAlign.charAt(0)+f.layout.charAt(0);f.floating||d([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(b,d){b.test(h)&&!k(a[d])&&(c[l[d]]=Math.max(c[l[d]],c.legend[(d+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][d]*f[d%2?"x":"y"]+n(f.margin,12)+e[d]))})},render:function(){var a=this,e=a.chart,f=e.renderer, -l=a.group,k,b,q,n,t=a.box,v=a.options,u=a.padding;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;l||(a.group=l=f.g("legend").attr({zIndex:7}).add(),a.contentGroup=f.g().attr({zIndex:1}).add(l),a.scrollGroup=f.g().add(a.contentGroup));a.renderTitle();k=a.getAllItems();h(k,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});v.reversed&&k.reverse();a.allItems=k;a.display=b=!!k.length;a.lastLineHeight=0;d(k,function(b){a.renderItem(b)}); -q=(v.width||a.offsetWidth)+u;n=a.lastItemY+a.lastLineHeight+a.titleHeight;n=a.handleOverflow(n);n+=u;t||(a.box=t=f.rect().addClass("highcharts-legend-box").attr({r:v.borderRadius}).add(l),t.isNew=!0);t.attr({stroke:v.borderColor,"stroke-width":v.borderWidth||0,fill:v.backgroundColor||"none"}).shadow(v.shadow);0f&&!1!==k.enabled?(this.clipHeight=q=Math.max(f-20-this.titleHeight-G,0),this.currentPage=n(this.currentPage,1),this.fullHeight=a,d(p,function(a,b){var c=a._legendItemPos[1];a=Math.round(a.legendItem.getBBox().height);var e=K.length;if(!e||c-K[e-1]>q&&(u||c)!==K[e-1])K.push(u||c),e++;b===p.length-1&&c+a-K[e-1]>q&&K.push(c);c!==u&&(u=c)}),l||(l=c.clipRect= -h.clipRect(0,G,9999,0),c.contentGroup.clip(l)),y(q),w||(this.nav=w=h.g().attr({zIndex:1}).add(this.group),this.up=h.symbol("triangle",0,0,v,v).on("click",function(){c.scroll(-1,t)}).add(w),this.pager=h.text("",15,10).addClass("highcharts-legend-navigation").css(k.style).add(w),this.down=h.symbol("triangle-down",0,0,v,v).on("click",function(){c.scroll(1,t)}).add(w)),c.scroll(0),a=f):w&&(y(),w.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return a},scroll:function(a,e){var c=this.pages, -d=c.length;a=this.currentPage+a;var h=this.clipHeight,b=this.options.navigation,g=this.pager,l=this.padding;a>d&&(a=d);0c&&(d=typeof a[0],"string"===d?f.name=a[0]:"number"===d&&(f.x=a[0]),e++);m=g.value;)g=f[++d];g&&g.color&&!this.options.color&&(this.color=g.color);return g},destroy:function(){var a=this.series.chart,f=a.hoverPoints,d;a.pointCount--;f&&(this.setState(),F(f,this),f.length||(a.hoverPoints=null));if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)t(this), -this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(d in this)this[d]=null},destroyElements:function(){for(var a=["graphic","dataLabel","dataLabelUpper","connector","shadowGroup"],f,d=6;d--;)f=a[d],this[f]&&(this[f]=this[f].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,color:this.color,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var f=this.series,g= -f.tooltipOptions,k=l(g.valueDecimals,""),n=g.valuePrefix||"",c=g.valueSuffix||"";A(f.pointArrayMap||["y"],function(e){e="{point."+e;if(n||c)a=a.replace(e+"}",n+e+"}"+c);a=a.replace(e+"}",e+":,."+k+"f}")});return d(a,{point:this,series:this.series})},firePointEvent:function(a,f,d){var g=this,h=this.series.options;(h.point.events[a]||g.options&&g.options.events&&g.options.events[a])&&this.importEvents();"click"===a&&h.allowPointSelect&&(d=function(a){g.select&&g.select(null,a.ctrlKey||a.metaKey||a.shiftKey)}); -k(this,a,f,d)},visible:!0}})(M);(function(a){var C=a.addEvent,A=a.animObject,D=a.arrayMax,F=a.arrayMin,k=a.correctFloat,d=a.Date,g=a.defaultOptions,u=a.defaultPlotOptions,l=a.defined,t=a.each,n=a.erase,f=a.error,h=a.extend,v=a.fireEvent,H=a.grep,c=a.isArray,e=a.isNumber,m=a.isString,r=a.merge,I=a.pick,b=a.removeEvent,q=a.splat,x=a.stableSort,L=a.SVGElement,E=a.syncTimeout,J=a.win;a.Series=a.seriesType("line",null,{lineWidth:2,allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{}, -marker:{lineWidth:0,lineColor:"#ffffff",radius:4,states:{hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){return null===this.y?"":a.numberFormat(this.y,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0,padding:5},cropThreshold:300,pointRange:0,softThreshold:!0,states:{hover:{lineWidthPlus:1, -marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3},{isCartesian:!0,pointClass:a.Point,sorted:!0,requireSorting:!0,directTouch:!1,axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],coll:"series",init:function(a,b){var c=this,e,f,d=a.series,g,m=function(a,b){return I(a.options.index,a._i)-I(b.options.index,b._i)};c.chart=a;c.options=b=c.setOptions(b);c.linkedSeries=[];c.bindAxes();h(c,{name:b.name,state:"",visible:!1!==b.visible,selected:!0=== -b.selected});f=b.events;for(e in f)C(c,e,f[e]);if(f&&f.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=!0;c.getColor();c.getSymbol();t(c.parallelArrays,function(a){c[a+"Data"]=[]});c.setData(b.data,!1);c.isCartesian&&(a.hasCartesianSeries=!0);d.length&&(g=d[d.length-1]);c._i=I(g&&g._i,-1)+1;d.push(c);x(d,m);this.yAxis&&x(this.yAxis.series,m);t(d,function(a,b){a.index=b;a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var a=this,b=a.options,c=a.chart, -e;t(a.axisTypes||[],function(d){t(c[d],function(c){e=c.options;if(b[d]===e.index||void 0!==b[d]&&b[d]===e.id||void 0===b[d]&&0===e.index)c.series.push(a),a[d]=c,c.isDirty=!0});a[d]||a.optionalAxis===d||f(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,f=arguments,d=e(b)?function(e){var f="y"===e&&c.toYData?c.toYData(a):a[e];c[e+"Data"][b]=f}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(f,2))};t(c.parallelArrays,d)},autoIncrement:function(){var a=this.options, -b=this.xIncrement,c,e=a.pointIntervalUnit,b=I(b,a.pointStart,0);this.pointInterval=c=I(this.pointInterval,a.pointInterval,1);e&&(a=new d(b),"day"===e?a=+a[d.hcSetDate](a[d.hcGetDate]()+c):"month"===e?a=+a[d.hcSetMonth](a[d.hcGetMonth]()+c):"year"===e&&(a=+a[d.hcSetFullYear](a[d.hcGetFullYear]()+c)),c=a-b);this.xIncrement=b+c;return b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},e=b.plotOptions||{},f=c[this.type];this.userOptions=a;c=r(f,c.series,a);this.tooltipOptions= -r(g.tooltip,g.plotOptions[this.type].tooltip,b.tooltip,e.series&&e.series.tooltip,e[this.type]&&e[this.type].tooltip,a.tooltip);null===f.marker&&delete c.marker;this.zoneAxis=c.zoneAxis;a=this.zones=(c.zones||[]).slice();!c.negativeColor&&!c.negativeFillColor||c.zones||a.push({value:c[this.zoneAxis+"Threshold"]||c.threshold||0,className:"highcharts-negative",color:c.negativeColor,fillColor:c.negativeFillColor});a.length&&l(a[a.length-1].value)&&a.push({color:this.color,fillColor:this.fillColor}); -return c},getCyclic:function(a,b,c){var e,f=this.userOptions,d=a+"Index",g=a+"Counter",h=c?c.length:I(this.chart.options.chart[a+"Count"],this.chart[a+"Count"]);b||(e=I(f[d],f["_"+d]),l(e)||(f["_"+d]=e=this.chart[g]%h,this.chart[g]+=1),c&&(b=c[e]));void 0!==e&&(this[d]=e);this[a]=b},getColor:function(){this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||u[this.type].color,this.chart.options.colors)},getSymbol:function(){this.getCyclic("symbol",this.options.marker.symbol, -this.chart.options.symbols)},drawLegendSymbol:a.LegendSymbolMixin.drawLineMarker,setData:function(a,b,d,g){var h=this,k=h.points,l=k&&k.length||0,w,q=h.options,r=h.chart,n=null,x=h.xAxis,v=q.turboThreshold,K=this.xData,G=this.yData,E=(w=h.pointArrayMap)&&w.length;a=a||[];w=a.length;b=I(b,!0);if(!1!==g&&w&&l===w&&!h.cropped&&!h.hasGroupedData&&h.visible)t(a,function(a,b){k[b].update&&a!==q.data[b]&&k[b].update(a,!1,null,!1)});else{h.xIncrement=null;h.colorCounter=0;t(this.parallelArrays,function(a){h[a+ -"Data"].length=0});if(v&&w>v){for(d=0;null===n&&dk||this.forceCrop))if(b[e-1]t)b=[],c=[];else if(b[0]t)d=this.cropData(this.xData,this.yData,n,t),b=d.xData,c=d.yData,d=d.start,g=!0;for(k=b.length||1;--k;)e=r?l(b[k])-l(b[k-1]):b[k]-b[k-1],0e&&this.requireSorting&&f(15);this.cropped=g;this.cropStart=d;this.processedXData=b;this.processedYData=c;this.closestPointRange=h},cropData:function(a,b,c,e){var f=a.length,d=0,g=f,h=I(this.cropShoulder,1),m;for(m=0;m=c){d=Math.max(0,m- -h);break}for(c=m;ce){g=c+h;break}return{xData:a.slice(d,g),yData:b.slice(d,g),start:d,end:g}},generatePoints:function(){var a=this.options.data,b=this.data,c,e=this.processedXData,f=this.processedYData,d=this.pointClass,g=e.length,h=this.cropStart||0,m,k=this.hasGroupedData,l,r=[],n;b||k||(b=[],b.length=a.length,b=this.data=b);for(n=0;n=m&&(f[n-1]||q)<=k,l&&q)if(l=w.length)for(;l--;)null!==w[l]&&(g[h++]=w[l]);else g[h++]=w;this.dataMin=F(g);this.dataMax=D(g)},translate:function(){this.processedXData||this.processData();this.generatePoints();var a=this.options,b=a.stacking,c=this.xAxis,f=c.categories,d=this.yAxis,g=this.points,h=g.length,m=!!this.modifyValue,q=a.pointPlacement,n="between"===q||e(q),r=a.threshold,t=a.startFromThreshold?r:0,x,v,E,u,J=Number.MAX_VALUE;"between"===q&&(q=.5);e(q)&&(q*=I(a.pointRange||c.pointRange)); -for(a=0;a=A&&(L.isNull=!0);L.plotX=x=k(Math.min(Math.max(-1E5,c.translate(H,0,0,0,1,q,"flags"===this.type)),1E5));b&&this.visible&&!L.isNull&&C&&C[H]&&(u=this.getStackIndicator(u,H,this.index),D=C[H],A=D.points[u.key],v=A[0],A=A[1],v===t&&u.key===C[H].base&&(v=I(r,d.min)),d.isLog&&0>=v&&(v=null),L.total=L.stackTotal=D.total,L.percentage=D.total&&L.y/D.total*100,L.stackY= -A,D.setOffset(this.pointXOffset||0,this.barW||0));L.yBottom=l(v)?d.translate(v,0,1,0,1):null;m&&(A=this.modifyValue(A,L));L.plotY=v="number"===typeof A&&Infinity!==A?Math.min(Math.max(-1E5,d.translate(A,0,1,0,1)),1E5):void 0;L.isInside=void 0!==v&&0<=v&&v<=d.len&&0<=x&&x<=c.len;L.clientX=n?k(c.translate(H,0,0,0,1,q)):x;L.negative=L.y<(r||0);L.category=f&&void 0!==f[L.x]?f[L.x]:L.x;L.isNull||(void 0!==E&&(J=Math.min(J,Math.abs(x-E))),E=x)}this.closestPointRangePx=J},getValidPoints:function(a,b){var c= -this.chart;return H(a||this.points||[],function(a){return b&&!c.isInsidePlot(a.plotX,a.plotY,c.inverted)?!1:!a.isNull})},setClip:function(a){var b=this.chart,c=this.options,e=b.renderer,f=b.inverted,d=this.clipBox,g=d||b.clipBox,h=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,g.height,c.xAxis,c.yAxis].join(),m=b[h],k=b[h+"m"];m||(a&&(g.width=0,b[h+"m"]=k=e.clipRect(-99,f?-b.plotLeft:-b.plotTop,99,f?b.chartWidth:b.chartHeight)),b[h]=m=e.clipRect(g),m.count={length:0});a&&!m.count[this.index]&& -(m.count[this.index]=!0,m.count.length+=1);!1!==c.clip&&(this.group.clip(a||d?m:b.clipRect),this.markerGroup.clip(k),this.sharedClipKey=h);a||(m.count[this.index]&&(delete m.count[this.index],--m.count.length),0===m.count.length&&h&&b[h]&&(d||(b[h]=b[h].destroy()),b[h+"m"]&&(b[h+"m"]=b[h+"m"].destroy())))},animate:function(a){var b=this.chart,c=A(this.options.animation),e;a?this.setClip(c):(e=this.sharedClipKey,(a=b[e])&&a.animate({width:b.plotSizeX},c),b[e+"m"]&&b[e+"m"].animate({width:b.plotSizeX+ -99},c),this.animate=null)},afterAnimate:function(){this.setClip();v(this,"afterAnimate")},drawPoints:function(){var a=this.points,b=this.chart,c,f,d,g,h=this.options.marker,m,k,l,q,n=this.markerGroup,r=I(h.enabled,this.xAxis.isRadial?!0:null,this.closestPointRangePx>2*h.radius);if(!1!==h.enabled||this._hasPointMarkers)for(f=a.length;f--;)d=a[f],c=d.plotY,g=d.graphic,m=d.marker||{},k=!!d.marker,l=r&&void 0===m.enabled||m.enabled,q=d.isInside,l&&e(c)&&null!==d.y?(c=I(m.symbol,this.symbol),d.hasImage= -0===c.indexOf("url"),l=this.markerAttribs(d,d.selected&&"select"),g?g[q?"show":"hide"](!0).animate(l):q&&(0f&&b.shadow));g&&(g.startX=c.xMap, -g.isArea=c.isArea)})},applyZones:function(){var a=this,b=this.chart,c=b.renderer,e=this.zones,f,d,g=this.clips||[],h,m=this.graph,k=this.area,l=Math.max(b.chartWidth,b.chartHeight),q=this[(this.zoneAxis||"y")+"Axis"],n,r,x=b.inverted,v,E,u,L,J=!1;e.length&&(m||k)&&q&&void 0!==q.min&&(r=q.reversed,v=q.horiz,m&&m.hide(),k&&k.hide(),n=q.getExtremes(),t(e,function(e,p){f=r?v?b.plotWidth:0:v?0:q.toPixels(n.min);f=Math.min(Math.max(I(d,f),0),l);d=Math.min(Math.max(Math.round(q.toPixels(I(e.value,n.max), -!0)),0),l);J&&(f=d=q.toPixels(n.max));E=Math.abs(f-d);u=Math.min(f,d);L=Math.max(f,d);q.isXAxis?(h={x:x?L:u,y:0,width:E,height:l},v||(h.x=b.plotHeight-h.x)):(h={x:0,y:x?L:u,width:l,height:E},v&&(h.y=b.plotWidth-h.y));x&&c.isVML&&(h=q.isXAxis?{x:0,y:r?u:L,height:h.width,width:b.chartWidth}:{x:h.y-b.plotLeft-b.spacingBox.x,y:0,width:h.height,height:b.chartHeight});g[p]?g[p].animate(h):(g[p]=c.clipRect(h),m&&a["zone-graph-"+p].clip(g[p]),k&&a["zone-area-"+p].clip(g[p]));J=e.value>n.max}),this.clips= -g)},invertGroups:function(a){function b(){var b={width:c.yAxis.len,height:c.xAxis.len};t(["group","markerGroup"],function(e){c[e]&&c[e].attr(b).invert(a)})}var c=this,e;c.xAxis&&(e=C(c.chart,"resize",b),C(c,"destroy",e),b(a),c.invertGroups=b)},plotGroup:function(a,b,c,e,f){var d=this[a],g=!d;g&&(this[a]=d=this.chart.renderer.g(b).attr({zIndex:e||.1}).add(f),d.addClass("highcharts-series-"+this.index+" highcharts-"+this.type+"-series highcharts-color-"+this.colorIndex+" "+(this.options.className|| -"")));d.attr({visibility:c})[g?"attr":"animate"](this.getPlotBox());return d},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;a.inverted&&(b=c,c=this.xAxis);return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this,b=a.chart,c,e=a.options,f=!!a.animate&&b.renderer.isSVG&&A(e.animation).duration,d=a.visible?"inherit":"hidden",g=e.zIndex,h=a.hasRendered,m=b.seriesGroup,k=b.inverted;c=a.plotGroup("group","series",d,g,m);a.markerGroup= -a.plotGroup("markerGroup","markers",d,g,m);f&&a.animate(!0);c.inverted=a.isCartesian?k:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(k);!1===e.clip||a.sharedClipKey||h||c.clip(b.clipRect);f&&a.animate();h||(a.animationTimeout=E(function(){a.afterAnimate()},f));a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirty|| -this.isDirtyData,c=this.group,e=this.xAxis,f=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:I(e&&e.left,a.plotLeft),translateY:I(f&&f.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree},kdDimensions:1,kdAxisArray:["clientX","plotY"],searchPoint:function(a,b){var c=this.xAxis,e=this.yAxis,f=this.chart.inverted;return this.searchKDTree({clientX:f?c.len-a.chartY+c.pos:a.chartX-c.pos,plotY:f?e.len-a.chartX+e.pos:a.chartY-e.pos},b)}, -buildKDTree:function(){function a(c,e,f){var d,g;if(g=c&&c.length)return d=b.kdAxisArray[e%f],c.sort(function(a,b){return a[d]-b[d]}),g=Math.floor(g/2),{point:c[g],left:a(c.slice(0,g),e+1,f),right:a(c.slice(g+1),e+1,f)}}var b=this,c=b.kdDimensions;delete b.kdTree;E(function(){b.kdTree=a(b.getValidPoints(null,!b.directTouch),c,c)},b.options.kdNow?0:1)},searchKDTree:function(a,b){function c(a,b,h,m){var k=b.point,q=e.kdAxisArray[h%m],n,r,p=k;r=l(a[f])&&l(k[f])?Math.pow(a[f]-k[f],2):null;n=l(a[d])&& -l(k[d])?Math.pow(a[d]-k[d],2):null;n=(r||0)+(n||0);k.dist=l(n)?Math.sqrt(n):Number.MAX_VALUE;k.distX=l(r)?Math.sqrt(r):Number.MAX_VALUE;q=a[q]-k[q];n=0>q?"left":"right";r=0>q?"right":"left";b[n]&&(n=c(a,b[n],h+1,m),p=n[g]n;)r--;this.updateParallelArrays(k,"splice",r,0,0);this.updateParallelArrays(k,r);h&&k.name&&(h[n]=k.name);m.splice(r,0,a);l&&(this.data.splice(r,0,null),this.processData());"point"===b.legendType&&this.generatePoints();e&&(d[0]&&d[0].remove?d[0].remove(!1):(d.shift(),this.updateParallelArrays(k,"shift"),m.shift()));this.isDirtyData=this.isDirty=!0;c&&g.redraw(f)},removePoint:function(a, -c,e){var b=this,f=b.data,d=f[a],g=b.points,h=b.chart,m=function(){g&&g.length===f.length&&g.splice(a,1);f.splice(a,1);b.options.data.splice(a,1);b.updateParallelArrays(d||{series:b},"splice",a,1);d&&d.destroy();b.isDirty=!0;b.isDirtyData=!0;c&&h.redraw()};r(e,h);c=H(c,!0);d?d.firePointEvent("remove",null,m):m()},remove:function(a,c,e){function b(){f.destroy();d.isDirtyLegend=d.isDirtyBox=!0;d.linkSeries();H(a,!0)&&d.redraw(c)}var f=this,d=f.chart;!1!==e?t(f,"remove",null,b):b()},update:function(a, -c){var b=this,e=this.chart,f=this.userOptions,d=this.type,h=a.type||f.type||e.options.chart.type,k=m[d].prototype,q=["group","markerGroup","dataLabelsGroup"],r;if(h&&h!==d||void 0!==a.zIndex)q.length=0;g(q,function(a){q[a]=b[a];delete b[a]});a=v(f,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1,null,!1);for(r in k)this[r]=void 0;l(this,m[h||d].prototype);g(q,function(a){b[a]=q[a]});this.init(e,a);e.linkSeries();H(c,!0)&&e.redraw(!1)}});l(D.prototype, -{update:function(a,c){var b=this.chart;a=b.options[this.coll][this.options.index]=v(this.userOptions,a);this.destroy(!0);this.init(b,l(a,{events:void 0}));b.isDirtyBox=!0;H(c,!0)&&b.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,e=this.series,f=e.length;f--;)e[f]&&e[f].remove(!1);u(b.axes,this);u(b[c],this);b.options[c].splice(this.options.index,1);g(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;H(a,!0)&&b.redraw()},setTitle:function(a,c){this.update({title:a}, -c)},setCategories:function(a,c){this.update({categories:a},c)}})})(M);(function(a){var C=a.color,A=a.each,D=a.map,F=a.pick,k=a.Series,d=a.seriesType;d("area","line",{softThreshold:!1,threshold:0},{singleStacks:!1,getStackPoints:function(){var a=[],d=[],k=this.xAxis,t=this.yAxis,n=t.stacks[this.stackKey],f={},h=this.points,v=this.index,H=t.series,c=H.length,e,m=F(t.options.reversedStacks,!0)?1:-1,r,I;if(this.options.stacking){for(r=0;ra&&l>d?(l=Math.max(a,d),n=2*d-l):lF&& -n>d?(n=Math.max(F,d),l=2*d-n):n=Math.abs(d)&&.5a.closestPointRange*a.xAxis.transA,l=a.borderWidth=g(k.borderWidth,l?0:1),c=a.yAxis,e=a.translatedThreshold=c.getThreshold(k.threshold),m=g(k.minPointLength,5),r=a.getColumnMetrics(),n=r.width,b=a.barW=Math.max(n,1+2*l),q=a.pointXOffset= -r.offset;d.inverted&&(e-=.5);k.pointPadding&&(b=Math.ceil(b));u.prototype.translate.apply(a);D(a.points,function(f){var h=g(f.yBottom,e),k=999+Math.abs(h),k=Math.min(Math.max(-k,f.plotY),c.len+k),l=f.plotX+q,r=b,t=Math.min(k,h),x,v=Math.max(k,h)-t;Math.abs(v)m?h-m:e-(x?m:0));f.barX=l;f.pointWidth=n;f.tooltipPos=d.inverted?[c.len+c.pos-d.plotLeft-k,a.xAxis.len-l-r/2,v]:[l+r/2,k+c.pos-d.plotTop,v];f.shapeType="rect";f.shapeArgs= -a.crispCol.apply(a,f.isNull?[f.plotX,c.len/2,0,0]:[l,t,r,v])})},getSymbol:a.noop,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(a,d){var f=this.options,g=this.pointAttrToOptions||{},c=g.stroke||"borderColor",e=g["stroke-width"]||"borderWidth",h=a&&a.color||this.color,k=a[c]||f[c]||this.color||h,g=f.dashStyle,l;a&&this.zones.length&&(h=(h=a.getZone())&&h.color||a.options.color|| -this.color);d&&(d=f.states[d],l=d.brightness,h=d.color||void 0!==l&&A(h).brighten(d.brightness).get()||h,k=d[c]||k,g=d.dashStyle||g);a={fill:h,stroke:k,"stroke-width":a[e]||f[e]||this[e]||0};f.borderRadius&&(a.r=f.borderRadius);g&&(a.dashstyle=g);return a},drawPoints:function(){var a=this,g=this.chart,l=a.options,n=g.renderer,c=l.animationLimit||250,e;D(a.points,function(f){var h=f.graphic;k(f.plotY)&&null!==f.y?(e=f.shapeArgs,h?(t(h),h[g.pointCountl;++l)t=g[l],a=2>l||2===l&&/%$/.test(t),g[l]=A(t,[d,F,u,g[2]][l])+(a?k:0);g[3]>g[2]&&(g[3]=g[2]);return g}}})(M);(function(a){var C=a.addEvent,A=a.defined,D=a.each,F=a.extend,k=a.inArray,d=a.noop,g=a.pick,u=a.Point,l=a.Series,t=a.seriesType,n=a.setAnimation;t("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return null===this.y? -void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,states:{hover:{brightness:.1,shadow:!1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:a.seriesTypes.column.prototype.pointAttribs,animate:function(a){var d=this,f=d.points,g=d.startAngleRad;a||(D(f,function(a){var c= -a.graphic,f=a.shapeArgs;c&&(c.attr({r:a.startR||d.center[3]/2,start:g,end:g}),c.animate({r:f.r,start:f.start,end:f.end},d.options.animation))}),d.animate=null)},updateTotals:function(){var a,d=0,g=this.points,k=g.length,c,e=this.options.ignoreHiddenPoint;for(a=0;ac.y&&(c.y=null),d+=e&&!c.visible?0:c.y;this.total=d;for(a=0;a1.5*Math.PI?l-=2*Math.PI:l<-Math.PI/2&&(l+=2*Math.PI);J.slicedTranslation={translateX:Math.round(Math.cos(l)*k),translateY:Math.round(Math.sin(l)*k)};e=Math.cos(l)*a[2]/2;m=Math.sin(l)*a[2]/2;J.tooltipPos=[a[0]+.7*e,a[1]+.7*m];J.half=l<-Math.PI/2||l>Math.PI/2?1:0;J.angle=l;c=Math.min(c,t/5);J.labelPos=[a[0]+e+Math.cos(l)*t,a[1]+m+Math.sin(l)*t,a[0]+e+Math.cos(l)*c,a[1]+m+Math.sin(l)* -c,a[0]+e,a[1]+m,0>t?"center":J.half?"right":"left",l]}},drawGraph:null,drawPoints:function(){var a=this,d=a.chart.renderer,g,k,c,e,m=a.options.shadow;m&&!a.shadowGroup&&(a.shadowGroup=d.g("shadow").add(a.group));D(a.points,function(f){if(null!==f.y){k=f.graphic;e=f.shapeArgs;g=f.sliced?f.slicedTranslation:{};var h=f.shadowGroup;m&&!h&&(h=f.shadowGroup=d.g("shadow").add(a.shadowGroup));h&&h.attr(g);c=a.pointAttribs(f,f.selected&&"select");k?k.setRadialReference(a.center).attr(c).animate(F(e,g)):(f.graphic= -k=d[f.shapeType](e).addClass(f.getClassName()).setRadialReference(a.center).attr(g).add(a.group),f.visible||k.attr({visibility:"hidden"}),k.attr(c).attr({"stroke-linejoin":"round"}).shadow(m,h))}})},searchPoint:d,sortByAngle:function(a,d){a.sort(function(a,f){return void 0!==a.angle&&(f.angle-a.angle)*d})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,getCenter:a.CenteredSeriesMixin.getCenter,getSymbol:d},{init:function(){u.prototype.init.apply(this,arguments);var a=this,d;a.name=g(a.name,"Slice"); -d=function(d){a.slice("select"===d.type)};C(a,"select",d);C(a,"unselect",d);return a},setVisible:function(a,d){var f=this,h=f.series,c=h.chart,e=h.options.ignoreHiddenPoint;d=g(d,e);a!==f.visible&&(f.visible=f.options.visible=a=void 0===a?!f.visible:a,h.options.data[k(f,h.data)]=f.options,D(["graphic","dataLabel","connector","shadowGroup"],function(c){if(f[c])f[c][a?"show":"hide"](!0)}),f.legendItem&&c.legend.colorizeItem(f,a),a||"hover"!==f.state||f.setState(""),e&&(h.isDirty=!0),d&&c.redraw())}, -slice:function(a,d,l){var f=this.series;n(l,f.chart);g(d,!0);this.sliced=this.options.sliced=a=A(a)?a:!this.sliced;f.options.data[k(this,f.data)]=this.options;a=a?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var d=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(d.x,d.y,d.r+a,d.r+a,{innerR:this.shapeArgs.r,start:d.start,end:d.end})}})})(M);(function(a){var C= -a.addEvent,A=a.arrayMax,D=a.defined,F=a.each,k=a.extend,d=a.format,g=a.map,u=a.merge,l=a.noop,t=a.pick,n=a.relativeLength,f=a.Series,h=a.seriesTypes,v=a.stableSort,H=a.stop;a.distribute=function(a,d){function c(a,b){return a.target-b.target}var e,f=!0,b=a,h=[],k;k=0;for(e=a.length;e--;)k+=a[e].size;if(k>d){v(a,function(a,b){return(b.rank||0)-(a.rank||0)});for(k=e=0;k<=d;)k+=a[e].size,e++;h=a.splice(e-1,a.length)}v(a,c);for(a=g(a,function(a){return{size:a.size,targets:[a.target]}});f;){for(e=a.length;e--;)f= -a[e],k=(Math.min.apply(0,f.targets)+Math.max.apply(0,f.targets))/2,f.pos=Math.min(Math.max(0,k-f.size/2),d-f.size);e=a.length;for(f=!1;e--;)0a[e].pos&&(a[e-1].size+=a[e].size,a[e-1].targets=a[e-1].targets.concat(a[e].targets),a[e-1].pos+a[e-1].size>d&&(a[e-1].pos=d-a[e-1].size),a.splice(e,1),f=!0)}e=0;F(a,function(a){var c=0;F(a.targets,function(){b[e].pos=a.pos+c;c+=b[e].size;e++})});b.push.apply(b,h);v(b,c)};f.prototype.drawDataLabels=function(){var a=this,e=a.options, -f=e.dataLabels,g=a.points,h,b,l=a.hasRendered||0,n,v,E=t(f.defer,!0),J=a.chart.renderer;if(f.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(f),v=a.plotGroup("dataLabelsGroup","data-labels",E&&!l?"hidden":"visible",f.zIndex||6),E&&(v.attr({opacity:+l}),l||C(a,"afterAnimate",function(){a.visible&&v.show(!0);v[e.animation?"animate":"attr"]({opacity:1},{duration:200})})),b=f,F(g,function(c){var g,m=c.dataLabel,l,q,r=c.connector,x=!0,w,E={};h=c.dlOptions||c.options&&c.options.dataLabels; -g=t(h&&h.enabled,b.enabled)&&null!==c.y;if(m&&!g)c.dataLabel=m.destroy();else if(g){f=u(b,h);w=f.style;g=f.rotation;l=c.getLabelConfig();n=f.format?d(f.format,l):f.formatter.call(l,f);w.color=t(f.color,w.color,a.color,"#000000");if(m)D(n)?(m.attr({text:n}),x=!1):(c.dataLabel=m=m.destroy(),r&&(c.connector=r.destroy()));else if(D(n)){m={fill:f.backgroundColor,stroke:f.borderColor,"stroke-width":f.borderWidth,r:f.borderRadius||0,rotation:g,padding:f.padding,zIndex:1};"contrast"===w.color&&(E.color=f.inside|| -0>f.distance||e.stacking?J.getContrast(c.color||a.color):"#000000");e.cursor&&(E.cursor=e.cursor);for(q in m)void 0===m[q]&&delete m[q];m=c.dataLabel=J[g?"text":"label"](n,0,-9999,f.shape,null,null,f.useHTML,null,"data-label").attr(m);m.addClass("highcharts-data-label-color-"+c.colorIndex+" "+(f.className||""));m.css(k(w,E));m.add(v);m.shadow(f.shadow)}m&&a.alignDataLabel(c,m,f,null,x)}})};f.prototype.alignDataLabel=function(a,e,d,f,g){var b=this.chart,c=b.inverted,h=t(a.plotX,-9999),m=t(a.plotY, --9999),l=e.getBBox(),n,r=d.rotation,u=d.align,v=this.visible&&(a.series.forceDL||b.isInsidePlot(h,Math.round(m),c)||f&&b.isInsidePlot(h,c?f.x+1:f.y+f.height-1,c)),A="justify"===t(d.overflow,"justify");v&&(n=d.style.fontSize,n=b.renderer.fontMetrics(n,e).b,f=k({x:c?b.plotWidth-m:h,y:Math.round(c?b.plotHeight-h:m),width:0,height:0},f),k(d,{width:l.width,height:l.height}),r?(A=!1,c=b.renderer.rotCorr(n,r),c={x:f.x+d.x+f.width/2+c.x,y:f.y+d.y+{top:0,middle:.5,bottom:1}[d.verticalAlign]*f.height},e[g? -"attr":"animate"](c).attr({align:u}),h=(r+720)%360,h=180h,"left"===u?c.y-=h?l.height:0:"center"===u?(c.x-=l.width/2,c.y-=l.height/2):"right"===u&&(c.x-=l.width,c.y-=h?0:l.height)):(e.align(d,null,f),c=e.alignAttr),A?this.justifyDataLabel(e,d,c,l,f,g):t(d.crop,!0)&&(v=b.isInsidePlot(c.x,c.y)&&b.isInsidePlot(c.x+l.width,c.y+l.height)),d.shape&&!r&&e.attr({anchorX:a.plotX,anchorY:a.plotY}));v||(H(e),e.attr({y:-9999}),e.placed=!1)};f.prototype.justifyDataLabel=function(a,d,f,g,h,b){var c=this.chart, -e=d.align,k=d.verticalAlign,m,l,n=a.box?0:a.padding||0;m=f.x+n;0>m&&("right"===e?d.align="left":d.x=-m,l=!0);m=f.x+g.width-n;m>c.plotWidth&&("left"===e?d.align="right":d.x=c.plotWidth-m,l=!0);m=f.y+n;0>m&&("bottom"===k?d.verticalAlign="top":d.y=-m,l=!0);m=f.y+g.height-n;m>c.plotHeight&&("top"===k?d.verticalAlign="bottom":d.y=c.plotHeight-m,l=!0);l&&(a.placed=!b,a.align(d,null,h))};h.pie&&(h.pie.prototype.drawDataLabels=function(){var c=this,d=c.data,h,k=c.chart,l=c.options.dataLabels,b=t(l.connectorPadding, -10),q=t(l.connectorWidth,1),n=k.plotWidth,u=k.plotHeight,v,J=l.distance,w=c.center,C=w[2]/2,G=w[1],D=0m-2?t:M,e),p._attr={visibility:Q,align:H[6]},p._pos={x:z+l.x+({left:b,right:-b}[H[6]]||0),y:M+l.y-10},H.x=z,H.y=M,null===c.options.size&&(y=p.width,z-yn-b&&(T[1]=Math.max(Math.round(z+ -y-n+b),T[1])),0>M-O/2?T[0]=Math.max(Math.round(-M+O/2),T[0]):M+O/2>u&&(T[2]=Math.max(Math.round(M+O/2-u),T[2])))}),0===A(T)||this.verifyDataLabelOverflow(T))&&(this.placeDataLabels(),D&&q&&F(this.points,function(a){var b;v=a.connector;if((p=a.dataLabel)&&p._pos&&a.visible){Q=p._attr.visibility;if(b=!v)a.connector=v=k.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+a.colorIndex).add(c.dataLabelsGroup),v.attr({"stroke-width":q,stroke:l.connectorColor||a.color||"#666666"}); -v[b?"attr":"animate"]({d:c.connectorPath(a.labelPos)});v.attr("visibility",Q)}else v&&(a.connector=v.destroy())}))},h.pie.prototype.connectorPath=function(a){var c=a.x,d=a.y;return t(this.options.dataLabels.softConnector,!0)?["M",c+("left"===a[6]?5:-5),d,"C",c,d,2*a[2]-a[4],2*a[3]-a[5],a[2],a[3],"L",a[4],a[5]]:["M",c+("left"===a[6]?5:-5),d,"L",a[2],a[3],"L",a[4],a[5]]},h.pie.prototype.placeDataLabels=function(){F(this.points,function(a){var c=a.dataLabel;c&&a.visible&&((a=c._pos)?(c.attr(c._attr), -c[c.moved?"animate":"attr"](a),c.moved=!0):c&&c.attr({y:-9999}))})},h.pie.prototype.alignDataLabel=l,h.pie.prototype.verifyDataLabelOverflow=function(a){var c=this.center,d=this.options,f=d.center,g=d.minSize||80,b,h;null!==f[0]?b=Math.max(c[2]-Math.max(a[1],a[3]),g):(b=Math.max(c[2]-a[1]-a[3],g),c[0]+=(a[3]-a[1])/2);null!==f[1]?b=Math.max(Math.min(b,c[2]-Math.max(a[0],a[2])),g):(b=Math.max(Math.min(b,c[2]-a[0]-a[2]),g),c[1]+=(a[0]-a[2])/2);bt(this.translatedThreshold,c.yAxis.len)),m=t(g.inside,!!this.options.stacking);e&&(h=u(e),0>h.y&&(h.height+=h.y,h.y=0),e=h.y+h.height-c.yAxis.len,0a+d||b+hc+f||g+kthis.pointCount))},pan:function(a,c){var b=this,d=b.hoverPoints, -e;d&&g(d,function(a){a.setState()});g("xy"===c?[1,0]:[1],function(c){c=b[c?"xAxis":"yAxis"][0];var d=c.horiz,f=a[d?"chartX":"chartY"],d=d?"mouseDownX":"mouseDownY",g=b[d],h=(c.pointRange||0)/2,k=c.getExtremes(),l=c.toValue(g-f,!0)+h,h=c.toValue(g+c.len-f,!0)-h,g=g>f;c.series.length&&(g||l>Math.min(k.dataMin,k.min))&&(!g||h=k(t.minWidth,0)&&this.chartHeight>=k(t.minHeight,0)};void 0===d._id&&(d._id=a.uniqueKey());n=n.call(this);!g[d._id]&&n?d.chartOptions&&(g[d._id]=this.currentOptions(d.chartOptions),this.update(d.chartOptions,u)):g[d._id]&&!n&&(this.update(g[d._id],u),delete g[d._id])};C.prototype.currentOptions=function(a){function g(a,k,f){var h,l;for(h in a)if(-1< -D(h,["series","xAxis","yAxis"]))for(a[h]=d(a[h]),f[h]=[],l=0;l