highstock.min.js
189 KB
/*
Highstock JS v2.0.4 (2014-09-02)
(c) 2009-2014 Torstein Honsi
License: www.highcharts.com/license
*/
(function(){function e(e,t){var n;e||(e={});for(n in t)e[n]=t[n];return e}function t(){var e,t=arguments,n,r={},i=function(e,t){var n,r;typeof e!=="object"&&(e={});for(r in t)t.hasOwnProperty(r)&&(n=t[r],e[r]=n&&typeof n==="object"&&Object.prototype.toString.call(n)!=="[object Array]"&&r!=="renderTo"&&typeof n.nodeType!=="number"?i(e[r]||{},n):t[r]);return e};t[0]===!0&&(r=t[1],t=Array.prototype.slice.call(t,2));n=t.length;for(e=0;e<n;e++)r=i(r,t[e]);return r}function n(e,t){return parseInt(e,t||10)}function r(e){return typeof e==="string"}function i(e){return e&&typeof e==="object"}function s(e){return Object.prototype.toString.call(e)==="[object Array]"}function o(e){return typeof e==="number"}function u(e){return R.log(e)/R.LN10}function a(e){return R.pow(10,e)}function f(e,t){for(var n=e.length;n--;)if(e[n]===t){e.splice(n,1);break}}function l(e){return e!==F&&e!==null}function c(e,t,n){var s,o;if(r(t))l(n)?e.setAttribute(t,n):e&&e.getAttribute&&(o=e.getAttribute(t));else if(l(t)&&i(t))for(s in t)e.setAttribute(s,t[s]);return o}function h(e){return s(e)?e:[e]}function p(){var e=arguments,t,n,r=e.length;for(t=0;t<r;t++)if(n=e[t],n!==F&&n!==null)return n}function d(t,n){if(et&&!ot&&n&&n.opacity!==F)n.filter="alpha(opacity="+n.opacity*100+")";e(t.style,n)}function v(t,n,r,i,s){t=I.createElement(t);n&&e(t,n);s&&d(t,{padding:0,border:Tt,margin:0});r&&d(t,r);i&&i.appendChild(t);return t}function m(t,n){var r=function(){return F};r.prototype=new t;e(r.prototype,n);return r}function g(e,t,r,i){var s=Ut.numberFormat,o=dt.lang,u=+e||0,a=t===-1?(u.toString().split(".")[1]||"").length:isNaN(t=$(t))?2:t,f=r===void 0?o.decimalPoint:r,o=i===void 0?o.thousandsSep:i,l=u<0?"-":"",c=String(n(u=$(u).toFixed(a))),h=c.length>3?c.length%3:0;return s!==g?s(e,t,r,i):l+(h?c.substr(0,h)+o:"")+c.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+o)+(a?f+$(u-c).toFixed(a).slice(2):"")}function y(e,t){return Array((t||2)+1-String(e).length).join(0)+e}function b(e,t,n){var r=e[t];e[t]=function(){var e=Array.prototype.slice.call(arguments);e.unshift(r);return n.apply(this,e)}}function w(e,t){for(var n="{",r=!1,i,s,o,u,a,f=[];(n=e.indexOf(n))!==-1;){i=e.slice(0,n);if(r){s=i.split(":");o=s.shift().split(".");a=o.length;i=t;for(u=0;u<a;u++)i=i[o[u]];if(s.length)s=s.join(":"),o=/\.([0-9])/,u=dt.lang,a=void 0,/f$/.test(s)?(a=(a=s.match(o))?a[1]:-1,i!==null&&(i=g(i,a,u.decimalPoint,s.indexOf(",")>-1?u.thousandsSep:""))):i=vt(s,i)}f.push(i);e=e.slice(n+1);n=(r=!r)?"}":"{"}f.push(e);return f.join("")}function E(e){return R.pow(10,z(R.log(e)/R.LN10))}function S(e,t,n,r){var i,n=p(n,1);i=e/n;t||(t=[1,2,2.5,5,10],r===!1&&(n===1?t=[1,2,5,10]:n<=.1&&(t=[1/n])));for(r=0;r<t.length;r++)if(e=t[r],i<=(t[r]+(t[r+1]||t[r]))/2)break;e*=n;return e}function x(e,t){var n=e.length,r,i;for(i=0;i<n;i++)e[i].ss_i=i;e.sort(function(e,n){r=t(e,n);return r===0?e.ss_i-n.ss_i:r});for(i=0;i<n;i++)delete e[i].ss_i}function T(e){for(var t=e.length,n=e[0];t--;)e[t]<n&&(n=e[t]);return n}function N(e){for(var t=e.length,n=e[0];t--;)e[t]>n&&(n=e[t]);return n}function C(e,t){for(var n in e)e[n]&&e[n]!==t&&e[n].destroy&&e[n].destroy(),delete e[n]}function k(e){pt||(pt=v(xt));e&&pt.appendChild(e);pt.innerHTML=""}function L(e){return parseFloat(e.toPrecision(14))}function A(e,t){mt=p(e,t.animation)}function O(){var e=dt.global.useUTC,t=e?"getUTC":"get",n=e?"setUTC":"set";kt=dt.global.Date||window.Date;At=(e&&dt.global.timezoneOffset||0)*6e4;Lt=e?kt.UTC:function(e,t,n,r,i,s){return(new kt(e,t,p(n,1),p(r,0),p(i,0),p(s,0))).getTime()};Ot=t+"Minutes";Mt=t+"Hours";_t=t+"Day";Dt=t+"Date";Pt=t+"Month";Ht=t+"FullYear";Bt=n+"Minutes";jt=n+"Hours";Ft=n+"Date";It=n+"Month";qt=n+"FullYear"}function M(){}function _(e,t,n,r){this.axis=e;this.pos=t;this.type=n||"";this.isNew=!0;!n&&!r&&this.addLabel()}function D(){this.init.apply(this,arguments)}function P(){this.init.apply(this,arguments)}function H(e,t,n,r,i){var s=e.chart.inverted;this.axis=e;this.isNegative=n;this.options=t;this.x=r;this.total=null;this.points={};this.stack=i;this.alignOptions={align:t.align||(s?n?"left":"right":"center"),verticalAlign:t.verticalAlign||(s?"middle":n?"bottom":"top"),y:p(t.y,s?4:n?14:-6),x:p(t.x,s?n?-6:6:0)};this.textAlign=t.textAlign||(s?n?"right":"left":"center")}function B(e){var t=e.options,n=t.navigator,r=n.enabled,t=t.scrollbar,i=t.enabled,s=r?n.height:0,o=i?t.height:0;this.handles=[];this.scrollbarButtons=[];this.elementsToDestroy=[];this.chart=e;this.setBaseSeries();this.height=s;this.scrollbarHeight=o;this.scrollbarEnabled=i;this.navigatorEnabled=r;this.navigatorOptions=n;this.scrollbarOptions=t;this.outlineHeight=s+o;this.init()}function j(e){this.init(e)}var F,I=document,q=window,R=Math,U=R.round,z=R.floor,W=R.ceil,X=R.max,V=R.min,$=R.abs,J=R.cos,K=R.sin,Q=R.PI,G=Q*2/360,Y=navigator.userAgent,Z=q.opera,et=/msie/i.test(Y)&&!Z,tt=I.documentMode===8,nt=/AppleWebKit/.test(Y),rt=/Firefox/.test(Y),it=/(Mobile|Android|Windows Phone)/.test(Y),st="http://www.w3.org/2000/svg",ot=!!I.createElementNS&&!!I.createElementNS(st,"svg").createSVGRect,ut=rt&&parseInt(Y.split("Firefox/")[1],10)<4,at=!ot&&!et&&!!I.createElement("canvas").getContext,ft,lt,ct={},ht=0,pt,dt,vt,mt,gt,yt,bt,wt=function(){return F},Et=[],St=0,xt="div",Tt="none",Nt=/^[0-9]+$/,Ct="stroke-width",kt,Lt,At,Ot,Mt,_t,Dt,Pt,Ht,Bt,jt,Ft,It,qt,Rt={},Ut;q.Highcharts?bt(16,!0):Ut=q.Highcharts={};vt=function(t,n,r){if(!l(n)||isNaN(n))return"Invalid date";var t=p(t,"%Y-%m-%d %H:%M:%S"),i=new kt(n-At),s,o=i[Mt](),u=i[_t](),a=i[Dt](),f=i[Pt](),c=i[Ht](),h=dt.lang,d=h.weekdays,i=e({a:d[u].substr(0,3),A:d[u],d:y(a),e:a,b:h.shortMonths[f],B:h.months[f],m:y(f+1),y:c.toString().substr(2,2),Y:c,H:y(o),I:y(o%12||12),l:o%12||12,M:y(i[Ot]()),p:o<12?"AM":"PM",P:o<12?"am":"pm",S:y(i.getSeconds()),L:y(U(n%1e3),3)},Ut.dateFormats);for(s in i)for(;t.indexOf("%"+s)!==-1;)t=t.replace("%"+s,typeof i[s]==="function"?i[s](n):i[s]);return r?t.substr(0,1).toUpperCase()+t.substr(1):t};bt=function(e,t){var n="Highcharts error #"+e+": www.highcharts.com/errors/"+e;if(t)throw n;q.console&&console.log(n)};yt={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:26784e5,year:31556952e3};gt={init:function(e,t,n){var t=t||"",r=e.shift,i=t.indexOf("C")>-1,s=i?7:3,o,t=t.split(" "),n=[].concat(n),u,a,f=function(e){for(o=e.length;o--;)e[o]==="M"&&e.splice(o+1,0,e[o+1],e[o+2],e[o+1],e[o+2])};i&&(f(t),f(n));e.isArea&&(u=t.splice(t.length-6,6),a=n.splice(n.length-6,6));if(r<=n.length/s&&t.length===n.length)for(;r--;)n=[].concat(n).splice(0,s).concat(n);e.shift=0;if(t.length)for(e=n.length;t.length<e;)r=[].concat(t).splice(t.length-s,s),i&&(r[s-6]=r[s-2],r[s-5]=r[s-1]),t=t.concat(r);u&&(t=t.concat(u),n=n.concat(a));return[t,n]},step:function(e,t,n,r){var i=[],s=e.length;if(n===1)i=r;else if(s===t.length&&n<1)for(;s--;)r=parseFloat(e[s]),i[s]=isNaN(r)?e[s]:n*parseFloat(t[s]-r)+r;else i=t;return i}};(function(t){q.HighchartsAdapter=q.HighchartsAdapter||t&&{init:function(e){var n=t.fx;t.extend(t.easing,{easeOutQuad:function(e,t,n,r,i){return-r*(t/=i)*(t-2)+n}});t.each(["cur","_default","width","height","opacity"],function(e,r){var i=n.step,s;r==="cur"?i=n.prototype:r==="_default"&&t.Tween&&(i=t.Tween.propHooks[r],r="set");(s=i[r])&&(i[r]=function(t){var n,t=e?t:this;if(t.prop!=="align")return n=t.elem,n.attr?n.attr(t.prop,r==="cur"?F:t.now):s.apply(this,arguments)})});b(t.cssHooks.opacity,"get",function(e,t,n){return t.attr?t.opacity||0:e.call(this,t,n)});this.addAnimSetter("d",function(t){var n=t.elem,r;if(!t.started)r=e.init(n,n.d,n.toD),t.start=r[0],t.end=r[1],t.started=!0;n.attr("d",e.step(t.start,t.end,t.pos,n.toD))});this.each=Array.prototype.forEach?function(e,t){return Array.prototype.forEach.call(e,t)}:function(e,t){var n,r=e.length;for(n=0;n<r;n++)if(t.call(e[n],e[n],n,e)===!1)return n};t.fn.highcharts=function(){var e="Chart",t=arguments,n,i;if(this[0]){r(t[0])&&(e=t[0],t=Array.prototype.slice.call(t,1));n=t[0];if(n!==F)n.chart=n.chart||{},n.chart.renderTo=this[0],new Ut[e](n,t[1]),i=this;n===F&&(i=Et[c(this[0],"data-highcharts-chart")])}return i}},addAnimSetter:function(e,n){t.Tween?t.Tween.propHooks[e]={set:n}:t.fx.step[e]=n},getScript:t.getScript,inArray:t.inArray,adapterRun:function(e,n){return t(e)[n]()},grep:t.grep,map:function(e,t){for(var n=[],r=0,i=e.length;r<i;r++)n[r]=t.call(e[r],e[r],r,e);return n},offset:function(e){return t(e).offset()},addEvent:function(e,n,r){t(e).bind(n,r)},removeEvent:function(e,n,r){var i=I.removeEventListener?"removeEventListener":"detachEvent";I[i]&&e&&!e[i]&&(e[i]=function(){});t(e).unbind(n,r)},fireEvent:function(n,r,i,s){var o=t.Event(r),u="detached"+r,a;!et&&i&&(delete i.layerX,delete i.layerY,delete i.returnValue);e(o,i);n[r]&&(n[u]=n[r],n[r]=null);t.each(["preventDefault","stopPropagation"],function(e,t){var n=o[t];o[t]=function(){try{n.call(o)}catch(e){t==="preventDefault"&&(a=!0)}}});t(n).trigger(o);n[u]&&(n[r]=n[u],n[u]=null);s&&!o.isDefaultPrevented()&&!a&&s(o)},washMouseEvent:function(e){var t=e.originalEvent||e;if(t.pageX===F)t.pageX=e.pageX,t.pageY=e.pageY;return t},animate:function(e,n,r){var i=t(e);if(!e.style)e.style={};if(n.d)e.toD=n.d,n.d=1;i.stop();n.opacity!==F&&e.attr&&(n.opacity+="px");e.hasAnim=1;i.animate(n,r)},stop:function(e){e.hasAnim&&t(e).stop()}}})(q.jQuery);var zt=q.HighchartsAdapter,Wt=zt||{};zt&&zt.init.call(zt,gt);var Xt=Wt.adapterRun,Vt=Wt.getScript,$t=Wt.inArray,Jt=Wt.each,Kt=Wt.grep,Qt=Wt.offset,Gt=Wt.map,Yt=Wt.addEvent,Zt=Wt.removeEvent,en=Wt.fireEvent,tn=Wt.washMouseEvent,nn=Wt.animate,rn=Wt.stop,Wt={enabled:!0,x:0,y:15,style:{color:"#606060",cursor:"default",fontSize:"11px"}};dt={colors:"#7cb5ec,#434348,#90ed7d,#f7a35c,#8085e9,#f15c80,#e4d354,#8085e8,#8d4653,#91e8e1".split(","),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),shortMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),decimalPoint:".",numericSymbols:"k,M,G,T,P,E".split(","),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:!0,canvasToolsURL:"http://code.highcharts.com/stock/2.0.4/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com/stock/2.0.4/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}}},title:{text:"Chart title",align:"center",margin:15,style:{color:"#333333",fontSize:"18px"}},subtitle:{text:"",align:"center",style:{color:"#555555"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1e3},events:{},lineWidth:2,marker:{lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0,lineWidthPlus:1,radiusPlus:2},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:t(Wt,{align:"center",enabled:!1,formatter:function(){return this.y===null?"":g(this.y,-1)},verticalAlign:"bottom",y:0}),cropThreshold:300,pointRange:0,states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1e3}},labels:{style:{position:"absolute",color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#909090",borderRadius:0,navigation:{activeColor:"#274b6d",inactiveColor:"#CCC"},shadow:!1,itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000"},itemHiddenStyle:{color:"#CCC"},itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"white",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:ot,backgroundColor:"rgba(249, 249, 249, .85)",borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.y}</b><br/>',shadow:!0,snap:it?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}};var sn=dt.plotOptions,zt=sn.line;O();var on=/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*\)/,un=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,an=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,fn=function(e){var r=[],i,s;(function(e){e&&e.stops?s=Gt(e.stops,function(e){return fn(e[1])}):(i=on.exec(e))?r=[n(i[1]),n(i[2]),n(i[3]),parseFloat(i[4],10)]:(i=un.exec(e))?r=[n(i[1],16),n(i[2],16),n(i[3],16),1]:(i=an.exec(e))&&(r=[n(i[1]),n(i[2]),n(i[3]),1])})(e);return{get:function(n){var i;s?(i=t(e),i.stops=[].concat(i.stops),Jt(s,function(e,t){i.stops[t]=[i.stops[t][0],e.get(n)]})):i=r&&!isNaN(r[0])?n==="rgb"?"rgb("+r[0]+","+r[1]+","+r[2]+")":n==="a"?r[3]:"rgba("+r.join(",")+")":e;return i},brighten:function(e){if(s)Jt(s,function(t){t.brighten(e)});else if(o(e)&&e!==0){var t;for(t=0;t<3;t++)r[t]+=n(e*255),r[t]<0&&(r[t]=0),r[t]>255&&(r[t]=255)}return this},rgba:r,setOpacity:function(e){r[3]=e;return this}}};M.prototype={opacity:1,textProps:"fontSize,fontWeight,fontFamily,color,lineHeight,width,textDecoration,textShadow,HcTextStroke".split(","),init:function(e,t){this.element=t==="span"?v(t):I.createElementNS(st,t);this.renderer=e},animate:function(e,n,r){n=p(n,mt,!0);rn(this);if(n){n=t(n,{});if(r)n.complete=r;nn(this,e,n)}else this.attr(e),r&&r();return this},colorGradient:function(e,n,r){var i=this.renderer,o,u,a,f,c,h,p,d,v,m,g=[];e.linearGradient?u="linearGradient":e.radialGradient&&(u="radialGradient");if(u){a=e[u];f=i.gradients;h=e.stops;v=r.radialReference;s(a)&&(e[u]=a={x1:a[0],y1:a[1],x2:a[2],y2:a[3],gradientUnits:"userSpaceOnUse"});u==="radialGradient"&&v&&!l(a.gradientUnits)&&(a=t(a,{cx:v[0]-v[2]/2+a.cx*v[2],cy:v[1]-v[2]/2+a.cy*v[2],r:a.r*v[2],gradientUnits:"userSpaceOnUse"}));for(m in a)m!=="id"&&g.push(m,a[m]);for(m in h)g.push(h[m]);g=g.join(",");f[g]?e=f[g].attr("id"):(a.id=e="highcharts-"+ht++,f[g]=c=i.createElement(u).attr(a).add(i.defs),c.stops=[],Jt(h,function(e){e[1].indexOf("rgba")===0?(o=fn(e[1]),p=o.get("rgb"),d=o.get("a")):(p=e[1],d=1);e=i.createElement("stop").attr({offset:e[0],"stop-color":p,"stop-opacity":d}).add(c);c.stops.push(e)}));r.setAttribute(n,"url("+i.url+"#"+e+")")}},attr:function(e,t){var n,r,i=this.element,s,o=this,u;typeof e==="string"&&t!==F&&(n=e,e={},e[n]=t);if(typeof e==="string")o=(this[e+"Getter"]||this._defaultGetter).call(this,e,i);else{for(n in e){r=e[n];u=!1;this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(n)&&(s||(this.symbolAttr(e),s=!0),u=!0);if(this.rotation&&(n==="x"||n==="y"))this.doTransform=!0;u||(this[n+"Setter"]||this._defaultSetter).call(this,r,n,i);this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(n)&&this.updateShadows(n,r)}if(this.doTransform)this.updateTransform(),this.doTransform=!1}return o},updateShadows:function(e,t){for(var n=this.shadows,r=n.length;r--;)n[r].setAttribute(e,e==="height"?X(t-(n[r].cutHeight||0),0):e==="d"?this.d:t)},addClass:function(e){var t=this.element,n=c(t,"class")||"";n.indexOf(e)===-1&&c(t,"class",n+" "+e);return this},symbolAttr:function(e){var t=this;Jt("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(n){t[n]=p(e[n],t[n])});t.attr({d:t.renderer.symbols[t.symbolName](t.x,t.y,t.width,t.height,t)})},clip:function(e){return this.attr("clip-path",e?"url("+this.renderer.url+"#"+e.id+")":Tt)},crisp:function(e){var t,n={},r,i=e.strokeWidth||this.strokeWidth||0;r=U(i)%2/2;e.x=z(e.x||this.x||0)+r;e.y=z(e.y||this.y||0)+r;e.width=z((e.width||this.width||0)-2*r);e.height=z((e.height||this.height||0)-2*r);e.strokeWidth=i;for(t in e)this[t]!==e[t]&&(this[t]=n[t]=e[t]);return n},css:function(t){var r=this.styles,i={},s=this.element,o,u,a="";o=!r;if(t&&t.color)t.fill=t.color;if(r)for(u in t)t[u]!==r[u]&&(i[u]=t[u],o=!0);if(o){o=this.textWidth=t&&t.width&&s.nodeName.toLowerCase()==="text"&&n(t.width);r&&(t=e(r,i));this.styles=t;o&&(at||!ot&&this.renderer.forExport)&&delete t.width;if(et&&!ot)d(this.element,t);else{r=function(e,t){return"-"+t.toLowerCase()};for(u in t)a+=u.replace(/([A-Z])/g,r)+":"+t[u]+";";c(s,"style",a)}o&&this.added&&this.renderer.buildText(this)}return this},on:function(e,t){var n=this,r=n.element;lt&&e==="click"?(r.ontouchstart=function(e){n.touchEventFired=kt.now();e.preventDefault();t.call(r,e)},r.onclick=function(e){(Y.indexOf("Android")===-1||kt.now()-(n.touchEventFired||0)>1100)&&t.call(r,e)}):r["on"+e]=t;return this},setRadialReference:function(e){this.element.radialReference=e;return this},translate:function(e,t){return this.attr({translateX:e,translateY:t})},invert:function(){this.inverted=!0;this.updateTransform();return this},updateTransform:function(){var e=this.translateX||0,t=this.translateY||0,n=this.scaleX,r=this.scaleY,i=this.inverted,s=this.rotation,o=this.element;i&&(e+=this.attr("width"),t+=this.attr("height"));e=["translate("+e+","+t+")"];i?e.push("rotate(90) scale(-1,1)"):s&&e.push("rotate("+s+" "+(o.getAttribute("x")||0)+" "+(o.getAttribute("y")||0)+")");(l(n)||l(r))&&e.push("scale("+p(n,1)+" "+p(r,1)+")");e.length&&o.setAttribute("transform",e.join(" "))},toFront:function(){var e=this.element;e.parentNode.appendChild(e);return this},align:function(e,t,n){var i,s,o,u,a={};s=this.renderer;o=s.alignedObjects;if(e){if(this.alignOptions=e,this.alignByTranslate=t,!n||r(n))this.alignTo=i=n||"renderer",f(o,this),o.push(this),n=null}else e=this.alignOptions,t=this.alignByTranslate,i=this.alignTo;n=p(n,s[i],s);i=e.align;s=e.verticalAlign;o=(n.x||0)+(e.x||0);u=(n.y||0)+(e.y||0);if(i==="right"||i==="center")o+=(n.width-(e.width||0))/{right:1,center:2}[i];a[t?"translateX":"x"]=U(o);if(s==="bottom"||s==="middle")u+=(n.height-(e.height||0))/({bottom:1,middle:2}[s]||1);a[t?"translateY":"y"]=U(u);this[this.placed?"animate":"attr"](a);this.placed=!0;this.alignAttr=a;return this},getBBox:function(){var t=this.bBox,n=this.renderer,r,i,s=this.rotation;r=this.element;var o=this.styles,u=s*G;i=this.textStr;var a;if(i===""||Nt.test(i))a="num."+i.toString().length+(o?"|"+o.fontSize+"|"+o.fontFamily:"");a&&(t=n.cache[a]);if(!t){if(r.namespaceURI===st||n.forExport){try{t=r.getBBox?e({},r.getBBox()):{width:r.offsetWidth,height:r.offsetHeight}}catch(f){}if(!t||t.width<0)t={width:0,height:0}}else t=this.htmlGetBBox();if(n.isSVG){r=t.width;i=t.height;if(et&&o&&o.fontSize==="11px"&&i.toPrecision(3)==="16.9")t.height=i=14;if(s)t.width=$(i*K(u))+$(r*J(u)),t.height=$(i*J(u))+$(r*K(u))}this.bBox=t;a&&(n.cache[a]=t)}return t},show:function(e){e&&this.element.namespaceURI===st?this.element.removeAttribute("visibility"):this.attr({visibility:e?"inherit":"visible"});return this},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(e){var t=this;t.animate({opacity:0},{duration:e||150,complete:function(){t.attr({y:-9999})}})},add:function(e){var t=this.renderer,r=e||t,i=r.element||t.box,s=this.element,o=this.zIndex,u,a;if(e)this.parentGroup=e;this.parentInverted=e&&e.inverted;this.textStr!==void 0&&t.buildText(this);if(o)r.handleZ=!0,o=n(o);if(r.handleZ){e=i.childNodes;for(u=0;u<e.length;u++)if(t=e[u],r=c(t,"zIndex"),t!==s&&(n(r)>o||!l(o)&&l(r))){i.insertBefore(s,t);a=!0;break}}a||i.appendChild(s);this.added=!0;if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(e){var t=e.parentNode;t&&t.removeChild(e)},destroy:function(){var e=this,t=e.element||{},n=e.shadows,r=e.renderer.isSVG&&t.nodeName==="SPAN"&&e.parentGroup,i,s;t.onclick=t.onmouseout=t.onmouseover=t.onmousemove=t.point=null;rn(e);if(e.clipPath)e.clipPath=e.clipPath.destroy();if(e.stops){for(s=0;s<e.stops.length;s++)e.stops[s]=e.stops[s].destroy();e.stops=null}e.safeRemoveChild(t);for(n&&Jt(n,function(t){e.safeRemoveChild(t)});r&&r.div&&r.div.childNodes.length===0;)t=r.parentGroup,e.safeRemoveChild(r.div),delete r.div,r=t;e.alignTo&&f(e.renderer.alignedObjects,e);for(i in e)delete e[i];return null},shadow:function(e,t,n){var r=[],i,s,o=this.element,u,a,f,l;if(e){a=p(e.width,3);f=(e.opacity||.15)/a;l=this.parentInverted?"(-1,-1)":"("+p(e.offsetX,1)+", "+p(e.offsetY,1)+")";for(i=1;i<=a;i++){s=o.cloneNode(0);u=a*2+1-2*i;c(s,{isShadow:"true",stroke:e.color||"black","stroke-opacity":f*i,"stroke-width":u,transform:"translate"+l,fill:Tt});if(n)c(s,"height",X(c(s,"height")-u,0)),s.cutHeight=u;t?t.element.appendChild(s):o.parentNode.insertBefore(s,o);r.push(s)}this.shadows=r}return this},xGetter:function(e){this.element.nodeName==="circle"&&(e={x:"cx",y:"cy"}[e]||e);return this._defaultGetter(e)},_defaultGetter:function(e){e=p(this[e],this.element?this.element.getAttribute(e):null,0);/^[\-0-9\.]+$/.test(e)&&(e=parseFloat(e));return e},dSetter:function(e,t,n){e&&e.join&&(e=e.join(" "));/(NaN| {2}|^$)/.test(e)&&(e="M 0 0");n.setAttribute(t,e);this[t]=e},dashstyleSetter:function(e){var t;if(e=e&&e.toLowerCase()){e=e.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(t=e.length;t--;)e[t]=n(e[t])*this["stroke-width"];e=e.join(",").replace("NaN","none");this.element.setAttribute("stroke-dasharray",e)}},alignSetter:function(e){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[e])},opacitySetter:function(e,t,n){this[t]=e;n.setAttribute(t,e)},titleSetter:function(e){var t=this.element.getElementsByTagName("title")[0];t||(t=I.createElementNS(st,"title"),this.element.appendChild(t));t.textContent=p(e,"").replace(/<[^>]*>/g,"")},textSetter:function(e){if(e!==this.textStr)delete this.bBox,this.textStr=e,this.added&&this.renderer.buildText(this)},fillSetter:function(e,t,n){typeof e==="string"?n.setAttribute(t,e):e&&this.colorGradient(e,t,n)},zIndexSetter:function(e,t,n){n.setAttribute(t,e);this[t]=e},_defaultSetter:function(e,t,n){n.setAttribute(t,e)}};M.prototype.yGetter=M.prototype.xGetter;M.prototype.translateXSetter=M.prototype.translateYSetter=M.prototype.rotationSetter=M.prototype.verticalAlignSetter=M.prototype.scaleXSetter=M.prototype.scaleYSetter=function(e,t){this[t]=e;this.doTransform=!0};M.prototype["stroke-widthSetter"]=M.prototype.strokeSetter=function(e,t,n){this[t]=e;if(this.stroke&&this["stroke-width"])this.strokeWidth=this["stroke-width"],M.prototype.fillSetter.call(this,this.stroke,"stroke",n),n.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0;else if(t==="stroke-width"&&e===0&&this.hasStroke)n.removeAttribute("stroke"),this.hasStroke=!1};var ln=function(){this.init.apply(this,arguments)};ln.prototype={Element:M,init:function(e,t,n,r,i){var s=location,o,r=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(r));o=r.element;e.appendChild(o);e.innerHTML.indexOf("xmlns")===-1&&c(o,"xmlns",st);this.isSVG=!0;this.box=o;this.boxWrapper=r;this.alignedObjects=[];this.url=(rt||nt)&&I.getElementsByTagName("base").length?s.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(I.createTextNode("Created with Highstock 2.0.4"));this.defs=this.createElement("defs").add();this.forExport=i;this.gradients={};this.cache={};this.setSize(t,n,!1);var u;if(rt&&e.getBoundingClientRect)this.subPixelFix=t=function(){d(e,{left:0,top:0});u=e.getBoundingClientRect();d(e,{left:W(u.left)-u.left+"px",top:W(u.top)-u.top+"px"})},t(),Yt(q,"resize",t)},getStyle:function(t){return this.style=e({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},t)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var e=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();C(this.gradients||{});this.gradients=null;if(e)this.defs=e.destroy();this.subPixelFix&&Zt(q,"resize",this.subPixelFix);return this.alignedObjects=null},createElement:function(e){var t=new this.Element;t.init(this,e);return t},draw:function(){},buildText:function(e){for(var t=e.element,r=this,i=r.forExport,s=p(e.textStr,"").toString(),o=s.indexOf("<")!==-1,u=t.childNodes,a,f,l=c(t,"x"),h=e.styles,v=e.textWidth,m=h&&h.lineHeight,g=h&&h.HcTextStroke,y=u.length,b=function(e){return m?n(m):r.fontMetrics(/(px|em)$/.test(e&&e.style.fontSize)?e.style.fontSize:h&&h.fontSize||r.style.fontSize||12,e).h};y--;)t.removeChild(u[y]);!o&&!g&&s.indexOf(" ")===-1?t.appendChild(I.createTextNode(s)):(a=/<.*style="([^"]+)".*>/,f=/<.*href="(http[^"]+)".*>/,v&&!e.added&&this.box.appendChild(t),s=o?s.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g):[s],s[s.length-1]===""&&s.pop(),Jt(s,function(n,s){var o,u=0,n=n.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");o=n.split("|||");Jt(o,function(n){if(n!==""||o.length===1){var p={},m=I.createElementNS(st,"tspan"),g;a.test(n)&&(g=n.match(a)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),c(m,"style",g));f.test(n)&&!i&&(c(m,"onclick",'location.href="'+n.match(f)[1]+'"'),d(m,{cursor:"pointer"}));n=(n.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"<").replace(/>/g,">");if(n!==" "){m.appendChild(I.createTextNode(n));if(u)p.dx=0;else if(s&&l!==null)p.x=l;c(m,p);t.appendChild(m);!u&&s&&(!ot&&i&&d(m,{display:"block"}),c(m,"dy",b(m)));if(v)for(var n=n.replace(/([^\^])-/g,"$1- ").split(" "),p=o.length>1||n.length>1&&h.whiteSpace!=="nowrap",y,w,E=h.HcHeight,S=[],x=b(m),T=1;p&&(n.length||S.length);)delete e.bBox,y=e.getBBox(),w=y.width,!ot&&r.forExport&&(w=r.measureSpanWidth(m.firstChild.data,e.styles)),y=w>v,!y||n.length===1?(n=S,S=[],n.length&&(T++,E&&T*x>E?(n=["..."],e.attr("title",e.textStr)):(m=I.createElementNS(st,"tspan"),c(m,{dy:x,x:l}),g&&c(m,"style",g),t.appendChild(m))),w>v&&(v=w)):(m.removeChild(m.firstChild),S.unshift(n.pop())),n.length&&m.appendChild(I.createTextNode(n.join(" ").replace(/- /g,"-")));u++}}})}))},button:function(n,r,i,s,o,u,a,f,l){var c=this.label(n,r,i,l,null,null,null,null,"button"),h=0,p,d,v,m,g,y,n={x1:0,y1:0,x2:0,y2:1},o=t({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:n,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},o);v=o.style;delete o.style;u=t(o,{stroke:"#68A",fill:{linearGradient:n,stops:[[0,"#FFF"],[1,"#ACF"]]}},u);m=u.style;delete u.style;a=t(o,{stroke:"#68A",fill:{linearGradient:n,stops:[[0,"#9BD"],[1,"#CDF"]]}},a);g=a.style;delete a.style;f=t(o,{style:{color:"#CCC"}},f);y=f.style;delete f.style;Yt(c.element,et?"mouseover":"mouseenter",function(){h!==3&&c.attr(u).css(m)});Yt(c.element,et?"mouseout":"mouseleave",function(){h!==3&&(p=[o,u,a][h],d=[v,m,g][h],c.attr(p).css(d))});c.setState=function(e){(c.state=h=e)?e===2?c.attr(a).css(g):e===3&&c.attr(f).css(y):c.attr(o).css(v)};return c.on("click",function(){h!==3&&s.call(c)}).attr(o).css(e({cursor:"default"},v))},crispLine:function(e,t){e[1]===e[4]&&(e[1]=e[4]=U(e[1])-t%2/2);e[2]===e[5]&&(e[2]=e[5]=U(e[2])+t%2/2);return e},path:function(t){var n={fill:Tt};s(t)?n.d=t:i(t)&&e(n,t);return this.createElement("path").attr(n)},circle:function(e,t,n){e=i(e)?e:{x:e,y:t,r:n};t=this.createElement("circle");t.xSetter=function(e){this.element.setAttribute("cx",e)};t.ySetter=function(e){this.element.setAttribute("cy",e)};return t.attr(e)},arc:function(e,t,n,r,s,o){if(i(e))t=e.y,n=e.r,r=e.innerR,s=e.start,o=e.end,e=e.x;e=this.symbol("arc",e||0,t||0,n||0,n||0,{innerR:r||0,start:s||0,end:o||0});e.r=n;return e},rect:function(e,t,n,r,s,o){var s=i(e)?e.r:s,u=this.createElement("rect"),e=i(e)?e:e===F?{}:{x:e,y:t,width:X(n,0),height:X(r,0)};if(o!==F)e.strokeWidth=o,e=u.crisp(e);if(s)e.r=s;u.rSetter=function(e){c(this.element,{rx:e,ry:e})};return u.attr(e)},setSize:function(e,t,n){var r=this.alignedObjects,i=r.length;this.width=e;this.height=t;for(this.boxWrapper[p(n,!0)?"animate":"attr"]({width:e,height:t});i--;)r[i].align()},g:function(e){var t=this.createElement("g");return l(e)?t.attr({"class":"highcharts-"+e}):t},image:function(t,n,r,i,s){var o={preserveAspectRatio:Tt};arguments.length>1&&e(o,{x:n,y:r,width:i,height:s});o=this.createElement("image").attr(o);o.element.setAttributeNS?o.element.setAttributeNS("http://www.w3.org/1999/xlink","href",t):o.element.setAttribute("hc-svg-href",t);return o},symbol:function(t,n,r,i,s,o){var u,a=this.symbols[t],a=a&&a(U(n),U(r),i,s,o),f=/^url\((.*?)\)$/,l,c;if(a)u=this.path(a),e(u,{symbolName:t,x:n,y:r,width:i,height:s}),o&&e(u,o);else if(f.test(t))c=function(e,t){e.element&&(e.attr({width:t[0],height:t[1]}),e.alignByTranslate||e.translate(U((i-t[0])/2),U((s-t[1])/2)))},l=t.match(f)[1],t=ct[l]||o&&o.width&&o.height&&[o.width,o.height],u=this.image(l).attr({x:n,y:r}),u.isImg=!0,t?c(u,t):(u.attr({width:0,height:0}),v("img",{onload:function(){c(u,ct[l]=[this.width,this.height])},src:l}));return u},symbols:{circle:function(e,t,n,r){var i=.166*n;return["M",e+n/2,t,"C",e+n+i,t,e+n+i,t+r,e+n/2,t+r,"C",e-i,t+r,e-i,t,e+n/2,t,"Z"]},square:function(e,t,n,r){return["M",e,t,"L",e+n,t,e+n,t+r,e,t+r,"Z"]},triangle:function(e,t,n,r){return["M",e+n/2,t,"L",e+n,t+r,e,t+r,"Z"]},"triangle-down":function(e,t,n,r){return["M",e,t,"L",e+n,t,e+n/2,t+r,"Z"]},diamond:function(e,t,n,r){return["M",e+n/2,t,"L",e+n,t+r/2,e+n/2,t+r,e,t+r/2,"Z"]},arc:function(e,t,n,r,i){var s=i.start,n=i.r||n||r,o=i.end-.001,r=i.innerR,u=i.open,a=J(s),f=K(s),l=J(o),o=K(o),i=i.end-s<Q?0:1;return["M",e+n*a,t+n*f,"A",n,n,0,i,1,e+n*l,t+n*o,u?"M":"L",e+r*l,t+r*o,"A",r,r,0,i,0,e+r*a,t+r*f,u?"":"Z"]},callout:function(e,t,n,r,i){var s=V(i&&i.r||0,n,r),o=s+6,u=i&&i.anchorX,a=i&&i.anchorY,i=U(i.strokeWidth||0)%2/2;e+=i;t+=i;i=["M",e+s,t,"L",e+n-s,t,"C",e+n,t,e+n,t,e+n,t+s,"L",e+n,t+r-s,"C",e+n,t+r,e+n,t+r,e+n-s,t+r,"L",e+s,t+r,"C",e,t+r,e,t+r,e,t+r-s,"L",e,t+s,"C",e,t,e,t,e+s,t];u&&u>n&&a>t+o&&a<t+r-o?i.splice(13,3,"L",e+n,a-6,e+n+6,a,e+n,a+6,e+n,t+r-s):u&&u<0&&a>t+o&&a<t+r-o?i.splice(33,3,"L",e,a+6,e-6,a,e,a-6,e,t+s):a&&a>r&&u>e+o&&u<e+n-o?i.splice(23,3,"L",u+6,t+r,u,t+r+6,u-6,t+r,e+s,t+r):a&&a<0&&u>e+o&&u<e+n-o&&i.splice(3,3,"L",u-6,t,u,t-6,u+6,t,n-s,t);return i}},clipRect:function(e,t,n,r){var i="highcharts-"+ht++,s=this.createElement("clipPath").attr({id:i}).add(this.defs),e=this.rect(e,t,n,r,0).add(s);e.id=i;e.clipPath=s;return e},text:function(e,t,n,r){var i=at||!ot&&this.forExport,s={};if(r&&!this.forExport)return this.html(e,t,n);s.x=Math.round(t||0);if(n)s.y=Math.round(n);if(e||e===0)s.text=e;e=this.createElement("text").attr(s);i&&e.css({position:"absolute"});if(!r)e.xSetter=function(e,t,n){var r=n.getElementsByTagName("tspan"),i,s=n.getAttribute(t),o;for(o=0;o<r.length;o++)i=r[o],i.getAttribute(t)===s&&i.setAttribute(t,e);n.setAttribute(t,e)};return e},fontMetrics:function(e,t){e=e||this.style.fontSize;if(t&&q.getComputedStyle)t=t.element||t,e=q.getComputedStyle(t,"").fontSize;var e=/px/.test(e)?n(e):/em/.test(e)?parseFloat(e)*12:12,r=e<24?e+4:U(e*1.2),i=U(r*.8);return{h:r,b:i,f:e}},label:function(n,r,i,s,o,u,a,f,c){function h(){var t,n;t=g.element.style;b=(x===void 0||T===void 0||m.styles.textAlign)&&g.textStr&&g.getBBox();m.width=(x||b.width||0)+2*E+S;m.height=(T||b.height||0)+2*E;A=E+v.fontMetrics(t&&t.fontSize,g).b;if(O){if(!y)t=U(-w*E),n=f?-A:0,m.box=y=s?v.symbol(s,t,n,m.width,m.height,L):v.rect(t,n,m.width,m.height,0,L[Ct]),y.attr("fill",Tt).add(m);y.isImg||y.attr(e({width:U(m.width),height:U(m.height)},L));L=null}}function p(){var e=m.styles,e=e&&e.textAlign,t=S+E*(1-w),n;n=f?0:A;if(l(x)&&b&&(e==="center"||e==="right"))t+={center:.5,right:1}[e]*(x-b.width);if(t!==g.x||n!==g.y)g.attr("x",t),n!==F&&g.attr("y",n);g.x=t;g.y=n}function d(e,t){y?y.attr(e,t):L[e]=t}var v=this,m=v.g(c),g=v.text("",0,0,a).attr({zIndex:1}),y,b,w=0,E=3,S=0,x,T,N,C,k=0,L={},A,O;m.onAdd=function(){g.add(m);m.attr({text:n||n===0?n:"",x:r,y:i});y&&l(o)&&m.attr({anchorX:o,anchorY:u})};m.widthSetter=function(e){x=e};m.heightSetter=function(e){T=e};m.paddingSetter=function(e){l(e)&&e!==E&&(E=e,p())};m.paddingLeftSetter=function(e){l(e)&&e!==S&&(S=e,p())};m.alignSetter=function(e){w={left:0,center:.5,right:1}[e]};m.textSetter=function(e){e!==F&&g.textSetter(e);h();p()};m["stroke-widthSetter"]=function(e,t){e&&(O=!0);k=e%2/2;d(t,e)};m.strokeSetter=m.fillSetter=m.rSetter=function(e,t){t==="fill"&&e&&(O=!0);d(t,e)};m.anchorXSetter=function(e,t){o=e;d(t,e+k-N)};m.anchorYSetter=function(e,t){u=e;d(t,e-C)};m.xSetter=function(e){m.x=e;w&&(e-=w*((x||b.width)+E));N=U(e);m.attr("translateX",N)};m.ySetter=function(e){C=m.y=U(e);m.attr("translateY",C)};var _=m.css;return e(m,{css:function(e){if(e){var n={},e=t(e);Jt(m.textProps,function(t){e[t]!==F&&(n[t]=e[t],delete e[t])});g.css(n)}return _.call(m,e)},getBBox:function(){return{width:b.width+2*E,height:b.height+2*E,x:b.x-E,y:b.y-E}},shadow:function(e){y&&y.shadow(e);return m},destroy:function(){Zt(m.element,"mouseenter");Zt(m.element,"mouseleave");g&&(g=g.destroy());y&&(y=y.destroy());M.prototype.destroy.call(m);m=v=h=p=d=null}})}};ft=ln;e(M.prototype,{htmlCss:function(t){var n=this.element;if(n=t&&n.tagName==="SPAN"&&t.width)delete t.width,this.textWidth=n,this.updateTransform();this.styles=e(this.styles,t);d(this.element,t);return this},htmlGetBBox:function(){var e=this.element,t=this.bBox;if(!t){if(e.nodeName==="text")e.style.position="absolute";t=this.bBox={x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}return t},htmlUpdateTransform:function(){if(this.added){var e=this.renderer,t=this.element,r=this.translateX||0,i=this.translateY||0,s=this.x||0,o=this.y||0,u=this.textAlign||"left",a={left:0,center:.5,right:1}[u],f=this.shadows;d(t,{marginLeft:r,marginTop:i});f&&Jt(f,function(e){d(e,{marginLeft:r+1,marginTop:i+1})});this.inverted&&Jt(t.childNodes,function(n){e.invertChild(n,t)});if(t.tagName==="SPAN"){var c=this.rotation,h,v=n(this.textWidth),m=[c,u,t.innerHTML,this.textWidth].join(",");if(m!==this.cTT){h=e.fontMetrics(t.style.fontSize).b;l(c)&&this.setSpanRotation(c,a,h);f=p(this.elemWidth,t.offsetWidth);if(f>v&&/[ \-]/.test(t.textContent||t.innerText))d(t,{width:v+"px",display:"block",whiteSpace:"normal"}),f=v;this.getSpanCorrection(f,h,a,c,u)}d(t,{left:s+(this.xCorr||0)+"px",top:o+(this.yCorr||0)+"px"});if(nt)h=t.offsetHeight;this.cTT=m}}else this.alignOnAdd=!0},setSpanRotation:function(e,t,n){var r={},i=et?"-ms-transform":nt?"-webkit-transform":rt?"MozTransform":Z?"-o-transform":"";r[i]=r.transform="rotate("+e+"deg)";r[i+(rt?"Origin":"-origin")]=r.transformOrigin=t*100+"% "+n+"px";d(this.element,r)},getSpanCorrection:function(e,t,n){this.xCorr=-e*n;this.yCorr=-t}});e(ln.prototype,{html:function(t,n,r){var i=this.createElement("span"),s=i.element,o=i.renderer;i.textSetter=function(e){e!==s.innerHTML&&delete this.bBox;s.innerHTML=this.textStr=e};i.xSetter=i.ySetter=i.alignSetter=i.rotationSetter=function(e,t){t==="align"&&(t="textAlign");i[t]=e;i.htmlUpdateTransform()};i.attr({text:t,x:U(n),y:U(r)}).css({position:"absolute",whiteSpace:"nowrap",fontFamily:this.style.fontFamily,fontSize:this.style.fontSize});i.css=i.htmlCss;if(o.isSVG)i.add=function(t){var n,r=o.box.parentNode,u=[];if(this.parentGroup=t){if(n=t.div,!n){for(;t;)u.push(t),t=t.parentGroup;Jt(u.reverse(),function(t){var i;n=t.div=t.div||v(xt,{className:c(t.element,"class")},{position:"absolute",left:(t.translateX||0)+"px",top:(t.translateY||0)+"px"},n||r);i=n.style;e(t,{translateXSetter:function(e,n){i.left=e+"px";t[n]=e;t.doTransform=!0},translateYSetter:function(e,n){i.top=e+"px";t[n]=e;t.doTransform=!0},visibilitySetter:function(e,t){i[t]=e}})})}}else n=r;n.appendChild(s);i.added=!0;i.alignOnAdd&&i.htmlUpdateTransform();return i};return i}});var cn,hn;if(!ot&&!at)hn={init:function(e,t){var n=["<",t,' filled="f" stroked="f"'],r=["position: ","absolute",";"],i=t===xt;(t==="shape"||i)&&r.push("left:0;top:0;width:1px;height:1px;");r.push("visibility: ",i?"hidden":"visible");n.push(' style="',r.join(""),'"/>');if(t)n=i||t==="span"||t==="img"?n.join(""):e.prepVML(n),this.element=v(n);this.renderer=e},add:function(e){var t=this.renderer,n=this.element,r=t.box,r=e?e.element||e:r;e&&e.inverted&&t.invertChild(n,r);r.appendChild(n);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform();if(this.onAdd)this.onAdd();return this},updateTransform:M.prototype.htmlUpdateTransform,setSpanRotation:function(){var e=this.rotation,t=J(e*G),n=K(e*G);d(this.element,{filter:e?["progid:DXImageTransform.Microsoft.Matrix(M11=",t,", M12=",-n,", M21=",n,", M22=",t,", sizingMethod='auto expand')"].join(""):Tt})},getSpanCorrection:function(e,t,n,r,i){var s=r?J(r*G):1,o=r?K(r*G):0,u=p(this.elemHeight,this.element.offsetHeight),a;this.xCorr=s<0&&-e;this.yCorr=o<0&&-u;a=s*o<0;this.xCorr+=o*t*(a?1-n:n);this.yCorr-=s*t*(r?a?n:1-n:1);i&&i!=="left"&&(this.xCorr-=e*n*(s<0?-1:1),r&&(this.yCorr-=u*n*(o<0?-1:1)),d(this.element,{textAlign:i}))},pathToVML:function(e){for(var t=e.length,n=[];t--;)if(o(e[t]))n[t]=U(e[t]*10)-5;else if(e[t]==="Z")n[t]="x";else if(n[t]=e[t],e.isArc&&(e[t]==="wa"||e[t]==="at"))n[t+5]===n[t+7]&&(n[t+7]+=e[t+7]>e[t+5]?1:-1),n[t+6]===n[t+8]&&(n[t+8]+=e[t+8]>e[t+6]?1:-1);return n.join(" ")||"x"},clip:function(e){var t=this,n;e?(n=e.members,f(n,t),n.push(t),t.destroyClip=function(){f(n,t)},e=e.getCSS(t)):(t.destroyClip&&t.destroyClip(),e={clip:tt?"inherit":"rect(auto)"});return t.css(e)},css:M.prototype.htmlCss,safeRemoveChild:function(e){e.parentNode&&k(e)},destroy:function(){this.destroyClip&&this.destroyClip();return M.prototype.destroy.apply(this)},on:function(e,t){this.element["on"+e]=function(){var e=q.event;e.target=e.srcElement;t(e)};return this},cutOffPath:function(e,t){var r,e=e.split(/[ ,]/);r=e.length;if(r===9||r===11)e[r-4]=e[r-2]=n(e[r-2])-10*t;return e.join(" ")},shadow:function(e,t,r){var i=[],s,o=this.element,u=this.renderer,a,f=o.style,l,c=o.path,h,d,m,g;c&&typeof c.value!=="string"&&(c="x");d=c;if(e){m=p(e.width,3);g=(e.opacity||.15)/m;for(s=1;s<=3;s++){h=m*2+1-2*s;r&&(d=this.cutOffPath(c.value,h+.5));l=['<shape isShadow="true" strokeweight="',h,'" filled="false" path="',d,'" coordsize="10 10" style="',o.style.cssText,'" />'];a=v(u.prepVML(l),null,{left:n(f.left)+p(e.offsetX,1),top:n(f.top)+p(e.offsetY,1)});if(r)a.cutOff=h+1;l=['<stroke color="',e.color||"black",'" opacity="',g*s,'"/>'];v(u.prepVML(l),null,null,a);t?t.element.appendChild(a):o.parentNode.insertBefore(a,o);i.push(a)}this.shadows=i}return this},updateShadows:wt,setAttr:function(e,t){tt?this.element[e]=t:this.element.setAttribute(e,t)},classSetter:function(e){this.element.className=e},dashstyleSetter:function(e,t,n){(n.getElementsByTagName("stroke")[0]||v(this.renderer.prepVML(["<stroke/>"]),null,null,n))[t]=e||"solid";this[t]=e},dSetter:function(e,t,n){var r=this.shadows,e=e||[];this.d=e.join&&e.join(" ");n.path=e=this.pathToVML(e);if(r)for(n=r.length;n--;)r[n].path=r[n].cutOff?this.cutOffPath(e,r[n].cutOff):e;this.setAttr(t,e)},fillSetter:function(e,t,n){var r=n.nodeName;if(r==="SPAN")n.style.color=e;else if(r!=="IMG")n.filled=e!==Tt,this.setAttr("fillcolor",this.renderer.color(e,n,t,this))},opacitySetter:wt,rotationSetter:function(e,t,n){n=n.style;this[t]=n[t]=e;n.left=-U(K(e*G)+1)+"px";n.top=U(J(e*G))+"px"},strokeSetter:function(e,t,n){this.setAttr("strokecolor",this.renderer.color(e,n,t))},"stroke-widthSetter":function(e,t,n){n.stroked=!!e;this[t]=e;o(e)&&(e+="px");this.setAttr("strokeweight",e)},titleSetter:function(e,t){this.setAttr(t,e)},visibilitySetter:function(e,t,n){e==="inherit"&&(e="visible");this.shadows&&Jt(this.shadows,function(n){n.style[t]=e});n.nodeName==="DIV"&&(e=e==="hidden"?"-999em":0,tt||(n.style[t]=e?"visible":"hidden"),t="top");n.style[t]=e},xSetter:function(e,t,n){this[t]=e;t==="x"?t="left":t==="y"&&(t="top");this.updateClipping?(this[t]=e,this.updateClipping()):n.style[t]=e},zIndexSetter:function(e,t,n){n.style[t]=e}},Ut.VMLElement=hn=m(M,hn),hn.prototype.ySetter=hn.prototype.widthSetter=hn.prototype.heightSetter=hn.prototype.xSetter,hn={Element:hn,isIE8:Y.indexOf("MSIE 8.0")>-1,init:function(t,n,r,i){var s;this.alignedObjects=[];i=this.createElement(xt).css(e(this.getStyle(i),{position:"relative"}));s=i.element;t.appendChild(i.element);this.isVML=!0;this.box=s;this.boxWrapper=i;this.cache={};this.setSize(n,r,!1);if(!I.namespaces.hcv){I.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{I.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(o){I.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},clipRect:function(t,n,r,s){var o=this.createElement(),u=i(t);return e(o,{members:[],left:(u?t.x:t)+1,top:(u?t.y:n)+1,width:(u?t.width:r)-1,height:(u?t.height:s)-1,getCSS:function(t){var n=t.element,r=n.nodeName,t=t.inverted,i=this.top-(r==="shape"?n.offsetTop:0),s=this.left,n=s+this.width,o=i+this.height,i={clip:"rect("+U(t?s:i)+"px,"+U(t?o:n)+"px,"+U(t?n:o)+"px,"+U(t?i:s)+"px)"};!t&&tt&&r==="DIV"&&e(i,{width:n+"px",height:o+"px"});return i},updateClipping:function(){Jt(o.members,function(e){e.element&&e.css(o.getCSS(e))})}})},color:function(e,t,n,r){var i=this,s,o=/^rgba/,u,a,f=Tt;e&&e.linearGradient?a="gradient":e&&e.radialGradient&&(a="pattern");if(a){var l,c,h=e.linearGradient||e.radialGradient,p,d,m,g,y,b="",e=e.stops,w,E=[],S=function(){u=['<fill colors="'+E.join(",")+'" opacity="',m,'" o:opacity2="',d,'" type="',a,'" ',b,'focus="100%" method="any" />'];v(i.prepVML(u),null,null,t)};p=e[0];w=e[e.length-1];p[0]>0&&e.unshift([0,p[1]]);w[0]<1&&e.push([1,w[1]]);Jt(e,function(e,t){o.test(e[1])?(s=fn(e[1]),l=s.get("rgb"),c=s.get("a")):(l=e[1],c=1);E.push(e[0]*100+"% "+l);t?(m=c,g=l):(d=c,y=l)});if(n==="fill")if(a==="gradient")n=h.x1||h[0]||0,e=h.y1||h[1]||0,p=h.x2||h[2]||0,h=h.y2||h[3]||0,b='angle="'+(90-R.atan((h-e)/(p-n))*180/Q)+'"',S();else{var f=h.r,x=f*2,T=f*2,N=h.cx,C=h.cy,k=t.radialReference,L,f=function(){k&&(L=r.getBBox(),N+=(k[0]-L.x)/L.width-.5,C+=(k[1]-L.y)/L.height-.5,x*=k[2]/L.width,T*=k[2]/L.height);b='src="'+dt.global.VMLRadialGradientURL+'" size="'+x+","+T+'" origin="0.5,0.5" position="'+N+","+C+'" color2="'+y+'" ';S()};r.added?f():r.onAdd=f;f=g}else f=l}else if(o.test(e)&&t.tagName!=="IMG")s=fn(e),u=["<",n,' opacity="',s.get("a"),'"/>'],v(this.prepVML(u),null,null,t),f=s.get("rgb");else{f=t.getElementsByTagName(n);if(f.length)f[0].opacity=1,f[0].type="solid";f=e}return f},prepVML:function(e){var t=this.isIE8,e=e.join("");t?(e=e.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),e=e.indexOf('style="')===-1?e.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):e.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):e=e.replace("<","<hcv:");return e},text:ln.prototype.html,path:function(t){var n={coordsize:"10 10"};s(t)?n.d=t:i(t)&&e(n,t);return this.createElement("shape").attr(n)},circle:function(e,t,n){var r=this.symbol("circle");if(i(e))n=e.r,t=e.y,e=e.x;r.isCircle=!0;r.r=n;return r.attr({x:e,y:t})},g:function(e){var t;e&&(t={className:"highcharts-"+e,"class":"highcharts-"+e});return this.createElement(xt).attr(t)},image:function(e,t,n,r,i){var s=this.createElement("img").attr({src:e});arguments.length>1&&s.attr({x:t,y:n,width:r,height:i});return s},createElement:function(e){return e==="rect"?this.symbol(e):ln.prototype.createElement.call(this,e)},invertChild:function(e,t){var r=this,i=t.style,s=e.tagName==="IMG"&&e.style;d(e,{flip:"x",left:n(i.width)-(s?n(s.top):1),top:n(i.height)-(s?n(s.left):1),rotation:-90});Jt(e.childNodes,function(t){r.invertChild(t,e)})},symbols:{arc:function(e,t,n,r,i){var s=i.start,o=i.end,u=i.r||n||r,n=i.innerR,r=J(s),a=K(s),f=J(o),l=K(o);if(o-s===0)return["x"];s=["wa",e-u,t-u,e+u,t+u,e+u*r,t+u*a,e+u*f,t+u*l];i.open&&!n&&s.push("e","M",e,t);s.push("at",e-n,t-n,e+n,t+n,e+n*f,t+n*l,e+n*r,t+n*a,"x","e");s.isArc=!0;return s},circle:function(e,t,n,r,i){i&&(n=r=2*i.r);i&&i.isCircle&&(e-=n/2,t-=r/2);return["wa",e,t,e+n,t+r,e+n,t+r/2,e+n,t+r/2,"e"]},rect:function(e,t,n,r,i){return ln.prototype.symbols[!l(i)||!i.r?"square":"callout"].call(0,e,t,n,r,i)}}},Ut.VMLRenderer=cn=function(){this.init.apply(this,arguments)},cn.prototype=t(ln.prototype,hn),ft=cn;ln.prototype.measureSpanWidth=function(e,t){var n=I.createElement("span"),r;r=I.createTextNode(e);n.appendChild(r);d(n,t);this.box.appendChild(n);r=n.offsetWidth;k(n);return r};var pn;if(at)Ut.CanVGRenderer=hn=function(){st="http://www.w3.org/1999/xhtml"},hn.prototype.symbols={},pn=function(){function e(){var e=t.length,n;for(n=0;n<e;n++)t[n]();t=[]}var t=[];return{push:function(n,r){t.length===0&&Vt(r,e);t.push(n)}}}(),ft=hn;_.prototype={addLabel:function(){var t=this.axis,n=t.options,r=t.chart,i=t.horiz,s=t.categories,u=t.names,f=this.pos,c=n.labels,h=c.rotation,d=t.tickPositions,i=i&&s&&!c.step&&!c.staggerLines&&!c.rotation&&r.plotWidth/d.length||!i&&(r.margin[3]||r.chartWidth*.33),v=f===d[0],m=f===d[d.length-1],g,u=s?p(s[f],u[f],f):f,s=this.label,y=d.info;t.isDatetimeAxis&&y&&(g=n.dateTimeLabelFormats[y.higherRanks[f]||y.unitName]);this.isFirst=v;this.isLast=m;n=t.labelFormatter.call({axis:t,chart:r,isFirst:v,isLast:m,dateTimeLabelFormat:g,value:t.isLog?L(a(u)):u});f=i&&{width:X(1,U(i-2*(c.padding||10)))+"px"};if(l(s))s&&s.attr({text:n}).css(f);else{g={align:t.labelAlign};if(o(h))g.rotation=h;if(i&&c.ellipsis)f.HcHeight=t.len/d.length;this.label=s=l(n)&&c.enabled?r.renderer.text(n,0,0,c.useHTML).attr(g).css(e(f,c.style)).add(t.labelGroup):null;t.tickBaseline=r.renderer.fontMetrics(c.style.fontSize,s).b;h&&t.side===2&&(t.tickBaseline*=J(h*G))}this.yOffset=s?p(c.y,t.tickBaseline+(t.side===2?8:-(s.getBBox().height/2))):0},getLabelSize:function(){var e=this.label,t=this.axis;return e?e.getBBox()[t.horiz?"height":"width"]:0},getLabelSides:function(){var e=this.label.getBBox(),t=this.axis,n=t.horiz,r=t.options.labels,e=n?e.width:e.height,t=n?r.x-e*{left:0,center:.5,right:1}[t.labelAlign]:0;return[t,n?e+t:e]},handleOverflow:function(e,t){var n=!0,r=this.axis,i=this.isFirst,s=this.isLast,o=r.horiz?t.x:t.y,u=r.reversed,a=r.tickPositions,f=this.getLabelSides(),l=f[0],f=f[1],c,h,p,d=this.label.line;c=d||0;h=r.labelEdge;p=r.justifyLabels&&(i||s);h[c]===F||o+l>h[c]?h[c]=o+f:p||(n=!1);if(p){c=(h=r.justifyToPlot)?r.pos:0;h=h?c+r.len:r.chart.chartWidth;do e+=i?1:-1,p=r.ticks[a[e]];while(a[e]&&(!p||!p.label||p.label.line!==d));r=p&&p.label.xy&&p.label.xy.x+p.getLabelSides()[i?0:1];i&&!u||s&&u?o+l<c&&(o=c-l,p&&o+f>r&&(n=!1)):o+f>h&&(o=h-f,p&&o+l<r&&(n=!1));t.x=o}return n},getPosition:function(e,t,n,r){var i=this.axis,s=i.chart,o=r&&s.oldChartHeight||s.chartHeight;return{x:e?i.translate(t+n,null,null,r)+i.transB:i.left+i.offset+(i.opposite?(r&&s.oldChartWidth||s.chartWidth)-i.right-i.left:0),y:e?o-i.bottom+i.offset-(i.opposite?i.height:0):o-i.translate(t+n,null,null,r)-i.transB}},getLabelPosition:function(e,t,n,r,i,s,o,u){var a=this.axis,f=a.transA,l=a.reversed,c=a.staggerLines,e=e+i.x-(s&&r?s*f*(l?-1:1):0),t=t+this.yOffset-(s&&!r?s*f*(l?1:-1):0);if(c)n.line=o/(u||1)%c,t+=n.line*(a.labelOffset/c);return{x:e,y:t}},getMarkPath:function(e,t,n,r,i,s){return s.crispLine(["M",e,t,"L",e+(i?0:-n),t+(i?n:0)],r)},render:function(e,t,n){var r=this.axis,i=r.options,s=r.chart.renderer,o=r.horiz,u=this.type,a=this.label,f=this.pos,l=i.labels,c=this.gridLine,h=u?u+"Grid":"grid",d=u?u+"Tick":"tick",v=i[h+"LineWidth"],m=i[h+"LineColor"],g=i[h+"LineDashStyle"],y=i[d+"Length"],h=i[d+"Width"]||0,b=i[d+"Color"],w=i[d+"Position"],d=this.mark,E=l.step,S=!0,x=r.tickmarkOffset,T=this.getPosition(o,f,x,t),N=T.x,T=T.y,C=o&&N===r.pos+r.len||!o&&T===r.pos?-1:1,n=p(n,1);this.isActive=!0;if(v){f=r.getPlotLinePath(f+x,v*C,t,!0);if(c===F){c={stroke:m,"stroke-width":v};if(g)c.dashstyle=g;if(!u)c.zIndex=1;if(t)c.opacity=0;this.gridLine=c=v?s.path(f).attr(c).add(r.gridGroup):null}if(!t&&c&&f)c[this.isNew?"attr":"animate"]({d:f,opacity:n})}if(h&&y)w==="inside"&&(y=-y),r.opposite&&(y=-y),u=this.getMarkPath(N,T,y,h*C,o,s),d?d.animate({d:u,opacity:n}):this.mark=s.path(u).attr({stroke:b,"stroke-width":h,opacity:n}).add(r.axisGroup);if(a&&!isNaN(N))a.xy=T=this.getLabelPosition(N,T,a,o,l,x,e,E),this.isFirst&&!this.isLast&&!p(i.showFirstLabel,1)||this.isLast&&!this.isFirst&&!p(i.showLastLabel,1)?S=!1:!r.isRadial&&!l.step&&!l.rotation&&!t&&n!==0&&(S=this.handleOverflow(e,T)),E&&e%E&&(S=!1),S&&!isNaN(T.y)?(T.opacity=n,a[this.isNew?"attr":"animate"](T),this.isNew=!1):a.attr("y",-9999)},destroy:function(){C(this,this.axis)}};Ut.PlotLineOrBand=function(e,t){this.axis=e;if(t)this.options=t,this.id=t.id};Ut.PlotLineOrBand.prototype={render:function(){var e=this,n=e.axis,r=n.horiz,i=(n.pointRange||0)/2,s=e.options,o=s.label,a=e.label,f=s.width,c=s.to,h=s.from,p=l(h)&&l(c),d=s.value,v=s.dashStyle,m=e.svgElem,g=[],y,b=s.color,w=s.zIndex,E=s.events,S={},x=n.chart.renderer;n.isLog&&(h=u(h),c=u(c),d=u(d));if(f){if(g=n.getPlotLinePath(d,f),S={stroke:b,"stroke-width":f},v)S.dashstyle=v}else if(p){h=X(h,n.min-i);c=V(c,n.max+i);g=n.getPlotBandPath(h,c,s);if(b)S.fill=b;if(s.borderWidth)S.stroke=s.borderColor,S["stroke-width"]=s.borderWidth}else return;if(l(w))S.zIndex=w;if(m)if(g)m.animate({d:g},null,m.onGetPath);else{if(m.hide(),m.onGetPath=function(){m.show()},a)e.label=a=a.destroy()}else if(g&&g.length&&(e.svgElem=m=x.path(g).attr(S).add(),E))for(y in i=function(t){m.on(t,function(n){E[t].apply(e,[n])})},E)i(y);if(o&&l(o.text)&&g&&g.length&&n.width>0&&n.height>0){o=t({align:r&&p&&"center",x:r?!p&&4:10,verticalAlign:!r&&p&&"middle",y:r?p?16:10:p?6:-4,rotation:r&&!p&&90},o);if(!a){S={align:o.textAlign||o.align,rotation:o.rotation};if(l(w))S.zIndex=w;e.label=a=x.text(o.text,0,0,o.useHTML).attr(S).css(o.style).add()}n=[g[1],g[4],p?g[6]:g[1]];p=[g[2],g[5],p?g[7]:g[2]];g=T(n);r=T(p);a.align(o,!1,{x:g,y:r,width:N(n)-g,height:N(p)-r});a.show()}else a&&a.hide();return e},destroy:function(){f(this.axis.plotLinesAndBands,this);delete this.axis;C(this)}};D.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,gridLineColor:"#C0C0C0",labels:Wt,lineColor:"#C0D0E0",lineWidth:1,minPadding:.01,maxPadding:.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:.05,minPadding:.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return g(this.total,-1)},style:Wt.style}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:null},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-15},title:{rotation:0}},init:function(e,t){var n=t.isX;this.horiz=e.inverted?!n:n;this.coll=(this.isXAxis=n)?"xAxis":"yAxis";this.opposite=t.opposite;this.side=t.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(t);var r=this.options,i=r.type;this.labelFormatter=r.labels.formatter||this.defaultLabelFormatter;this.userOptions=t;this.minPixelPadding=0;this.chart=e;this.reversed=r.reversed;this.zoomEnabled=r.zoomEnabled!==!1;this.categories=r.categories||i==="category";this.names=[];this.isLog=i==="logarithmic";this.isDatetimeAxis=i==="datetime";this.isLinked=l(r.linkedTo);this.tickmarkOffset=this.categories&&r.tickmarkPlacement==="between"&&p(r.tickInterval,1)===1?.5:0;this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=r.minRange||r.maxZoom;this.range=r.range;this.offset=r.offset||0;this.stacks={};this.oldStacks={};this.min=this.max=null;this.crosshair=p(r.crosshair,h(e.options.tooltip.crosshairs)[n?0:1],!1);var s,r=this.options.events;$t(this,e.axes)===-1&&(n&&!this.isColorAxis?e.axes.splice(e.xAxis.length,0,this):e.axes.push(this),e[this.coll].push(this));this.series=this.series||[];if(e.inverted&&n&&this.reversed===F)this.reversed=!0;this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(s in r)Yt(this,s,r[s]);if(this.isLog)this.val2lin=u,this.lin2val=a},setOptions:function(e){this.options=t(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],t(dt[this.coll],e))},defaultLabelFormatter:function(){var e=this.axis,t=this.value,n=e.categories,r=this.dateTimeLabelFormat,i=dt.lang.numericSymbols,s=i&&i.length,o,u=e.options.labels.format,e=e.isLog?t:e.tickInterval;if(u)o=w(u,this);else if(n)o=t;else if(r)o=vt(r,t);else if(s&&e>=1e3)for(;s--&&o===F;)n=Math.pow(1e3,s+1),e>=n&&i[s]!==null&&(o=g(t/n,-1)+i[s]);o===F&&(o=$(t)>=1e4?g(t,0):g(t,-1,F,""));return o},getSeriesExtremes:function(){var e=this,t=e.chart;e.hasVisibleSeries=!1;e.dataMin=e.dataMax=e.ignoreMinPadding=e.ignoreMaxPadding=null;e.buildStacks&&e.buildStacks();Jt(e.series,function(n){if(n.visible||!t.options.chart.ignoreHiddenSeries){var r;r=n.options.threshold;var i;e.hasVisibleSeries=!0;e.isLog&&r<=0&&(r=null);if(e.isXAxis){if(r=n.xData,r.length)e.dataMin=V(p(e.dataMin,r[0]),T(r)),e.dataMax=X(p(e.dataMax,r[0]),N(r))}else{n.getExtremes();i=n.dataMax;n=n.dataMin;if(l(n)&&l(i))e.dataMin=V(p(e.dataMin,n),n),e.dataMax=X(p(e.dataMax,i),i);if(l(r))if(e.dataMin>=r)e.dataMin=r,e.ignoreMinPadding=!0;else if(e.dataMax<r)e.dataMax=r,e.ignoreMaxPadding=!0}}})},translate:function(e,t,n,r,i,s){var u=1,a=0,f=r?this.oldTransA:this.transA,r=r?this.oldMin:this.min,l=this.minPixelPadding,i=(this.options.ordinal||this.isLog&&i)&&this.lin2val;if(!f)f=this.transA;if(n)u*=-1,a=this.len;this.reversed&&(u*=-1,a-=u*(this.sector||this.len));t?(e=e*u+a,e-=l,e=e/f+r,i&&(e=this.lin2val(e))):(i&&(e=this.val2lin(e)),s==="between"&&(s=.5),e=u*(e-r)*f+a+u*l+(o(s)?f*s*this.pointRange:0));return e},toPixels:function(e,t){return this.translate(e,!1,!this.horiz,null,!0)+(t?0:this.pos)},toValue:function(e,t){return this.translate(e-(t?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(e,t,n,r,i){var s=this.chart,o=this.left,u=this.top,a,f,l=n&&s.oldChartHeight||s.chartHeight,c=n&&s.oldChartWidth||s.chartWidth,h;a=this.transB;i=p(i,this.translate(e,null,null,n));e=n=U(i+a);a=f=U(l-i-a);if(isNaN(i))h=!0;else if(this.horiz){if(a=u,f=l-this.bottom,e<o||e>o+this.width)h=!0}else if(e=o,n=c-this.right,a<u||a>u+this.height)h=!0;return h&&!r?null:s.renderer.crispLine(["M",e,a,"L",n,f],t||1)},getLinearTickPositions:function(e,t,n){var r,i=L(z(t/e)*e),s=L(W(n/e)*e),u=[];if(t===n&&o(t))return[t];for(t=i;t<=s;){u.push(t);t=L(t+e);if(t===r)break;r=t}return u},getMinorTickPositions:function(){var e=this.options,t=this.tickPositions,n=this.minorTickInterval,r=[],i;if(this.isLog){i=t.length;for(e=1;e<i;e++)r=r.concat(this.getLogTickPositions(n,t[e-1],t[e],!0))}else if(this.isDatetimeAxis&&e.minorTickInterval==="auto")r=r.concat(this.getTimeTicks(this.normalizeTimeTickInterval(n),this.min,this.max,e.startOfWeek)),r[0]<this.min&&r.shift();else for(t=this.min+(t[0]-this.min)%n;t<=this.max;t+=n)r.push(t);return r},adjustForMinRange:function(){var e=this.options,t=this.min,n=this.max,r,i=this.dataMax-this.dataMin>=this.minRange,s,o,u,a,f;if(this.isXAxis&&this.minRange===F&&!this.isLog)l(e.min)||l(e.max)?this.minRange=null:(Jt(this.series,function(e){a=e.xData;for(o=f=e.xIncrement?1:a.length-1;o>0;o--)if(u=a[o]-a[o-1],s===F||u<s)s=u}),this.minRange=V(s*5,this.dataMax-this.dataMin));if(n-t<this.minRange){var c=this.minRange;r=(c-n+t)/2;r=[t-r,p(e.min,t-r)];if(i)r[2]=this.dataMin;t=N(r);n=[t+c,p(e.max,t+c)];if(i)n[2]=this.dataMax;n=T(n);n-t<c&&(r[0]=n-c,r[1]=p(e.min,n-c),t=N(r))}this.min=t;this.max=n},setAxisTranslation:function(e){var t=this,n=t.max-t.min,i=t.axisPointRange||0,s,o=0,u=0,a=t.linkedParent,f=!!t.categories,c=t.transA;if(t.isXAxis||f||i)a?(o=a.minPointOffset,u=a.pointRangePadding):Jt(t.series,function(e){var a=f?1:t.isXAxis?e.pointRange:t.axisPointRange||0,c=e.options.pointPlacement,h=e.closestPointRange;a>n&&(a=0);i=X(i,a);o=X(o,r(c)?0:a/2);u=X(u,c==="on"?0:a);!e.noSharedTooltip&&l(h)&&(s=l(s)?V(s,h):h)}),a=t.ordinalSlope&&s?t.ordinalSlope/s:1,t.minPointOffset=o*=a,t.pointRangePadding=u*=a,t.pointRange=V(i,n),t.closestPointRange=s;if(e)t.oldTransA=c;t.translationSlope=t.transA=c=t.len/(n+u||1);t.transB=t.horiz?t.left:t.bottom;t.minPixelPadding=c*o},setTickPositions:function(e){var t=this,n=t.chart,r=t.options,i=r.startOnTick,s=r.endOnTick,a=t.isLog,f=t.isDatetimeAxis,c=t.isXAxis,h=t.isLinked,d=t.options.tickPositioner,v=r.maxPadding,m=r.minPadding,g=r.tickInterval,y=r.minTickInterval,b=r.tickPixelInterval,w,x=t.categories;h?(t.linkedParent=n[t.coll][r.linkedTo],n=t.linkedParent.getExtremes(),t.min=p(n.min,n.dataMin),t.max=p(n.max,n.dataMax),r.type!==t.linkedParent.options.type&&bt(11,1)):(t.min=p(t.userMin,r.min,t.dataMin),t.max=p(t.userMax,r.max,t.dataMax));if(a)!e&&V(t.min,p(t.dataMin,t.min))<=0&&bt(10,1),t.min=L(u(t.min)),t.max=L(u(t.max));if(t.range&&l(t.max))t.userMin=t.min=X(t.min,t.max-t.range),t.userMax=t.max,t.range=null;t.beforePadding&&t.beforePadding();t.adjustForMinRange();if(!x&&!t.axisPointRange&&!t.usePercentage&&!h&&l(t.min)&&l(t.max)&&(n=t.max-t.min)){if(!l(r.min)&&!l(t.userMin)&&m&&(t.dataMin<0||!t.ignoreMinPadding))t.min-=n*m;if(!l(r.max)&&!l(t.userMax)&&v&&(t.dataMax>0||!t.ignoreMaxPadding))t.max+=n*v}if(o(r.floor))t.min=X(t.min,r.floor);if(o(r.ceiling))t.max=V(t.max,r.ceiling);t.min===t.max||t.min===void 0||t.max===void 0?t.tickInterval=1:h&&!g&&b===t.linkedParent.options.tickPixelInterval?t.tickInterval=t.linkedParent.tickInterval:(t.tickInterval=p(g,x?1:(t.max-t.min)*b/X(t.len,b)),!l(g)&&t.len<b&&!this.isRadial&&!this.isLog&&!x&&i&&s&&(w=!0,t.tickInterval/=4));c&&!e&&Jt(t.series,function(e){e.processData(t.min!==t.oldMin||t.max!==t.oldMax)});t.setAxisTranslation(!0);t.beforeSetTickPositions&&t.beforeSetTickPositions();if(t.postProcessTickInterval)t.tickInterval=t.postProcessTickInterval(t.tickInterval);if(t.pointRange)t.tickInterval=X(t.pointRange,t.tickInterval);if(!g&&t.tickInterval<y)t.tickInterval=y;if(!f&&!a&&!g)t.tickInterval=S(t.tickInterval,null,E(t.tickInterval),p(r.allowDecimals,!(t.tickInterval>1&&t.tickInterval<5&&t.max>1e3&&t.max<9999)));t.minorTickInterval=r.minorTickInterval==="auto"&&t.tickInterval?t.tickInterval/5:r.minorTickInterval;t.tickPositions=e=r.tickPositions?[].concat(r.tickPositions):d&&d.apply(t,[t.min,t.max]);if(!e)!t.ordinalPositions&&(t.max-t.min)/t.tickInterval>X(2*t.len,200)&&bt(19,!0),e=f?t.getTimeTicks(t.normalizeTimeTickInterval(t.tickInterval,r.units),t.min,t.max,r.startOfWeek,t.ordinalPositions,t.closestPointRange,!0):a?t.getLogTickPositions(t.tickInterval,t.min,t.max):t.getLinearTickPositions(t.tickInterval,t.min,t.max),w&&e.splice(1,e.length-2),t.tickPositions=e;if(!h)r=e[0],a=e[e.length-1],f=t.minPointOffset||0,i?t.min=r:t.min-f>r&&e.shift(),s?t.max=a:t.max+f<a&&e.pop(),e.length===0&&l(r)&&e.push((a+r)/2),e.length===1&&(i=$(t.max)>1e13?1:.001,t.min-=i,t.max+=i)},setMaxTicks:function(){var e=this.chart,t=e.maxTicks||{},n=this.tickPositions,r=this._maxTicksKey=[this.coll,this.pos,this.len].join("-");if(!this.isLinked&&!this.isDatetimeAxis&&n&&n.length>(t[r]||0)&&this.options.alignTicks!==!1)t[r]=n.length;e.maxTicks=t},adjustTickAmount:function(){var e=this._maxTicksKey,t=this.tickPositions,n=this.chart.maxTicks;if(n&&n[e]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1&&this.min!==F){var r=this.tickAmount,i=t.length;this.tickAmount=e=n[e];if(i<e){for(;t.length<e;)t.push(L(t[t.length-1]+this.tickInterval));this.transA*=(i-1)/(e-1);this.max=t[t.length-1]}if(l(r)&&e!==r)this.isDirty=!0}},setScale:function(){var e=this.stacks,t,n,r,i;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();i=this.len!==this.oldAxisLength;Jt(this.series,function(e){if(e.isDirtyData||e.isDirty||e.xAxis.isDirty)r=!0});if(i||r||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(t in e)for(n in e[t])e[t][n].total=null,e[t][n].cum=0;this.forceRedraw=!1;this.getSeriesExtremes();this.setTickPositions();this.oldUserMin=this.userMin;this.oldUserMax=this.userMax;if(!this.isDirty)this.isDirty=i||this.min!==this.oldMin||this.max!==this.oldMax}else if(!this.isXAxis){if(this.oldStacks)e=this.stacks=this.oldStacks;for(t in e)for(n in e[t])e[t][n].cum=e[t][n].total}this.setMaxTicks()},setExtremes:function(t,n,r,i,s){var o=this,u=o.chart,r=p(r,!0),s=e(s,{min:t,max:n});en(o,"setExtremes",s,function(){o.userMin=t;o.userMax=n;o.eventArgs=s;o.isDirtyExtremes=!0;r&&u.redraw(i)})},zoom:function(e,t){var n=this.dataMin,r=this.dataMax,i=this.options;this.allowZoomOutside||(l(n)&&e<=V(n,p(i.min,n))&&(e=F),l(r)&&t>=X(r,p(i.max,r))&&(t=F));this.displayBtn=e!==F||t!==F;this.setExtremes(e,t,!1,F,{trigger:"zoom"});return!0},setAxisSize:function(){var e=this.chart,t=this.options,n=t.offsetLeft||0,r=this.horiz,i=p(t.width,e.plotWidth-n+(t.offsetRight||0)),s=p(t.height,e.plotHeight),o=p(t.top,e.plotTop),t=p(t.left,e.plotLeft+n),n=/%$/;n.test(s)&&(s=parseInt(s,10)/100*e.plotHeight);n.test(o)&&(o=parseInt(o,10)/100*e.plotHeight+e.plotTop);this.left=t;this.top=o;this.width=i;this.height=s;this.bottom=e.chartHeight-s-o;this.right=e.chartWidth-i-t;this.len=X(r?i:s,0);this.pos=r?t:o},getExtremes:function(){var e=this.isLog;return{min:e?L(a(this.min)):this.min,max:e?L(a(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(e){var t=this.isLog,n=t?a(this.min):this.min,t=t?a(this.max):this.max;n>e||e===null?e=n:t<e&&(e=t);return this.translate(e,0,1,0,1)},autoLabelAlign:function(e){e=(p(e,0)-this.side*90+720)%360;return e>15&&e<165?"right":e>195&&e<345?"left":"center"},getOffset:function(){var e=this,t=e.chart,n=t.renderer,r=e.options,i=e.tickPositions,s=e.ticks,o=e.horiz,u=e.side,a=t.inverted?[1,0,3,2][u]:u,f,c,h=0,d,v=0,m=r.title,g=r.labels,y=0,b=t.axisOffset,t=t.clipOffset,w=[-1,1,1,-1][u],E,S=1,x=p(g.maxStaggerLines,5),T,N,C,k,L;e.hasData=f=e.hasVisibleSeries||l(e.min)&&l(e.max)&&!!i;e.showAxis=c=f||p(r.showEmpty,!0);e.staggerLines=e.horiz&&g.staggerLines;if(!e.axisGroup)e.gridGroup=n.g("grid").attr({zIndex:r.gridZIndex||1}).add(),e.axisGroup=n.g("axis").attr({zIndex:r.zIndex||2}).add(),e.labelGroup=n.g("axis-labels").attr({zIndex:g.zIndex||7}).addClass("highcharts-"+e.coll.toLowerCase()+"-labels").add();if(f||e.isLinked){e.labelAlign=p(g.align||e.autoLabelAlign(g.rotation));Jt(i,function(t){s[t]?s[t].addLabel():s[t]=new _(e,t)});if(e.horiz&&!e.staggerLines&&x&&!g.rotation){for(f=e.reversed?[].concat(i).reverse():i;S<x;){T=[];N=!1;for(E=0;E<f.length;E++)C=f[E],k=(k=s[C].label&&s[C].label.getBBox())?k.width:0,L=E%S,k&&(C=e.translate(C),T[L]!==F&&C<T[L]&&(N=!0),T[L]=C+k);if(N)S++;else break}if(S>1)e.staggerLines=S}Jt(i,function(t){if(u===0||u===2||{1:"left",3:"right"}[u]===e.labelAlign)y=X(s[t].getLabelSize(),y)});if(e.staggerLines)y*=e.staggerLines,e.labelOffset=y}else for(E in s)s[E].destroy(),delete s[E];if(m&&m.text&&m.enabled!==!1){if(!e.axisTitle)e.axisTitle=n.text(m.text,0,0,m.useHTML).attr({zIndex:7,rotation:m.rotation||0,align:m.textAlign||{low:"left",middle:"center",high:"right"}[m.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(m.style).add(e.axisGroup),e.axisTitle.isNew=!0;if(c)h=e.axisTitle.getBBox()[o?"height":"width"],d=m.offset,v=l(d)?0:p(m.margin,o?5:10);e.axisTitle[c?"show":"hide"]()}e.offset=w*p(r.offset,b[u]);n=u===2?e.tickBaseline:0;o=y+v+(y&&w*(o?p(g.y,e.tickBaseline+8):g.x)-n);e.axisTitleMargin=p(d,o);b[u]=X(b[u],e.axisTitleMargin+h+w*e.offset,o);t[a]=X(t[a],z(r.lineWidth/2)*2)},getLinePath:function(e){var t=this.chart,n=this.opposite,r=this.offset,i=this.horiz,s=this.left+(n?this.width:0)+r,r=t.chartHeight-this.bottom-(n?this.height:0)+r;n&&(e*=-1);return t.renderer.crispLine(["M",i?this.left:s,i?r:this.top,"L",i?t.chartWidth-this.right:s,i?r:t.chartHeight-this.bottom],e)},getTitlePosition:function(){var e=this.horiz,t=this.left,r=this.top,i=this.len,s=this.options.title,o=e?t:r,u=this.opposite,a=this.offset,f=n(s.style.fontSize||12),i={low:o+(e?0:i),middle:o+i/2,high:o+(e?i:0)}[s.align],t=(e?r+this.height:t)+(e?1:-1)*(u?-1:1)*this.axisTitleMargin+(this.side===2?f:0);return{x:e?i:t+(u?this.width:0)+a+(s.x||0),y:e?t-(u?this.height:0)+a:i+(s.y||0)}},render:function(){var e=this,t=e.horiz,n=e.reversed,r=e.chart,i=r.renderer,s=e.options,o=e.isLog,u=e.isLinked,f=e.tickPositions,c,h=e.axisTitle,p=e.ticks,d=e.minorTicks,v=e.alternateBands,m=s.stackLabels,g=s.alternateGridColor,y=e.tickmarkOffset,b=s.lineWidth,w=r.hasRendered&&l(e.oldMin)&&!isNaN(e.oldMin),E=e.hasData,S=e.showAxis,x,T=s.labels.overflow,N=e.justifyLabels=t&&T!==!1,C;e.labelEdge.length=0;e.justifyToPlot=T==="justify";Jt([p,d,v],function(e){for(var t in e)e[t].isActive=!1});if(E||u)if(e.minorTickInterval&&!e.categories&&Jt(e.getMinorTickPositions(),function(t){d[t]||(d[t]=new _(e,t,"minor"));w&&d[t].isNew&&d[t].render(null,!0);d[t].render(null,!1,1)}),f.length&&(c=f.slice(),(t&&n||!t&&!n)&&c.reverse(),N&&(c=c.slice(1).concat([c[0]])),Jt(c,function(t,n){N&&(n=n===c.length-1?0:n+1);if(!u||t>=e.min&&t<=e.max)p[t]||(p[t]=new _(e,t)),w&&p[t].isNew&&p[t].render(n,!0,.1),p[t].render(n)}),y&&e.min===0&&(p[-1]||(p[-1]=new _(e,-1,null,!0)),p[-1].render(-1))),g&&Jt(f,function(t,n){if(n%2===0&&t<e.max)v[t]||(v[t]=new Ut.PlotLineOrBand(e)),x=t+y,C=f[n+1]!==F?f[n+1]+y:e.max,v[t].options={from:o?a(x):x,to:o?a(C):C,color:g},v[t].render(),v[t].isActive=!0}),!e._addedPlotLB)Jt((s.plotLines||[]).concat(s.plotBands||[]),function(t){e.addPlotBandOrLine(t)}),e._addedPlotLB=!0;Jt([p,d,v],function(e){var t,n,i=[],s=mt?mt.duration||500:0,o=function(){for(n=i.length;n--;)e[i[n]]&&!e[i[n]].isActive&&(e[i[n]].destroy(),delete e[i[n]])};for(t in e)if(!e[t].isActive)e[t].render(t,!1,0),e[t].isActive=!1,i.push(t);e===v||!r.hasRendered||!s?o():s&&setTimeout(o,s)});if(b)t=e.getLinePath(b),e.axisLine?e.axisLine.animate({d:t}):e.axisLine=i.path(t).attr({stroke:s.lineColor,"stroke-width":b,zIndex:7}).add(e.axisGroup),e.axisLine[S?"show":"hide"]();if(h&&S)h[h.isNew?"attr":"animate"](e.getTitlePosition()),h.isNew=!1;m&&m.enabled&&e.renderStackTotals();e.isDirty=!1},redraw:function(){this.render();Jt(this.plotLinesAndBands,function(e){e.render()});Jt(this.series,function(e){e.isDirty=!0})},destroy:function(e){var t=this,n=t.stacks,r,i=t.plotLinesAndBands;e||Zt(t);for(r in n)C(n[r]),n[r]=null;Jt([t.ticks,t.minorTicks,t.alternateBands],function(e){C(e)});for(e=i.length;e--;)i[e].destroy();Jt("stackTotalGroup,axisLine,axisTitle,axisGroup,cross,gridGroup,labelGroup".split(","),function(e){t[e]&&(t[e]=t[e].destroy())});this.cross&&this.cross.destroy()},drawCrosshair:function(e,t){if(this.crosshair)if((l(t)||!p(this.crosshair.snap,!0))===!1)this.hideCrosshair();else{var n,r=this.crosshair,i=r.animation;p(r.snap,!0)?l(t)&&(n=this.chart.inverted!=this.horiz?t.plotX:this.len-t.plotY):n=this.horiz?e.chartX-this.pos:this.len-e.chartY+this.pos;n=this.isRadial?this.getPlotLinePath(this.isXAxis?t.x:p(t.stackY,t.y)):this.getPlotLinePath(null,null,null,null,n);if(n===null)this.hideCrosshair();else if(this.cross)this.cross.attr({visibility:"visible"})[i?"animate":"attr"]({d:n},i);else{i={"stroke-width":r.width||1,stroke:r.color||"#C0C0C0",zIndex:r.zIndex||2};if(r.dashStyle)i.dashstyle=r.dashStyle;this.cross=this.chart.renderer.path(n).attr(i).add()}}},hideCrosshair:function(){this.cross&&this.cross.hide()}};e(D.prototype,{getPlotBandPath:function(e,t){var n=this.getPlotLinePath(t),r=this.getPlotLinePath(e);r&&n?r.push(n[4],n[5],n[1],n[2]):r=null;return r},addPlotBand:function(e){return this.addPlotBandOrLine(e,"plotBands")},addPlotLine:function(e){return this.addPlotBandOrLine(e,"plotLines")},addPlotBandOrLine:function(e,t){var n=(new Ut.PlotLineOrBand(this,e)).render(),r=this.userOptions;n&&(t&&(r[t]=r[t]||[],r[t].push(e)),this.plotLinesAndBands.push(n));return n},removePlotBandOrLine:function(e){for(var t=this.plotLinesAndBands,n=this.options,r=this.userOptions,i=t.length;i--;)t[i].id===e&&t[i].destroy();Jt([n.plotLines||[],r.plotLines||[],n.plotBands||[],r.plotBands||[]],function(t){for(i=t.length;i--;)t[i].id===e&&f(t,t[i])})}});D.prototype.getTimeTicks=function(t,n,r,i){var s=[],o={},u=dt.global.useUTC,a,f=new kt(n-At),c=t.unitRange,h=t.count;if(l(n)){c>=yt.second&&(f.setMilliseconds(0),f.setSeconds(c>=yt.minute?0:h*z(f.getSeconds()/h)));if(c>=yt.minute)f[Bt](c>=yt.hour?0:h*z(f[Ot]()/h));if(c>=yt.hour)f[jt](c>=yt.day?0:h*z(f[Mt]()/h));if(c>=yt.day)f[Ft](c>=yt.month?1:h*z(f[Dt]()/h));c>=yt.month&&(f[It](c>=yt.year?0:h*z(f[Pt]()/h)),a=f[Ht]());c>=yt.year&&(a-=a%h,f[qt](a));if(c===yt.week)f[Ft](f[Dt]()-f[_t]()+p(i,1));n=1;At&&(f=new kt(f.getTime()+At));a=f[Ht]();for(var i=f.getTime(),d=f[Pt](),v=f[Dt](),m=(yt.day+(u?At:f.getTimezoneOffset()*6e4))%yt.day;i<r;)s.push(i),c===yt.year?i=Lt(a+n*h,0):c===yt.month?i=Lt(a,d+n*h):!u&&(c===yt.day||c===yt.week)?i=Lt(a,d,v+n*h*(c===yt.day?1:7)):i+=c*h,n++;s.push(i);Jt(Kt(s,function(e){return c<=yt.hour&&e%yt.day===m}),function(e){o[e]="day"})}s.info=e(t,{higherRanks:o,totalRange:c*h});return s};D.prototype.normalizeTimeTickInterval=function(e,t){var n=t||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],r=n[n.length-1],i=yt[r[0]],s=r[1],o;for(o=0;o<n.length;o++)if(r=n[o],i=yt[r[0]],s=r[1],n[o+1]&&e<=(i*s[s.length-1]+yt[n[o+1][0]])/2)break;i===yt.year&&e<5*i&&(s=[1,2,5]);n=S(e/i,s,r[0]==="year"?X(E(e/i),1):1);return{unitRange:i,count:n,unitName:r[0]}};D.prototype.getLogTickPositions=function(e,t,n,r){var i=this.options,s=this.len,o=[];if(!r)this._minorAutoInterval=null;if(e>=.5)e=U(e),o=this.getLinearTickPositions(e,t,n);else if(e>=.08)for(var s=z(t),f,l,c,h,d,i=e>.3?[1,2,4]:e>.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];s<n+1&&!d;s++){l=i.length;for(f=0;f<l&&!d;f++)c=u(a(s)*i[f]),c>t&&(!r||h<=n)&&h!==F&&o.push(h),h>n&&(d=!0),h=c}else if(t=a(t),n=a(n),e=i[r?"minorTickInterval":"tickInterval"],e=p(e==="auto"?null:e,this._minorAutoInterval,(n-t)*(i.tickPixelInterval/(r?5:1))/((r?s/this.tickPositions.length:s)||1)),e=S(e,null,E(e)),o=Gt(this.getLinearTickPositions(e,t,n),u),!r)this._minorAutoInterval=e/5;if(!r)this.tickInterval=e;return o};var dn=Ut.Tooltip=function(){this.init.apply(this,arguments)};dn.prototype={init:function(e,t){var r=t.borderWidth,i=t.style,s=n(i.padding);this.chart=e;this.options=t;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.label=e.renderer.label("",0,0,t.shape||"callout",null,null,t.useHTML,null,"tooltip").attr({padding:s,fill:t.backgroundColor,"stroke-width":r,r:t.borderRadius,zIndex:8}).css(i).css({padding:0}).add().attr({y:-9999});at||this.label.shadow(t.shadow);this.shared=t.shared},destroy:function(){if(this.label)this.label=this.label.destroy();clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(t,n,r,i){var s=this,o=s.now,u=s.options.animation!==!1&&!s.isHidden&&($(t-o.x)>1||$(n-o.y)>1),a=s.followPointer||s.len>1;e(o,{x:u?(2*o.x+t)/3:t,y:u?(o.y+n)/2:n,anchorX:a?F:u?(2*o.anchorX+r)/3:r,anchorY:a?F:u?(o.anchorY+i)/2:i});s.label.attr(o);if(u)clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){s&&s.move(t,n,r,i)},32)},hide:function(e){var t=this,n;clearTimeout(this.hideTimer);if(!this.isHidden)n=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){t.label.fadeOut();t.isHidden=!0},p(e,this.options.hideDelay,500)),n&&Jt(n,function(e){e.setState()}),this.chart.hoverPoints=null},getAnchor:function(e,t){var n,r=this.chart,i=r.inverted,s=r.plotTop,o=0,u=0,a,e=h(e);n=e[0].tooltipPos;this.followPointer&&t&&(t.chartX===F&&(t=r.pointer.normalize(t)),n=[t.chartX-r.plotLeft,t.chartY-s]);n||(Jt(e,function(e){a=e.series.yAxis;o+=e.plotX;u+=(e.plotLow?(e.plotLow+e.plotHigh)/2:e.plotY)+(!i&&a?a.top-s:0)}),o/=e.length,u/=e.length,n=[i?r.plotWidth-u:o,this.shared&&!i&&e.length>1&&t?t.chartY-s:i?r.plotHeight-o:u]);return Gt(n,U)},getPosition:function(e,t,n){var r=this.chart,i=this.distance,s={},o,u=["y",r.chartHeight,t,n.plotY+r.plotTop],a=["x",r.chartWidth,e,n.plotX+r.plotLeft],f=n.ttBelow||r.inverted&&!n.negative||!r.inverted&&n.negative,l=function(e,t,n,r){var o=n<r-i,t=r+i+n<t,n=r-i-n;r+=i;if(f&&t)s[e]=r;else if(!f&&o)s[e]=n;else if(o)s[e]=n;else if(t)s[e]=r;else return!1},c=function(e,t,n,r){if(r<i||r>t-i)return!1;else s[e]=r<n/2?1:r>t-n/2?t-n-2:r-n/2},h=function(e){var t=u;u=a;a=t;o=e},p=function(){l.apply(0,u)!==!1?c.apply(0,a)===!1&&!o&&(h(!0),p()):o?s.x=s.y=0:(h(!0),p())};(r.inverted||this.len>1)&&h();p();return s},defaultFormatter:function(e){var t=this.points||h(this),n=t[0].series,r;r=[e.tooltipHeaderFormatter(t[0])];Jt(t,function(e){n=e.series;r.push(n.tooltipFormatter&&n.tooltipFormatter(e)||e.point.tooltipFormatter(n.tooltipOptions.pointFormat))});r.push(e.options.footerFormat||"");return r.join("")},refresh:function(e,t){var n=this.chart,r=this.label,i=this.options,s,o,u={},a,f=[];a=i.formatter||this.defaultFormatter;var u=n.hoverPoints,l,c=this.shared;clearTimeout(this.hideTimer);this.followPointer=h(e)[0].series.tooltipOptions.followPointer;o=this.getAnchor(e,t);s=o[0];o=o[1];c&&(!e.series||!e.series.noSharedTooltip)?(n.hoverPoints=e,u&&Jt(u,function(e){e.setState()}),Jt(e,function(e){e.setState("hover");f.push(e.getLabelConfig())}),u={x:e[0].category,y:e[0].y},u.points=f,this.len=f.length,e=e[0]):u=e.getLabelConfig();a=a.call(u,this);u=e.series;this.distance=p(u.tooltipOptions.distance,16);a===!1?this.hide():(this.isHidden&&(rn(r),r.attr("opacity",1).show()),r.attr({text:a}),l=i.borderColor||e.color||u.color||"#606060",r.attr({stroke:l}),this.updatePosition({plotX:s,plotY:o,negative:e.negative,ttBelow:e.ttBelow}),this.isHidden=!1);en(n,"tooltipRefresh",{text:a,x:s+n.plotLeft,y:o+n.plotTop,borderColor:l})},updatePosition:function(e){var t=this.chart,n=this.label,n=(this.options.positioner||this.getPosition).call(this,n.width,n.height,e);this.move(U(n.x),U(n.y),e.plotX+t.plotLeft,e.plotY+t.plotTop)},tooltipHeaderFormatter:function(e){var t=e.series,n=t.tooltipOptions,r=n.dateTimeLabelFormats,i=n.xDateFormat,s=t.xAxis,u=s&&s.options.type==="datetime"&&o(e.key),n=n.headerFormat,s=s&&s.closestPointRange,a;if(u&&!i){if(s)for(a in yt){if(yt[a]>=s||yt[a]<=yt.day&&e.key%yt[a]>0){i=r[a];break}}else i=r.day;i=i||r.year}u&&i&&(n=n.replace("{point.key}","{point.key:"+i+"}"));return w(n,{point:e,series:t})}};var vn;lt=I.documentElement.ontouchstart!==F;var mn=Ut.Pointer=function(e,t){this.init(e,t)};mn.prototype={init:function(e,t){var n=t.chart,r=n.events,i=at?"":n.zoomType,n=e.inverted,s;this.options=t;this.chart=e;this.zoomX=s=/x/.test(i);this.zoomY=i=/y/.test(i);this.zoomHor=s&&!n||i&&n;this.zoomVert=i&&!n||s&&n;this.hasZoom=s||i;this.runChartClick=r&&!!r.click;this.pinchDown=[];this.lastValidTouch={};if(Ut.Tooltip&&t.tooltip.enabled)e.tooltip=new dn(e,t.tooltip),this.followTouchMove=t.tooltip.followTouchMove;this.setDOMEvents()},normalize:function(t,n){var r,i,t=t||window.event,t=tn(t);if(!t.target)t.target=t.srcElement;i=t.touches?t.touches.length?t.touches.item(0):t.changedTouches[0]:t;if(!n)this.chartPosition=n=Qt(this.chart.container);i.pageX===F?(r=X(t.x,t.clientX-n.left),i=t.y):(r=i.pageX-n.left,i=i.pageY-n.top);return e(t,{chartX:U(r),chartY:U(i)})},getCoordinates:function(e){var t={xAxis:[],yAxis:[]};Jt(this.chart.axes,function(n){t[n.isXAxis?"xAxis":"yAxis"].push({axis:n,value:n.toValue(e[n.horiz?"chartX":"chartY"])})});return t},getIndex:function(e){var t=this.chart;return t.inverted?t.plotHeight+t.plotTop-e.chartY:e.chartX-t.plotLeft},runPointActions:function(e){var t=this.chart,n=t.series,r=t.tooltip,i,s,o=t.hoverPoint,u=t.hoverSeries,a,f,l=t.chartWidth,c=this.getIndex(e);if(r&&this.options.tooltip.shared&&(!u||!u.noSharedTooltip)){s=[];a=n.length;for(f=0;f<a;f++)if(n[f].visible&&n[f].options.enableMouseTracking!==!1&&!n[f].noSharedTooltip&&n[f].singularTooltips!==!0&&n[f].tooltipPoints.length&&(i=n[f].tooltipPoints[c])&&i.series)i._dist=$(c-i.clientX),l=V(l,i._dist),s.push(i);for(a=s.length;a--;)s[a]._dist>l&&s.splice(a,1);if(s.length&&s[0].clientX!==this.hoverX)r.refresh(s,e),this.hoverX=s[0].clientX}n=u&&u.tooltipOptions.followPointer;if(u&&u.tracker&&!n){if((i=u.tooltipPoints[c])&&i!==o)i.onMouseOver(e)}else r&&n&&!r.isHidden&&(u=r.getAnchor([{}],e),r.updatePosition({plotX:u[0],plotY:u[1]}));if(r&&!this._onDocumentMouseMove)this._onDocumentMouseMove=function(e){if(Et[vn])Et[vn].pointer.onDocumentMouseMove(e)},Yt(I,"mousemove",this._onDocumentMouseMove);Jt(t.axes,function(t){t.drawCrosshair(e,p(i,o))})},reset:function(e,t){var n=this.chart,r=n.hoverSeries,i=n.hoverPoint,s=n.tooltip,o=s&&s.shared?n.hoverPoints:i;(e=e&&s&&o)&&h(o)[0].plotX===F&&(e=!1);if(e)s.refresh(o),i&&i.setState(i.state,!0);else{if(i)i.onMouseOut();if(r)r.onMouseOut();s&&s.hide(t);if(this._onDocumentMouseMove)Zt(I,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null;Jt(n.axes,function(e){e.hideCrosshair()});this.hoverX=null}},scaleGroups:function(e,t){var n=this.chart,r;Jt(n.series,function(i){r=e||i.getPlotBox();i.xAxis&&i.xAxis.zoomEnabled&&(i.group.attr(r),i.markerGroup&&(i.markerGroup.attr(r),i.markerGroup.clip(t?n.clipRect:null)),i.dataLabelsGroup&&i.dataLabelsGroup.attr(r))});n.clipRect.attr(t||n.clipBox)},dragStart:function(e){var t=this.chart;t.mouseIsDown=e.type;t.cancelClick=!1;t.mouseDownX=this.mouseDownX=e.chartX;t.mouseDownY=this.mouseDownY=e.chartY},drag:function(e){var t=this.chart,n=t.options.chart,r=e.chartX,i=e.chartY,s=this.zoomHor,o=this.zoomVert,u=t.plotLeft,a=t.plotTop,f=t.plotWidth,l=t.plotHeight,c,h=this.mouseDownX,p=this.mouseDownY,d=n.panKey&&e[n.panKey+"Key"];r<u?r=u:r>u+f&&(r=u+f);i<a?i=a:i>a+l&&(i=a+l);this.hasDragged=Math.sqrt(Math.pow(h-r,2)+Math.pow(p-i,2));if(this.hasDragged>10){c=t.isInsidePlot(h-u,p-a);if(t.hasCartesianSeries&&(this.zoomX||this.zoomY)&&c&&!d&&!this.selectionMarker)this.selectionMarker=t.renderer.rect(u,a,s?1:f,o?1:l,0).attr({fill:n.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add();this.selectionMarker&&s&&(r-=h,this.selectionMarker.attr({width:$(r),x:(r>0?0:r)+h}));this.selectionMarker&&o&&(r=i-p,this.selectionMarker.attr({height:$(r),y:(r>0?0:r)+p}));c&&!this.selectionMarker&&n.panning&&t.pan(e,n.panning)}},drop:function(t){var n=this.chart,r=this.hasPinched;if(this.selectionMarker){var i={xAxis:[],yAxis:[],originalEvent:t.originalEvent||t},s=this.selectionMarker,o=s.attr?s.attr("x"):s.x,u=s.attr?s.attr("y"):s.y,a=s.attr?s.attr("width"):s.width,f=s.attr?s.attr("height"):s.height,l;if(this.hasDragged||r)Jt(n.axes,function(e){if(e.zoomEnabled){var n=e.horiz,r=t.type==="touchend"?e.minPixelPadding:0,s=e.toValue((n?o:u)+r),n=e.toValue((n?o+a:u+f)-r);!isNaN(s)&&!isNaN(n)&&(i[e.coll].push({axis:e,min:V(s,n),max:X(s,n)}),l=!0)}}),l&&en(n,"selection",i,function(t){n.zoom(e(t,r?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();r&&this.scaleGroups()}if(n)d(n.container,{cursor:n._cursor}),n.cancelClick=this.hasDragged>10,n.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[]},onContainerMouseDown:function(e){e=this.normalize(e);e.preventDefault&&e.preventDefault();this.dragStart(e)},onDocumentMouseUp:function(e){Et[vn]&&Et[vn].pointer.drop(e)},onDocumentMouseMove:function(e){var t=this.chart,n=this.chartPosition,r=t.hoverSeries,e=this.normalize(e,n);n&&r&&!this.inClass(e.target,"highcharts-tracker")&&!t.isInsidePlot(e.chartX-t.plotLeft,e.chartY-t.plotTop)&&this.reset()},onContainerMouseLeave:function(){var e=Et[vn];if(e)e.pointer.reset(),e.pointer.chartPosition=null},onContainerMouseMove:function(e){var t=this.chart;vn=t.index;e=this.normalize(e);e.returnValue=!1;t.mouseIsDown==="mousedown"&&this.drag(e);(this.inClass(e.target,"highcharts-tracker")||t.isInsidePlot(e.chartX-t.plotLeft,e.chartY-t.plotTop))&&!t.openMenu&&this.runPointActions(e)},inClass:function(e,t){for(var n;e;){if(n=c(e,"class"))if(n.indexOf(t)!==-1)return!0;else if(n.indexOf("highcharts-container")!==-1)return!1;e=e.parentNode}},onTrackerMouseOut:function(e){var t=this.chart.hoverSeries,n=(e=e.relatedTarget||e.toElement)&&e.point&&e.point.series;if(t&&!t.options.stickyTracking&&!this.inClass(e,"highcharts-tooltip")&&n!==t)t.onMouseOut()},onContainerClick:function(t){var n=this.chart,r=n.hoverPoint,i=n.plotLeft,s=n.plotTop,t=this.normalize(t);t.cancelBubble=!0;n.cancelClick||(r&&this.inClass(t.target,"highcharts-tracker")?(en(r.series,"click",e(t,{point:r})),n.hoverPoint&&r.firePointEvent("click",t)):(e(t,this.getCoordinates(t)),n.isInsidePlot(t.chartX-i,t.chartY-s)&&en(n,"click",t)))},setDOMEvents:function(){var e=this,t=e.chart.container;t.onmousedown=function(t){e.onContainerMouseDown(t)};t.onmousemove=function(t){e.onContainerMouseMove(t)};t.onclick=function(t){e.onContainerClick(t)};Yt(t,"mouseleave",e.onContainerMouseLeave);St===1&&Yt(I,"mouseup",e.onDocumentMouseUp);if(lt)t.ontouchstart=function(t){e.onContainerTouchStart(t)},t.ontouchmove=function(t){e.onContainerTouchMove(t)},St===1&&Yt(I,"touchend",e.onDocumentTouchEnd)},destroy:function(){var e;Zt(this.chart.container,"mouseleave",this.onContainerMouseLeave);St||(Zt(I,"mouseup",this.onDocumentMouseUp),Zt(I,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(e in this)this[e]=null}};e(Ut.Pointer.prototype,{pinchTranslate:function(e,t,n,r,i,s){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,e,t,n,r,i,s);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,e,t,n,r,i,s)},pinchTranslateDirection:function(e,t,n,r,i,s,o,u){var a=this.chart,f=e?"x":"y",l=e?"X":"Y",c="chart"+l,h=e?"width":"height",p=a["plot"+(e?"Left":"Top")],d,v,m=u||1,g=a.inverted,y=a.bounds[e?"h":"v"],b=t.length===1,w=t[0][c],E=n[0][c],S=!b&&t[1][c],x=!b&&n[1][c],T,n=function(){!b&&$(w-S)>20&&(m=u||$(E-x)/$(w-S));v=(p-E)/m+w;d=a["plot"+(e?"Width":"Height")]/m};n();t=v;t<y.min?(t=y.min,T=!0):t+d>y.max&&(t=y.max-d,T=!0);T?(E-=.8*(E-o[f][0]),b||(x-=.8*(x-o[f][1])),n()):o[f]=[E,x];g||(s[f]=v-p,s[h]=d);s=g?1/m:m;i[h]=d;i[f]=t;r[g?e?"scaleY":"scaleX":"scale"+l]=m;r["translate"+l]=s*p+(E-s*w)},pinch:function(t){var n=this,r=n.chart,i=n.pinchDown,s=n.followTouchMove,o=t.touches,u=o.length,a=n.lastValidTouch,f=n.hasZoom,l=n.selectionMarker,c={},h=u===1&&(n.inClass(t.target,"highcharts-tracker")&&r.runTrackerClick||n.runChartClick),d={};(f||s)&&!h&&t.preventDefault();Gt(o,function(e){return n.normalize(e)});if(t.type==="touchstart")Jt(o,function(e,t){i[t]={chartX:e.chartX,chartY:e.chartY}}),a.x=[i[0].chartX,i[1]&&i[1].chartX],a.y=[i[0].chartY,i[1]&&i[1].chartY],Jt(r.axes,function(e){if(e.zoomEnabled){var t=r.bounds[e.horiz?"h":"v"],n=e.minPixelPadding,i=e.toPixels(p(e.options.min,e.dataMin)),s=e.toPixels(p(e.options.max,e.dataMax)),o=V(i,s),i=X(i,s);t.min=V(e.pos,o-n);t.max=X(e.pos+e.len,i+n)}}),n.res=!0;else if(i.length){if(!l)n.selectionMarker=l=e({destroy:wt},r.plotBox);n.pinchTranslate(i,o,c,l,d,a);n.hasPinched=f;n.scaleGroups(c,d);if(!f&&s&&u===1)this.runPointActions(n.normalize(t));else if(n.res)n.res=!1,this.reset(!1,0)}},onContainerTouchStart:function(e){var t=this.chart;vn=t.index;e.touches.length===1?(e=this.normalize(e),t.isInsidePlot(e.chartX-t.plotLeft,e.chartY-t.plotTop)?(this.runPointActions(e),this.pinch(e)):this.reset()):e.touches.length===2&&this.pinch(e)},onContainerTouchMove:function(e){(e.touches.length===1||e.touches.length===2)&&this.pinch(e)},onDocumentTouchEnd:function(e){Et[vn]&&Et[vn].pointer.drop(e)}});if(q.PointerEvent||q.MSPointerEvent){var gn={},yn=!!q.PointerEvent,bn=function(){var e,t=[];t.item=function(e){return this[e]};for(e in gn)gn.hasOwnProperty(e)&&t.push({pageX:gn[e].pageX,pageY:gn[e].pageY,target:gn[e].target});return t},wn=function(e,t,n,r){e=e.originalEvent||e;if((e.pointerType==="touch"||e.pointerType===e.MSPOINTER_TYPE_TOUCH)&&Et[vn])r(e),r=Et[vn].pointer,r[t]({type:n,target:e.currentTarget,preventDefault:wt,touches:bn()})};e(mn.prototype,{onContainerPointerDown:function(e){wn(e,"onContainerTouchStart","touchstart",function(e){gn[e.pointerId]={pageX:e.pageX,pageY:e.pageY,target:e.currentTarget}})},onContainerPointerMove:function(e){wn(e,"onContainerTouchMove","touchmove",function(e){gn[e.pointerId]={pageX:e.pageX,pageY:e.pageY};if(!gn[e.pointerId].target)gn[e.pointerId].target=e.currentTarget})},onDocumentPointerUp:function(e){wn(e,"onContainerTouchEnd","touchend",function(e){delete gn[e.pointerId]})},batchMSEvents:function(e){e(this.chart.container,yn?"pointerdown":"MSPointerDown",this.onContainerPointerDown);e(this.chart.container,yn?"pointermove":"MSPointerMove",this.onContainerPointerMove);e(I,yn?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});b(mn.prototype,"init",function(e,t,n){e.call(this,t,n);(this.hasZoom||this.followTouchMove)&&d(t.container,{"-ms-touch-action":Tt,"touch-action":Tt})});b(mn.prototype,"setDOMEvents",function(e){e.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(Yt)});b(mn.prototype,"destroy",function(e){this.batchMSEvents(Zt);e.call(this)})}var En=Ut.Legend=function(e,t){this.init(e,t)};En.prototype={init:function(e,n){var r=this,i=n.itemStyle,s=p(n.padding,8),o=n.itemMarginTop||0;this.options=n;if(n.enabled)r.itemStyle=i,r.itemHiddenStyle=t(i,n.itemHiddenStyle),r.itemMarginTop=o,r.padding=s,r.initialItemX=s,r.initialItemY=s-5,r.maxItemWidth=0,r.chart=e,r.itemHeight=0,r.lastLineHeight=0,r.symbolWidth=p(n.symbolWidth,16),r.pages=[],r.render(),Yt(r.chart,"endResize",function(){r.positionCheckboxes()})},colorizeItem:function(e,t){var n=this.options,r=e.legendItem,i=e.legendLine,s=e.legendSymbol,o=this.itemHiddenStyle.color,n=t?n.itemStyle.color:o,u=t?e.legendColor||e.color||"#CCC":o,o=e.options&&e.options.marker,a={fill:u},f;r&&r.css({fill:n,color:n});i&&i.attr({stroke:u});if(s){if(o&&s.isMarker)for(f in a.stroke=u,o=e.convertAttribs(o),o)r=o[f],r!==F&&(a[f]=r);s.attr(a)}},positionItem:function(e){var t=this.options,n=t.symbolPadding,t=!t.rtl,r=e._legendItemPos,i=r[0],r=r[1],s=e.checkbox;e.legendGroup&&e.legendGroup.translate(t?i:this.legendWidth-i-2*n-4,r);if(s)s.x=i,s.y=r},destroyItem:function(e){var t=e.checkbox;Jt(["legendItem","legendLine","legendSymbol","legendGroup"],function(t){e[t]&&(e[t]=e[t].destroy())});t&&k(e.checkbox)},destroy:function(){var e=this.group,t=this.box;if(t)this.box=t.destroy();if(e)this.group=e.destroy()},positionCheckboxes:function(e){var t=this.group.alignAttr,n,r=this.clipHeight||this.legendHeight;if(t)n=t.translateY,Jt(this.allItems,function(i){var s=i.checkbox,o;s&&(o=n+s.y+(e||0)+3,d(s,{left:t.translateX+i.checkboxOffset+s.x-20+"px",top:o+"px",display:o>n-6&&o<n+r-6?"":Tt}))})},renderTitle:function(){var e=this.padding,t=this.options.title,n=0;if(t.text){if(!this.title)this.title=this.chart.renderer.label(t.text,e-3,e-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(t.style).add(this.group);e=this.title.getBBox();n=e.height;this.offsetWidth=e.width;this.contentGroup.attr({translateY:n})}this.titleHeight=n},renderItem:function(e){var n=this.chart,r=n.renderer,i=this.options,s=i.layout==="horizontal",o=this.symbolWidth,u=i.symbolPadding,a=this.itemStyle,f=this.itemHiddenStyle,l=this.padding,c=s?p(i.itemDistance,20):0,h=!i.rtl,d=i.width,v=i.itemMarginBottom||0,m=this.itemMarginTop,g=this.initialItemX,y=e.legendItem,b=e.series&&e.series.drawLegendSymbol?e.series:e,E=b.options,E=this.createCheckboxForItem&&E&&E.showCheckbox,S=i.useHTML;if(!y){e.legendGroup=r.g("legend-item").attr({zIndex:1}).add(this.scrollGroup);e.legendItem=y=r.text(i.labelFormat?w(i.labelFormat,e):i.labelFormatter.call(e),h?o+u:-u,this.baseline||0,S).css(t(e.visible?a:f)).attr({align:h?"left":"right",zIndex:2}).add(e.legendGroup);if(!this.baseline)this.baseline=r.fontMetrics(a.fontSize,y).f+3+m,y.attr("y",this.baseline);b.drawLegendSymbol(this,e);this.setItemEvents&&this.setItemEvents(e,y,S,a,f);this.colorizeItem(e,e.visible);E&&this.createCheckboxForItem(e)}r=y.getBBox();o=e.checkboxOffset=i.itemWidth||e.legendItemWidth||o+u+r.width+c+(E?20:0);this.itemHeight=u=U(e.legendItemHeight||r.height);if(s&&this.itemX-g+o>(d||n.chartWidth-2*l-g-i.x))this.itemX=g,this.itemY+=m+this.lastLineHeight+v,this.lastLineHeight=0;this.maxItemWidth=X(this.maxItemWidth,o);this.lastItemY=m+this.itemY+v;this.lastLineHeight=X(u,this.lastLineHeight);e._legendItemPos=[this.itemX,this.itemY];s?this.itemX+=o:(this.itemY+=m+u+v,this.lastLineHeight=u);this.offsetWidth=d||X((s?this.itemX-g-c:o)+l,this.offsetWidth)},getAllItems:function(){var e=[];Jt(this.chart.series,function(t){var n=t.options;if(p(n.showInLegend,!l(n.linkedTo)?F:!1,!0))e=e.concat(t.legendItems||(n.legendType==="point"?t.data:t))});return e},render:function(){var t=this,n=t.chart,r=n.renderer,i=t.group,s,o,u,a,f=t.box,l=t.options,c=t.padding,h=l.borderWidth,p=l.backgroundColor;t.itemX=t.initialItemX;t.itemY=t.initialItemY;t.offsetWidth=0;t.lastItemY=0;if(!i)t.group=i=r.g("legend").attr({zIndex:7}).add(),t.contentGroup=r.g().attr({zIndex:1}).add(i),t.scrollGroup=r.g().add(t.contentGroup);t.renderTitle();s=t.getAllItems();x(s,function(e,t){return(e.options&&e.options.legendIndex||0)-(t.options&&t.options.legendIndex||0)});l.reversed&&s.reverse();t.allItems=s;t.display=o=!!s.length;Jt(s,function(e){t.renderItem(e)});u=l.width||t.offsetWidth;a=t.lastItemY+t.lastLineHeight+t.titleHeight;a=t.handleOverflow(a);if(h||p){u+=c;a+=c;if(f){if(u>0&&a>0)f[f.isNew?"attr":"animate"](f.crisp({width:u,height:a})),f.isNew=!1}else t.box=f=r.rect(0,0,u,a,l.borderRadius,h||0).attr({stroke:l.borderColor,"stroke-width":h||0,fill:p||Tt}).add(i).shadow(l.shadow),f.isNew=!0;f[o?"show":"hide"]()}t.legendWidth=u;t.legendHeight=a;Jt(s,function(e){t.positionItem(e)});o&&i.align(e({width:u,height:a},l),!0,"spacingBox");n.isResizing||this.positionCheckboxes()},handleOverflow:function(e){var t=this,n=this.chart,r=n.renderer,i=this.options,s=i.y,s=n.spacingBox.height+(i.verticalAlign==="top"?-s:s)-this.padding,o=i.maxHeight,u,a=this.clipRect,f=i.navigation,l=p(f.animation,!0),c=f.arrowSize||12,h=this.nav,d=this.pages,v,m=this.allItems;i.layout==="horizontal"&&(s/=2);o&&(s=V(s,o));d.length=0;if(e>s&&!i.useHTML){this.clipHeight=u=X(s-20-this.titleHeight-this.padding,0);this.currentPage=p(this.currentPage,1);this.fullHeight=e;Jt(m,function(e,t){var n=e._legendItemPos[1],r=U(e.legendItem.getBBox().height),i=d.length;if(!i||n-d[i-1]>u&&(v||n)!==d[i-1])d.push(v||n),i++;t===m.length-1&&n+r-d[i-1]>u&&d.push(n);n!==v&&(v=n)});if(!a)a=t.clipRect=r.clipRect(0,this.padding,9999,0),t.contentGroup.clip(a);a.attr({height:u});if(!h)this.nav=h=r.g().attr({zIndex:1}).add(this.group),this.up=r.symbol("triangle",0,0,c,c).on("click",function(){t.scroll(-1,l)}).add(h),this.pager=r.text("",15,10).css(f.style).add(h),this.down=r.symbol("triangle-down",0,0,c,c).on("click",function(){t.scroll(1,l)}).add(h);t.scroll(0);e=s}else if(h)a.attr({height:n.chartHeight}),h.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0;return e},scroll:function(e,t){var n=this.pages,r=n.length,i=this.currentPage+e,s=this.clipHeight,o=this.options.navigation,u=o.activeColor,o=o.inactiveColor,a=this.pager,f=this.padding;i>r&&(i=r);if(i>0)t!==F&&A(t,this.chart),this.nav.attr({translateX:f,translateY:s+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:i===1?o:u}).css({cursor:i===1?"default":"pointer"}),a.attr({text:i+"/"+r}),this.down.attr({x:18+this.pager.getBBox().width,fill:i===r?o:u}).css({cursor:i===r?"default":"pointer"}),n=-n[i-1]+this.initialItemY,this.scrollGroup.animate({translateY:n}),this.currentPage=i,this.positionCheckboxes(n)}};Wt=Ut.LegendSymbolMixin={drawRectangle:function(e,t){var n=e.options.symbolHeight||12;t.legendSymbol=this.chart.renderer.rect(0,e.baseline-5-n/2,e.symbolWidth,n,e.options.symbolRadius||0).attr({zIndex:3}).add(t.legendGroup)},drawLineMarker:function(e){var t=this.options,n=t.marker,r;r=e.symbolWidth;var i=this.chart.renderer,s=this.legendGroup,e=e.baseline-U(i.fontMetrics(e.options.itemStyle.fontSize,this.legendItem).b*.3),o;if(t.lineWidth){o={"stroke-width":t.lineWidth};if(t.dashStyle)o.dashstyle=t.dashStyle;this.legendLine=i.path(["M",0,e,"L",r,e]).attr(o).add(s)}if(n&&n.enabled!==!1)t=n.radius,this.legendSymbol=r=i.symbol(this.symbol,r/2-t,e-t,2*t,2*t).add(s),r.isMarker=!0}};(/Trident\/7\.0/.test(Y)||rt)&&b(En.prototype,"positionItem",function(e,t){var n=this,r=function(){t._legendItemPos&&e.call(n,t)};r();setTimeout(r)});P.prototype={init:function(e,n){var r,i=e.series;e.series=null;r=t(dt,e);r.series=e.series=i;this.userOptions=e;i=r.chart;this.margin=this.splashArray("margin",i);this.spacing=this.splashArray("spacing",i);var s=i.events;this.bounds={h:{},v:{}};this.callback=n;this.isResizing=0;this.options=r;this.axes=[];this.series=[];this.hasCartesianSeries=i.showAxes;var o=this,u;o.index=Et.length;Et.push(o);St++;i.reflow!==!1&&Yt(o,"load",function(){o.initReflow()});if(s)for(u in s)Yt(o,u,s[u]);o.xAxis=[];o.yAxis=[];o.animation=at?!1:p(i.animation,!0);o.pointCount=o.colorCounter=o.symbolCounter=0;o.firstRender()},initSeries:function(e){var t=this.options.chart;(t=Rt[e.type||t.type||t.defaultSeriesType])||bt(17,!0);t=new t;t.init(this,e);return t},isInsidePlot:function(e,t,n){var r=n?t:e,e=n?e:t;return r>=0&&r<=this.plotWidth&&e>=0&&e<=this.plotHeight},adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&Jt(this.axes,function(e){e.adjustTickAmount()});this.maxTicks=null},redraw:function(t){var n=this.axes,r=this.series,i=this.pointer,s=this.legend,o=this.isDirtyLegend,u,a,f=this.hasCartesianSeries,l=this.isDirtyBox,c=r.length,h=c,p=this.renderer,d=p.isHidden(),v=[];A(t,this);d&&this.cloneRenderTo();for(this.layOutTitles();h--;)if(t=r[h],t.options.stacking&&(u=!0,t.isDirty)){a=!0;break}if(a)for(h=c;h--;)if(t=r[h],t.options.stacking)t.isDirty=!0;Jt(r,function(e){e.isDirty&&e.options.legendType==="point"&&(o=!0)});if(o&&s.options.enabled)s.render(),this.isDirtyLegend=!1;u&&this.getStacks();if(f){if(!this.isResizing)this.maxTicks=null,Jt(n,function(e){e.setScale()});this.adjustTickAmounts()}this.getMargins();f&&(Jt(n,function(e){e.isDirty&&(l=!0)}),Jt(n,function(t){if(t.isDirtyExtremes)t.isDirtyExtremes=!1,v.push(function(){en(t,"afterSetExtremes",e(t.eventArgs,t.getExtremes()));delete t.eventArgs});(l||u)&&t.redraw()}));l&&this.drawChartBox();Jt(r,function(e){e.isDirty&&e.visible&&(!e.isCartesian||e.xAxis)&&e.redraw()});i&&i.reset(!0);p.draw();en(this,"redraw");d&&this.cloneRenderTo(!0);Jt(v,function(e){e.call()})},get:function(e){var t=this.axes,n=this.series,r,i;for(r=0;r<t.length;r++)if(t[r].options.id===e)return t[r];for(r=0;r<n.length;r++)if(n[r].options.id===e)return n[r];for(r=0;r<n.length;r++){i=n[r].points||[];for(t=0;t<i.length;t++)if(i[t].id===e)return i[t]}return null},getAxes:function(){var e=this,t=this.options,n=t.xAxis=h(t.xAxis||{}),t=t.yAxis=h(t.yAxis||{});Jt(n,function(e,t){e.index=t;e.isX=!0});Jt(t,function(e,t){e.index=t});n=n.concat(t);Jt(n,function(t){new D(e,t)});e.adjustTickAmounts()},getSelectedPoints:function(){var e=[];Jt(this.series,function(t){e=e.concat(Kt(t.points||[],function(e){return e.selected}))});return e},getSelectedSeries:function(){return Kt(this.series,function(e){return e.selected})},getStacks:function(){var e=this;Jt(e.yAxis,function(e){if(e.stacks&&e.hasVisibleSeries)e.oldStacks=e.stacks});Jt(e.series,function(t){if(t.options.stacking&&(t.visible===!0||e.options.chart.ignoreHiddenSeries===!1))t.stackKey=t.type+p(t.options.stack,"")})},setTitle:function(e,n,r){var i;var s=this,o=s.options,u;u=o.title=t(o.title,e);i=o.subtitle=t(o.subtitle,n),o=i;Jt([["title",e,u],["subtitle",n,o]],function(e){var t=e[0],n=s[t],r=e[1],e=e[2];n&&r&&(s[t]=n=n.destroy());e&&e.text&&!n&&(s[t]=s.renderer.text(e.text,0,0,e.useHTML).attr({align:e.align,"class":"highcharts-"+t,zIndex:e.zIndex||4}).css(e.style).add())});s.layOutTitles(r)},layOutTitles:function(t){var n=0,r=this.title,i=this.subtitle,s=this.options,o=s.title,s=s.subtitle,u=this.renderer,a=this.spacingBox.width-44;if(r&&(r.css({width:(o.width||a)+"px"}).align(e({y:u.fontMetrics(o.style.fontSize,r).b-3},o),!1,"spacingBox"),!o.floating&&!o.verticalAlign))n=r.getBBox().height;i&&(i.css({width:(s.width||a)+"px"}).align(e({y:n+(o.margin-13)+u.fontMetrics(o.style.fontSize,i).b},s),!1,"spacingBox"),!s.floating&&!s.verticalAlign&&(n=W(n+i.getBBox().height)));r=this.titleOffset!==n;this.titleOffset=n;if(!this.isDirtyBox&&r)this.isDirtyBox=r,this.hasRendered&&p(t,!0)&&this.isDirtyBox&&this.redraw()},getChartSize:function(){var e=this.options.chart,t=e.width,e=e.height,n=this.renderToClone||this.renderTo;if(!l(t))this.containerWidth=Xt(n,"width");if(!l(e))this.containerHeight=Xt(n,"height");this.chartWidth=X(0,t||this.containerWidth||600);this.chartHeight=X(0,p(e,this.containerHeight>19?this.containerHeight:400))},cloneRenderTo:function(e){var t=this.renderToClone,n=this.container;e?t&&(this.renderTo.appendChild(n),k(t),delete this.renderToClone):(n&&n.parentNode===this.renderTo&&this.renderTo.removeChild(n),this.renderToClone=t=this.renderTo.cloneNode(0),d(t,{position:"absolute",top:"-9999px",display:"block"}),t.style.setProperty&&t.style.setProperty("display","block","important"),I.body.appendChild(t),n&&t.appendChild(n))},getContainer:function(){var t,i=this.options.chart,s,o,u;this.renderTo=t=i.renderTo;u="highcharts-"+ht++;if(r(t))this.renderTo=t=I.getElementById(t);t||bt(13,!0);s=n(c(t,"data-highcharts-chart"));!isNaN(s)&&Et[s]&&Et[s].hasRendered&&Et[s].destroy();c(t,"data-highcharts-chart",this.index);t.innerHTML="";!i.skipClone&&!t.offsetWidth&&this.cloneRenderTo();this.getChartSize();s=this.chartWidth;o=this.chartHeight;this.container=t=v(xt,{className:"highcharts-container"+(i.className?" "+i.className:""),id:u},e({position:"relative",overflow:"hidden",width:s+"px",height:o+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},i.style),this.renderToClone||t);this._cursor=t.style.cursor;this.renderer=i.forExport?new ln(t,s,o,i.style,!0):new ft(t,s,o,i.style);at&&this.renderer.create(this,t,s,o)},getMargins:function(){var e=this.spacing,t,n=this.legend,r=this.margin,i=this.options.legend,s=p(i.margin,20),o=i.x,u=i.y,a=i.align,f=i.verticalAlign,c=this.titleOffset;this.resetMargins();t=this.axisOffset;if(c&&!l(r[0]))this.plotTop=X(this.plotTop,c+this.options.title.margin+e[0]);if(n.display&&!i.floating)if(a==="right"){if(!l(r[1]))this.marginRight=X(this.marginRight,n.legendWidth-o+s+e[1])}else if(a==="left"){if(!l(r[3]))this.plotLeft=X(this.plotLeft,n.legendWidth+o+s+e[3])}else if(f==="top"){if(!l(r[0]))this.plotTop=X(this.plotTop,n.legendHeight+u+s+e[0])}else if(f==="bottom"&&!l(r[2]))this.marginBottom=X(this.marginBottom,n.legendHeight-u+s+e[2]);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);this.hasCartesianSeries&&Jt(this.axes,function(e){e.getOffset()});l(r[3])||(this.plotLeft+=t[3]);l(r[0])||(this.plotTop+=t[0]);l(r[2])||(this.marginBottom+=t[2]);l(r[1])||(this.marginRight+=t[1]);this.setChartSize()},reflow:function(e){var t=this,n=t.options.chart,r=t.renderTo,i=n.width||Xt(r,"width"),s=n.height||Xt(r,"height"),n=e?e.target:q,r=function(){if(t.container)t.setSize(i,s,!1),t.hasUserSize=null};if(!t.hasUserSize&&i&&s&&(n===q||n===I)){if(i!==t.containerWidth||s!==t.containerHeight)clearTimeout(t.reflowTimeout),e?t.reflowTimeout=setTimeout(r,100):r();t.containerWidth=i;t.containerHeight=s}},initReflow:function(){var e=this,t=function(t){e.reflow(t)};Yt(q,"resize",t);Yt(e,"destroy",function(){Zt(q,"resize",t)})},setSize:function(e,t,n){var r=this,i,s,o;r.isResizing+=1;o=function(){r&&en(r,"endResize",null,function(){r.isResizing-=1})};A(n,r);r.oldChartHeight=r.chartHeight;r.oldChartWidth=r.chartWidth;if(l(e))r.chartWidth=i=X(0,U(e)),r.hasUserSize=!!i;if(l(t))r.chartHeight=s=X(0,U(t));(mt?nn:d)(r.container,{width:i+"px",height:s+"px"},mt);r.setChartSize(!0);r.renderer.setSize(i,s,n);r.maxTicks=null;Jt(r.axes,function(e){e.isDirty=!0;e.setScale()});Jt(r.series,function(e){e.isDirty=!0});r.isDirtyLegend=!0;r.isDirtyBox=!0;r.layOutTitles();r.getMargins();r.redraw(n);r.oldChartHeight=null;en(r,"resize");mt===!1?o():setTimeout(o,mt&&mt.duration||500)},setChartSize:function(e){var t=this.inverted,n=this.renderer,r=this.chartWidth,i=this.chartHeight,s=this.options.chart,o=this.spacing,u=this.clipOffset,a,f,l,c;this.plotLeft=a=U(this.plotLeft);this.plotTop=f=U(this.plotTop);this.plotWidth=l=X(0,U(r-a-this.marginRight));this.plotHeight=c=X(0,U(i-f-this.marginBottom));this.plotSizeX=t?c:l;this.plotSizeY=t?l:c;this.plotBorderWidth=s.plotBorderWidth||0;this.spacingBox=n.spacingBox={x:o[3],y:o[0],width:r-o[3]-o[1],height:i-o[0]-o[2]};this.plotBox=n.plotBox={x:a,y:f,width:l,height:c};r=2*z(this.plotBorderWidth/2);t=W(X(r,u[3])/2);n=W(X(r,u[0])/2);this.clipBox={x:t,y:n,width:z(this.plotSizeX-X(r,u[1])/2-t),height:X(0,z(this.plotSizeY-X(r,u[2])/2-n))};e||Jt(this.axes,function(e){e.setAxisSize();e.setAxisTranslation()})},resetMargins:function(){var e=this.spacing,t=this.margin;this.plotTop=p(t[0],e[0]);this.marginRight=p(t[1],e[1]);this.marginBottom=p(t[2],e[2]);this.plotLeft=p(t[3],e[3]);this.axisOffset=[0,0,0,0];this.clipOffset=[0,0,0,0]},drawChartBox:function(){var e=this.options.chart,t=this.renderer,n=this.chartWidth,r=this.chartHeight,i=this.chartBackground,s=this.plotBackground,o=this.plotBorder,u=this.plotBGImage,a=e.borderWidth||0,f=e.backgroundColor,l=e.plotBackgroundColor,c=e.plotBackgroundImage,h=e.plotBorderWidth||0,p,d=this.plotLeft,v=this.plotTop,m=this.plotWidth,g=this.plotHeight,y=this.plotBox,b=this.clipRect,w=this.clipBox;p=a+(e.shadow?8:0);if(a||f)if(i)i.animate(i.crisp({width:n-p,height:r-p}));else{i={fill:f||Tt};if(a)i.stroke=e.borderColor,i["stroke-width"]=a;this.chartBackground=t.rect(p/2,p/2,n-p,r-p,e.borderRadius,a).attr(i).addClass("highcharts-background").add().shadow(e.shadow)}if(l)s?s.animate(y):this.plotBackground=t.rect(d,v,m,g,0).attr({fill:l}).add().shadow(e.plotShadow);if(c)u?u.animate(y):this.plotBGImage=t.image(c,d,v,m,g).add();b?b.animate({width:w.width,height:w.height}):this.clipRect=t.clipRect(w);if(h)o?o.animate(o.crisp({x:d,y:v,width:m,height:g,strokeWidth:-h})):this.plotBorder=t.rect(d,v,m,g,0,-h).attr({stroke:e.plotBorderColor,"stroke-width":h,fill:Tt,zIndex:1}).add();this.isDirtyBox=!1},propFromSeries:function(){var e=this,t=e.options.chart,n,r=e.options.series,i,s;Jt(["inverted","angular","polar"],function(o){n=Rt[t.type||t.defaultSeriesType];s=e[o]||t[o]||n&&n.prototype[o];for(i=r&&r.length;!s&&i--;)(n=Rt[r[i].type])&&n.prototype[o]&&(s=!0);e[o]=s})},linkSeries:function(){var e=this,t=e.series;Jt(t,function(e){e.linkedSeries.length=0});Jt(t,function(t){var n=t.options.linkedTo;if(r(n)&&(n=n===":previous"?e.series[t.index-1]:e.get(n)))n.linkedSeries.push(t),t.linkedParent=n})},renderSeries:function(){Jt(this.series,function(e){e.translate();e.setTooltipPoints&&e.setTooltipPoints();e.render()})},renderLabels:function(){var t=this,r=t.options.labels;r.items&&Jt(r.items,function(i){var s=e(r.style,i.style),o=n(s.left)+t.plotLeft,u=n(s.top)+t.plotTop+12;delete s.left;delete s.top;t.renderer.text(i.html,o,u).attr({zIndex:2}).css(s).add()})},render:function(){var e=this.axes,t=this.renderer,n=this.options;this.setTitle();this.legend=new En(this,n.legend);this.getStacks();Jt(e,function(e){e.setScale()});this.getMargins();this.maxTicks=null;Jt(e,function(e){e.setTickPositions(!0);e.setMaxTicks()});this.adjustTickAmounts();this.getMargins();this.drawChartBox();this.hasCartesianSeries&&Jt(e,function(e){e.render()});if(!this.seriesGroup)this.seriesGroup=t.g("series-group").attr({zIndex:3}).add();this.renderSeries();this.renderLabels();this.showCredits(n.credits);this.hasRendered=!0},showCredits:function(e){if(e.enabled&&!this.credits)this.credits=this.renderer.text(e.text,0,0).on("click",function(){if(e.href)location.href=e.href}).attr({align:e.position.align,zIndex:8}).css(e.style).add().align(e.position)},destroy:function(){var e=this,t=e.axes,n=e.series,r=e.container,i,s=r&&r.parentNode;en(e,"destroy");Et[e.index]=F;St--;e.renderTo.removeAttribute("data-highcharts-chart");Zt(e);for(i=t.length;i--;)t[i]=t[i].destroy();for(i=n.length;i--;)n[i]=n[i].destroy();Jt("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(t){var n=e[t];n&&n.destroy&&(e[t]=n.destroy())});if(r)r.innerHTML="",Zt(r),s&&k(r);for(i in e)delete e[i]},isReadyToRender:function(){var e=this;return!ot&&q==q.top&&I.readyState!=="complete"||at&&!q.canvg?(at?pn.push(function(){e.firstRender()},e.options.global.canvasToolsURL):I.attachEvent("onreadystatechange",function(){I.detachEvent("onreadystatechange",e.firstRender);I.readyState==="complete"&&e.firstRender()}),!1):!0},firstRender:function(){var e=this,t=e.options,n=e.callback;if(e.isReadyToRender()){e.getContainer();en(e,"init");e.resetMargins();e.setChartSize();e.propFromSeries();e.getAxes();Jt(t.series||[],function(t){e.initSeries(t)});e.linkSeries();en(e,"beforeRender");if(Ut.Pointer)e.pointer=new mn(e,t);e.render();e.renderer.draw();n&&n.apply(e,[e]);Jt(e.callbacks,function(t){t.apply(e,[e])});e.cloneRenderTo(!0);en(e,"load")}},splashArray:function(e,t){var n=t[e],n=i(n)?n:[n,n,n,n];return[p(t[e+"Top"],n[0]),p(t[e+"Right"],n[1]),p(t[e+"Bottom"],n[2]),p(t[e+"Left"],n[3])]}};P.prototype.callbacks=[];hn=Ut.CenteredSeriesMixin={getCenter:function(){var e=this.options,t=this.chart,r=2*(e.slicedOffset||0),i,s=t.plotWidth-2*r,o=t.plotHeight-2*r,t=e.center,e=[p(t[0],"50%"),p(t[1],"50%"),e.size||"100%",e.innerSize||0],u=V(s,o),a;return Gt(e,function(e,t){a=/%$/.test(e);i=t<2||t===2&&a;return(a?[s,o,u,u][t]*n(e)/100:e)+(i?r:0)})}};var Sn=function(){};Sn.prototype={init:function(e,t,n){this.series=e;this.applyOptions(t,n);this.pointAttr={};if(e.options.colorByPoint&&(t=e.options.colors||e.chart.options.colors,this.color=this.color||t[e.colorCounter++],e.colorCounter===t.length))e.colorCounter=0;e.chart.pointCount++;return this},applyOptions:function(t,n){var r=this.series,i=r.options.pointValKey||r.pointValKey,t=Sn.prototype.optionsToObject.call(this,t);e(this,t);this.options=this.options?e(this.options,t):t;if(i)this.y=this[i];if(this.x===F&&r)this.x=n===F?r.autoIncrement():n;return this},optionsToObject:function(e){var t={},n=this.series,r=n.pointArrayMap||["y"],i=r.length,o=0,u=0;if(typeof e==="number"||e===null)t[r[0]]=e;else if(s(e)){if(e.length>i){n=typeof e[0];if(n==="string")t.name=e[0];else if(n==="number")t.x=e[0];o++}for(;u<i;)t[r[u++]]=e[o++]}else if(typeof e==="object"){t=e;if(e.dataLabels)n._hasPointLabels=!0;if(e.marker)n._hasPointMarkers=!0}return t},destroy:function(){var e=this.series.chart,t=e.hoverPoints,n;e.pointCount--;if(t&&(this.setState(),f(t,this),!t.length))e.hoverPoints=null;if(this===e.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)Zt(this),this.destroyElements();this.legendItem&&e.legend.destroyItem(this);for(n in this)this[n]=null},destroyElements:function(){for(var e="graphic,dataLabel,dataLabelUpper,group,connector,shadowGroup".split(","),t,n=6;n--;)t=e[n],this[t]&&(this[t]=this[t].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(e){var t=this.series,n=t.tooltipOptions,r=p(n.valueDecimals,""),i=n.valuePrefix||"",s=n.valueSuffix||"";Jt(t.pointArrayMap||["y"],function(t){t="{point."+t;if(i||s)e=e.replace(t+"}",i+t+"}"+s);e=e.replace(t+"}",t+":,."+r+"f}")});return w(e,{point:this,series:this.series})},firePointEvent:function(e,t,n){var r=this,i=this.series.options;(i.point.events[e]||r.options&&r.options.events&&r.options.events[e])&&this.importEvents();e==="click"&&i.allowPointSelect&&(n=function(e){r.select(null,e.ctrlKey||e.metaKey||e.shiftKey)});en(this,e,t,n)}};var xn=function(){};xn.prototype={isCartesian:!0,type:"line",pointClass:Sn,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(t,n){var r=this,i,s,o=t.series,u=function(e,t){return p(e.options.index,e._i)-p(t.options.index,t._i)};r.chart=t;r.options=n=r.setOptions(n);r.linkedSeries=[];r.bindAxes();e(r,{name:n.name,state:"",pointAttr:{},visible:n.visible!==!1,selected:n.selected===!0});if(at)n.animation=!1;s=n.events;for(i in s)Yt(r,i,s[i]);if(s&&s.click||n.point&&n.point.events&&n.point.events.click||n.allowPointSelect)t.runTrackerClick=!0;r.getColor();r.getSymbol();Jt(r.parallelArrays,function(e){r[e+"Data"]=[]});r.setData(n.data,!1);if(r.isCartesian)t.hasCartesianSeries=!0;o.push(r);r._i=o.length-1;x(o,u);this.yAxis&&x(this.yAxis.series,u);Jt(o,function(e,t){e.index=t;e.name=e.name||"Series "+(t+1)})},bindAxes:function(){var e=this,t=e.options,n=e.chart,r;Jt(e.axisTypes||[],function(i){Jt(n[i],function(n){r=n.options;if(t[i]===r.index||t[i]!==F&&t[i]===r.id||t[i]===F&&r.index===0)n.series.push(e),e[i]=n,n.isDirty=!0});!e[i]&&e.optionalAxis!==i&&bt(18,!0)})},updateParallelArrays:function(e,t){var n=e.series,r=arguments;Jt(n.parallelArrays,typeof t==="number"?function(r){var i=r==="y"&&n.toYData?n.toYData(e):e[r];n[r+"Data"][t]=i}:function(e){Array.prototype[t].apply(n[e+"Data"],Array.prototype.slice.call(r,2))})},autoIncrement:function(){var e=this.options,t=this.xIncrement,t=p(t,e.pointStart,0);this.pointInterval=p(this.pointInterval,e.pointInterval,1);this.xIncrement=t+this.pointInterval;return t},getSegments:function(){var e=-1,t=[],n,r=this.points,i=r.length;if(i)if(this.options.connectNulls){for(n=i;n--;)r[n].y===null&&r.splice(n,1);r.length&&(t=[r])}else Jt(r,function(n,s){n.y===null?(s>e+1&&t.push(r.slice(e+1,s)),e=s):s===i-1&&t.push(r.slice(e+1,s+1))});this.segments=t},setOptions:function(e){var n=this.chart,r=n.options.plotOptions,n=n.userOptions||{},i=n.plotOptions||{},s=r[this.type];this.userOptions=e;r=t(s,r.series,e);this.tooltipOptions=t(dt.tooltip,dt.plotOptions[this.type].tooltip,n.tooltip,i.series&&i.series.tooltip,i[this.type]&&i[this.type].tooltip,e.tooltip);s.marker===null&&delete r.marker;return r},getCyclic:function(e,t,n){var r=this.userOptions,i="_"+e+"Index",s=e+"Counter";t||(l(r[i])?t=r[i]:(r[i]=t=this.chart[s]%n.length,this.chart[s]+=1),t=n[t]);this[e]=t},getColor:function(){this.options.colorByPoint||this.getCyclic("color",this.options.color||sn[this.type].color,this.chart.options.colors)},getSymbol:function(){var e=this.options.marker;this.getCyclic("symbol",e.symbol,this.chart.options.symbols);if(/^url/.test(this.symbol))e.radius=0},drawLegendSymbol:Wt.drawLineMarker,setData:function(e,t,n,i){var u=this,a=u.points,f=a&&a.length||0,l,c=u.options,h=u.chart,d=null,v=u.xAxis,m=v&&!!v.categories,g=u.tooltipPoints,y=c.turboThreshold,b=this.xData,w=this.yData,E=(l=u.pointArrayMap)&&l.length,e=e||[];l=e.length;t=p(t,!0);if(i!==!1&&l&&f===l&&!u.cropped&&!u.hasGroupedData)Jt(e,function(e,t){a[t].update(e,!1,null,!1)});else{u.xIncrement=null;u.pointRange=m?1:c.pointRange;u.colorCounter=0;Jt(this.parallelArrays,function(e){u[e+"Data"].length=0});if(y&&l>y){for(n=0;d===null&&n<l;)d=e[n],n++;if(o(d)){m=p(c.pointStart,0);c=p(c.pointInterval,1);for(n=0;n<l;n++)b[n]=m,w[n]=e[n],m+=c;u.xIncrement=m}else if(s(d))if(E)for(n=0;n<l;n++)c=e[n],b[n]=c[0],w[n]=c.slice(1,E+1);else for(n=0;n<l;n++)c=e[n],b[n]=c[0],w[n]=c[1];else bt(12)}else for(n=0;n<l;n++)if(e[n]!==F&&(c={series:u},u.pointClass.prototype.applyOptions.apply(c,[e[n]]),u.updateParallelArrays(c,n),m&&c.name))v.names[c.x]=c.name;r(w[0])&&bt(14,!0);u.data=[];u.options.data=e;for(n=f;n--;)a[n]&&a[n].destroy&&a[n].destroy();if(g)g.length=0;if(v)v.minRange=v.userMinRange;u.isDirty=u.isDirtyData=h.isDirtyBox=!0;n=!1}t&&h.redraw(n)},processData:function(e){var t=this.xData,n=this.yData,r=t.length,i;i=0;var s,o,u=this.xAxis,a,f=this.options;a=f.cropThreshold;var l=0,c=this.isCartesian,h,p;if(c&&!this.isDirty&&!u.isDirty&&!this.yAxis.isDirty&&!e)return!1;if(u)h=u.getExtremes(),p=h.min,h=h.max;if(c&&this.sorted&&(!a||r>a||this.forceCrop))if(t[r-1]<p||t[0]>h)t=[],n=[];else if(t[0]<p||t[r-1]>h)i=this.cropData(this.xData,this.yData,p,h),t=i.xData,n=i.yData,i=i.start,s=!0,l=t.length;for(a=t.length-1;a>=0;a--)r=t[a]-t[a-1],!s&&t[a]>p&&t[a]<h&&l++,r>0&&(o===F||r<o)?o=r:r<0&&this.requireSorting&&bt(15);this.cropped=s;this.cropStart=i;this.processedXData=t;this.processedYData=n;this.activePointCount=l;if(f.pointRange===null)this.pointRange=o||1;this.closestPointRange=o},cropData:function(e,t,n,r){var i=e.length,s=0,o=i,u=p(this.cropShoulder,1),a;for(a=0;a<i;a++)if(e[a]>=n){s=X(0,a-u);break}for(;a<i;a++)if(e[a]>r){o=a+u;break}return{xData:e.slice(s,o),yData:t.slice(s,o),start:s,end:o}},generatePoints:function(){var e=this.options.data,t=this.data,n,r=this.processedXData,i=this.processedYData,s=this.pointClass,o=r.length,u=this.cropStart||0,a,f=this.hasGroupedData,l,c=[],p;if(!t&&!f)t=[],t.length=e.length,t=this.data=t;for(p=0;p<o;p++)a=u+p,f?c[p]=(new s).init(this,[r[p]].concat(h(i[p]))):(t[a]?l=t[a]:e[a]!==F&&(t[a]=l=(new s).init(this,e[a],r[p])),c[p]=l),c[p].index=a;if(t&&(o!==(n=t.length)||f))for(p=0;p<n;p++)if(p===u&&!f&&(p+=o),t[p])t[p].destroyElements(),t[p].plotX=F;this.data=t;this.points=c},getExtremes:function(e){var t=this.yAxis,n=this.processedXData,r,i=[],s=0;r=this.xAxis.getExtremes();var o=r.min,u=r.max,a,f,l,c,e=e||this.stackedYData||this.processedYData;r=e.length;for(c=0;c<r;c++)if(f=n[c],l=e[c],a=l!==null&&l!==F&&(!t.isLog||l.length||l>0),f=this.getExtremesFromAll||this.cropped||(n[c+1]||f)>=o&&(n[c-1]||f)<=u,a&&f)if(a=l.length)for(;a--;)l[a]!==null&&(i[s++]=l[a]);else i[s++]=l;this.dataMin=p(void 0,T(i));this.dataMax=p(void 0,N(i))},translate:function(){this.processedXData||this.processData();this.generatePoints();for(var e=this.options,t=e.stacking,n=this.xAxis,r=n.categories,i=this.yAxis,s=this.points,u=s.length,a=!!this.modifyValue,f=e.pointPlacement,c=f==="between"||o(f),h=e.threshold,e=0;e<u;e++){var d=s[e],v=d.x,m=d.y,g=d.low,y=t&&i.stacks[(this.negStacks&&m<h?"-":"")+this.stackKey];if(i.isLog&&m<=0)d.y=m=null,bt(10);d.plotX=n.translate(v,0,0,0,1,f,this.type==="flags");if(t&&this.visible&&y&&y[v])y=y[v],m=y.points[this.index+","+e],g=m[0],m=m[1],g===0&&(g=p(h,i.min)),i.isLog&&g<=0&&(g=null),d.total=d.stackTotal=y.total,d.percentage=y.total&&d.y/y.total*100,d.stackY=m,y.setOffset(this.pointXOffset||0,this.barW||0);d.yBottom=l(g)?i.translate(g,0,1,0,1):null;a&&(m=this.modifyValue(m,d));d.plotY=typeof m==="number"&&m!==Infinity?i.translate(m,0,1,0,1):F;d.clientX=c?n.translate(v,0,0,0,1):d.plotX;d.negative=d.y<(h||0);d.category=r&&r[d.x]!==F?r[d.x]:d.x}this.getSegments()},animate:function(t){var n=this.chart,r=n.renderer,s;s=this.options.animation;var o=this.clipBox||n.clipBox,u=n.inverted,a;if(s&&!i(s))s=sn[this.type].animation;a=["_sharedClip",s.duration,s.easing,o.height].join(",");t?(t=n[a],s=n[a+"m"],t||(n[a]=t=r.clipRect(e(o,{width:0})),n[a+"m"]=s=r.clipRect(-99,u?-n.plotLeft:-n.plotTop,99,u?n.chartWidth:n.chartHeight)),this.group.clip(t),this.markerGroup.clip(s),this.sharedClipKey=a):((t=n[a])&&t.animate({width:n.plotSizeX},s),n[a+"m"]&&n[a+"m"].animate({width:n.plotSizeX+99},s),this.animate=null)},afterAnimate:function(){var e=this.chart,t=this.sharedClipKey,n=this.group,r=this.clipBox;if(n&&this.options.clip!==!1){if(!t||!r)n.clip(r?e.renderer.clipRect(r):e.clipRect);this.markerGroup.clip()}en(this,"afterAnimate");setTimeout(function(){t&&e[t]&&(r||(e[t]=e[t].destroy()),e[t+"m"]&&(e[t+"m"]=e[t+"m"].destroy()))},100)},drawPoints:function(){var t,n=this.points,r=this.chart,i,s,o,u,a,f,l,c,h=this.options.marker,d=this.pointAttr[""],v,m,g,y=this.markerGroup,b=p(h.enabled,!this.requireSorting||this.activePointCount<.5*this.xAxis.len/h.radius);if(h.enabled!==!1||this._hasPointMarkers)for(o=n.length;o--;)if(u=n[o],i=z(u.plotX),s=u.plotY,c=u.graphic,v=u.marker||{},m=!!u.marker,t=b&&v.enabled===F||v.enabled,g=r.isInsidePlot(U(i),s,r.inverted),t&&s!==F&&!isNaN(s)&&u.y!==null)if(t=u.pointAttr[u.selected?"select":""]||d,a=t.r,f=p(v.symbol,this.symbol),l=f.indexOf("url")===0,c)c[g?"show":"hide"](!0).animate(e({x:i-a,y:s-a},c.symbolName?{width:2*a,height:2*a}:{}));else{if(g&&(a>0||l))u.graphic=r.renderer.symbol(f,i-a,s-a,2*a,2*a,m?v:h).attr(t).add(y)}else if(c)u.graphic=c.destroy()},convertAttribs:function(e,t,n,r){var i=this.pointAttrToOptions,s,o,u={},e=e||{},t=t||{},n=n||{},r=r||{};for(s in i)o=i[s],u[s]=p(e[o],t[s],n[s],r[s]);return u},getAttribs:function(){var t=this,n=t.options,r=sn[t.type].marker?n.marker:n,i=r.states,s=i.hover,o,u=t.color;o={stroke:u,fill:u};var a=t.points||[],f,c=[],h,p=t.pointAttrToOptions;h=t.hasPointSpecificOptions;var d=n.negativeColor,v=r.lineColor,m=r.fillColor;f=n.turboThreshold;var g;n.marker?(s.radius=s.radius||r.radius+s.radiusPlus,s.lineWidth=s.lineWidth||r.lineWidth+s.lineWidthPlus):s.color=s.color||fn(s.color||u).brighten(s.brightness).get();c[""]=t.convertAttribs(r,o);Jt(["hover","select"],function(e){c[e]=t.convertAttribs(i[e],c[""])});t.pointAttr=c;u=a.length;if(!f||u<f||h)for(;u--;){f=a[u];if((r=f.options&&f.options.marker||f.options)&&r.enabled===!1)r.radius=0;if(f.negative&&d)f.color=f.fillColor=d;h=n.colorByPoint||f.color;if(f.options)for(g in p)l(r[p[g]])&&(h=!0);if(h){r=r||{};h=[];i=r.states||{};o=i.hover=i.hover||{};if(!n.marker)o.color=o.color||!f.options.color&&s.color||fn(f.color).brighten(o.brightness||s.brightness).get();o={color:f.color};if(!m)o.fillColor=f.color;if(!v)o.lineColor=f.color;h[""]=t.convertAttribs(e(o,r),c[""]);h.hover=t.convertAttribs(i.hover,c.hover,h[""]);h.select=t.convertAttribs(i.select,c.select,h[""])}else h=c;f.pointAttr=h}},destroy:function(){var e=this,t=e.chart,n=/AppleWebKit\/533/.test(Y),r,i,s=e.data||[],o,u,a;en(e,"destroy");Zt(e);Jt(e.axisTypes||[],function(t){if(a=e[t])f(a.series,e),a.isDirty=a.forceRedraw=!0});e.legendItem&&e.chart.legend.destroyItem(e);for(i=s.length;i--;)(o=s[i])&&o.destroy&&o.destroy();e.points=null;clearTimeout(e.animationTimeout);Jt("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),function(t){e[t]&&(r=n&&t==="group"?"hide":"destroy",e[t][r]())});if(t.hoverSeries===e)t.hoverSeries=null;f(t.series,e);for(u in e)delete e[u]},getSegmentPath:function(e){var t=this,n=[],r=t.options.step;Jt(e,function(i,s){var o=i.plotX,u=i.plotY,a;t.getPointSpline?n.push.apply(n,t.getPointSpline(e,i,s)):(n.push(s?"L":"M"),r&&s&&(a=e[s-1],r==="right"?n.push(a.plotX,u):r==="center"?n.push((a.plotX+o)/2,a.plotY,(a.plotX+o)/2,u):n.push(o,a.plotY)),n.push(i.plotX,i.plotY))});return n},getGraphPath:function(){var e=this,t=[],n,r=[];Jt(e.segments,function(i){n=e.getSegmentPath(i);i.length>1?t=t.concat(n):r.push(i[0])});e.singlePoints=r;return e.graphPath=t},drawGraph:function(){var e=this,t=this.options,n=[["graph",t.lineColor||this.color]],r=t.lineWidth,i=t.dashStyle,s=t.linecap!=="square",o=this.getGraphPath(),u=t.negativeColor;u&&n.push(["graphNeg",u]);Jt(n,function(n,u){var a=n[0],f=e[a];if(f)rn(f),f.animate({d:o});else if(r&&o.length)f={stroke:n[1],"stroke-width":r,fill:Tt,zIndex:1},i?f.dashstyle=i:s&&(f["stroke-linecap"]=f["stroke-linejoin"]="round"),e[a]=e.chart.renderer.path(o).attr(f).add(e.group).shadow(!u&&t.shadow)})},clipNeg:function(){var e=this.options,t=this.chart,n=t.renderer,r=e.negativeColor||e.negativeFillColor,i,s=this.graph,o=this.area,u=this.posClip,a=this.negClip;i=t.chartWidth;var f=t.chartHeight,l=X(i,f),c=this.yAxis;if(r&&(s||o)){r=U(c.toPixels(e.threshold||0,!0));r<0&&(l-=r);e={x:0,y:0,width:l,height:r};l={x:0,y:r,width:l,height:l};if(t.inverted)e.height=l.y=t.plotWidth-r,n.isVML&&(e={x:t.plotWidth-r-t.plotLeft,y:0,width:i,height:f},l={x:r+t.plotLeft-i,y:0,width:t.plotLeft+r,height:i});c.reversed?(t=l,i=e):(t=e,i=l);u?(u.animate(t),a.animate(i)):(this.posClip=u=n.clipRect(t),this.negClip=a=n.clipRect(i),s&&this.graphNeg&&(s.clip(u),this.graphNeg.clip(a)),o&&(o.clip(u),this.areaNeg.clip(a)))}},invertGroups:function(){function e(){var e={width:t.yAxis.len,height:t.xAxis.len};Jt(["group","markerGroup"],function(n){t[n]&&t[n].attr(e).invert()})}var t=this,n=t.chart;if(t.xAxis)Yt(n,"resize",e),Yt(t,"destroy",function(){Zt(n,"resize",e)}),e(),t.invertGroups=e},plotGroup:function(e,t,n,r,i){var s=this[e],o=!s;o&&(this[e]=s=this.chart.renderer.g(t).attr({visibility:n,zIndex:r||.1}).add(i));s[o?"attr":"animate"](this.getPlotBox());return s},getPlotBox:function(){var e=this.chart,t=this.xAxis,n=this.yAxis;if(e.inverted)t=n,n=this.xAxis;return{translateX:t?t.left:e.plotLeft,translateY:n?n.top:e.plotTop,scaleX:1,scaleY:1}},render:function(){var e=this,t=e.chart,n,r=e.options,i=(n=r.animation)&&!!e.animate&&t.renderer.isSVG&&p(n.duration,500)||0,s=e.visible?"visible":"hidden",o=r.zIndex,u=e.hasRendered,a=t.seriesGroup;n=e.plotGroup("group","series",s,o,a);e.markerGroup=e.plotGroup("markerGroup","markers",s,o,a);i&&e.animate(!0);e.getAttribs();n.inverted=e.isCartesian?t.inverted:!1;e.drawGraph&&(e.drawGraph(),e.clipNeg());Jt(e.points,function(e){e.redraw&&e.redraw()});e.drawDataLabels&&e.drawDataLabels();e.visible&&e.drawPoints();e.drawTracker&&e.options.enableMouseTracking!==!1&&e.drawTracker();t.inverted&&e.invertGroups();r.clip!==!1&&!e.sharedClipKey&&!u&&n.clip(t.clipRect);i&&e.animate();if(!u)i?e.animationTimeout=setTimeout(function(){e.afterAnimate()},i):e.afterAnimate();e.isDirty=e.isDirtyData=!1;e.hasRendered=!0},redraw:function(){var e=this.chart,t=this.isDirtyData,n=this.group,r=this.xAxis,i=this.yAxis;n&&(e.inverted&&n.attr({width:e.plotWidth,height:e.plotHeight}),n.animate({translateX:p(r&&r.left,e.plotLeft),translateY:p(i&&i.top,e.plotTop)}));this.translate();this.setTooltipPoints&&this.setTooltipPoints(!0);this.render();t&&en(this,"updatedData")}};H.prototype={destroy:function(){C(this,this.axis)},render:function(e){var t=this.options,n=t.format,n=n?w(n,this):t.formatter.call(this);this.label?this.label.attr({text:n,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(n,null,null,t.useHTML).css(t.style).attr({align:this.textAlign,rotation:t.rotation,visibility:"hidden"}).add(e)},setOffset:function(e,t){var n=this.axis,r=n.chart,i=r.inverted,s=this.isNegative,o=n.translate(n.usePercentage?100:this.total,0,0,0,1),n=n.translate(0),n=$(o-n),u=r.xAxis[0].translate(this.x)+e,a=r.plotHeight,s={x:i?s?o:o-n:u,y:i?a-u-t:s?a-o-n:a-o,width:i?n:t,height:i?t:n};if(i=this.label)i.align(this.alignOptions,null,s),s=i.alignAttr,i[this.options.crop===!1||r.isInsidePlot(s.x,s.y)?"show":"hide"](!0)}};D.prototype.buildStacks=function(){var e=this.series,t=p(this.options.reversedStacks,!0),n=e.length;if(!this.isXAxis){for(this.usePercentage=!1;n--;)e[t?n:e.length-n-1].setStackedPoints();if(this.usePercentage)for(n=0;n<e.length;n++)e[n].setPercentStacks()}};D.prototype.renderStackTotals=function(){var e=this.chart,t=e.renderer,n=this.stacks,r,i,s=this.stackTotalGroup;if(!s)this.stackTotalGroup=s=t.g("stack-labels").attr({visibility:"visible",zIndex:6}).add();s.translate(e.plotLeft,e.plotTop);for(r in n)for(i in e=n[r],e)e[i].render(s)};xn.prototype.setStackedPoints=function(){if(this.options.stacking&&!(this.visible!==!0&&this.chart.options.chart.ignoreHiddenSeries!==!1)){var e=this.processedXData,t=this.processedYData,n=[],r=t.length,i=this.options,s=i.threshold,o=i.stack,i=i.stacking,u=this.stackKey,a="-"+u,f=this.negStacks,l=this.yAxis,c=l.stacks,h=l.oldStacks,p,d,v,m,g,y;for(m=0;m<r;m++){g=e[m];y=t[m];v=this.index+","+m;d=(p=f&&y<s)?a:u;c[d]||(c[d]={});if(!c[d][g])h[d]&&h[d][g]?(c[d][g]=h[d][g],c[d][g].total=null):c[d][g]=new H(l,l.options.stackLabels,p,g,o);d=c[d][g];d.points[v]=[d.cum||0];i==="percent"?(p=p?u:a,f&&c[p]&&c[p][g]?(p=c[p][g],d.total=p.total=X(p.total,d.total)+$(y)||0):d.total=L(d.total+($(y)||0))):d.total=L(d.total+(y||0));d.cum=(d.cum||0)+(y||0);d.points[v].push(d.cum);n[m]=d.cum}if(i==="percent")l.usePercentage=!0;this.stackedYData=n;l.oldStacks={}}};xn.prototype.setPercentStacks=function(){var e=this,t=e.stackKey,n=e.yAxis.stacks,r=e.processedXData;Jt([t,"-"+t],function(t){var i;for(var s=r.length,o,u;s--;)if(o=r[s],i=(u=n[t]&&n[t][o])&&u.points[e.index+","+s],o=i)u=u.total?100/u.total:0,o[0]=L(o[0]*u),o[1]=L(o[1]*u),e.stackedYData[s]=o[1]})};e(P.prototype,{addSeries:function(e,t,n){var r,i=this;e&&(t=p(t,!0),en(i,"addSeries",{options:e},function(){r=i.initSeries(e);i.isDirtyLegend=!0;i.linkSeries();t&&i.redraw(n)}));return r},addAxis:function(e,n,r,i){var s=n?"xAxis":"yAxis",o=this.options;new D(this,t(e,{index:this[s].length,isX:n}));o[s]=h(o[s]||{});o[s].push(e);p(r,!0)&&this.redraw(i)},showLoading:function(t){var n=this,r=n.options,i=n.loadingDiv,s=r.loading,o=function(){i&&d(i,{left:n.plotLeft+"px",top:n.plotTop+"px",width:n.plotWidth+"px",height:n.plotHeight+"px"})};if(!i)n.loadingDiv=i=v(xt,{className:"highcharts-loading"},e(s.style,{zIndex:10,display:Tt}),n.container),n.loadingSpan=v("span",null,s.labelStyle,i),Yt(n,"redraw",o);n.loadingSpan.innerHTML=t||r.lang.loading;if(!n.loadingShown)d(i,{opacity:0,display:""}),nn(i,{opacity:s.style.opacity},{duration:s.showDuration||0}),n.loadingShown=!0;o()},hideLoading:function(){var e=this.options,t=this.loadingDiv;t&&nn(t,{opacity:0},{duration:e.loading.hideDuration||100,complete:function(){d(t,{display:Tt})}});this.loadingShown=!1}});e(Sn.prototype,{update:function(e,t,n,r){function o(){u.applyOptions(e);if(i(e)&&!s(e))u.redraw=function(){if(f)e&&e.marker&&e.marker.symbol?u.graphic=f.destroy():f.attr(u.pointAttr[u.state||""]);if(e&&e.dataLabels&&u.dataLabel)u.dataLabel=u.dataLabel.destroy();u.redraw=null};l=u.index;a.updateParallelArrays(u,l);h.data[l]=u.options;a.isDirty=a.isDirtyData=!0;if(!a.fixedBox&&a.hasCartesianSeries)c.isDirtyBox=!0;h.legendType==="point"&&c.legend.destroyItem(u);t&&c.redraw(n)}var u=this,a=u.series,f=u.graphic,l,c=a.chart,h=a.options,t=p(t,!0);r===!1?o():u.firePointEvent("update",{options:e},o)},remove:function(e,t){var n=this,r=n.series,i=r.points,s=r.chart,o,u=r.data;A(t,s);e=p(e,!0);n.firePointEvent("remove",null,function(){o=$t(n,u);u.length===i.length&&i.splice(o,1);u.splice(o,1);r.options.data.splice(o,1);r.updateParallelArrays(n,"splice",o,1);n.destroy();r.isDirty=!0;r.isDirtyData=!0;e&&s.redraw()})}});e(xn.prototype,{addPoint:function(e,t,n,r){var i=this.options,s=this.data,o=this.graph,u=this.area,a=this.chart,f=this.xAxis&&this.xAxis.names,l=o&&o.shift||0,c=i.data,h,d=this.xData;A(r,a);n&&Jt([o,u,this.graphNeg,this.areaNeg],function(e){if(e)e.shift=l+1});if(u)u.isArea=!0;t=p(t,!0);r={series:this};this.pointClass.prototype.applyOptions.apply(r,[e]);o=r.x;u=d.length;if(this.requireSorting&&o<d[u-1])for(h=!0;u&&d[u-1]>o;)u--;this.updateParallelArrays(r,"splice",u,0,0);this.updateParallelArrays(r,u);if(f&&r.name)f[o]=r.name;c.splice(u,0,e);h&&(this.data.splice(u,0,null),this.processData());i.legendType==="point"&&this.generatePoints();n&&(s[0]&&s[0].remove?s[0].remove(!1):(s.shift(),this.updateParallelArrays(r,"shift"),c.shift()));this.isDirtyData=this.isDirty=!0;t&&(this.getAttribs(),a.redraw())},remove:function(e,t){var n=this,r=n.chart,e=p(e,!0);if(!n.isRemoving)n.isRemoving=!0,en(n,"remove",null,function(){n.destroy();r.isDirtyLegend=r.isDirtyBox=!0;r.linkSeries();e&&r.redraw(t)});n.isRemoving=!1},update:function(n,r){var i=this,s=this.chart,o=this.userOptions,u=this.type,a=Rt[u].prototype,f=["group","markerGroup","dataLabelsGroup"],l;Jt(f,function(e){f[e]=i[e];delete i[e]});n=t(o,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},n);this.remove(!1);for(l in a)a.hasOwnProperty(l)&&(this[l]=F);e(this,Rt[n.type||u].prototype);Jt(f,function(e){i[e]=f[e]});this.init(s,n);s.linkSeries();p(r,!0)&&s.redraw(!1)}});e(D.prototype,{update:function(n,r){var i=this.chart,n=i.options[this.coll][this.options.index]=t(this.userOptions,n);this.destroy(!0);this._addedPlotLB=F;this.init(i,e(n,{events:F}));i.isDirtyBox=!0;p(r,!0)&&i.redraw()},remove:function(e){for(var t=this.chart,n=this.coll,r=this.series,i=r.length;i--;)r[i]&&r[i].remove(!1);f(t.axes,this);f(t[n],this);t.options[n].splice(this.options.index,1);Jt(t[n],function(e,t){e.options.index=t});this.destroy();t.isDirtyBox=!0;p(e,!0)&&t.redraw()},setTitle:function(e,t){this.update({title:e},t)},setCategories:function(e,t){this.update({categories:e},t)}});var Tn=m(xn);Rt.line=Tn;sn.area=t(zt,{threshold:0});var Nn=m(xn,{type:"area",getSegments:function(){var e=this,t=[],n=[],r=[],i=this.xAxis,s=this.yAxis,o=s.stacks[this.stackKey],u={},a,f,l=this.points,c=this.options.connectNulls,h,p;if(this.options.stacking&&!this.cropped){for(h=0;h<l.length;h++)u[l[h].x]=l[h];for(p in o)o[p].total!==null&&r.push(+p);r.sort(function(e,t){return e-t});Jt(r,function(t){var r=0,l;if(!c||u[t]&&u[t].y!==null)if(u[t])n.push(u[t]);else{for(h=e.index;h<=s.series.length;h++)if(l=o[t].points[h+","+t]){r=l[1];break}a=i.translate(t);f=s.toPixels(r,!0);n.push({y:null,plotX:a,clientX:a,plotY:f,yBottom:f,onMouseOver:wt})}});n.length&&t.push(n)}else xn.prototype.getSegments.call(this),t=this.segments;this.segments=t},getSegmentPath:function(e){var t=xn.prototype.getSegmentPath.call(this,e),n=[].concat(t),r,i=this.options;r=t.length;var s=this.yAxis.getThreshold(i.threshold),o;r===3&&n.push("L",t[1],t[2]);if(i.stacking&&!this.closedStacks)for(r=e.length-1;r>=0;r--)o=p(e[r].yBottom,s),r<e.length-1&&i.step&&n.push(e[r+1].plotX,o),n.push(e[r].plotX,o);else this.closeSegment(n,e,s);this.areaPath=this.areaPath.concat(n);return t},closeSegment:function(e,t,n){e.push("L",t[t.length-1].plotX,n,"L",t[0].plotX,n)},drawGraph:function(){this.areaPath=[];xn.prototype.drawGraph.apply(this);var e=this,t=this.areaPath,n=this.options,r=n.negativeColor,i=n.negativeFillColor,s=[["area",this.color,n.fillColor]];(r||i)&&s.push(["areaNeg",r,i]);Jt(s,function(r){var i=r[0],s=e[i];s?s.animate({d:t}):e[i]=e.chart.renderer.path(t).attr({fill:p(r[2],fn(r[1]).setOpacity(p(n.fillOpacity,.75)).get()),zIndex:0}).add(e.group)})},drawLegendSymbol:Wt.drawRectangle});Rt.area=Nn;sn.spline=t(zt);Tn=m(xn,{type:"spline",getPointSpline:function(e,t,n){var r=t.plotX,i=t.plotY,s=e[n-1],o=e[n+1],u,a,f,l;if(s&&o){e=s.plotY;f=o.plotX;var o=o.plotY,c;u=(1.5*r+s.plotX)/2.5;a=(1.5*i+e)/2.5;f=(1.5*r+f)/2.5;l=(1.5*i+o)/2.5;c=(l-a)*(f-r)/(f-u)+i-l;a+=c;l+=c;a>e&&a>i?(a=X(e,i),l=2*i-a):a<e&&a<i&&(a=V(e,i),l=2*i-a);l>o&&l>i?(l=X(o,i),a=2*i-l):l<o&&l<i&&(l=V(o,i),a=2*i-l);t.rightContX=f;t.rightContY=l}n?(t=["C",s.rightContX||s.plotX,s.rightContY||s.plotY,u||r,a||i,r,i],s.rightContX=s.rightContY=null):t=["M",r,i];return t}});Rt.spline=Tn;sn.areaspline=t(sn.area);Nn=Nn.prototype;Tn=m(Tn,{type:"areaspline",closedStacks:!0,getSegmentPath:Nn.getSegmentPath,closeSegment:Nn.closeSegment,drawGraph:Nn.drawGraph,drawLegendSymbol:Wt.drawRectangle});Rt.areaspline=Tn;sn.column=t(zt,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},stickyTracking:!1,tooltip:{distance:6},threshold:0});Tn=m(xn,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",r:"borderRadius"},cropShoulder:0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){xn.prototype.init.apply(this,arguments);var e=this,t=e.chart;t.hasRendered&&Jt(t.series,function(t){if(t.type===e.type)t.isDirty=!0})},getColumnMetrics:function(){var e=this,t=e.options,n=e.xAxis,r=e.yAxis,i=n.reversed,s,o={},u,a=0;t.grouping===!1?a=1:Jt(e.chart.series,function(t){var n=t.options,i=t.yAxis;if(t.type===e.type&&t.visible&&r.len===i.len&&r.pos===i.pos)n.stacking?(s=t.stackKey,o[s]===F&&(o[s]=a++),u=o[s]):n.grouping!==!1&&(u=a++),t.columnIndex=u});var n=V($(n.transA)*(n.ordinalSlope||t.pointRange||n.closestPointRange||n.tickInterval||1),n.len),f=n*t.groupPadding,c=(n-2*f)/a,h=t.pointWidth,t=l(h)?(c-h)/2:c*t.pointPadding,h=p(h,c-2*t);return e.columnMetrics={width:h,offset:t+(f+((i?a-(e.columnIndex||0):e.columnIndex)||0)*c-n/2)*(i?-1:1)}},translate:function(){var e=this,t=e.chart,n=e.options,r=e.borderWidth=p(n.borderWidth,e.activePointCount>.5*e.xAxis.len?0:1),i=e.yAxis,s=e.translatedThreshold=i.getThreshold(n.threshold),o=p(n.minPointLength,5),u=e.getColumnMetrics(),a=u.width,f=e.barW=X(a,1+2*r),l=e.pointXOffset=u.offset,c=-(r%2?.5:0),h=r%2?.5:1;t.renderer.isVML&&t.inverted&&(h+=1);n.pointPadding&&(f=W(f));xn.prototype.translate.apply(e);Jt(e.points,function(n){var r=p(n.yBottom,s),u=V(X(-999-r,n.plotY),i.len+999+r),d=n.plotX+l,v=f,m=V(u,r),g;g=X(u,r)-m;$(g)<o&&o&&(g=o,m=U($(m-s)>o?r-o:s-(i.translate(n.y,0,1,0,1)<=s?o:0)));n.barX=d;n.pointWidth=a;n.tooltipPos=t.inverted?[i.len-u,e.xAxis.len-d-v/2]:[d+v/2,u+i.pos-t.plotTop];v=U(d+v)+c;d=U(d)+c;v-=d;r=$(m)<.5;g=U(m+g)+h;m=U(m)+h;g-=m;r&&(m-=1,g+=1);n.shapeType="rect";n.shapeArgs={x:d,y:m,width:v,height:g}})},getSymbol:wt,drawLegendSymbol:Wt.drawRectangle,drawGraph:wt,drawPoints:function(){var e=this,n=this.chart,r=e.options,i=n.renderer,s=r.animationLimit||250,o,u;Jt(e.points,function(a){var f=a.plotY,c=a.graphic;if(f!==F&&!isNaN(f)&&a.y!==null)o=a.shapeArgs,f=l(e.borderWidth)?{"stroke-width":e.borderWidth}:{},u=a.pointAttr[a.selected?"select":""]||e.pointAttr[""],c?(rn(c),c.attr(f)[n.pointCount<s?"animate":"attr"](t(o))):a.graphic=i[a.shapeType](o).attr(u).attr(f).add(e.group).shadow(r.shadow,null,r.stacking&&!r.borderRadius);else if(c)a.graphic=c.destroy()})},animate:function(e){var t=this.yAxis,n=this.options,r=this.chart.inverted,i={};if(ot)e?(i.scaleY=.001,e=V(t.pos+t.len,X(t.pos,t.toPixels(n.threshold))),r?i.translateX=e-t.len:i.translateY=e,this.group.attr(i)):(i.scaleY=1,i[r?"translateX":"translateY"]=t.pos,this.group.animate(i,this.options.animation),this.animate=null)},remove:function(){var e=this,t=e.chart;t.hasRendered&&Jt(t.series,function(t){if(t.type===e.type)t.isDirty=!0});xn.prototype.remove.apply(e,arguments)}});Rt.column=Tn;sn.bar=t(sn.column);Nn=m(Tn,{type:"bar",inverted:!0});Rt.bar=Nn;sn.scatter=t(zt,{lineWidth:0,tooltip:{headerFormat:'<span style="color:{series.color}">●</span> <span style="font-size: 10px;"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"},stickyTracking:!1});Nn=m(xn,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,singularTooltips:!0,drawGraph:function(){this.options.lineWidth&&xn.prototype.drawGraph.call(this)}});Rt.scatter=Nn;sn.pie=t(zt,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name}},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}});zt={type:"pie",isCartesian:!1,pointClass:m(Sn,{init:function(){Sn.prototype.init.apply(this,arguments);var t=this,n;if(t.y<0)t.y=null;e(t,{visible:t.visible!==!1,name:p(t.name,"Slice")});n=function(e){t.slice(e.type==="select")};Yt(t,"select",n);Yt(t,"unselect",n);return t},setVisible:function(e){var t=this,n=t.series,r=n.chart;t.visible=t.options.visible=e=e===F?!t.visible:e;n.options.data[$t(t,n.data)]=t.options;Jt(["graphic","dataLabel","connector","shadowGroup"],function(n){if(t[n])t[n][e?"show":"hide"](!0)});t.legendItem&&r.legend.colorizeItem(t,e);if(!n.isDirty&&n.options.ignoreHiddenPoint)n.isDirty=!0,r.redraw()},slice:function(e,t,n){var r=this.series;A(n,r.chart);p(t,!0);this.sliced=this.options.sliced=e=l(e)?e:!this.sliced;r.options.data[$t(this,r.data)]=this.options;e=e?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(e);this.shadowGroup&&this.shadowGroup.animate(e)},haloPath:function(e){var t=this.shapeArgs,n=this.series.chart;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(n.plotLeft+t.x,n.plotTop+t.y,t.r+e,t.r+e,{innerR:this.shapeArgs.r,start:t.start,end:t.end})}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},singularTooltips:!0,getColor:wt,animate:function(e){var t=this,n=t.points,r=t.startAngleRad;if(!e)Jt(n,function(e){var n=e.graphic,e=e.shapeArgs;n&&(n.attr({r:t.center[3]/2,start:r,end:r}),n.animate({r:e.r,start:e.start,end:e.end},t.options.animation))}),t.animate=null},setData:function(e,t,n,r){xn.prototype.setData.call(this,e,!1,n,r);this.processData();this.generatePoints();p(t,!0)&&this.chart.redraw(n)},generatePoints:function(){var e,t=0,n,r,i,s=this.options.ignoreHiddenPoint;xn.prototype.generatePoints.call(this);n=this.points;r=n.length;for(e=0;e<r;e++)i=n[e],t+=s&&!i.visible?0:i.y;this.total=t;for(e=0;e<r;e++)i=n[e],i.percentage=t>0?i.y/t*100:0,i.total=t},translate:function(e){this.generatePoints();var t=0,n=this.options,r=n.slicedOffset,i=r+n.borderWidth,s,o,u,a=n.startAngle||0,f=this.startAngleRad=Q/180*(a-90),a=(this.endAngleRad=Q/180*(p(n.endAngle,a+360)-90))-f,l=this.points,c=n.dataLabels.distance,n=n.ignoreHiddenPoint,h,d=l.length,v;if(!e)this.center=e=this.getCenter();this.getX=function(t,n){u=R.asin(V((t-e[1])/(e[2]/2+c),1));return e[0]+(n?-1:1)*J(u)*(e[2]/2+c)};for(h=0;h<d;h++){v=l[h];s=f+t*a;if(!n||v.visible)t+=v.percentage/100;o=f+t*a;v.shapeType="arc";v.shapeArgs={x:e[0],y:e[1],r:e[2]/2,innerR:e[3]/2,start:U(s*1e3)/1e3,end:U(o*1e3)/1e3};u=(o+s)/2;u>1.5*Q?u-=2*Q:u<-Q/2&&(u+=2*Q);v.slicedTranslation={translateX:U(J(u)*r),translateY:U(K(u)*r)};s=J(u)*e[2]/2;o=K(u)*e[2]/2;v.tooltipPos=[e[0]+s*.7,e[1]+o*.7];v.half=u<-Q/2||u>Q/2?1:0;v.angle=u;i=V(i,c/2);v.labelPos=[e[0]+s+J(u)*c,e[1]+o+K(u)*c,e[0]+s+J(u)*i,e[1]+o+K(u)*i,e[0]+s,e[1]+o,c<0?"center":v.half?"right":"left",u]}},drawGraph:null,drawPoints:function(){var t=this,n=t.chart.renderer,r,i,s=t.options.shadow,o,u;if(s&&!t.shadowGroup)t.shadowGroup=n.g("shadow").add(t.group);Jt(t.points,function(a){i=a.graphic;u=a.shapeArgs;o=a.shadowGroup;if(s&&!o)o=a.shadowGroup=n.g("shadow").add(t.shadowGroup);r=a.sliced?a.slicedTranslation:{translateX:0,translateY:0};o&&o.attr(r);i?i.animate(e(u,r)):a.graphic=i=n[a.shapeType](u).setRadialReference(t.center).attr(a.pointAttr[a.selected?"select":""]).attr({"stroke-linejoin":"round"}).attr(r).add(t.group).shadow(s,o);a.visible!==void 0&&a.setVisible(a.visible)})},sortByAngle:function(e,t){e.sort(function(e,n){return e.angle!==void 0&&(n.angle-e.angle)*t})},drawLegendSymbol:Wt.drawRectangle,getCenter:hn.getCenter,getSymbol:wt};zt=m(xn,zt);Rt.pie=zt;xn.prototype.drawDataLabels=function(){var n=this,r=n.options,i=r.cursor,s=r.dataLabels,o=n.points,u,a,f=n.hasRendered||0,c,h;if(s.enabled||n._hasPointLabels)n.dlProcessOptions&&n.dlProcessOptions(s),h=n.plotGroup("dataLabelsGroup","data-labels",s.defer?"hidden":"visible",s.zIndex||6),p(s.defer,!0)&&(h.attr({opacity:+f}),f||Yt(n,"afterAnimate",function(){n.visible&&h.show();h[r.animation?"animate":"attr"]({opacity:1},{duration:200})})),a=s,Jt(o,function(r){var o,f=r.dataLabel,d,v,m=r.connector,g=!0;u=r.options&&r.options.dataLabels;o=p(u&&u.enabled,a.enabled);if(f&&!o)r.dataLabel=f.destroy();else if(o){s=t(a,u);o=s.rotation;d=r.getLabelConfig();c=s.format?w(s.format,d):s.formatter.call(d,s);s.style.color=p(s.color,s.style.color,n.color,"black");if(f)if(l(c))f.attr({text:c}),g=!1;else{if(r.dataLabel=f=f.destroy(),m)r.connector=m.destroy()}else if(l(c)){f={fill:s.backgroundColor,stroke:s.borderColor,"stroke-width":s.borderWidth,r:s.borderRadius||0,rotation:o,padding:s.padding,zIndex:1};for(v in f)f[v]===F&&delete f[v];f=r.dataLabel=n.chart.renderer[o?"text":"label"](c,0,-999,null,null,null,s.useHTML).attr(f).css(e(s.style,i&&{cursor:i})).add(h).shadow(s.shadow)}f&&n.alignDataLabel(r,f,s,null,g)}})};xn.prototype.alignDataLabel=function(t,n,r,i,s){var o=this.chart,u=o.inverted,a=p(t.plotX,-999),f=p(t.plotY,-999),l=n.getBBox();if(t=this.visible&&(t.series.forceDL||o.isInsidePlot(a,U(f),u)||i&&o.isInsidePlot(a,u?i.x+1:i.y+i.height-1,u)))i=e({x:u?o.plotWidth-f:a,y:U(u?o.plotHeight-a:f),width:0,height:0},i),e(r,{width:l.width,height:l.height}),r.rotation?n[s?"attr":"animate"]({x:i.x+r.x+i.width/2,y:i.y+r.y+i.height/2}).attr({align:r.align}):(n.align(r,null,i),u=n.alignAttr,p(r.overflow,"justify")==="justify"?this.justifyDataLabel(n,r,u,l,i,s):p(r.crop,!0)&&(t=o.isInsidePlot(u.x,u.y)&&o.isInsidePlot(u.x+l.width,u.y+l.height)));if(!t)n.attr({y:-999}),n.placed=!1};xn.prototype.justifyDataLabel=function(e,t,n,r,i,s){var o=this.chart,u=t.align,a=t.verticalAlign,f,l;f=n.x;if(f<0)u==="right"?t.align="left":t.x=-f,l=!0;f=n.x+r.width;if(f>o.plotWidth)u==="left"?t.align="right":t.x=o.plotWidth-f,l=!0;f=n.y;if(f<0)a==="bottom"?t.verticalAlign="top":t.y=-f,l=!0;f=n.y+r.height;if(f>o.plotHeight)a==="top"?t.verticalAlign="bottom":t.y=o.plotHeight-f,l=!0;if(l)e.placed=!s,e.align(t,null,i)};if(Rt.pie)Rt.pie.prototype.drawDataLabels=function(){var e=this,t=e.data,n,r=e.chart,i=e.options.dataLabels,s=p(i.connectorPadding,10),o=p(i.connectorWidth,1),u=r.plotWidth,a=r.plotHeight,f,l,c=p(i.softConnector,!0),h=i.distance,d=e.center,v=d[2]/2,m=d[1],g=h>0,y,b,w,E=[[],[]],S,x,T,C,k,L=[0,0,0,0],A=function(e,t){return t.y-e.y};if(e.visible&&(i.enabled||e._hasPointLabels)){xn.prototype.drawDataLabels.apply(e);Jt(t,function(e){e.dataLabel&&e.visible&&E[e.half].push(e)});for(C=2;C--;){var O=[],M=[],_=E[C],D=_.length,P;if(D){e.sortByAngle(_,C-.5);for(k=t=0;!t&&_[k];)t=_[k]&&_[k].dataLabel&&(_[k].dataLabel.getBBox().height||21),k++;if(h>0){b=V(m+v+h,r.plotHeight);for(k=X(0,m-v-h);k<=b;k+=t)O.push(k);b=O.length;if(D>b){n=[].concat(_);n.sort(A);for(k=D;k--;)n[k].rank=k;for(k=D;k--;)_[k].rank>=b&&_.splice(k,1);D=_.length}for(k=0;k<D;k++){n=_[k];w=n.labelPos;n=9999;var H,B;for(B=0;B<b;B++)H=$(O[B]-w[1]),H<n&&(n=H,P=B);if(P<k&&O[k]!==null)P=k;else for(b<D-k+P&&O[k]!==null&&(P=b-D+k);O[P]===null;)P++;M.push({i:P,y:O[P]});O[P]=null}M.sort(A)}for(k=0;k<D;k++){n=_[k];w=n.labelPos;y=n.dataLabel;T=n.visible===!1?"hidden":"visible";n=w[1];if(h>0){if(b=M.pop(),P=b.i,x=b.y,n>x&&O[P+1]!==null||n<x&&O[P-1]!==null)x=V(X(0,n),r.plotHeight)}else x=n;S=i.justify?d[0]+(C?-1:1)*(v+h):e.getX(x===m-v-h||x===m+v+h?n:x,C);y._attr={visibility:T,align:w[6]};y._pos={x:S+i.x+({left:s,right:-s}[w[6]]||0),y:x+i.y-10};y.connX=S;y.connY=x;if(this.options.size===null)b=y.width,S-b<s?L[3]=X(U(b-S+s),L[3]):S+b>u-s&&(L[1]=X(U(S+b-u+s),L[1])),x-t/2<0?L[0]=X(U(-x+t/2),L[0]):x+t/2>a&&(L[2]=X(U(x+t/2-a),L[2]))}}}if(N(L)===0||this.verifyDataLabelOverflow(L))this.placeDataLabels(),g&&o&&Jt(this.points,function(t){f=t.connector;w=t.labelPos;if((y=t.dataLabel)&&y._pos)T=y._attr.visibility,S=y.connX,x=y.connY,l=c?["M",S+(w[6]==="left"?5:-5),x,"C",S,x,2*w[2]-w[4],2*w[3]-w[5],w[2],w[3],"L",w[4],w[5]]:["M",S+(w[6]==="left"?5:-5),x,"L",w[2],w[3],"L",w[4],w[5]],f?(f.animate({d:l}),f.attr("visibility",T)):t.connector=f=e.chart.renderer.path(l).attr({"stroke-width":o,stroke:i.connectorColor||t.color||"#606060",visibility:T}).add(e.dataLabelsGroup);else if(f)t.connector=f.destroy()})}},Rt.pie.prototype.placeDataLabels=function(){Jt(this.points,function(e){var e=e.dataLabel,t;if(e)(t=e._pos)?(e.attr(e._attr),e[e.moved?"animate":"attr"](t),e.moved=!0):e&&e.attr({y:-999})})},Rt.pie.prototype.alignDataLabel=wt,Rt.pie.prototype.verifyDataLabelOverflow=function(e){var t=this.center,n=this.options,r=n.center,i=n=n.minSize||80,s;r[0]!==null?i=X(t[2]-X(e[1],e[3]),n):(i=X(t[2]-e[1]-e[3],n),t[0]+=(e[3]-e[1])/2);r[1]!==null?i=X(V(i,t[2]-X(e[0],e[2])),n):(i=X(V(i,t[2]-e[0]-e[2]),n),t[1]+=(e[0]-e[2])/2);i<t[2]?(t[2]=i,this.translate(t),Jt(this.points,function(e){if(e.dataLabel)e.dataLabel._pos=null}),this.drawDataLabels&&this.drawDataLabels()):s=!0;return s};if(Rt.column)Rt.column.prototype.alignDataLabel=function(e,n,r,i,s){var o=this.chart,u=o.inverted,a=e.dlBox||e.shapeArgs,f=e.below||e.plotY>p(this.translatedThreshold,o.plotSizeY),l=p(r.inside,!!this.options.stacking);if(a&&(i=t(a),u&&(i={x:o.plotWidth-i.y-i.height,y:o.plotHeight-i.x-i.width,width:i.height,height:i.width}),!l))u?(i.x+=f?0:i.width,i.width=0):(i.y+=f?i.height:0,i.height=0);r.align=p(r.align,!u||l?"center":f?"right":"left");r.verticalAlign=p(r.verticalAlign,u||l?"middle":f?"top":"bottom");xn.prototype.alignDataLabel.call(this,e,n,r,i,s)};var Cn=Ut.TrackerMixin={drawTrackerPoint:function(){var e=this,t=e.chart,n=t.pointer,r=e.options.cursor,i=r&&{cursor:r},s=function(n){var r=n.target,i;if(t.hoverSeries!==e)e.onMouseOver();for(;r&&!i;)i=r.point,r=r.parentNode;if(i!==F&&i!==t.hoverPoint)i.onMouseOver(n)};Jt(e.points,function(e){if(e.graphic)e.graphic.element.point=e;if(e.dataLabel)e.dataLabel.element.point=e});if(!e._hasTracking)Jt(e.trackerGroups,function(t){if(e[t]&&(e[t].addClass("highcharts-tracker").on("mouseover",s).on("mouseout",function(e){n.onTrackerMouseOut(e)}).css(i),lt))e[t].on("touchstart",s)}),e._hasTracking=!0},drawTrackerGraph:function(){var e=this,t=e.options,n=t.trackByArea,r=[].concat(n?e.areaPath:e.graphPath),i=r.length,s=e.chart,o=s.pointer,u=s.renderer,a=s.options.tooltip.snap,f=e.tracker,l=t.cursor,c=l&&{cursor:l},l=e.singlePoints,h,p=function(){if(s.hoverSeries!==e)e.onMouseOver()},d="rgba(192,192,192,"+(ot?1e-4:.002)+")";if(i&&!n)for(h=i+1;h--;)r[h]==="M"&&r.splice(h+1,0,r[h+1]-a,r[h+2],"L"),(h&&r[h]==="M"||h===i)&&r.splice(h,0,"L",r[h-2]+a,r[h-1]);for(h=0;h<l.length;h++)i=l[h],r.push("M",i.plotX-a,i.plotY,"L",i.plotX+a,i.plotY);f?f.attr({d:r}):(e.tracker=u.path(r).attr({"stroke-linejoin":"round",visibility:e.visible?"visible":"hidden",stroke:d,fill:n?d:Tt,"stroke-width":t.lineWidth+(n?0:2*a),zIndex:2}).add(e.group),Jt([e.tracker,e.markerGroup],function(e){e.addClass("highcharts-tracker").on("mouseover",p).on("mouseout",function(e){o.onTrackerMouseOut(e)}).css(c);if(lt)e.on("touchstart",p)}))}};if(Rt.column)Tn.prototype.drawTracker=Cn.drawTrackerPoint;if(Rt.pie)Rt.pie.prototype.drawTracker=Cn.drawTrackerPoint;if(Rt.scatter)Nn.prototype.drawTracker=Cn.drawTrackerPoint;e(En.prototype,{setItemEvents:function(e,t,n,r,i){var s=this;(n?t:e.legendGroup).on("mouseover",function(){e.setState("hover");t.css(s.options.itemHoverStyle)}).on("mouseout",function(){t.css(e.visible?r:i);e.setState()}).on("click",function(t){var n=function(){e.setVisible()},t={browserEvent:t};e.firePointEvent?e.firePointEvent("legendItemClick",t,n):en(e,"legendItemClick",t,n)})},createCheckboxForItem:function(e){e.checkbox=v("input",{type:"checkbox",checked:e.selected,defaultChecked:e.selected},this.options.itemCheckboxStyle,this.chart.container);Yt(e.checkbox,"click",function(t){en(e,"checkboxClick",{checked:t.target.checked},function(){e.select()})})}});dt.legend.itemStyle.cursor="pointer";e(P.prototype,{showResetZoom:function(){var e=this,t=dt.lang,n=e.options.chart.resetZoomButton,r=n.theme,i=r.states,s=n.relativeTo==="chart"?null:"plotBox";this.resetZoomButton=e.renderer.button(t.resetZoom,null,null,function(){e.zoomOut()},r,i&&i.hover).attr({align:n.position.align,title:t.resetZoomTitle}).add().align(n.position,!1,s)},zoomOut:function(){var e=this;en(e,"selection",{resetSelection:!0},function(){e.zoom()})},zoom:function(e){var t,n=this.pointer,r=!1,s;!e||e.resetSelection?Jt(this.axes,function(e){t=e.zoom()}):Jt(e.xAxis.concat(e.yAxis),function(e){var i=e.axis,s=i.isXAxis;if(n[s?"zoomX":"zoomY"]||n[s?"pinchX":"pinchY"])t=i.zoom(e.min,e.max),i.displayBtn&&(r=!0)});s=this.resetZoomButton;if(r&&!s)this.showResetZoom();else if(!r&&i(s))this.resetZoomButton=s.destroy();t&&this.redraw(p(this.options.chart.animation,e&&e.animation,this.pointCount<100))},pan:function(e,t){var n=this,r=n.hoverPoints,i;r&&Jt(r,function(e){e.setState()});Jt(t==="xy"?[1,0]:[1],function(t){var r=e[t?"chartX":"chartY"],s=n[t?"xAxis":"yAxis"][0],o=n[t?"mouseDownX":"mouseDownY"],u=(s.pointRange||0)/2,a=s.getExtremes(),f=s.toValue(o-r,!0)+u,o=s.toValue(o+n[t?"plotWidth":"plotHeight"]-r,!0)-u;s.series.length&&f>V(a.dataMin,a.min)&&o<X(a.dataMax,a.max)&&(s.setExtremes(f,o,!1,!1,{trigger:"pan"}),i=!0);n[t?"mouseDownX":"mouseDownY"]=r});i&&n.redraw(!1);d(n.container,{cursor:"move"})}});e(Sn.prototype,{select:function(e,t){var n=this,r=n.series,i=r.chart,e=p(e,!n.selected);n.firePointEvent(e?"select":"unselect",{accumulate:t},function(){n.selected=n.options.selected=e;r.options.data[$t(n,r.data)]=n.options;n.setState(e&&"select");t||Jt(i.getSelectedPoints(),function(e){if(e.selected&&e!==n)e.selected=e.options.selected=!1,r.options.data[$t(e,r.data)]=e.options,e.setState(""),e.firePointEvent("unselect")})})},onMouseOver:function(e){var t=this.series,n=t.chart,r=n.tooltip,i=n.hoverPoint;if(i&&i!==this)i.onMouseOut();this.firePointEvent("mouseOver");r&&(!r.shared||t.noSharedTooltip)&&r.refresh(this,e);this.setState("hover");n.hoverPoint=this},onMouseOut:function(){var e=this.series.chart,t=e.hoverPoints;this.firePointEvent("mouseOut");if(!t||$t(this,t)===-1)this.setState(),e.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var e=t(this.series.options.point,this.options).events,n;this.events=e;for(n in e)Yt(this,n,e[n]);this.hasImportedEvents=!0}},setState:function(n,r){var i=this.plotX,s=this.plotY,o=this.series,u=o.options.states,a=sn[o.type].marker&&o.options.marker,f=a&&!a.enabled,l=a&&a.states[n],c=l&&l.enabled===!1,h=o.stateMarkerGraphic,p=this.marker||{},d=o.chart,v=o.halo,m,n=n||"";m=this.pointAttr[n]||o.pointAttr[n];if(!(n===this.state&&!r||this.selected&&n!=="select"||u[n]&&u[n].enabled===!1||n&&(c||f&&l.enabled===!1)||n&&p.states&&p.states[n]&&p.states[n].enabled===!1)){if(this.graphic)a=a&&this.graphic.symbolName&&m.r,this.graphic.attr(t(m,a?{x:i-a,y:s-a,width:2*a,height:2*a}:{})),h&&h.hide();else{if(n&&l)if(a=l.radius,p=p.symbol||o.symbol,h&&h.currentSymbol!==p&&(h=h.destroy()),h)h[r?"animate":"attr"]({x:i-a,y:s-a});else if(p)o.stateMarkerGraphic=h=d.renderer.symbol(p,i-a,s-a,2*a,2*a).attr(m).add(o.markerGroup),h.currentSymbol=p;if(h)h[n&&d.isInsidePlot(i,s,d.inverted)?"show":"hide"]()}if((i=u[n]&&u[n].halo)&&i.size){if(!v)o.halo=v=d.renderer.path().add(o.seriesGroup);v.attr(e({fill:fn(this.color||o.color).setOpacity(i.opacity).get()},i.attributes))[r?"animate":"attr"]({d:this.haloPath(i.size)})}else v&&v.attr({d:[]});this.state=n}},haloPath:function(e){var t=this.series,n=t.chart,r=t.getPlotBox(),i=n.inverted;return n.renderer.symbols.circle(r.translateX+(i?t.yAxis.len-this.plotY:this.plotX)-e,r.translateY+(i?t.xAxis.len-this.plotX:this.plotY)-e,e*2,e*2)}});e(xn.prototype,{onMouseOver:function(){var e=this.chart,t=e.hoverSeries;if(t&&t!==this)t.onMouseOut();this.options.events.mouseOver&&en(this,"mouseOver");this.setState("hover");e.hoverSeries=this},onMouseOut:function(){var e=this.options,t=this.chart,n=t.tooltip,r=t.hoverPoint;if(r)r.onMouseOut();this&&e.events.mouseOut&&en(this,"mouseOut");n&&!e.stickyTracking&&(!n.shared||this.noSharedTooltip)&&n.hide();this.setState();t.hoverSeries=null},setState:function(e){var t=this.options,n=this.graph,r=this.graphNeg,i=t.states,t=t.lineWidth,e=e||"";if(this.state!==e)this.state=e,i[e]&&i[e].enabled===!1||(e&&(t=i[e].lineWidth||t+(i[e].lineWidthPlus||0)),n&&!n.dashstyle&&(e={"stroke-width":t},n.attr(e),r&&r.attr(e)))},setVisible:function(e,t){var n=this,r=n.chart,i=n.legendItem,s,o=r.options.chart.ignoreHiddenSeries,u=n.visible;s=(n.visible=e=n.userOptions.visible=e===F?!u:e)?"show":"hide";Jt(["group","dataLabelsGroup","markerGroup","tracker"],function(e){if(n[e])n[e][s]()});if(r.hoverSeries===n)n.onMouseOut();i&&r.legend.colorizeItem(n,e);n.isDirty=!0;n.options.stacking&&Jt(r.series,function(e){if(e.options.stacking&&e.visible)e.isDirty=!0});Jt(n.linkedSeries,function(t){t.setVisible(e,!1)});if(o)r.isDirtyBox=!0;t!==!1&&r.redraw();en(n,s)},setTooltipPoints:function(e){var t=[],n,r,i=this.xAxis,s=i&&i.getExtremes(),o=i?i.tooltipLen||i.len:this.chart.plotSizeX,u,a,f=[];if(!(this.options.enableMouseTracking===!1||this.singularTooltips)){if(e)this.tooltipPoints=null;Jt(this.segments||this.points,function(e){t=t.concat(e)});i&&i.reversed&&(t=t.reverse());this.orderTooltipPoints&&this.orderTooltipPoints(t);e=t.length;for(a=0;a<e;a++)if(i=t[a],n=i.x,n>=s.min&&n<=s.max){u=t[a+1];n=r===F?0:r+1;for(r=t[a+1]?V(X(0,z((i.clientX+(u?u.wrappedClientX||u.clientX:o))/2)),o):o;n>=0&&n<=r;)f[n++]=i}this.tooltipPoints=f}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(e){this.selected=e=e===F?!this.selected:e;if(this.checkbox)this.checkbox.checked=e;en(this,e?"select":"unselect")},drawTracker:Cn.drawTrackerGraph});b(xn.prototype,"init",function(e){var t;e.apply(this,Array.prototype.slice.call(arguments,1));(t=this.xAxis)&&t.options.ordinal&&Yt(this,"updatedData",function(){delete t.ordinalIndex})});b(D.prototype,"getTimeTicks",function(e,t,n,r,i,s,o,u){var a=0,f=0,c,h={},p,d,v,m=[],g=-Number.MAX_VALUE,y=this.options.tickPixelInterval;if(!this.options.ordinal||!s||s.length<3||n===F)return e.call(this,t,n,r,i);for(d=s.length;f<d;f++){v=f&&s[f-1]>r;s[f]<n&&(a=f);if(f===d-1||s[f+1]-s[f]>o*5||v){if(s[f]>g){for(c=e.call(this,t,s[a],s[f],i);c.length&&c[0]<=g;)c.shift();c.length&&(g=c[c.length-1]);m=m.concat(c)}a=f+1}if(v)break}e=c.info;if(u&&e.unitRange<=yt.hour){f=m.length-1;for(a=1;a<f;a++)(new kt(m[a]-At))[Dt]()!==(new kt(m[a-1]-At))[Dt]()&&(h[m[a]]="day",p=!0);p&&(h[m[0]]="day");e.higherRanks=h}m.info=e;if(u&&l(y)){var u=e=m.length,f=[],b;for(p=[];u--;)a=this.translate(m[u]),b&&(p[u]=b-a),f[u]=b=a;p.sort();p=p[z(p.length/2)];p<y*.6&&(p=null);u=m[e-1]>r?e-1:e;for(b=void 0;u--;)a=f[u],r=b-a,b&&r<y*.8&&(p===null||r<p*.8)?(h[m[u]]&&!h[m[u+1]]?(r=u+1,b=a):r=u,m.splice(r,1)):b=a}return m});e(D.prototype,{beforeSetTickPositions:function(){var e,t=[],n=!1,r,i=this.getExtremes(),s=i.min,i=i.max,o;if(this.options.ordinal){Jt(this.series,function(n,r){if(n.visible!==!1&&n.takeOrdinalPosition!==!1&&(t=t.concat(n.processedXData),e=t.length,t.sort(function(e,t){return e-t}),e))for(r=e-1;r--;)t[r]===t[r+1]&&t.splice(r,1)});e=t.length;if(e>2){r=t[1]-t[0];for(o=e-1;o--&&!n;)t[o+1]-t[o]!==r&&(n=!0);if(!this.options.keepOrdinalPadding&&(t[0]-s>r||i-t[t.length-1]>r))n=!0}n?(this.ordinalPositions=t,n=this.val2lin(X(s,t[0]),!0),r=X(this.val2lin(V(i,t[t.length-1]),!0),1),this.ordinalSlope=i=(i-s)/(r-n),this.ordinalOffset=s-n*i):this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=F}this.groupIntervalFactor=null},val2lin:function(e,t){var n=this.ordinalPositions;if(n){var r=n.length,i,s;for(i=r;i--;)if(n[i]===e){s=i;break}for(i=r-1;i--;)if(e>n[i]||i===0){n=(e-n[i])/(n[i+1]-n[i]);s=i+n;break}return t?s:this.ordinalSlope*(s||0)+this.ordinalOffset}else return e},lin2val:function(e,t){var n=this.ordinalPositions;if(n){var r=this.ordinalSlope,i=this.ordinalOffset,s=n.length-1,o,u;if(t)e<0?e=n[0]:e>s?e=n[s]:(s=z(e),u=e-s);else for(;s--;)if(o=r*s+i,e>=o){r=r*(s+1)+i;u=(e-o)/(r-o);break}return u!==F&&n[s]!==F?n[s]+(u?u*(n[s+1]-n[s]):0):e}else return e},getExtendedPositions:function(){var e=this.chart,t=this.series[0].currentDataGrouping,n=this.ordinalIndex,r=t?t.count+t.unitName:"raw",i=this.getExtremes(),s,o;if(!n)n=this.ordinalIndex={};if(!n[r])s={series:[],getExtremes:function(){return{min:i.dataMin,max:i.dataMax}},options:{ordinal:!0},val2lin:D.prototype.val2lin},Jt(this.series,function(n){o={xAxis:s,xData:n.xData,chart:e,destroyGroupedData:wt};o.options={dataGrouping:t?{enabled:!0,forced:!0,approximation:"open",units:[[t.unitName,[t.count]]]}:{enabled:!1}};n.processData.apply(o);s.series.push(o)}),this.beforeSetTickPositions.apply(s),n[r]=s.ordinalPositions;return n[r]},getGroupIntervalFactor:function(e,t,n){var r=0,n=n.processedXData,i=n.length,s=[],o=this.groupIntervalFactor;if(!o){for(;r<i-1;r++)s[r]=n[r+1]-n[r];s.sort(function(e,t){return e-t});r=s[z(i/2)];e=X(e,n[0]);t=V(t,n[i-1]);this.groupIntervalFactor=o=i*r/(t-e)}return o},postProcessTickInterval:function(e){var t=this.ordinalSlope;return t?e/(t/this.closestPointRange):e}});b(P.prototype,"pan",function(e,t){var n=this.xAxis[0],r=t.chartX,i=!1;if(n.options.ordinal&&n.series.length){var s=this.mouseDownX,o=n.getExtremes(),u=o.dataMax,a=o.min,f=o.max,l=this.hoverPoints,c=n.closestPointRange,s=(s-r)/(n.translationSlope*(n.ordinalSlope||c)),h={ordinalPositions:n.getExtendedPositions()},c=n.lin2val,p=n.val2lin,v;if(h.ordinalPositions){if($(s)>1)l&&Jt(l,function(e){e.setState()}),s<0?(l=h,v=n.ordinalPositions?n:h):(l=n.ordinalPositions?n:h,v=h),h=v.ordinalPositions,u>h[h.length-1]&&h.push(u),this.fixedRange=f-a,s=n.toFixedRange(null,null,c.apply(l,[p.apply(l,[a,!0])+s,!0]),c.apply(v,[p.apply(v,[f,!0])+s,!0])),s.min>=V(o.dataMin,a)&&s.max<=X(u,f)&&n.setExtremes(s.min,s.max,!0,!1,{trigger:"pan"}),this.mouseDownX=r,d(this.container,{cursor:"move"})}else i=!0}else i=!0;i&&e.apply(this,Array.prototype.slice.call(arguments,1))});b(xn.prototype,"getSegments",function(e){var t,n=this.options.gapSize,r=this.xAxis;e.apply(this,Array.prototype.slice.call(arguments,1));if(n)t=this.segments,Jt(t,function(e,i){for(var s=e.length-1;s--;)e[s+1].x-e[s].x>r.closestPointRange*n&&t.splice(i+1,0,e.splice(s+1,e.length-s))})});var kn=xn.prototype,zt=dn.prototype,Ln=kn.processData,An=kn.generatePoints,On=kn.destroy,Mn=zt.tooltipHeaderFormatter,_n={approximation:"average",groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%A, %b %e, %H:%M:%S.%L","%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],second:["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],minute:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],hour:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],day:["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],week:["Week from %A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],month:["%B %Y","%B","-%B %Y"],year:["%Y","%Y","-%Y"]}},Dn={line:{},spline:{},area:{},areaspline:{},column:{approximation:"sum",groupPixelWidth:10},arearange:{approximation:"range"},areasplinerange:{approximation:"range"},columnrange:{approximation:"range",groupPixelWidth:10},candlestick:{approximation:"ohlc",groupPixelWidth:10},ohlc:{approximation:"ohlc",groupPixelWidth:5}},Pn=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]],Hn={sum:function(e){var t=e.length,n;if(!t&&e.hasNulls)n=null;else if(t)for(n=0;t--;)n+=e[t];return n},average:function(e){var t=e.length,e=Hn.sum(e);typeof e==="number"&&t&&(e/=t);return e},open:function(e){return e.length?e[0]:e.hasNulls?null:F},high:function(e){return e.length?N(e):e.hasNulls?null:F},low:function(e){return e.length?T(e):e.hasNulls?null:F},close:function(e){return e.length?e[e.length-1]:e.hasNulls?null:F},ohlc:function(e,t,n,r){e=Hn.open(e);t=Hn.high(t);n=Hn.low(n);r=Hn.close(r);if(typeof e==="number"||typeof t==="number"||typeof n==="number"||typeof r==="number")return[e,t,n,r]},range:function(e,t){e=Hn.low(e);t=Hn.high(t);if(typeof e==="number"||typeof t==="number")return[e,t]}};kn.groupData=function(e,t,n,r){var i=this.data,s=this.options.data,o=[],u=[],a=e.length,f,l,c=!!t,h=[[],[],[],[]],r=typeof r==="function"?r:Hn[r],p=this.pointArrayMap,d=p&&p.length,v;for(v=0;v<=a;v++)if(e[v]>=n[0])break;for(;v<=a;v++){for(;n[1]!==F&&e[v]>=n[1]||v===a;)if(f=n.shift(),l=r.apply(0,h),l!==F&&(o.push(f),u.push(l)),h[0]=[],h[1]=[],h[2]=[],h[3]=[],v===a)break;if(v===a)break;if(p){f=this.cropStart+v;f=i&&i[f]||this.pointClass.prototype.applyOptions.apply({series:this},[s[f]]);var m;for(l=0;l<d;l++)if(m=f[p[l]],typeof m==="number")h[l].push(m);else if(m===null)h[l].hasNulls=!0}else if(f=c?t[v]:null,typeof f==="number")h[0].push(f);else if(f===null)h[0].hasNulls=!0}return[o,u]};kn.processData=function(){var e=this.chart,t=this.options,n=t.dataGrouping,r=this.allowDG!==!1&&n&&p(n.enabled,e.options._stock),i;this.forceCrop=r;this.groupPixelWidth=null;this.hasProcessed=!0;if(Ln.apply(this,arguments)!==!1&&r){this.destroyGroupedData();var s=this.processedXData,o=this.processedYData,u=e.plotSizeX,e=this.xAxis,a=e.options.ordinal,f=this.groupPixelWidth=e.getGroupPixelWidth&&e.getGroupPixelWidth(),r=this.pointRange;if(f){i=!0;this.points=null;var c=e.getExtremes(),r=c.min,c=c.max,a=a&&e.getGroupIntervalFactor(r,c,this)||1,u=f*(c-r)/u*a,f=e.getTimeTicks(e.normalizeTimeTickInterval(u,n.units||Pn),r,c,e.options.startOfWeek,s,this.closestPointRange),o=kn.groupData.apply(this,[s,o,f,n.approximation]),s=o[0],o=o[1];if(n.smoothed){n=s.length-1;for(s[n]=c;n--&&n>0;)s[n]+=u/2;s[0]=r}this.currentDataGrouping=f.info;if(t.pointRange===null)this.pointRange=f.info.totalRange;this.closestPointRange=f.info.totalRange;if(l(s[0])&&s[0]<e.dataMin)e.dataMin=s[0];this.processedXData=s;this.processedYData=o}else this.currentDataGrouping=null,this.pointRange=r;this.hasGroupedData=i}};kn.destroyGroupedData=function(){var e=this.groupedData;Jt(e||[],function(t,n){t&&(e[n]=t.destroy?t.destroy():null)});this.groupedData=null};kn.generatePoints=function(){An.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};zt.tooltipHeaderFormatter=function(e){var t=e.series,n=t.tooltipOptions,r=t.options.dataGrouping,i=n.xDateFormat,s,u=t.xAxis,a;if(u&&u.options.type==="datetime"&&r&&o(e.key)){t=t.currentDataGrouping;r=r.dateTimeLabelFormats;if(t)u=r[t.unitName],t.count===1?i=u[0]:(i=u[1],s=u[2]);else if(!i&&r)for(a in yt)if(yt[a]>=u.closestPointRange||yt[a]<=yt.day&&e.key%yt[a]>0){i=r[a][0];break}i=vt(i,e.key);s&&(i+=vt(s,e.key+t.totalRange-1));e=n.headerFormat.replace("{point.key}",i)}else e=Mn.call(this,e);return e};kn.destroy=function(){for(var e=this.groupedData||[],t=e.length;t--;)e[t]&&e[t].destroy();On.apply(this)};b(kn,"setOptions",function(e,n){var r=e.call(this,n),i=this.type,s=this.chart.options.plotOptions,o=sn[i].dataGrouping;if(Dn[i])o||(o=t(_n,Dn[i])),r.dataGrouping=t(o,s.series&&s.series.dataGrouping,s[i].dataGrouping,n.dataGrouping);if(this.chart.options._stock)this.requireSorting=!0;return r});b(D.prototype,"setScale",function(e){e.call(this);Jt(this.series,function(e){e.hasProcessed=!1})});D.prototype.getGroupPixelWidth=function(){var e=this.series,t=e.length,n,r=0,i=!1,s;for(n=t;n--;)(s=e[n].options.dataGrouping)&&(r=X(r,s.groupPixelWidth));for(n=t;n--;)if((s=e[n].options.dataGrouping)&&e[n].hasProcessed)if(t=(e[n].processedXData||e[n].data).length,e[n].groupPixelWidth||t>this.chart.plotSizeX/r||t&&s.forced)i=!0;return i?r:0};sn.ohlc=t(sn.column,{lineWidth:1,tooltip:{pointFormat:'<span style="color:{series.color}">●</span> <b> {series.name}</b><br/>Open: {point.open}<br/>High: {point.high}<br/>Low: {point.low}<br/>Close: {point.close}<br/>'},states:{hover:{lineWidth:3}},threshold:null});zt=m(Rt.column,{type:"ohlc",pointArrayMap:["open","high","low","close"],toYData:function(e){return[e.open,e.high,e.low,e.close]},pointValKey:"high",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"},upColorProp:"stroke",getAttribs:function(){Rt.column.prototype.getAttribs.apply(this,arguments);var e=this.options,n=e.states,e=e.upColor||this.color,r=t(this.pointAttr),i=this.upColorProp;r[""][i]=e;r.hover[i]=n.hover.upColor||e;r.select[i]=n.select.upColor||e;Jt(this.points,function(e){if(e.open<e.close)e.pointAttr=r})},translate:function(){var e=this.yAxis;Rt.column.prototype.translate.apply(this);Jt(this.points,function(t){if(t.open!==null)t.plotOpen=e.translate(t.open,0,1,0,1);if(t.close!==null)t.plotClose=e.translate(t.close,0,1,0,1)})},drawPoints:function(){var e=this,t=e.chart,n,r,i,s,o,u,a,f;Jt(e.points,function(l){if(l.plotY!==F)a=l.graphic,n=l.pointAttr[l.selected?"selected":""]||e.pointAttr[""],s=n["stroke-width"]%2/2,f=U(l.plotX)-s,o=U(l.shapeArgs.width/2),u=["M",f,U(l.yBottom),"L",f,U(l.plotY)],l.open!==null&&(r=U(l.plotOpen)+s,u.push("M",f,r,"L",f-o,r)),l.close!==null&&(i=U(l.plotClose)+s,u.push("M",f,i,"L",f+o,i)),a?a.animate({d:u}):l.graphic=t.renderer.path(u).attr(n).add(e.group)})},animate:null});Rt.ohlc=zt;sn.candlestick=t(sn.column,{lineColor:"black",lineWidth:1,states:{hover:{lineWidth:2}},tooltip:sn.ohlc.tooltip,threshold:null,upColor:"white"});zt=m(zt,{type:"candlestick",pointAttrToOptions:{fill:"color",stroke:"lineColor","stroke-width":"lineWidth"},upColorProp:"fill",getAttribs:function(){Rt.ohlc.prototype.getAttribs.apply(this,arguments);var e=this.options,t=e.states,n=e.upLineColor||e.lineColor,r=t.hover.upLineColor||n,i=t.select.upLineColor||n;Jt(this.points,function(e){if(e.open<e.close)e.pointAttr[""].stroke=n,e.pointAttr.hover.stroke=r,e.pointAttr.select.stroke=i})},drawPoints:function(){var e=this,t=e.chart,n,r=e.pointAttr[""],i,s,o,u,a,f,l,c,h,p,d;Jt(e.points,function(v){h=v.graphic;if(v.plotY!==F)n=v.pointAttr[v.selected?"selected":""]||r,l=n["stroke-width"]%2/2,c=U(v.plotX)-l,i=v.plotOpen,s=v.plotClose,o=R.min(i,s),u=R.max(i,s),d=U(v.shapeArgs.width/2),a=U(o)!==U(v.plotY),f=u!==v.yBottom,o=U(o)+l,u=U(u)+l,p=["M",c-d,u,"L",c-d,o,"L",c+d,o,"L",c+d,u,"Z","M",c,o,"L",c,a?U(v.plotY):o,"M",c,u,"L",c,f?U(v.yBottom):u],h?h.animate({d:p}):v.graphic=t.renderer.path(p).attr(n).add(e.group).shadow(e.options.shadow)})}});Rt.candlestick=zt;var Bn=ln.prototype.symbols;sn.flags=t(sn.column,{fillColor:"white",lineWidth:1,pointRange:0,shape:"flag",stackDistance:12,states:{hover:{lineColor:"black",fillColor:"#FCFFC5"}},style:{fontSize:"11px",fontWeight:"bold",textAlign:"center"},tooltip:{pointFormat:"{point.text}<br/>"},threshold:null,y:-30});Rt.flags=m(Rt.column,{type:"flags",sorted:!1,noSharedTooltip:!0,allowDG:!1,takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:xn.prototype.init,pointAttrToOptions:{fill:"fillColor",stroke:"color","stroke-width":"lineWidth",r:"radius"},translate:function(){Rt.column.prototype.translate.apply(this);var e=this.chart,t=this.points,n=t.length-1,r,i,s=this.options.onSeries,s=(r=s&&e.get(s))&&r.options.step,o=r&&r.points,u=o&&o.length,a=this.xAxis,f=a.getExtremes(),l,c,h;if(r&&r.visible&&u){r=r.currentDataGrouping;c=o[u-1].x+(r?r.totalRange:0);for(t.sort(function(e,t){return e.x-t.x});u--&&t[n];)if(r=t[n],l=o[u],l.x<=r.x&&l.plotY!==F){if(r.x<=c)r.plotY=l.plotY,l.x<r.x&&!s&&(h=o[u+1])&&h.plotY!==F&&(r.plotY+=(r.x-l.x)/(h.x-l.x)*(h.plotY-l.plotY));n--;u++;if(n<0)break}}Jt(t,function(n,r){if(n.plotY===F)n.x>=f.min&&n.x<=f.max?n.plotY=e.chartHeight-a.bottom-(a.opposite?a.height:0)+a.offset-e.plotTop:n.shapeArgs={};if((i=t[r-1])&&i.plotX===n.plotX){if(i.stackIndex===F)i.stackIndex=0;n.stackIndex=i.stackIndex+1}})},drawPoints:function(){var e,n=this.pointAttr[""],r=this.points,i=this.chart.renderer,s,o,u=this.options,a=u.y,f,l,c,h,p=u.lineWidth%2/2,d,v;for(l=r.length;l--;)if(c=r[l],e=c.plotX>this.xAxis.len,s=c.plotX+(e?p:-p),h=c.stackIndex,f=c.options.shape||u.shape,o=c.plotY,o!==F&&(o=c.plotY+a+p-(h!==F&&h*u.stackDistance)),d=h?F:c.plotX+p,v=h?F:c.plotY,h=c.graphic,o!==F&&s>=0&&!e)e=c.pointAttr[c.selected?"select":""]||n,h?h.attr({x:s,y:o,r:e.r,anchorX:d,anchorY:v}):c.graphic=i.label(c.options.title||u.title||"A",s,o,f,d,v,u.useHTML).css(t(u.style,c.style)).attr(e).attr({align:f==="flag"?"left":"center",width:u.width,height:u.height}).add(this.markerGroup).shadow(u.shadow),c.tooltipPos=[s,o];else if(h)c.graphic=h.destroy()},drawTracker:function(){var e=this.points;Cn.drawTrackerPoint.apply(this);Jt(e,function(t){var n=t.graphic;n&&Yt(n.element,"mouseover",function(){if(t.stackIndex>0&&!t.raised)t._y=n.y,n.attr({y:t._y-8}),t.raised=!0;Jt(e,function(e){if(e!==t&&e.raised&&e.graphic)e.graphic.attr({y:e._y}),e.raised=!1})})})},animate:wt});Bn.flag=function(e,t,n,r,i){var s=i&&i.anchorX||e,i=i&&i.anchorY||t;return["M",s,i,"L",e,t+r,e,t,e+n,t,e+n,t+r,e,t+r,"M",s,i,"Z"]};Jt(["circle","square"],function(e){Bn[e+"pin"]=function(t,n,r,i,s){var o=s&&s.anchorX,s=s&&s.anchorY,t=Bn[e](t,n,r,i);o&&s&&t.push("M",o,n>s?n:n+i,"L",o,s);return t}});ft===Ut.VMLRenderer&&Jt(["flag","circlepin","squarepin"],function(e){cn.prototype.symbols[e]=Bn[e]});var zt=[].concat(Pn),jn=function(e){return Math[e].apply(0,Kt(arguments,function(e){return typeof e==="number"}))};zt[4]=["day",[1,2,3,4]];zt[5]=["week",[1,2,3]];e(dt,{navigator:{handles:{backgroundColor:"#ebe7e8",borderColor:"#b2b1b6"},height:40,margin:25,maskFill:"rgba(128,179,236,0.3)",maskInside:!0,outlineColor:"#b2b1b6",outlineWidth:1,series:{type:Rt.areaspline===F?"line":"areaspline",color:"#4572A7",compare:null,fillOpacity:.05,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:zt},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",lineColor:"#4572A7",lineWidth:1,marker:{enabled:!1},pointRange:0,shadow:!1,threshold:null},xAxis:{tickWidth:0,lineWidth:0,gridLineColor:"#EEE",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#888"},x:3,y:-4},crosshair:!1},yAxis:{gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickWidth:0}},scrollbar:{height:it?20:14,barBackgroundColor:"#bfc8d1",barBorderRadius:0,barBorderWidth:1,barBorderColor:"#bfc8d1",buttonArrowColor:"#666",buttonBackgroundColor:"#ebe7e8",buttonBorderColor:"#bbb",buttonBorderRadius:0,buttonBorderWidth:1,minWidth:6,rifleColor:"#666",trackBackgroundColor:"#eeeeee",trackBorderColor:"#eeeeee",trackBorderWidth:1,liveRedraw:ot&&!it}});B.prototype={drawHandle:function(e,t){var n=this.chart,r=n.renderer,i=this.elementsToDestroy,s=this.handles,o=this.navigatorOptions.handles,o={fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":1},u;this.rendered||(s[t]=r.g("navigator-handle-"+["left","right"][t]).css({cursor:"e-resize"}).attr({zIndex:4-t}).add(),u=r.rect(-4.5,0,9,16,0,1).attr(o).add(s[t]),i.push(u),u=r.path(["M",-1.5,4,"L",-1.5,12,"M",.5,4,"L",.5,12]).attr(o).add(s[t]),i.push(u));s[t][n.isResizing?"animate":"attr"]({translateX:this.scrollerLeft+this.scrollbarHeight+parseInt(e,10),translateY:this.top+this.height/2-8})},drawScrollbarButton:function(e){var t=this.chart.renderer,n=this.elementsToDestroy,r=this.scrollbarButtons,i=this.scrollbarHeight,s=this.scrollbarOptions,o;this.rendered||(r[e]=t.g().add(this.scrollbarGroup),o=t.rect(-.5,-.5,i+1,i+1,s.buttonBorderRadius,s.buttonBorderWidth).attr({stroke:s.buttonBorderColor,"stroke-width":s.buttonBorderWidth,fill:s.buttonBackgroundColor}).add(r[e]),n.push(o),o=t.path(["M",i/2+(e?-1:1),i/2-3,"L",i/2+(e?-1:1),i/2+3,i/2+(e?2:-2),i/2]).attr({fill:s.buttonArrowColor}).add(r[e]),n.push(o));e&&r[e].attr({translateX:this.scrollerWidth-i})},render:function(e,t,n,r){var i=this.chart,s=i.renderer,o,u,a,f,l=this.scrollbarGroup,c=this.navigatorGroup,h=this.scrollbar,c=this.xAxis,d=this.scrollbarTrack,v=this.scrollbarHeight,m=this.scrollbarEnabled,g=this.navigatorOptions,y=this.scrollbarOptions,b=y.minWidth,w=this.height,E=this.top,S=this.navigatorEnabled,x=g.outlineWidth,T=x/2,N=0,C=this.outlineHeight,k=y.barBorderRadius,L=y.barBorderWidth,A=E+T,O;if(!isNaN(e)){this.navigatorLeft=o=p(c.left,i.plotLeft+v);this.navigatorWidth=u=p(c.len,i.plotWidth-2*v);this.scrollerLeft=a=o-v;this.scrollerWidth=f=f=u+2*v;c.getExtremes&&(O=this.getUnionExtremes(!0))&&(O.dataMin!==c.min||O.dataMax!==c.max)&&c.setExtremes(O.dataMin,O.dataMax,!0,!1);n=p(n,c.translate(e));r=p(r,c.translate(t));if(isNaN(n)||$(n)===Infinity)n=0,r=f;if(!(c.translate(r,!0)-c.translate(n,!0)<i.xAxis[0].minRange)){this.zoomedMax=V(X(n,r),u);this.zoomedMin=X(this.fixedWidth?this.zoomedMax-this.fixedWidth:V(n,r),0);this.range=this.zoomedMax-this.zoomedMin;n=U(this.zoomedMax);t=U(this.zoomedMin);e=n-t;if(!this.rendered){if(S){this.navigatorGroup=c=s.g("navigator").attr({zIndex:3}).add();this.leftShade=s.rect().attr({fill:g.maskFill}).add(c);if(!g.maskInside)this.rightShade=s.rect().attr({fill:g.maskFill}).add(c);this.outline=s.path().attr({"stroke-width":x,stroke:g.outlineColor}).add(c)}if(m)this.scrollbarGroup=l=s.g("scrollbar").add(),h=y.trackBorderWidth,this.scrollbarTrack=d=s.rect().attr({x:0,y:-h%2/2,fill:y.trackBackgroundColor,stroke:y.trackBorderColor,"stroke-width":h,r:y.trackBorderRadius||0,height:v}).add(l),this.scrollbar=h=s.rect().attr({y:-L%2/2,height:v,fill:y.barBackgroundColor,stroke:y.barBorderColor,"stroke-width":L,r:k}).add(l),this.scrollbarRifles=s.path().attr({stroke:y.rifleColor,"stroke-width":1}).add(l)}i=i.isResizing?"animate":"attr";if(S){this.leftShade[i](g.maskInside?{x:o+t,y:E,width:n-t,height:w}:{x:o,y:E,width:t,height:w});if(this.rightShade)this.rightShade[i]({x:o+n,y:E,width:u-n,height:w});this.outline[i]({d:["M",a,A,"L",o+t+T,A,o+t+T,A+C,"L",o+n-T,A+C,"L",o+n-T,A,a+f,A].concat(g.maskInside?["M",o+t+T,A,"L",o+n-T,A]:[])});this.drawHandle(t+T,0);this.drawHandle(n+T,1)}if(m&&l)this.drawScrollbarButton(0),this.drawScrollbarButton(1),l[i]({translateX:a,translateY:U(A+w)}),d[i]({width:f}),o=v+t,u=e-L,u<b&&(N=(b-u)/2,u=b,o-=N),this.scrollbarPad=N,h[i]({x:z(o)+L%2/2,width:u}),b=v+t+e/2-.5,this.scrollbarRifles.attr({visibility:e>12?"visible":"hidden"})[i]({d:["M",b-3,v/4,"L",b-3,2*v/3,"M",b,v/4,"L",b,2*v/3,"M",b+3,v/4,"L",b+3,2*v/3]});this.scrollbarPad=N;this.rendered=!0}}},addEvents:function(){var e=this.chart.container,t=this.mouseDownHandler,n=this.mouseMoveHandler,r=this.mouseUpHandler,i;i=[[e,"mousedown",t],[e,"mousemove",n],[document,"mouseup",r]];lt&&i.push([e,"touchstart",t],[e,"touchmove",n],[document,"touchend",r]);Jt(i,function(e){Yt.apply(null,e)});this._events=i},removeEvents:function(){Jt(this._events,function(e){Zt.apply(null,e)});this._events=F;this.navigatorEnabled&&this.baseSeries&&Zt(this.baseSeries,"updatedData",this.updatedDataHandler)},init:function(){var e=this,n=e.chart,r,i,s=e.scrollbarHeight,o=e.navigatorOptions,u=e.height,a=e.top,f,l,c=document.body.style,h,d=e.baseSeries;e.mouseDownHandler=function(t){var t=n.pointer.normalize(t),i=e.zoomedMin,s=e.zoomedMax,o=e.top,a=e.scrollbarHeight,l=e.scrollerLeft,p=e.scrollerWidth,d=e.navigatorLeft,v=e.navigatorWidth,m=e.scrollbarPad,g=e.range,y=t.chartX,b=t.chartY,t=n.xAxis[0],w,E=it?10:7;if(b>o&&b<o+u+a)if((o=!e.scrollbarEnabled||b<o+u)&&R.abs(y-i-d)<E)e.grabbedLeft=!0,e.otherHandlePos=s,e.fixedExtreme=t.max,n.fixedRange=null;else if(o&&R.abs(y-s-d)<E)e.grabbedRight=!0,e.otherHandlePos=i,e.fixedExtreme=t.min,n.fixedRange=null;else if(y>d+i-m&&y<d+s+m){e.grabbedCenter=y;e.fixedWidth=g;if(n.renderer.isSVG)h=c.cursor,c.cursor="ew-resize";f=y-i}else if(y>l&&y<l+p){s=o?y-d-g/2:y<d?i-g*.2:y>l+p-a?i+g*.2:y<d+i?i-g:s;if(s<0)s=0;else if(s+g>=v)s=v-g,w=r.dataMax;if(s!==i)e.fixedWidth=g,i=r.toFixedRange(s,s+g,null,w),t.setExtremes(i.min,i.max,!0,!1,{trigger:"navigator"})}};e.mouseMoveHandler=function(t){var r=e.scrollbarHeight,i=e.navigatorLeft,s=e.navigatorWidth,o=e.scrollerLeft,u=e.scrollerWidth,a=e.range,c;if(t.pageX!==0)t=n.pointer.normalize(t),c=t.chartX,c<i?c=i:c>o+u-r&&(c=o+u-r),e.grabbedLeft?(l=!0,e.render(0,0,c-i,e.otherHandlePos)):e.grabbedRight?(l=!0,e.render(0,0,e.otherHandlePos,c-i)):e.grabbedCenter&&(l=!0,c<f?c=f:c>s+f-a&&(c=s+f-a),e.render(0,0,c-f,c-f+a)),l&&e.scrollbarOptions.liveRedraw&&setTimeout(function(){e.mouseUpHandler(t)},0)};e.mouseUpHandler=function(t){var i,s;if(l){if(e.zoomedMin===e.otherHandlePos)i=e.fixedExtreme;else if(e.zoomedMax===e.otherHandlePos)s=e.fixedExtreme;i=r.toFixedRange(e.zoomedMin,e.zoomedMax,i,s);n.xAxis[0].setExtremes(i.min,i.max,!0,!1,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:t})}if(t.type!=="mousemove")e.grabbedLeft=e.grabbedRight=e.grabbedCenter=e.fixedWidth=e.fixedExtreme=e.otherHandlePos=l=f=null,c.cursor=h||""};var v=n.xAxis.length,m=n.yAxis.length;n.extraBottomMargin=e.outlineHeight+o.margin;e.navigatorEnabled?(e.xAxis=r=new D(n,t({ordinal:d&&d.xAxis.options.ordinal},o.xAxis,{id:"navigator-x-axis",isX:!0,type:"datetime",index:v,height:u,offset:0,offsetLeft:s,offsetRight:-s,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1})),e.yAxis=i=new D(n,t(o.yAxis,{id:"navigator-y-axis",alignTicks:!1,height:u,offset:0,index:m,zoomEnabled:!1})),d||o.series.data?e.addBaseSeries():n.series.length===0&&b(n,"redraw",function(t,r){if(n.series.length>0&&!e.series)e.setBaseSeries(),n.redraw=t;t.call(n,r)})):e.xAxis=r={translate:function(e,t){var r=n.xAxis[0],i=r.getExtremes(),o=n.plotWidth-2*s,u=jn("min",r.options.min,i.dataMin),r=jn("max",r.options.max,i.dataMax)-u;return t?e*r/o+u:o*(e-u)/r},toFixedRange:D.prototype.toFixedRange};b(n,"getMargins",function(t){var n=this.legend,s=n.options;t.call(this);e.top=a=e.navigatorOptions.top||this.chartHeight-e.height-e.scrollbarHeight-this.spacing[2]-(s.verticalAlign==="bottom"&&s.enabled&&!s.floating?n.legendHeight+p(s.margin,10):0);if(r&&i)r.options.top=i.options.top=a,r.setAxisSize(),i.setAxisSize()});e.addEvents()},getUnionExtremes:function(e){var t=this.chart.xAxis[0],n=this.xAxis,r=n.options,i=t.options;if(!e||t.dataMin!==null)return{dataMin:jn("min",r&&r.min,i.min,t.dataMin,n.dataMin),dataMax:jn("max",r&&r.max,i.max,t.dataMax,n.dataMax)}},setBaseSeries:function(e){var t=this.chart,e=e||t.options.navigator.baseSeries;this.series&&this.series.remove();this.baseSeries=t.series[e]||typeof e==="string"&&t.get(e)||t.series[0];this.xAxis&&this.addBaseSeries()},addBaseSeries:function(){var n=this.baseSeries,r=n?n.options:{},i=r.data,s=this.navigatorOptions.series,o;o=s.data;this.hasNavigatorData=!!o;r=t(r,s,{enableMouseTracking:!1,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",name:"Navigator",showInLegend:!1,isInternal:!0,visible:!0});r.data=o||i;this.series=this.chart.initSeries(r);if(n&&this.navigatorOptions.adaptToUpdatedData!==!1)Yt(n,"updatedData",this.updatedDataHandler),n.userOptions.events=e(n.userOptions.event,{updatedData:this.updatedDataHandler})},updatedDataHandler:function(){var e=this.chart.scroller,t=e.baseSeries,n=t.xAxis,r=n.getExtremes(),i=r.min,s=r.max,o=r.dataMin,r=r.dataMax,u=s-i,a,f,l,c,h,p=e.series;a=p.xData;var d=!!n.setExtremes;f=s>=a[a.length-1]-(this.closestPointRange||0);a=i<=o;if(!e.hasNavigatorData)p.options.pointStart=t.xData[0],p.setData(t.options.data,!1),h=!0;a&&(c=o,l=c+u);f&&(l=r,a||(c=X(l-u,p.xData[0])));d&&(a||f)?isNaN(c)||n.setExtremes(c,l,!0,!1,{trigger:"updatedData"}):(h&&this.chart.redraw(!1),e.render(X(i,o),V(s,r)))},destroy:function(){this.removeEvents();Jt([this.xAxis,this.yAxis,this.leftShade,this.rightShade,this.outline,this.scrollbarTrack,this.scrollbarRifles,this.scrollbarGroup,this.scrollbar],function(e){e&&e.destroy&&e.destroy()});this.xAxis=this.yAxis=this.leftShade=this.rightShade=this.outline=this.scrollbarTrack=this.scrollbarRifles=this.scrollbarGroup=this.scrollbar=null;Jt([this.scrollbarButtons,this.handles,this.elementsToDestroy],function(e){C(e)})}};Ut.Scroller=B;b(D.prototype,"zoom",function(e,t,n){var r=this.chart,i=r.options,s=i.chart.zoomType,o=i.navigator,i=i.rangeSelector,u;if(this.isXAxis&&(o&&o.enabled||i&&i.enabled))if(s==="x")r.resetZoomButton="blocked";else if(s==="y")u=!1;else if(s==="xy")r=this.previousZoom,l(t)?this.previousZoom=[this.min,this.max]:r&&(t=r[0],n=r[1],delete this.previousZoom);return u!==F?u:e.call(this,t,n)});b(P.prototype,"init",function(e,t,n){Yt(this,"beforeRender",function(){var e=this.options;if(e.navigator.enabled||e.scrollbar.enabled)this.scroller=new B(this)});e.call(this,t,n)});b(xn.prototype,"addPoint",function(e,t,n,r,o){var u=this.options.turboThreshold;u&&this.xData.length>u&&i(t)&&!s(t)&&this.chart.scroller&&bt(20,!0);e.call(this,t,n,r,o)});e(dt,{rangeSelector:{buttonTheme:{width:28,height:18,fill:"#f7f7f7",padding:2,r:0,"stroke-width":0,style:{color:"#444",cursor:"pointer",fontWeight:"normal"},zIndex:7,states:{hover:{fill:"#e7e7e7"},select:{fill:"#e7f0f9",style:{color:"black",fontWeight:"bold"}}}},inputPosition:{align:"right"},labelStyle:{color:"#666"}}});dt.lang=t(dt.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"});j.prototype={clickButton:function(e,n){var r=this,i=r.selected,s=r.chart,o=r.buttons,u=r.buttonOptions[e],a=s.xAxis[0],f=s.scroller&&s.scroller.getUnionExtremes()||a||{},l=f.dataMin,c=f.dataMax,h,d=a&&U(V(a.max,p(c,a.max))),v=new kt(d),m=u.type,g=u.count,f=u._range,y;if(!(l===null||c===null||e===r.selected)){if(m==="month"||m==="year")h={month:"Month",year:"FullYear"}[m],v["set"+h](v["get"+h]()-g),h=v.getTime(),l=p(l,Number.MIN_VALUE),isNaN(h)||h<l?(h=l,d=V(h+f,c)):f=d-h;else if(f)h=X(d-f,l),d=V(h+f,c);else if(m==="ytd")if(a){if(c===F)l=Number.MAX_VALUE,c=Number.MIN_VALUE,Jt(s.series,function(e){e=e.xData;l=V(e[0],l);c=X(e[e.length-1],c)}),n=!1;d=new kt(c);y=d.getFullYear();h=y=X(l||0,kt.UTC(y,0,1));d=d.getTime();d=V(c||d,d)}else{Yt(s,"beforeRender",function(){r.clickButton(e)});return}else m==="all"&&a&&(h=l,d=c);o[i]&&o[i].setState(0);o[e]&&o[e].setState(2);s.fixedRange=f;a?a.setExtremes(h,d,p(n,1),0,{trigger:"rangeSelectorButton",rangeSelectorButton:u}):(i=s.options.xAxis,i[0]=t(i[0],{range:f,min:y}));r.setSelected(e)}},setSelected:function(e){this.selected=this.options.selected=e},defaultButtons:[{type:"month",count:1,text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],init:function(e){var t=this,n=e.options.rangeSelector,r=n.buttons||[].concat(t.defaultButtons),i=n.selected,s=t.blurInputs=function(){var e=t.minInput,n=t.maxInput;e&&e.blur&&en(e,"blur");n&&n.blur&&en(n,"blur")};t.chart=e;t.options=n;t.buttons=[];e.extraTopMargin=35;t.buttonOptions=r;Yt(e.container,"mousedown",s);Yt(e,"resize",s);Jt(r,t.computeButtonRange);i!==F&&r[i]&&this.clickButton(i,!1);Yt(e,"load",function(){Yt(e.xAxis[0],"afterSetExtremes",function(){t.updateButtonStates(!0)})})},updateButtonStates:function(e){var t=this,n=this.chart,r=n.xAxis[0],i=n.scroller&&n.scroller.getUnionExtremes()||r,s=i.dataMin,o=i.dataMax,u=t.selected,a=t.options.allButtonsEnabled,f=t.buttons;e&&n.fixedRange!==U(r.max-r.min)&&(f[u]&&f[u].setState(0),t.setSelected(null));Jt(t.buttonOptions,function(e,n){var i=e._range,l=i>o-s,c=i<r.minRange,h=e.type==="all"&&r.max-r.min>=o-s&&f[n].state!==2,p=e.type==="ytd"&&vt("%Y",s)===vt("%Y",o);i===U(r.max-r.min)&&n!==u?(t.setSelected(n),f[n].setState(2)):!a&&(l||c||h||p)?f[n].setState(3):f[n].state===3&&f[n].setState(0)})},computeButtonRange:function(e){var t=e.type,n=e.count||1,r={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5};if(r[t])e._range=r[t]*n;else if(t==="month"||t==="year")e._range={month:30,year:365}[t]*864e5*n},setInputValue:function(e,t){var n=this.chart.options.rangeSelector;if(l(t))this[e+"Input"].HCTime=t;this[e+"Input"].value=vt(n.inputEditDateFormat||"%Y-%m-%d",this[e+"Input"].HCTime);this[e+"DateBox"].attr({text:vt(n.inputDateFormat||"%b %e, %Y",this[e+"Input"].HCTime)})},drawInput:function(r){var i=this,s=i.chart,o=s.renderer.style,u=s.renderer,a=s.options.rangeSelector,f=i.div,l=r==="min",c,h,p,m=this.inputGroup;this[r+"Label"]=h=u.label(dt.lang[l?"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).attr({padding:2}).css(t(o,a.labelStyle)).add(m);m.offset+=h.width+5;this[r+"DateBox"]=p=u.label("",m.offset).attr({padding:2,width:a.inputBoxWidth||90,height:a.inputBoxHeight||17,stroke:a.inputBoxBorderColor||"silver","stroke-width":1}).css(t({textAlign:"center",color:"#444"},o,a.inputStyle)).on("click",function(){i[r+"Input"].focus()}).add(m);m.offset+=p.width+(l?10:0);this[r+"Input"]=c=v("input",{name:r,className:"highcharts-range-selector",type:"text"},e({position:"absolute",border:0,width:"1px",height:"1px",padding:0,textAlign:"center",fontSize:o.fontSize,fontFamily:o.fontFamily,top:s.plotTop+"px"},a.inputStyle),f);c.onfocus=function(){d(this,{left:m.translateX+p.x+"px",top:m.translateY+"px",width:p.width-2+"px",height:p.height-2+"px",border:"2px solid silver"})};c.onblur=function(){d(this,{border:0,width:"1px",height:"1px"});i.setInputValue(r)};c.onchange=function(){var e=c.value,t=(a.inputDateParser||kt.parse)(e),r=s.xAxis[0],o=r.dataMin,u=r.dataMax;isNaN(t)&&(t=e.split("-"),t=kt.UTC(n(t[0]),n(t[1])-1,n(t[2])));isNaN(t)||(dt.global.useUTC||(t+=(new kt).getTimezoneOffset()*6e4),l?t>i.maxInput.HCTime?t=F:t<o&&(t=o):t<i.minInput.HCTime?t=F:t>u&&(t=u),t!==F&&s.xAxis[0].setExtremes(l?t:r.min,l?r.max:t,F,F,{trigger:"rangeSelectorInput"}))}},render:function(t,n){var r=this,i=r.chart,s=i.renderer,o=i.container,u=i.options,a=u.exporting&&u.navigation&&u.navigation.buttonOptions,f=u.rangeSelector,l=r.buttons,u=dt.lang,c=r.div,c=r.inputGroup,h=f.buttonTheme,d=f.inputEnabled!==!1,m=h&&h.states,g=i.plotLeft,y;if(!r.rendered&&(r.zoomText=s.text(u.rangeSelectorZoom,g,i.plotTop-20).css(f.labelStyle).add(),y=g+r.zoomText.getBBox().width+5,Jt(r.buttonOptions,function(e,t){l[t]=s.button(e.text,y,i.plotTop-35,function(){r.clickButton(t);r.isActive=!0},h,m&&m.hover,m&&m.select).css({textAlign:"center"}).add();y+=l[t].width+p(f.buttonSpacing,5);r.selected===t&&l[t].setState(2)}),r.updateButtonStates(),d))r.div=c=v("div",null,{position:"relative",height:0,zIndex:1}),o.parentNode.insertBefore(c,o),r.inputGroup=c=s.g("input-group").add(),c.offset=0,r.drawInput("min"),r.drawInput("max");d&&(o=i.plotTop-45,c.align(e({y:o,width:c.offset,x:a&&o<(a.y||0)+a.height-i.spacing[0]?-40:0},f.inputPosition),!0,i.spacingBox),r.setInputValue("min",t),r.setInputValue("max",n));r.rendered=!0},destroy:function(){var e=this.minInput,t=this.maxInput,n=this.chart,r=this.blurInputs,i;Zt(n.container,"mousedown",r);Zt(n,"resize",r);C(this.buttons);if(e)e.onfocus=e.onblur=e.onchange=null;if(t)t.onfocus=t.onblur=t.onchange=null;for(i in this)this[i]&&i!=="chart"&&(this[i].destroy?this[i].destroy():this[i].nodeType&&k(this[i])),this[i]=null}};D.prototype.toFixedRange=function(e,t,n,r){var i=this.chart&&this.chart.fixedRange,e=p(n,this.translate(e,!0)),t=p(r,this.translate(t,!0)),n=i&&(t-e)/i;n>.7&&n<1.3&&(r?e=t-i:t=e+i);return{min:e,max:t}};b(P.prototype,"init",function(e,t,n){Yt(this,"init",function(){if(this.options.rangeSelector.enabled)this.rangeSelector=new j(this)});e.call(this,t,n)});Ut.RangeSelector=j;P.prototype.callbacks.push(function(e){function t(){s=e.xAxis[0].getExtremes();o.render(s.min,s.max)}function n(){s=e.xAxis[0].getExtremes();isNaN(s.min)||u.render(s.min,s.max)}function r(e){e.triggerOp!=="navigator-drag"&&o.render(e.min,e.max)}function i(e){u.render(e.min,e.max)}var s,o=e.scroller,u=e.rangeSelector;o&&(Yt(e.xAxis[0],"afterSetExtremes",r),b(e,"drawChartBox",function(e){var n=this.isDirtyBox;e.call(this);n&&t()}),t());u&&(Yt(e.xAxis[0],"afterSetExtremes",i),Yt(e,"resize",n),n());Yt(e,"destroy",function(){o&&Zt(e.xAxis[0],"afterSetExtremes",r);u&&(Zt(e,"resize",n),Zt(e.xAxis[0],"afterSetExtremes",i))})});Ut.StockChart=function(e,n){var r=e.series,i,s=p(e.navigator&&e.navigator.enabled,!0)?{startOnTick:!1,endOnTick:!1}:null,o={marker:{enabled:!1,radius:2},states:{hover:{lineWidth:2}}},u={shadow:!1,borderWidth:0};e.xAxis=Gt(h(e.xAxis||{}),function(e){return t({minPadding:0,maxPadding:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0},e,{type:"datetime",categories:null},s)});e.yAxis=Gt(h(e.yAxis||{}),function(e){i=p(e.opposite,!0);return t({labels:{y:-2},opposite:i,showLastLabel:!1,title:{text:null}},e)});e.series=null;e=t({chart:{panning:!0,pinchType:"x"},navigator:{enabled:!0},scrollbar:{enabled:!0},rangeSelector:{enabled:!0},title:{text:null,style:{fontSize:"16px"}},tooltip:{shared:!0,crosshairs:!0},legend:{enabled:!1},plotOptions:{line:o,spline:o,area:o,areaspline:o,arearange:o,areasplinerange:o,column:u,columnrange:u,candlestick:u,ohlc:u}},e,{_stock:!0,chart:{inverted:!1}});e.series=r;return new P(e,n)};b(mn.prototype,"init",function(e,t,n){var r=n.chart.pinchType||"";e.call(this,t,n);this.pinchX=this.pinchHor=r.indexOf("x")!==-1;this.pinchY=this.pinchVert=r.indexOf("y")!==-1;this.hasZoom=this.hasZoom||this.pinchHor||this.pinchVert});b(D.prototype,"autoLabelAlign",function(e){var t=this.chart,n=this.options,t=t._labelPanes=t._labelPanes||{},r=this.options.labels;if(this.chart.options._stock&&this.coll==="yAxis"&&(n=n.top+","+n.height,!t[n]&&r.enabled)){if(r.x===15)r.x=0;if(r.align===void 0)r.align="right";t[n]=1;return"right"}return e.call(this,[].slice.call(arguments,1))});D.prototype.getPlotLinePath=function(e,t,n,r,i){var s=this,o=this.isLinked&&!this.series?this.linkedParent.series:this.series,u=s.chart,a=u.renderer,f=s.left,c=s.top,h,d,v,m,g=[],y,b;if(s.coll==="xAxis"||s.coll==="yAxis")y=s.isXAxis?l(s.options.yAxis)?[u.yAxis[s.options.yAxis]]:Gt(o,function(e){return e.yAxis}):l(s.options.xAxis)?[u.xAxis[s.options.xAxis]]:Gt(o,function(e){return e.xAxis});Jt(s.isXAxis?u.yAxis:u.xAxis,function(e){if(l(e.options.id)?e.options.id.indexOf("navigator")===-1:1){var t=e.isXAxis?"yAxis":"xAxis",t=l(e.options[t])?u[t][e.options[t]]:u[t][0];s===t&&y.push(e)}});b=y.length?[]:[s];Jt(y,function(e){$t(e,b)===-1&&b.push(e)});i=p(i,s.translate(e,null,null,n));isNaN(i)||(s.horiz?Jt(b,function(e){d=e.top;m=d+e.len;h=v=U(i+s.transB);(h>=f&&h<=f+s.width||r)&&g.push("M",h,d,"L",v,m)}):Jt(b,function(e){h=e.left;v=h+e.width;d=m=U(c+s.height-i);(d>=c&&d<=c+s.height||r)&&g.push("M",h,d,"L",v,m)}));if(g.length>0)return a.crispPolyLine(g,t||1)};D.prototype.getPlotBandPath=function(e,t){var n=this.getPlotLinePath(t),r=this.getPlotLinePath(e),i=[],s;if(r&&n)for(s=0;s<r.length;s+=6)i.push("M",r[s+1],r[s+2],"L",r[s+4],r[s+5],n[s+4],n[s+5],n[s+1],n[s+2]);else i=null;return i};ln.prototype.crispPolyLine=function(e,t){var n;for(n=0;n<e.length;n+=6)e[n+1]===e[n+4]&&(e[n+1]=e[n+4]=U(e[n+1])-t%2/2),e[n+2]===e[n+5]&&(e[n+2]=e[n+5]=U(e[n+2])+t%2/2);return e};if(ft===Ut.VMLRenderer)cn.prototype.crispPolyLine=ln.prototype.crispPolyLine;b(D.prototype,"hideCrosshair",function(e,t){e.call(this,t);l(this.crossLabelArray)&&(l(t)?this.crossLabelArray[t]&&this.crossLabelArray[t].hide():Jt(this.crossLabelArray,function(e){e.hide()}))});b(D.prototype,"drawCrosshair",function(t,n,r){var i,s;t.call(this,n,r);if(l(this.crosshair.label)&&this.crosshair.label.enabled&&l(r)){var t=this.chart,o=this.options.crosshair.label,u=this.isXAxis?"x":"y",n=this.horiz,a=this.opposite,f=this.left,c=this.top,h=this.crossLabel,d,v,m=o.format,g="";if(!h)h=this.crossLabel=t.renderer.label().attr({align:o.align||(n?"center":a?this.labelAlign==="right"?"right":"left":this.labelAlign==="left"?"left":"center"),zIndex:12,height:n?16:F,fill:o.backgroundColor||this.series[0]&&this.series[0].color||"gray",padding:p(o.padding,2),stroke:o.borderColor||null,"stroke-width":o.borderWidth||0}).css(e({color:"white",fontWeight:"normal",fontSize:"11px",textAlign:"center"},o.style)).add();n?(d=r.plotX+f,v=c+(a?0:this.height)):(d=a?this.width+f:0,v=r.plotY+c);if(v<c||v>c+this.height)this.hideCrosshair();else{!m&&!o.formatter&&(this.isDatetimeAxis&&(g="%b %d, %Y"),m="{value"+(g?":"+g:"")+"}");h.attr({text:m?w(m,{value:r[u]}):o.formatter.call(this,r[u]),x:d,y:v,visibility:"visible"});r=h.getBBox();if(n){if(this.options.tickPosition==="inside"&&!a||this.options.tickPosition!=="inside"&&a)v=h.y-r.height}else v=h.y-r.height/2;n?(i=f-r.x,s=f+this.width-r.x):(i=this.labelAlign==="left"?f:0,s=this.labelAlign==="right"?f+this.width:t.chartWidth);h.translateX<i&&(d+=i-h.translateX);h.translateX+r.width>=s&&(d-=h.translateX+r.width-s);h.attr({x:d,y:v,visibility:"visible"})}}});var Fn=kn.init,In=kn.processData,qn=Sn.prototype.tooltipFormatter;kn.init=function(){Fn.apply(this,arguments);this.setCompare(this.options.compare)};kn.setCompare=function(e){this.modifyValue=e==="value"||e==="percent"?function(t,n){var r=this.compareValue;if(t!==F&&(t=e==="value"?t-r:t=100*(t/r)-100,n))n.change=t;return t}:null;if(this.chart.hasRendered)this.isDirty=!0};kn.processData=function(){var e=0,t,n,r;In.apply(this,arguments);if(this.xAxis&&this.processedYData){t=this.processedXData;n=this.processedYData;for(r=n.length;e<r;e++)if(typeof n[e]==="number"&&t[e]>=this.xAxis.min){this.compareValue=n[e];break}}};b(kn,"getExtremes",function(e){e.apply(this,[].slice.call(arguments,1));if(this.modifyValue)this.dataMax=this.modifyValue(this.dataMax),this.dataMin=this.modifyValue(this.dataMin)});D.prototype.setCompare=function(e,t){this.isXAxis||(Jt(this.series,function(t){t.setCompare(e)}),p(t,!0)&&this.chart.redraw())};Sn.prototype.tooltipFormatter=function(e){e=e.replace("{point.change}",(this.change>0?"+":"")+g(this.change,p(this.series.tooltipOptions.changeDecimals,2)));return qn.apply(this,[e])};b(xn.prototype,"render",function(e){if(this.chart.options._stock)!this.clipBox&&this.animate&&this.animate.toString().indexOf("sharedClip")!==-1?(this.clipBox=t(this.chart.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=this.yAxis.len):this.chart[this.sharedClipKey]&&this.chart[this.sharedClipKey].attr({width:this.xAxis.len,height:this.yAxis.len});e.call(this)});e(Ut,{Axis:D,Chart:P,Color:fn,Point:Sn,Tick:_,Renderer:ft,Series:xn,SVGElement:M,SVGRenderer:ln,arrayMin:T,arrayMax:N,charts:Et,dateFormat:vt,format:w,pathAnim:gt,getOptions:function(){return dt},hasBidiBug:ut,isTouchDevice:it,numberFormat:g,seriesTypes:Rt,setOptions:function(e){dt=t(!0,dt,e);O();return dt},addEvent:Yt,removeEvent:Zt,createElement:v,discardElement:k,css:d,each:Jt,extend:e,map:Gt,merge:t,pick:p,splat:h,extendClass:m,pInt:n,wrap:b,svg:ot,canvas:at,vml:!ot&&!at,product:"Highstock",version:"2.0.4"})})()