|
|
@@ -0,0 +1,640 @@ |
|
|
|
/* |
|
|
|
Highstock JS v8.0.0 (2019-12-10) |
|
|
|
|
|
|
|
(c) 2009-2018 Torstein Honsi |
|
|
|
|
|
|
|
License: www.highcharts.com/license |
|
|
|
*/ |
|
|
|
(function(S,K){"object"===typeof module&&module.exports?(K["default"]=K,module.exports=S.document?K(S):K):"function"===typeof define&&define.amd?define("highcharts/highstock",function(){return K(S)}):(S.Highcharts&&S.Highcharts.error(16,!0),S.Highcharts=K(S))})("undefined"!==typeof window?window:this,function(S){function K(d,g,M,F){d.hasOwnProperty(g)||(d[g]=F.apply(null,M))}var y={};K(y,"parts/Globals.js",[],function(){var d="undefined"!==typeof S?S:"undefined"!==typeof window?window:{},g=d.document, |
|
|
|
M=d.navigator&&d.navigator.userAgent||"",F=g&&g.createElementNS&&!!g.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,E=/(edge|msie|trident)/i.test(M)&&!d.opera,D=-1!==M.indexOf("Firefox"),x=-1!==M.indexOf("Chrome"),v=D&&4>parseInt(M.split("Firefox/")[1],10);return{product:"Highcharts",version:"8.0.0",deg2rad:2*Math.PI/360,doc:g,hasBidiBug:v,hasTouch:!!d.TouchEvent,isMS:E,isWebKit:-1!==M.indexOf("AppleWebKit"),isFirefox:D,isChrome:x,isSafari:!x&&-1!==M.indexOf("Safari"),isTouchDevice:/(Mobile|Android|Windows Phone)/.test(M), |
|
|
|
SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:F,win:d,marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){},charts:[],dateFormats:{}}});K(y,"parts/Utilities.js",[y["parts/Globals.js"]],function(d){function g(a,l){return parseInt(a,l||10)}function M(a){return"string"===typeof a}function F(a){a=Object.prototype.toString.call(a);return"[object Array]"===a||"[object Array Iterator]"===a}function E(a,l){return!!a&&"object"===typeof a&&(!l|| |
|
|
|
!F(a))}function D(a){return E(a)&&"number"===typeof a.nodeType}function x(a){var l=a&&a.constructor;return!(!E(a,!0)||D(a)||!l||!l.name||"Object"===l.name)}function v(a){return"number"===typeof a&&!isNaN(a)&&Infinity>a&&-Infinity<a}function C(a){return"undefined"!==typeof a&&null!==a}function B(a,l,b){var c;M(l)?C(b)?a.setAttribute(l,b):a&&a.getAttribute&&((c=a.getAttribute(l))||"class"!==l||(c=a.getAttribute(l+"Name"))):h(l,function(l,b){a.setAttribute(b,l)});return c}function p(a,l){var b;a||(a= |
|
|
|
{});for(b in l)a[b]=l[b];return a}function z(){for(var a=arguments,l=a.length,b=0;b<l;b++){var c=a[b];if("undefined"!==typeof c&&null!==c)return c}}function m(a,l){var b=function(){};b.prototype=new a;p(b.prototype,l);return b}function q(a,l){return parseFloat(a.toPrecision(l||14))}function w(a,l,b,c){a=+a||0;l=+l;var n=d.defaultOptions.lang,f=(a.toString().split(".")[1]||"").split("e")[0].length,e=a.toString().split("e");if(-1===l)l=Math.min(f,20);else if(!v(l))l=2;else if(l&&e[1]&&0>e[1]){var k= |
|
|
|
l+ +e[1];0<=k?(e[0]=(+e[0]).toExponential(k).split("e")[0],l=k):(e[0]=e[0].split(".")[0]||0,a=20>l?(e[0]*Math.pow(10,e[1])).toFixed(l):0,e[1]=0)}var u=(Math.abs(e[1]?e[0]:a)+Math.pow(10,-Math.max(l,f)-1)).toFixed(l);f=String(g(u));k=3<f.length?f.length%3:0;b=z(b,n.decimalPoint);c=z(c,n.thousandsSep);a=(0>a?"-":"")+(k?f.substr(0,k)+c:"");a+=f.substr(k).replace(/(\d{3})(?=\d)/g,"$1"+c);l&&(a+=b+u.slice(-l));e[1]&&0!==+a&&(a+="e"+e[1]);return a}function h(a,l,b){for(var c in a)Object.hasOwnProperty.call(a, |
|
|
|
c)&&l.call(b||a[c],a[c],c,a)}d.timers=[];var f=d.charts,c=d.doc,b=d.win;d.error=function(a,l,c,f){var n=v(a),t=n?"Highcharts error #"+a+": www.highcharts.com/errors/"+a+"/":a.toString(),e=function(){if(l)throw Error(t);b.console&&console.log(t)};if("undefined"!==typeof f){var k="";n&&(t+="?");d.objectEach(f,function(a,e){k+="\n"+e+": "+a;n&&(t+=encodeURI(e)+"="+encodeURI(a))});t+=k}c?d.fireEvent(c,"displayError",{code:a,message:t,params:f},e):e()};d.Fx=function(a,l,b){this.options=l;this.elem=a;this.prop= |
|
|
|
b};d.Fx.prototype={dSetter:function(){var a=this.paths[0],b=this.paths[1],c=[],f=this.now,h=a.length;if(1===f)c=this.toD;else if(h===b.length&&1>f)for(;h--;){var r=parseFloat(a[h]);c[h]=isNaN(r)||"A"===b[h-4]||"A"===b[h-5]?b[h]:f*parseFloat(""+(b[h]-r))+r}else c=b;this.elem.attr("d",c,null,!0)},update:function(){var a=this.elem,b=this.prop,c=this.now,f=this.options.step;if(this[b+"Setter"])this[b+"Setter"]();else a.attr?a.element&&a.attr(b,c,null,!0):a.style[b]=c+this.unit;f&&f.call(a,c,this)},run:function(a, |
|
|
|
l,c){var f=this,n=f.options,r=function(a){return r.stopped?!1:f.step(a)},e=b.requestAnimationFrame||function(a){setTimeout(a,13)},k=function(){for(var a=0;a<d.timers.length;a++)d.timers[a]()||d.timers.splice(a--,1);d.timers.length&&e(k)};a!==l||this.elem["forceAnimate:"+this.prop]?(this.startTime=+new Date,this.start=a,this.end=l,this.unit=c,this.now=this.start,this.pos=0,r.elem=this.elem,r.prop=this.prop,r()&&1===d.timers.push(r)&&e(k)):(delete n.curAnim[this.prop],n.complete&&0===Object.keys(n.curAnim).length&& |
|
|
|
n.complete.call(this.elem))},step:function(a){var b=+new Date,c=this.options,f=this.elem,d=c.complete,r=c.duration,e=c.curAnim;if(f.attr&&!f.element)a=!1;else if(a||b>=r+this.startTime){this.now=this.end;this.pos=1;this.update();var k=e[this.prop]=!0;h(e,function(a){!0!==a&&(k=!1)});k&&d&&d.call(f);a=!1}else this.pos=c.easing((b-this.startTime)/r),this.now=this.start+(this.end-this.start)*this.pos,this.update(),a=!0;return a},initPath:function(a,b,c){function l(a){for(A=a.length;A--;){var e="M"=== |
|
|
|
a[A]||"L"===a[A];var k=/[a-zA-Z]/.test(a[A+3]);e&&k&&a.splice(A+1,0,a[A+1],a[A+2],a[A+1],a[A+2])}}function f(a,e){for(;a.length<m;){a[0]=e[m-a.length];var k=a.slice(0,h);[].splice.apply(a,[0,0].concat(k));J&&(k=a.slice(a.length-h),[].splice.apply(a,[a.length,0].concat(k)),A--)}a[0]="M"}function n(a,e){for(var k=(m-a.length)/h;0<k&&k--;)G=a.slice().splice(a.length/L-h,h*L),G[0]=e[m-h-k*h],u&&(G[h-6]=G[h-2],G[h-5]=G[h-1]),[].splice.apply(a,[a.length/L,0].concat(G)),J&&k--}b=b||"";var e=a.startX,k=a.endX, |
|
|
|
u=-1<b.indexOf("C"),h=u?7:3,G,A;b=b.split(" ");c=c.slice();var J=a.isArea,L=J?2:1;u&&(l(b),l(c));if(e&&k){for(A=0;A<e.length;A++)if(e[A]===k[0]){var d=A;break}else if(e[0]===k[k.length-e.length+A]){d=A;var q=!0;break}else if(e[e.length-1]===k[k.length-e.length+A]){d=e.length-A;break}"undefined"===typeof d&&(b=[])}if(b.length&&v(d)){var m=c.length+d*L*h;q?(f(b,c),n(c,b)):(f(c,b),n(b,c))}return[b,c]},fillSetter:function(){d.Fx.prototype.strokeSetter.apply(this,arguments)},strokeSetter:function(){this.elem.attr(this.prop, |
|
|
|
d.color(this.start).tweenTo(d.color(this.end),this.pos),null,!0)}};d.merge=function(){var a,b=arguments,c={},f=function(a,e){"object"!==typeof a&&(a={});h(e,function(k,b){!E(k,!0)||x(k)||D(k)?a[b]=e[b]:a[b]=f(a[b]||{},k)});return a};!0===b[0]&&(c=b[1],b=Array.prototype.slice.call(b,2));var d=b.length;for(a=0;a<d;a++)c=f(c,b[a]);return c};d.clearTimeout=function(a){C(a)&&clearTimeout(a)};d.css=function(a,b){d.isMS&&!d.svg&&b&&"undefined"!==typeof b.opacity&&(b.filter="alpha(opacity="+100*b.opacity+ |
|
|
|
")");p(a.style,b)};d.createElement=function(a,b,f,t,h){a=c.createElement(a);var l=d.css;b&&p(a,b);h&&l(a,{padding:"0",border:"none",margin:"0"});f&&l(a,f);t&&t.appendChild(a);return a};d.datePropsToTimestamps=function(a){h(a,function(b,c){E(b)&&"function"===typeof b.getTime?a[c]=b.getTime():(E(b)||F(b))&&d.datePropsToTimestamps(b)})};d.formatSingle=function(a,b,c){var l=/\.([0-9])/,f=d.defaultOptions.lang,n=c&&c.time||d.time;c=c&&c.numberFormatter||w;/f$/.test(a)?(l=(l=a.match(l))?l[1]:-1,null!== |
|
|
|
b&&(b=c(b,l,f.decimalPoint,-1<a.indexOf(",")?f.thousandsSep:""))):b=n.dateFormat(a,b);return b};d.format=function(a,b,c){for(var l="{",f=!1,n,e,k,u,h=[],G;a;){l=a.indexOf(l);if(-1===l)break;n=a.slice(0,l);if(f){n=n.split(":");e=n.shift().split(".");u=e.length;G=b;for(k=0;k<u;k++)G&&(G=G[e[k]]);n.length&&(G=d.formatSingle(n.join(":"),G,c));h.push(G)}else h.push(n);a=a.slice(l+1);l=(f=!f)?"}":"{"}h.push(a);return h.join("")};d.getMagnitude=function(a){return Math.pow(10,Math.floor(Math.log(a)/Math.LN10))}; |
|
|
|
d.normalizeTickInterval=function(a,b,c,f,h){var l=a;c=z(c,1);var e=a/c;b||(b=h?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],!1===f&&(1===c?b=b.filter(function(a){return 0===a%1}):.1>=c&&(b=[1/c])));for(f=0;f<b.length&&!(l=b[f],h&&l*c>=a||!h&&e<=(b[f]+(b[f+1]||b[f]))/2);f++);return l=q(l*c,-Math.round(Math.log(.001)/Math.LN10))};d.stableSort=function(a,b){var c=a.length,l,f;for(f=0;f<c;f++)a[f].safeI=f;a.sort(function(a,e){l=b(a,e);return 0===l?a.safeI-e.safeI:l});for(f=0;f<c;f++)delete a[f].safeI}; |
|
|
|
d.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:24192E5,year:314496E5};Math.easeInOutSine=function(a){return-.5*(Math.cos(Math.PI*a)-1)};d.getStyle=function(a,c,f){if("width"===c)return c=Math.min(a.offsetWidth,a.scrollWidth),f=a.getBoundingClientRect&&a.getBoundingClientRect().width,f<c&&f>=c-1&&(c=Math.floor(f)),Math.max(0,c-d.getStyle(a,"padding-left")-d.getStyle(a,"padding-right"));if("height"===c)return Math.max(0,Math.min(a.offsetHeight,a.scrollHeight)- |
|
|
|
d.getStyle(a,"padding-top")-d.getStyle(a,"padding-bottom"));b.getComputedStyle||d.error(27,!0);if(a=b.getComputedStyle(a,void 0))a=a.getPropertyValue(c),z(f,"opacity"!==c)&&(a=g(a));return a};d.inArray=function(a,b,c){return b.indexOf(a,c)};d.find=Array.prototype.find?function(a,b){return a.find(b)}:function(a,b){var c,l=a.length;for(c=0;c<l;c++)if(b(a[c],c))return a[c]};d.keys=Object.keys;d.stop=function(a,b){for(var c=d.timers.length;c--;)d.timers[c].elem!==a||b&&b!==d.timers[c].prop||(d.timers[c].stopped= |
|
|
|
!0)};h({map:"map",each:"forEach",grep:"filter",reduce:"reduce",some:"some"},function(a,b){d[b]=function(b){return Array.prototype[a].apply(b,[].slice.call(arguments,1))}});d.addEvent=function(a,b,c,f){void 0===f&&(f={});var l=a.addEventListener||d.addEventListenerPolyfill;var n="function"===typeof a&&a.prototype?a.prototype.protoEvents=a.prototype.protoEvents||{}:a.hcEvents=a.hcEvents||{};d.Point&&a instanceof d.Point&&a.series&&a.series.chart&&(a.series.chart.runTrackerClick=!0);l&&l.call(a,b,c, |
|
|
|
!1);n[b]||(n[b]=[]);n[b].push({fn:c,order:"number"===typeof f.order?f.order:Infinity});n[b].sort(function(a,b){return a.order-b.order});return function(){d.removeEvent(a,b,c)}};d.removeEvent=function(a,b,c){function l(e,b){var c=a.removeEventListener||d.removeEventListenerPolyfill;c&&c.call(a,e,b,!1)}function f(e){var c;if(a.nodeName){if(b){var f={};f[b]=!0}else f=e;h(f,function(a,b){if(e[b])for(c=e[b].length;c--;)l(b,e[b][c].fn)})}}var n;["protoEvents","hcEvents"].forEach(function(e,k){var u=(k= |
|
|
|
k?a:a.prototype)&&k[e];u&&(b?(n=u[b]||[],c?(u[b]=n.filter(function(a){return c!==a.fn}),l(b,c)):(f(u),u[b]=[])):(f(u),k[e]={}))})};d.fireEvent=function(a,b,f,h){var l;f=f||{};if(c.createEvent&&(a.dispatchEvent||a.fireEvent)){var n=c.createEvent("Events");n.initEvent(b,!0,!0);p(n,f);a.dispatchEvent?a.dispatchEvent(n):a.fireEvent(b,n)}else f.target||p(f,{preventDefault:function(){f.defaultPrevented=!0},target:a,type:b}),function(e,b){void 0===e&&(e=[]);void 0===b&&(b=[]);var c=0,k=0,n=e.length+b.length; |
|
|
|
for(l=0;l<n;l++)!1===(e[c]?b[k]?e[c].order<=b[k].order?e[c++]:b[k++]:e[c++]:b[k++]).fn.call(a,f)&&f.preventDefault()}(a.protoEvents&&a.protoEvents[b],a.hcEvents&&a.hcEvents[b]);h&&!f.defaultPrevented&&h.call(a,f)};d.animate=function(a,b,c){var l,f="",n,e;if(!E(c)){var k=arguments;c={duration:k[2],easing:k[3],complete:k[4]}}v(c.duration)||(c.duration=400);c.easing="function"===typeof c.easing?c.easing:Math[c.easing]||Math.easeInOutSine;c.curAnim=d.merge(b);h(b,function(k,h){d.stop(a,h);e=new d.Fx(a, |
|
|
|
c,h);n=null;"d"===h?(e.paths=e.initPath(a,a.d,b.d),e.toD=b.d,l=0,n=1):a.attr?l=a.attr(h):(l=parseFloat(d.getStyle(a,h))||0,"opacity"!==h&&(f="px"));n||(n=k);n&&n.match&&n.match("px")&&(n=n.replace(/px/g,""));e.run(l,n,f)})};d.seriesType=function(a,b,c,f,h){var l=d.getOptions(),e=d.seriesTypes;l.plotOptions[a]=d.merge(l.plotOptions[b],c);e[a]=m(e[b]||function(){},f);e[a].prototype.type=a;h&&(e[a].prototype.pointClass=m(d.Point,h));return e[a]};d.uniqueKey=function(){var a=Math.random().toString(36).substring(2, |
|
|
|
9),b=0;return function(){return"highcharts-"+a+"-"+b++}}();d.isFunction=function(a){return"function"===typeof a};b.jQuery&&(b.jQuery.fn.highcharts=function(){var a=[].slice.call(arguments);if(this[0])return a[0]?(new (d[M(a[0])?a.shift():"Chart"])(this[0],a[0],a[1]),this):f[B(this[0],"data-highcharts-chart")]});return{animObject:function(a){return E(a)?d.merge(a):{duration:a?500:0}},arrayMax:function(a){for(var b=a.length,c=a[0];b--;)a[b]>c&&(c=a[b]);return c},arrayMin:function(a){for(var b=a.length, |
|
|
|
c=a[0];b--;)a[b]<c&&(c=a[b]);return c},attr:B,clamp:function(a,b,c){return a>b?a<c?a:c:b},correctFloat:q,defined:C,destroyObjectProperties:function(a,b){h(a,function(c,f){c&&c!==b&&c.destroy&&c.destroy();delete a[f]})},discardElement:function(a){var b=d.garbageBin;b||(b=d.createElement("div"));a&&b.appendChild(a);b.innerHTML=""},erase:function(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}},extend:p,extendClass:m,isArray:F,isClass:x,isDOMElement:D,isNumber:v,isObject:E,isString:M, |
|
|
|
numberFormat:w,objectEach:h,offset:function(a){var f=c.documentElement;a=a.parentElement||a.parentNode?a.getBoundingClientRect():{top:0,left:0};return{top:a.top+(b.pageYOffset||f.scrollTop)-(f.clientTop||0),left:a.left+(b.pageXOffset||f.scrollLeft)-(f.clientLeft||0)}},pad:function(a,b,c){return Array((b||2)+1-String(a).replace("-","").length).join(c||"0")+a},pick:z,pInt:g,relativeLength:function(a,b,c){return/%$/.test(a)?b*parseFloat(a)/100+(c||0):parseFloat(a)},setAnimation:function(a,b){b.renderer.globalAnimation= |
|
|
|
z(a,b.options.chart.animation,!0)},splat:function(a){return F(a)?a:[a]},syncTimeout:function(a,b,c){if(0<b)return setTimeout(a,b,c);a.call(0,c);return-1},wrap:function(a,b,c){var f=a[b];a[b]=function(){var a=Array.prototype.slice.call(arguments),b=arguments,e=this;e.proceed=function(){f.apply(e,arguments.length?arguments:b)};a.unshift(f);a=c.apply(this,a);e.proceed=null;return a}}}});K(y,"parts/Color.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var M=g.isNumber,F=g.pInt,E=d.merge; |
|
|
|
d.Color=function(g){if(!(this instanceof d.Color))return new d.Color(g);this.init(g)};d.Color.prototype={parsers:[{regex:/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*\)/,parse:function(d){return[F(d[1]),F(d[2]),F(d[3]),parseFloat(d[4],10)]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(d){return[F(d[1]),F(d[2]),F(d[3]),1]}}],names:{white:"#ffffff",black:"#000000"},init:function(g){var x,v;if((this.input=g=this.names[g&& |
|
|
|
g.toLowerCase?g.toLowerCase():""]||g)&&g.stops)this.stops=g.stops.map(function(g){return new d.Color(g[1])});else{if(g&&g.charAt&&"#"===g.charAt()){var C=g.length;g=parseInt(g.substr(1),16);7===C?x=[(g&16711680)>>16,(g&65280)>>8,g&255,1]:4===C&&(x=[(g&3840)>>4|(g&3840)>>8,(g&240)>>4|g&240,(g&15)<<4|g&15,1])}if(!x)for(v=this.parsers.length;v--&&!x;){var D=this.parsers[v];(C=D.regex.exec(g))&&(x=D.parse(C))}}this.rgba=x||[]},get:function(d){var g=this.input,v=this.rgba;if(this.stops){var C=E(g);C.stops= |
|
|
|
[].concat(C.stops);this.stops.forEach(function(g,p){C.stops[p]=[C.stops[p][0],g.get(d)]})}else C=v&&M(v[0])?"rgb"===d||!d&&1===v[3]?"rgb("+v[0]+","+v[1]+","+v[2]+")":"a"===d?v[3]:"rgba("+v.join(",")+")":g;return C},brighten:function(d){var g,v=this.rgba;if(this.stops)this.stops.forEach(function(g){g.brighten(d)});else if(M(d)&&0!==d)for(g=0;3>g;g++)v[g]+=F(255*d),0>v[g]&&(v[g]=0),255<v[g]&&(v[g]=255);return this},setOpacity:function(d){this.rgba[3]=d;return this},tweenTo:function(d,g){var v=this.rgba, |
|
|
|
x=d.rgba;x.length&&v&&v.length?(d=1!==x[3]||1!==v[3],g=(d?"rgba(":"rgb(")+Math.round(x[0]+(v[0]-x[0])*(1-g))+","+Math.round(x[1]+(v[1]-x[1])*(1-g))+","+Math.round(x[2]+(v[2]-x[2])*(1-g))+(d?","+(x[3]+(v[3]-x[3])*(1-g)):"")+")"):g=d.input||"none";return g}};d.color=function(g){return new d.Color(g)}});K(y,"parts/SvgRenderer.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var M=g.animObject,F=g.attr,E=g.defined,D=g.destroyObjectProperties,x=g.erase,v=g.extend,C=g.isArray,B=g.isNumber, |
|
|
|
p=g.isObject,z=g.isString,m=g.objectEach,q=g.pick,w=g.pInt,h=g.splat,f=d.addEvent,c=d.animate,b=d.charts,a=d.color,l=d.css,n=d.createElement,t=d.deg2rad,I=d.doc,r=d.hasTouch,e=d.isFirefox,k=d.isMS,u=d.isWebKit,H=d.merge,G=d.noop,A=d.removeEvent,J=d.stop,L=d.svg,Q=d.SVG_NS,V=d.symbolSizes,U=d.win;var P=d.SVGElement=function(){return this};v(P.prototype,{opacity:1,SVG_NS:Q,textProps:"direction fontSize fontWeight fontFamily fontStyle color lineHeight width textAlign textDecoration textOverflow textOutline cursor".split(" "), |
|
|
|
init:function(a,e){this.element="span"===e?n(e):I.createElementNS(this.SVG_NS,e);this.renderer=a;d.fireEvent(this,"afterInit")},animate:function(a,e,b){var k=M(q(e,this.renderer.globalAnimation,!0));q(I.hidden,I.msHidden,I.webkitHidden,!1)&&(k.duration=0);0!==k.duration?(b&&(k.complete=b),c(this,a,k)):(this.attr(a,void 0,b),m(a,function(a,e){k.step&&k.step.call(this,a,{prop:e,pos:1})},this));return this},complexColor:function(a,e,b){var c=this.renderer,k,A,f,l,u,J,N,O,h,n,t,L=[],r;d.fireEvent(this.renderer, |
|
|
|
"complexColor",{args:arguments},function(){a.radialGradient?A="radialGradient":a.linearGradient&&(A="linearGradient");A&&(f=a[A],u=c.gradients,N=a.stops,n=b.radialReference,C(f)&&(a[A]=f={x1:f[0],y1:f[1],x2:f[2],y2:f[3],gradientUnits:"userSpaceOnUse"}),"radialGradient"===A&&n&&!E(f.gradientUnits)&&(l=f,f=H(f,c.getRadialAttr(n,l),{gradientUnits:"userSpaceOnUse"})),m(f,function(a,e){"id"!==e&&L.push(e,a)}),m(N,function(a){L.push(a)}),L=L.join(","),u[L]?t=u[L].attr("id"):(f.id=t=d.uniqueKey(),u[L]=J= |
|
|
|
c.createElement(A).attr(f).add(c.defs),J.radAttr=l,J.stops=[],N.forEach(function(a){0===a[1].indexOf("rgba")?(k=d.color(a[1]),O=k.get("rgb"),h=k.get("a")):(O=a[1],h=1);a=c.createElement("stop").attr({offset:a[0],"stop-color":O,"stop-opacity":h}).add(J);J.stops.push(a)})),r="url("+c.url+"#"+t+")",b.setAttribute(e,r),b.gradient=L,a.toString=function(){return r})})},applyTextOutline:function(a){var e=this.element,b;-1!==a.indexOf("contrast")&&(a=a.replace(/contrast/g,this.renderer.getContrast(e.style.fill))); |
|
|
|
a=a.split(" ");var c=a[a.length-1];if((b=a[0])&&"none"!==b&&d.svg){this.fakeTS=!0;a=[].slice.call(e.getElementsByTagName("tspan"));this.ySetter=this.xSetter;b=b.replace(/(^[\d\.]+)(.*?)$/g,function(a,e,b){return 2*e+b});this.removeTextOutline(a);var k=e.firstChild;a.forEach(function(a,f){0===f&&(a.setAttribute("x",e.getAttribute("x")),f=e.getAttribute("y"),a.setAttribute("y",f||0),null===f&&e.setAttribute("y",0));a=a.cloneNode(1);F(a,{"class":"highcharts-text-outline",fill:c,stroke:c,"stroke-width":b, |
|
|
|
"stroke-linejoin":"round"});e.insertBefore(a,k)})}},removeTextOutline:function(a){for(var e=a.length,b;e--;)b=a[e],"highcharts-text-outline"===b.getAttribute("class")&&x(a,this.element.removeChild(b))},symbolCustomAttribs:"x y width height r start end innerR anchorX anchorY rounded".split(" "),attr:function(a,e,b,c){var k=this.element,f,A=this,l,u,N=this.symbolCustomAttribs;if("string"===typeof a&&"undefined"!==typeof e){var O=a;a={};a[O]=e}"string"===typeof a?A=(this[a+"Getter"]||this._defaultGetter).call(this, |
|
|
|
a,k):(m(a,function(e,b){l=!1;c||J(this,b);this.symbolName&&-1!==d.inArray(b,N)&&(f||(this.symbolAttr(a),f=!0),l=!0);!this.rotation||"x"!==b&&"y"!==b||(this.doTransform=!0);l||(u=this[b+"Setter"]||this._defaultSetter,u.call(this,e,b,k),!this.styledMode&&this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(b)&&this.updateShadows(b,e,u))},this),this.afterSetters());b&&b.call(this);return A},afterSetters:function(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)},updateShadows:function(a, |
|
|
|
e,b){for(var c=this.shadows,k=c.length;k--;)b.call(c[k],"height"===a?Math.max(e-(c[k].cutHeight||0),0):"d"===a?this.d:e,a,c[k])},addClass:function(a,e){var b=e?"":this.attr("class")||"";a=(a||"").split(/ /g).reduce(function(a,e){-1===b.indexOf(e)&&a.push(e);return a},b?[b]:[]).join(" ");a!==b&&this.attr("class",a);return this},hasClass:function(a){return-1!==(this.attr("class")||"").split(" ").indexOf(a)},removeClass:function(a){return this.attr("class",(this.attr("class")||"").replace(z(a)?new RegExp(" ?"+ |
|
|
|
a+" ?"):a,""))},symbolAttr:function(a){var e=this;"x y r start end width height innerR anchorX anchorY clockwise".split(" ").forEach(function(b){e[b]=q(a[b],e[b])});e.attr({d:e.renderer.symbols[e.symbolName](e.x,e.y,e.width,e.height,e)})},clip:function(a){return this.attr("clip-path",a?"url("+this.renderer.url+"#"+a.id+")":"none")},crisp:function(a,e){e=e||a.strokeWidth||0;var b=Math.round(e)%2/2;a.x=Math.floor(a.x||this.x||0)+b;a.y=Math.floor(a.y||this.y||0)+b;a.width=Math.floor((a.width||this.width|| |
|
|
|
0)-2*b);a.height=Math.floor((a.height||this.height||0)-2*b);E(a.strokeWidth)&&(a.strokeWidth=e);return a},css:function(a){var e=this.styles,b={},c=this.element,k="",f=!e,A=["textOutline","textOverflow","width"];a&&a.color&&(a.fill=a.color);e&&m(a,function(a,c){a!==e[c]&&(b[c]=a,f=!0)});if(f){e&&(a=v(e,b));if(a)if(null===a.width||"auto"===a.width)delete this.textWidth;else if("text"===c.nodeName.toLowerCase()&&a.width)var u=this.textWidth=w(a.width);this.styles=a;u&&!L&&this.renderer.forExport&&delete a.width; |
|
|
|
if(c.namespaceURI===this.SVG_NS){var J=function(a,e){return"-"+e.toLowerCase()};m(a,function(a,e){-1===A.indexOf(e)&&(k+=e.replace(/([A-Z])/g,J)+":"+a+";")});k&&F(c,"style",k)}else l(c,a);this.added&&("text"===this.element.nodeName&&this.renderer.buildText(this),a&&a.textOutline&&this.applyTextOutline(a.textOutline))}return this},getStyle:function(a){return U.getComputedStyle(this.element||this,"").getPropertyValue(a)},strokeWidth:function(){if(!this.renderer.styledMode)return this["stroke-width"]|| |
|
|
|
0;var a=this.getStyle("stroke-width"),e=0;if(a.indexOf("px")===a.length-2)e=w(a);else if(""!==a){var b=I.createElementNS(Q,"rect");F(b,{width:a,"stroke-width":0});this.element.parentNode.appendChild(b);e=b.getBBox().width;b.parentNode.removeChild(b)}return e},on:function(a,e){var b=this,c=b.element;r&&"click"===a?(c.ontouchstart=function(a){b.touchEventFired=Date.now();a.preventDefault();e.call(c,a)},c.onclick=function(a){(-1===U.navigator.userAgent.indexOf("Android")||1100<Date.now()-(b.touchEventFired|| |
|
|
|
0))&&e.call(c,a)}):c["on"+a]=e;return this},setRadialReference:function(a){var e=this.renderer.gradients[this.element.gradient];this.element.radialReference=a;e&&e.radAttr&&e.animate(this.renderer.getRadialAttr(a,e.radAttr));return this},translate:function(a,e){return this.attr({translateX:a,translateY:e})},invert:function(a){this.inverted=a;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,e=this.translateY||0,b=this.scaleX,c=this.scaleY,k=this.inverted,f=this.rotation, |
|
|
|
A=this.matrix,l=this.element;k&&(a+=this.width,e+=this.height);a=["translate("+a+","+e+")"];E(A)&&a.push("matrix("+A.join(",")+")");k?a.push("rotate(90) scale(-1,1)"):f&&a.push("rotate("+f+" "+q(this.rotationOriginX,l.getAttribute("x"),0)+" "+q(this.rotationOriginY,l.getAttribute("y")||0)+")");(E(b)||E(c))&&a.push("scale("+q(b,1)+" "+q(c,1)+")");a.length&&l.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,e,b){var c, |
|
|
|
k={};var f=this.renderer;var A=f.alignedObjects;var l,u;if(a){if(this.alignOptions=a,this.alignByTranslate=e,!b||z(b))this.alignTo=c=b||"renderer",x(A,this),A.push(this),b=null}else a=this.alignOptions,e=this.alignByTranslate,c=this.alignTo;b=q(b,f[c],f);c=a.align;f=a.verticalAlign;A=(b.x||0)+(a.x||0);var J=(b.y||0)+(a.y||0);"right"===c?l=1:"center"===c&&(l=2);l&&(A+=(b.width-(a.width||0))/l);k[e?"translateX":"x"]=Math.round(A);"bottom"===f?u=1:"middle"===f&&(u=2);u&&(J+=(b.height-(a.height||0))/ |
|
|
|
u);k[e?"translateY":"y"]=Math.round(J);this[this.placed?"animate":"attr"](k);this.placed=!0;this.alignAttr=k;return this},getBBox:function(a,e){var b,c=this.renderer,k=this.element,f=this.styles,A=this.textStr,l,u=c.cache,J=c.cacheKeys,h=k.namespaceURI===this.SVG_NS;e=q(e,this.rotation,0);var N=c.styledMode?k&&P.prototype.getStyle.call(k,"font-size"):f&&f.fontSize;if(E(A)){var n=A.toString();-1===n.indexOf("<")&&(n=n.replace(/[0-9]/g,"0"));n+=["",e,N,this.textWidth,f&&f.textOverflow].join()}n&&!a&& |
|
|
|
(b=u[n]);if(!b){if(h||c.forExport){try{(l=this.fakeTS&&function(a){[].forEach.call(k.querySelectorAll(".highcharts-text-outline"),function(e){e.style.display=a})})&&l("none"),b=k.getBBox?v({},k.getBBox()):{width:k.offsetWidth,height:k.offsetHeight},l&&l("")}catch(ea){""}if(!b||0>b.width)b={width:0,height:0}}else b=this.htmlGetBBox();c.isSVG&&(a=b.width,c=b.height,h&&(b.height=c={"11px,17":14,"13px,20":16}[f&&f.fontSize+","+Math.round(c)]||c),e&&(f=e*t,b.width=Math.abs(c*Math.sin(f))+Math.abs(a*Math.cos(f)), |
|
|
|
b.height=Math.abs(c*Math.cos(f))+Math.abs(a*Math.sin(f))));if(n&&0<b.height){for(;250<J.length;)delete u[J.shift()];u[n]||J.push(n);u[n]=b}}return b},show:function(a){return this.attr({visibility:a?"inherit":"visible"})},hide:function(a){a?this.attr({y:-9999}):this.attr({visibility:"hidden"});return this},fadeOut:function(a){var e=this;e.animate({opacity:0},{duration:a||150,complete:function(){e.attr({y:-9999})}})},add:function(a){var e=this.renderer,b=this.element;a&&(this.parentGroup=a);this.parentInverted= |
|
|
|
a&&a.inverted;"undefined"!==typeof this.textStr&&e.buildText(this);this.added=!0;if(!a||a.handleZ||this.zIndex)var c=this.zIndexSetter();c||(a?a.element:e.box).appendChild(b);if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var e=a.parentNode;e&&e.removeChild(a)},destroy:function(){var a=this,e=a.element||{},b=a.renderer,c=b.isSVG&&"SPAN"===e.nodeName&&a.parentGroup,k=e.ownerSVGElement,f=a.clipPath;e.onclick=e.onmouseout=e.onmouseover=e.onmousemove=e.point=null;J(a);f&&k&&([].forEach.call(k.querySelectorAll("[clip-path],[CLIP-PATH]"), |
|
|
|
function(a){-1<a.getAttribute("clip-path").indexOf(f.element.id)&&a.removeAttribute("clip-path")}),a.clipPath=f.destroy());if(a.stops){for(k=0;k<a.stops.length;k++)a.stops[k]=a.stops[k].destroy();a.stops=null}a.safeRemoveChild(e);for(b.styledMode||a.destroyShadows();c&&c.div&&0===c.div.childNodes.length;)e=c.parentGroup,a.safeRemoveChild(c.div),delete c.div,c=e;a.alignTo&&x(b.alignedObjects,a);m(a,function(e,b){a[b]&&a[b].parentGroup===a&&a[b].destroy&&a[b].destroy();delete a[b]})},shadow:function(a, |
|
|
|
e,b){var c=[],k,f=this.element;if(!a)this.destroyShadows();else if(!this.shadows){var A=q(a.width,3);var l=(a.opacity||.15)/A;var u=this.parentInverted?"(-1,-1)":"("+q(a.offsetX,1)+", "+q(a.offsetY,1)+")";for(k=1;k<=A;k++){var J=f.cloneNode(0);var h=2*A+1-2*k;F(J,{stroke:a.color||"#000000","stroke-opacity":l*k,"stroke-width":h,transform:"translate"+u,fill:"none"});J.setAttribute("class",(J.getAttribute("class")||"")+" highcharts-shadow");b&&(F(J,"height",Math.max(F(J,"height")-h,0)),J.cutHeight=h); |
|
|
|
e?e.element.appendChild(J):f.parentNode&&f.parentNode.insertBefore(J,f);c.push(J)}this.shadows=c}return this},destroyShadows:function(){(this.shadows||[]).forEach(function(a){this.safeRemoveChild(a)},this);this.shadows=void 0},xGetter:function(a){"circle"===this.element.nodeName&&("x"===a?a="cx":"y"===a&&(a="cy"));return this._defaultGetter(a)},_defaultGetter:function(a){a=q(this[a+"Value"],this[a],this.element?this.element.getAttribute(a):null,0);/^[\-0-9\.]+$/.test(a)&&(a=parseFloat(a));return a}, |
|
|
|
dSetter:function(a,e,b){a&&a.join&&(a=a.join(" "));/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");this[e]!==a&&(b.setAttribute(e,a),this[e]=a)},dashstyleSetter:function(a){var e,b=this["stroke-width"];"inherit"===b&&(b=1);if(a=a&&a.toLowerCase()){a=a.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(e=a.length;e--;)a[e]=w(a[e])* |
|
|
|
b;a=a.join(",").replace(/NaN/g,"none");this.element.setAttribute("stroke-dasharray",a)}},alignSetter:function(a){var e={left:"start",center:"middle",right:"end"};e[a]&&(this.alignValue=a,this.element.setAttribute("text-anchor",e[a]))},opacitySetter:function(a,e,b){this[e]=a;b.setAttribute(e,a)},titleSetter:function(a){var e=this.element.getElementsByTagName("title")[0];e||(e=I.createElementNS(this.SVG_NS,"title"),this.element.appendChild(e));e.firstChild&&e.removeChild(e.firstChild);e.appendChild(I.createTextNode(String(q(a, |
|
|
|
"")).replace(/<[^>]*>/g,"").replace(/</g,"<").replace(/>/g,">")))},textSetter:function(a){a!==this.textStr&&(delete this.bBox,delete this.textPxLength,this.textStr=a,this.added&&this.renderer.buildText(this))},setTextPath:function(a,e){var b=this.element,c={textAnchor:"text-anchor"},k=!1,f=this.textPathWrapper,A=!f;e=H(!0,{enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e);var l=e.attributes;if(a&&e&&e.enabled){f&&null===f.element.parentNode?(A=!0,f=f.destroy()):f&&this.removeTextOutline.call(f.parentGroup, |
|
|
|
[].slice.call(b.getElementsByTagName("tspan")));this.options&&this.options.padding&&(l.dx=-this.options.padding);f||(this.textPathWrapper=f=this.renderer.createElement("textPath"),k=!0);var u=f.element;(e=a.element.getAttribute("id"))||a.element.setAttribute("id",e=d.uniqueKey());if(A)for(a=b.getElementsByTagName("tspan");a.length;)a[0].setAttribute("y",0),B(l.dx)&&a[0].setAttribute("x",-l.dx),u.appendChild(a[0]);k&&f.add({element:this.text?this.text.element:b});u.setAttributeNS("http://www.w3.org/1999/xlink", |
|
|
|
"href",this.renderer.url+"#"+e);E(l.dy)&&(u.parentNode.setAttribute("dy",l.dy),delete l.dy);E(l.dx)&&(u.parentNode.setAttribute("dx",l.dx),delete l.dx);m(l,function(a,e){u.setAttribute(c[e]||e,a)});b.removeAttribute("transform");this.removeTextOutline.call(f,[].slice.call(b.getElementsByTagName("tspan")));this.text&&!this.renderer.styledMode&&this.attr({fill:"none","stroke-width":0});this.applyTextOutline=this.updateTransform=G}else f&&(delete this.updateTransform,delete this.applyTextOutline,this.destroyTextPath(b, |
|
|
|
a),this.updateTransform(),this.options.rotation&&this.applyTextOutline(this.options.style.textOutline));return this},destroyTextPath:function(a,e){var b=a.getElementsByTagName("text")[0];if(b){if(b.removeAttribute("dx"),b.removeAttribute("dy"),e.element.setAttribute("id",""),b.getElementsByTagName("textPath").length){for(a=this.textPathWrapper.element.childNodes;a.length;)b.appendChild(a[0]);b.removeChild(this.textPathWrapper.element)}}else if(a.getAttribute("dx")||a.getAttribute("dy"))a.removeAttribute("dx"), |
|
|
|
a.removeAttribute("dy");this.textPathWrapper=this.textPathWrapper.destroy()},fillSetter:function(a,e,b){"string"===typeof a?b.setAttribute(e,a):a&&this.complexColor(a,e,b)},visibilitySetter:function(a,e,b){"inherit"===a?b.removeAttribute(e):this[e]!==a&&b.setAttribute(e,a);this[e]=a},zIndexSetter:function(a,e){var b=this.renderer,c=this.parentGroup,k=(c||b).element||b.box,f=this.element,A=!1;b=k===b.box;var l=this.added;var u;E(a)?(f.setAttribute("data-z-index",a),a=+a,this[e]===a&&(l=!1)):E(this[e])&& |
|
|
|
f.removeAttribute("data-z-index");this[e]=a;if(l){(a=this.zIndex)&&c&&(c.handleZ=!0);e=k.childNodes;for(u=e.length-1;0<=u&&!A;u--){c=e[u];l=c.getAttribute("data-z-index");var J=!E(l);if(c!==f)if(0>a&&J&&!b&&!u)k.insertBefore(f,e[u]),A=!0;else if(w(l)<=a||J&&(!E(a)||0<=a))k.insertBefore(f,e[u+1]||null),A=!0}A||(k.insertBefore(f,e[b?3:0]||null),A=!0)}return A},_defaultSetter:function(a,e,b){b.setAttribute(e,a)}});P.prototype.yGetter=P.prototype.xGetter;P.prototype.translateXSetter=P.prototype.translateYSetter= |
|
|
|
P.prototype.rotationSetter=P.prototype.verticalAlignSetter=P.prototype.rotationOriginXSetter=P.prototype.rotationOriginYSetter=P.prototype.scaleXSetter=P.prototype.scaleYSetter=P.prototype.matrixSetter=function(a,e){this[e]=a;this.doTransform=!0};P.prototype["stroke-widthSetter"]=P.prototype.strokeSetter=function(a,e,b){this[e]=a;this.stroke&&this["stroke-width"]?(P.prototype.fillSetter.call(this,this.stroke,"stroke",b),b.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"=== |
|
|
|
e&&0===a&&this.hasStroke?(b.removeAttribute("stroke"),this.hasStroke=!1):this.renderer.styledMode&&this["stroke-width"]&&(b.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0)};g=d.SVGRenderer=function(){this.init.apply(this,arguments)};v(g.prototype,{Element:P,SVG_NS:Q,init:function(a,b,c,k,A,J,h){var n=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"});h||n.css(this.getStyle(k));k=n.element;a.appendChild(k);F(a,"dir","ltr");-1===a.innerHTML.indexOf("xmlns")&& |
|
|
|
F(k,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=k;this.boxWrapper=n;this.alignedObjects=[];this.url=(e||u)&&I.getElementsByTagName("base").length?U.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(I.createTextNode("Created with Highcharts 8.0.0"));this.defs=this.createElement("defs").add();this.allowHTML=J;this.forExport=A;this.styledMode=h;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount= |
|
|
|
0;this.setSize(b,c,!1);var t;e&&a.getBoundingClientRect&&(b=function(){l(a,{left:0,top:0});t=a.getBoundingClientRect();l(a,{left:Math.ceil(t.left)-t.left+"px",top:Math.ceil(t.top)-t.top+"px"})},b(),this.unSubPixelFix=f(U,"resize",b))},definition:function(a){function e(a,c){var k;h(a).forEach(function(a){var f=b.createElement(a.tagName),A={};m(a,function(a,e){"tagName"!==e&&"children"!==e&&"textContent"!==e&&(A[e]=a)});f.attr(A);f.add(c||b.defs);a.textContent&&f.element.appendChild(I.createTextNode(a.textContent)); |
|
|
|
e(a.children||[],f);k=f});return k}var b=this;return e(a)},getStyle:function(a){return this.style=v({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},setStyle:function(a){this.boxWrapper.css(this.getStyle(a))},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();D(this.gradients||{});this.gradients=null;a&&(this.defs=a.destroy());this.unSubPixelFix&& |
|
|
|
this.unSubPixelFix();return this.alignedObjects=null},createElement:function(a){var e=new this.Element;e.init(this,a);return e},draw:G,getRadialAttr:function(a,e){return{cx:a[0]-a[2]/2+e.cx*a[2],cy:a[1]-a[2]/2+e.cy*a[2],r:e.r*a[2]}},truncate:function(a,e,b,c,k,f,A){var l=this,u=a.rotation,J,h=c?1:0,n=(b||c).length,t=n,L=[],H=function(a){e.firstChild&&e.removeChild(e.firstChild);a&&e.appendChild(I.createTextNode(a))},d=function(f,u){u=u||f;if("undefined"===typeof L[u])if(e.getSubStringLength)try{L[u]= |
|
|
|
k+e.getSubStringLength(0,c?u+1:u)}catch(ha){""}else l.getSpanWidth&&(H(A(b||c,f)),L[u]=k+l.getSpanWidth(a,e));return L[u]},r;a.rotation=0;var G=d(e.textContent.length);if(r=k+G>f){for(;h<=n;)t=Math.ceil((h+n)/2),c&&(J=A(c,t)),G=d(t,J&&J.length-1),h===n?h=n+1:G>f?n=t-1:h=t;0===n?H(""):b&&n===b.length-1||H(J||A(b||c,t))}c&&c.splice(0,t);a.actualWidth=G;a.rotation=u;return r},escapes:{"&":"&","<":"<",">":">","'":"'",'"':"""},buildText:function(a){var e=a.element,b=this,c=b.forExport, |
|
|
|
k=q(a.textStr,"").toString(),f=-1!==k.indexOf("<"),A=e.childNodes,u,J=F(e,"x"),h=a.styles,n=a.textWidth,t=h&&h.lineHeight,H=h&&h.textOutline,d=h&&"ellipsis"===h.textOverflow,r=h&&"nowrap"===h.whiteSpace,G=h&&h.fontSize,g,O=A.length;h=n&&!a.added&&this.box;var V=function(a){var c;b.styledMode||(c=/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:G||b.style.fontSize||12);return t?w(t):b.fontMetrics(c,a.getAttribute("style")?a:e).h},p=function(a,e){m(b.escapes,function(b,c){e&&-1!==e.indexOf(b)|| |
|
|
|
(a=a.toString().replace(new RegExp(b,"g"),c))});return a},v=function(a,e){var b=a.indexOf("<");a=a.substring(b,a.indexOf(">")-b);b=a.indexOf(e+"=");if(-1!==b&&(b=b+e.length+1,e=a.charAt(b),'"'===e||"'"===e))return a=a.substring(b+1),a.substring(0,a.indexOf(e))},z=/<br.*?>/g;var U=[k,d,r,t,H,G,n].join();if(U!==a.textCache){for(a.textCache=U;O--;)e.removeChild(A[O]);f||H||d||n||-1!==k.indexOf(" ")&&(!r||z.test(k))?(h&&h.appendChild(e),f?(k=b.styledMode?k.replace(/<(b|strong)>/g,'<span class="highcharts-strong">').replace(/<(i|em)>/g, |
|
|
|
'<span class="highcharts-emphasized">'):k.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">'),k=k.replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(z)):k=[k],k=k.filter(function(a){return""!==a}),k.forEach(function(k,f){var A=0,h=0;k=k.replace(/^\s+|\s+$/g,"").replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");var t=k.split("|||");t.forEach(function(k){if(""!==k||1===t.length){var H={},N=I.createElementNS(b.SVG_NS, |
|
|
|
"tspan"),q,m;(q=v(k,"class"))&&F(N,"class",q);if(q=v(k,"style"))q=q.replace(/(;| |^)color([ :])/,"$1fill$2"),F(N,"style",q);(m=v(k,"href"))&&!c&&(F(N,"onclick",'location.href="'+m+'"'),F(N,"class","highcharts-anchor"),b.styledMode||l(N,{cursor:"pointer"}));k=p(k.replace(/<[a-zA-Z\/](.|\n)*?>/g,"")||" ");if(" "!==k){N.appendChild(I.createTextNode(k));A?H.dx=0:f&&null!==J&&(H.x=J);F(N,H);e.appendChild(N);!A&&g&&(!L&&c&&l(N,{display:"block"}),F(N,"dy",V(N)));if(n){var w=k.replace(/([^\^])-/g,"$1- ").split(" "); |
|
|
|
H=!r&&(1<t.length||f||1<w.length);m=0;var ba=V(N);if(d)u=b.truncate(a,N,k,void 0,0,Math.max(0,n-parseInt(G||12,10)),function(a,e){return a.substring(0,e)+"\u2026"});else if(H)for(;w.length;)w.length&&!r&&0<m&&(N=I.createElementNS(Q,"tspan"),F(N,{dy:ba,x:J}),q&&F(N,"style",q),N.appendChild(I.createTextNode(w.join(" ").replace(/- /g,"-"))),e.appendChild(N)),b.truncate(a,N,null,w,0===m?h:0,n,function(a,e){return w.slice(0,e).join(" ").replace(/- /g,"-")}),h=a.actualWidth,m++}A++}}});g=g||e.childNodes.length}), |
|
|
|
d&&u&&a.attr("title",p(a.textStr,["<",">"])),h&&h.removeChild(e),H&&a.applyTextOutline&&a.applyTextOutline(H)):e.appendChild(I.createTextNode(p(k)))}},getContrast:function(e){e=a(e).rgba;e[0]*=1;e[1]*=1.2;e[2]*=.5;return 459<e[0]+e[1]+e[2]?"#000000":"#FFFFFF"},button:function(a,e,b,c,A,l,u,J,h,n){var t=this.label(a,e,b,h,null,null,n,null,"button"),L=0,d=this.styledMode;t.attr(H({padding:8,r:2},A));if(!d){A=H({fill:"#f7f7f7",stroke:"#cccccc","stroke-width":1,style:{color:"#333333",cursor:"pointer", |
|
|
|
fontWeight:"normal"}},A);var r=A.style;delete A.style;l=H(A,{fill:"#e6e6e6"},l);var G=l.style;delete l.style;u=H(A,{fill:"#e6ebf5",style:{color:"#000000",fontWeight:"bold"}},u);var N=u.style;delete u.style;J=H(A,{style:{color:"#cccccc"}},J);var Q=J.style;delete J.style}f(t.element,k?"mouseover":"mouseenter",function(){3!==L&&t.setState(1)});f(t.element,k?"mouseout":"mouseleave",function(){3!==L&&t.setState(L)});t.setState=function(a){1!==a&&(t.state=L=a);t.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+ |
|
|
|
["normal","hover","pressed","disabled"][a||0]);d||t.attr([A,l,u,J][a||0]).css([r,G,N,Q][a||0])};d||t.attr(A).css(v({cursor:"default"},r));return t.on("click",function(a){3!==L&&c.call(t,a)})},crispLine:function(a,e){a[1]===a[4]&&(a[1]=a[4]=Math.round(a[1])-e%2/2);a[2]===a[5]&&(a[2]=a[5]=Math.round(a[2])+e%2/2);return a},path:function(a){var e=this.styledMode?{}:{fill:"none"};C(a)?e.d=a:p(a)&&v(e,a);return this.createElement("path").attr(e)},circle:function(a,e,b){a=p(a)?a:"undefined"===typeof a?{}: |
|
|
|
{x:a,y:e,r:b};e=this.createElement("circle");e.xSetter=e.ySetter=function(a,e,b){b.setAttribute("c"+e,a)};return e.attr(a)},arc:function(a,e,b,c,k,f){p(a)?(c=a,e=c.y,b=c.r,a=c.x):c={innerR:c,start:k,end:f};a=this.symbol("arc",a,e,b,b,c);a.r=b;return a},rect:function(a,e,b,c,k,f){k=p(a)?a.r:k;var A=this.createElement("rect");a=p(a)?a:"undefined"===typeof a?{}:{x:a,y:e,width:Math.max(b,0),height:Math.max(c,0)};this.styledMode||("undefined"!==typeof f&&(a.strokeWidth=f,a=A.crisp(a)),a.fill="none");k&& |
|
|
|
(a.r=k);A.rSetter=function(a,e,b){A.r=a;F(b,{rx:a,ry:a})};A.rGetter=function(){return A.r};return A.attr(a)},setSize:function(a,e,b){var c=this.alignedObjects,k=c.length;this.width=a;this.height=e;for(this.boxWrapper.animate({width:a,height:e},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:q(b,!0)?void 0:0});k--;)c[k].align()},g:function(a){var e=this.createElement("g");return a?e.attr({"class":"highcharts-"+a}):e},image:function(a,e,b,c,k,A){var l= |
|
|
|
{preserveAspectRatio:"none"},u=function(a,e){a.setAttributeNS?a.setAttributeNS("http://www.w3.org/1999/xlink","href",e):a.setAttribute("hc-svg-href",e)},J=function(e){u(h.element,a);A.call(h,e)};1<arguments.length&&v(l,{x:e,y:b,width:c,height:k});var h=this.createElement("image").attr(l);A?(u(h.element,"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),l=new U.Image,f(l,"load",J),l.src=a,l.complete&&J({})):u(h.element,a);return h},symbol:function(a,e,c,k,f,A){var u=this, |
|
|
|
J=/^url\((.*?)\)$/,h=J.test(a),t=!h&&(this.symbols[a]?a:"circle"),L=t&&this.symbols[t],H=E(e)&&L&&L.call(this.symbols,Math.round(e),Math.round(c),k,f,A);if(L){var d=this.path(H);u.styledMode||d.attr("fill","none");v(d,{symbolName:t,x:e,y:c,width:k,height:f});A&&v(d,A)}else if(h){var r=a.match(J)[1];d=this.image(r);d.imgwidth=q(V[r]&&V[r].width,A&&A.width);d.imgheight=q(V[r]&&V[r].height,A&&A.height);var G=function(){d.attr({width:d.width,height:d.height})};["width","height"].forEach(function(a){d[a+ |
|
|
|
"Setter"]=function(a,e){var b={},c=this["img"+e],k="width"===e?"translateX":"translateY";this[e]=a;E(c)&&(A&&"within"===A.backgroundSize&&this.width&&this.height&&(c=Math.round(c*Math.min(this.width/this.imgwidth,this.height/this.imgheight))),this.element&&this.element.setAttribute(e,c),this.alignByTranslate||(b[k]=((this[e]||0)-c)/2,this.attr(b)))}});E(e)&&d.attr({x:e,y:c});d.isImg=!0;E(d.imgwidth)&&E(d.imgheight)?G():(d.attr({width:0,height:0}),n("img",{onload:function(){var a=b[u.chartIndex];0=== |
|
|
|
this.width&&(l(this,{position:"absolute",top:"-999em"}),I.body.appendChild(this));V[r]={width:this.width,height:this.height};d.imgwidth=this.width;d.imgheight=this.height;d.element&&G();this.parentNode&&this.parentNode.removeChild(this);u.imgCount--;if(!u.imgCount&&a&&a.onload)a.onload()},src:r}),this.imgCount++)}return d},symbols:{circle:function(a,e,b,c){return this.arc(a+b/2,e+c/2,b/2,c/2,{start:.5*Math.PI,end:2.5*Math.PI,open:!1})},square:function(a,e,b,c){return["M",a,e,"L",a+b,e,a+b,e+c,a,e+ |
|
|
|
c,"Z"]},triangle:function(a,e,b,c){return["M",a+b/2,e,"L",a+b,e+c,a,e+c,"Z"]},"triangle-down":function(a,e,b,c){return["M",a,e,"L",a+b,e,a+b/2,e+c,"Z"]},diamond:function(a,e,b,c){return["M",a+b/2,e,"L",a+b,e+c/2,a+b/2,e+c,a,e+c/2,"Z"]},arc:function(a,e,b,c,k){var f=k.start,A=k.r||b,u=k.r||c||b,l=k.end-.001;b=k.innerR;c=q(k.open,.001>Math.abs(k.end-k.start-2*Math.PI));var J=Math.cos(f),h=Math.sin(f),n=Math.cos(l);l=Math.sin(l);f=q(k.longArc,.001>k.end-f-Math.PI?0:1);A=["M",a+A*J,e+u*h,"A",A,u,0,f, |
|
|
|
q(k.clockwise,1),a+A*n,e+u*l];E(b)&&A.push(c?"M":"L",a+b*n,e+b*l,"A",b,b,0,f,E(k.clockwise)?1-k.clockwise:0,a+b*J,e+b*h);A.push(c?"":"Z");return A},callout:function(a,e,b,c,k){var f=Math.min(k&&k.r||0,b,c),A=f+6,l=k&&k.anchorX;k=k&&k.anchorY;var u=["M",a+f,e,"L",a+b-f,e,"C",a+b,e,a+b,e,a+b,e+f,"L",a+b,e+c-f,"C",a+b,e+c,a+b,e+c,a+b-f,e+c,"L",a+f,e+c,"C",a,e+c,a,e+c,a,e+c-f,"L",a,e+f,"C",a,e,a,e,a+f,e];l&&l>b?k>e+A&&k<e+c-A?u.splice(13,3,"L",a+b,k-6,a+b+6,k,a+b,k+6,a+b,e+c-f):u.splice(13,3,"L",a+b, |
|
|
|
c/2,l,k,a+b,c/2,a+b,e+c-f):l&&0>l?k>e+A&&k<e+c-A?u.splice(33,3,"L",a,k+6,a-6,k,a,k-6,a,e+f):u.splice(33,3,"L",a,c/2,l,k,a,c/2,a,e+f):k&&k>c&&l>a+A&&l<a+b-A?u.splice(23,3,"L",l+6,e+c,l,e+c+6,l-6,e+c,a+f,e+c):k&&0>k&&l>a+A&&l<a+b-A&&u.splice(3,3,"L",l-6,e,l,e-6,l+6,e,b-f,e);return u}},clipRect:function(a,e,b,c){var k=d.uniqueKey()+"-",f=this.createElement("clipPath").attr({id:k}).add(this.defs);a=this.rect(a,e,b,c,0).add(f);a.id=k;a.clipPath=f;a.count=0;return a},text:function(a,e,b,c){var k={};if(c&& |
|
|
|
(this.allowHTML||!this.forExport))return this.html(a,e,b);k.x=Math.round(e||0);b&&(k.y=Math.round(b));E(a)&&(k.text=a);a=this.createElement("text").attr(k);c||(a.xSetter=function(a,e,b){var c=b.getElementsByTagName("tspan"),k=b.getAttribute(e),f;for(f=0;f<c.length;f++){var A=c[f];A.getAttribute(e)===k&&A.setAttribute(e,a)}b.setAttribute(e,a)});return a},fontMetrics:function(a,e){a=!this.styledMode&&/px/.test(a)||!U.getComputedStyle?a||e&&e.style&&e.style.fontSize||this.style&&this.style.fontSize: |
|
|
|
e&&P.prototype.getStyle.call(e,"font-size");a=/px/.test(a)?w(a):12;e=24>a?a+3:Math.round(1.2*a);return{h:e,b:Math.round(.8*e),f:a}},rotCorr:function(a,e,b){var c=a;e&&b&&(c=Math.max(c*Math.cos(e*t),4));return{x:-a/3*Math.sin(e*t),y:c}},label:function(a,e,b,c,k,f,l,u,J){var h=this,n=h.styledMode,t=h.g("button"!==J&&"label"),L=t.text=h.text("",0,0,l).attr({zIndex:1}),d,r,G=0,Q=3,q=0,m,I,w,N,g,V={},p,ba,z=/^url\((.*?)\)$/.test(c),U=n||z,x=function(){return n?d.strokeWidth()%2/2:(p?parseInt(p,10):0)% |
|
|
|
2/2};J&&t.addClass("highcharts-"+J);var O=function(){var a=L.element.style,e={};r=("undefined"===typeof m||"undefined"===typeof I||g)&&E(L.textStr)&&L.getBBox();t.width=(m||r.width||0)+2*Q+q;t.height=(I||r.height||0)+2*Q;ba=Q+Math.min(h.fontMetrics(a&&a.fontSize,L).b,r?r.height:Infinity);U&&(d||(t.box=d=h.symbols[c]||z?h.symbol(c):h.rect(),d.addClass(("button"===J?"":"highcharts-label-box")+(J?" highcharts-"+J+"-box":"")),d.add(t),a=x(),e.x=a,e.y=(u?-ba:0)+a),e.width=Math.round(t.width),e.height= |
|
|
|
Math.round(t.height),d.attr(v(e,V)),V={})};var ca=function(){var a=q+Q;var e=u?0:ba;E(m)&&r&&("center"===g||"right"===g)&&(a+={center:.5,right:1}[g]*(m-r.width));if(a!==L.x||e!==L.y)L.attr("x",a),L.hasBoxWidthChanged&&(r=L.getBBox(!0),O()),"undefined"!==typeof e&&L.attr("y",e);L.x=a;L.y=e};var C=function(a,e){d?d.attr(a,e):V[a]=e};t.onAdd=function(){L.add(t);t.attr({text:a||0===a?a:"",x:e,y:b});d&&E(k)&&t.attr({anchorX:k,anchorY:f})};t.widthSetter=function(a){m=B(a)?a:null};t.heightSetter=function(a){I= |
|
|
|
a};t["text-alignSetter"]=function(a){g=a};t.paddingSetter=function(a){E(a)&&a!==Q&&(Q=t.padding=a,ca())};t.paddingLeftSetter=function(a){E(a)&&a!==q&&(q=a,ca())};t.alignSetter=function(a){a={left:0,center:.5,right:1}[a];a!==G&&(G=a,r&&t.attr({x:w}))};t.textSetter=function(a){"undefined"!==typeof a&&L.attr({text:a});O();ca()};t["stroke-widthSetter"]=function(a,e){a&&(U=!0);p=this["stroke-width"]=a;C(e,a)};n?t.rSetter=function(a,e){C(e,a)}:t.strokeSetter=t.fillSetter=t.rSetter=function(a,e){"r"!==e&& |
|
|
|
("fill"===e&&a&&(U=!0),t[e]=a);C(e,a)};t.anchorXSetter=function(a,e){k=t.anchorX=a;C(e,Math.round(a)-x()-w)};t.anchorYSetter=function(a,e){f=t.anchorY=a;C(e,a-N)};t.xSetter=function(a){t.x=a;G&&(a-=G*((m||r.width)+2*Q),t["forceAnimate:x"]=!0);w=Math.round(a);t.attr("translateX",w)};t.ySetter=function(a){N=t.y=Math.round(a);t.attr("translateY",N)};var T=t.css;l={css:function(a){if(a){var e={};a=H(a);t.textProps.forEach(function(b){"undefined"!==typeof a[b]&&(e[b]=a[b],delete a[b])});L.css(e);"width"in |
|
|
|
e&&O();"fontSize"in e&&(O(),ca())}return T.call(t,a)},getBBox:function(){return{width:r.width+2*Q,height:r.height+2*Q,x:r.x-Q,y:r.y-Q}},destroy:function(){A(t.element,"mouseenter");A(t.element,"mouseleave");L&&(L=L.destroy());d&&(d=d.destroy());P.prototype.destroy.call(t);t=h=O=ca=C=null}};n||(l.shadow=function(a){a&&(O(),d&&d.shadow(a));return t});return v(t,l)}});d.Renderer=g});K(y,"parts/Html.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var M=g.attr,F=g.defined,E=g.extend, |
|
|
|
D=g.pick,x=g.pInt,v=d.createElement,C=d.css,B=d.isFirefox,p=d.isMS,z=d.isWebKit,m=d.SVGElement;g=d.SVGRenderer;var q=d.win;E(m.prototype,{htmlCss:function(d){var h="SPAN"===this.element.tagName&&d&&"width"in d,f=D(h&&d.width,void 0);if(h){delete d.width;this.textWidth=f;var c=!0}d&&"ellipsis"===d.textOverflow&&(d.whiteSpace="nowrap",d.overflow="hidden");this.styles=E(this.styles,d);C(this.element,d);c&&this.htmlUpdateTransform();return this},htmlGetBBox:function(){var d=this.element;return{x:d.offsetLeft, |
|
|
|
y:d.offsetTop,width:d.offsetWidth,height:d.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var d=this.renderer,h=this.element,f=this.translateX||0,c=this.translateY||0,b=this.x||0,a=this.y||0,l=this.textAlign||"left",n={left:0,center:.5,right:1}[l],t=this.styles,q=t&&t.whiteSpace;C(h,{marginLeft:f,marginTop:c});!d.styledMode&&this.shadows&&this.shadows.forEach(function(a){C(a,{marginLeft:f+1,marginTop:c+1})});this.inverted&&[].forEach.call(h.childNodes,function(a){d.invertChild(a,h)}); |
|
|
|
if("SPAN"===h.tagName){t=this.rotation;var r=this.textWidth&&x(this.textWidth),e=[t,l,h.innerHTML,this.textWidth,this.textAlign].join(),k;(k=r!==this.oldTextWidth)&&!(k=r>this.oldTextWidth)&&((k=this.textPxLength)||(C(h,{width:"",whiteSpace:q||"nowrap"}),k=h.offsetWidth),k=k>r);k&&(/[ \-]/.test(h.textContent||h.innerText)||"ellipsis"===h.style.textOverflow)?(C(h,{width:r+"px",display:"block",whiteSpace:q||"normal"}),this.oldTextWidth=r,this.hasBoxWidthChanged=!0):this.hasBoxWidthChanged=!1;e!==this.cTT&& |
|
|
|
(q=d.fontMetrics(h.style.fontSize,h).b,!F(t)||t===(this.oldRotation||0)&&l===this.oldAlign||this.setSpanRotation(t,n,q),this.getSpanCorrection(!F(t)&&this.textPxLength||h.offsetWidth,q,n,t,l));C(h,{left:b+(this.xCorr||0)+"px",top:a+(this.yCorr||0)+"px"});this.cTT=e;this.oldRotation=t;this.oldAlign=l}}else this.alignOnAdd=!0},setSpanRotation:function(d,h,f){var c={},b=this.renderer.getTransformKey();c[b]=c.transform="rotate("+d+"deg)";c[b+(B?"Origin":"-origin")]=c.transformOrigin=100*h+"% "+f+"px"; |
|
|
|
C(this.element,c)},getSpanCorrection:function(d,h,f){this.xCorr=-d*f;this.yCorr=-h}});E(g.prototype,{getTransformKey:function(){return p&&!/Edge/.test(q.navigator.userAgent)?"-ms-transform":z?"-webkit-transform":B?"MozTransform":q.opera?"-o-transform":""},html:function(d,h,f){var c=this.createElement("span"),b=c.element,a=c.renderer,l=a.isSVG,n=function(a,b){["opacity","visibility"].forEach(function(c){a[c+"Setter"]=function(e,k,f){var l=a.div?a.div.style:b;m.prototype[c+"Setter"].call(this,e,k,f); |
|
|
|
l&&(l[k]=e)}});a.addedSetters=!0};c.textSetter=function(a){a!==b.innerHTML&&(delete this.bBox,delete this.oldTextWidth);this.textStr=a;b.innerHTML=D(a,"");c.doTransform=!0};l&&n(c,c.element.style);c.xSetter=c.ySetter=c.alignSetter=c.rotationSetter=function(a,b){"align"===b&&(b="textAlign");c[b]=a;c.doTransform=!0};c.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)};c.attr({text:d,x:Math.round(h),y:Math.round(f)}).css({position:"absolute"});a.styledMode||c.css({fontFamily:this.style.fontFamily, |
|
|
|
fontSize:this.style.fontSize});b.style.whiteSpace="nowrap";c.css=c.htmlCss;l&&(c.add=function(f){var l=a.box.parentNode,h=[];if(this.parentGroup=f){var e=f.div;if(!e){for(;f;)h.push(f),f=f.parentGroup;h.reverse().forEach(function(a){function b(e,b){a[b]=e;"translateX"===b?f.left=e+"px":f.top=e+"px";a.doTransform=!0}var k=M(a.element,"class");e=a.div=a.div||v("div",k?{className:k}:void 0,{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px",display:a.display,opacity:a.opacity, |
|
|
|
pointerEvents:a.styles&&a.styles.pointerEvents},e||l);var f=e.style;E(a,{classSetter:function(a){return function(e){this.element.setAttribute("class",e);a.className=e}}(e),on:function(){h[0].div&&c.on.apply({element:h[0].div},arguments);return a},translateXSetter:b,translateYSetter:b});a.addedSetters||n(a)})}}else e=l;e.appendChild(b);c.added=!0;c.alignOnAdd&&c.htmlUpdateTransform();return c});return c}})});K(y,"parts/Time.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var M=g.defined, |
|
|
|
F=g.extend,E=g.isObject,D=g.objectEach,x=g.pad,v=g.pick,C=g.splat,B=d.merge,p=d.timeUnits,z=d.win;d.Time=function(d){this.update(d,!1)};d.Time.prototype={defaultOptions:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},update:function(d){var q=v(d&&d.useUTC,!0),m=this;this.options=d=B(!0,this.options||{},d);this.Date=d.Date||z.Date||Date;this.timezoneOffset=(this.useUTC=q)&&d.timezoneOffset;this.getTimezoneOffset=this.timezoneOffsetFunction();(this.variableTimezone= |
|
|
|
!(q&&!d.getTimezoneOffset&&!d.timezone))||this.timezoneOffset?(this.get=function(h,f){var c=f.getTime(),b=c-m.getTimezoneOffset(f);f.setTime(b);h=f["getUTC"+h]();f.setTime(c);return h},this.set=function(h,f,c){if("Milliseconds"===h||"Seconds"===h||"Minutes"===h&&0===f.getTimezoneOffset()%60)f["set"+h](c);else{var b=m.getTimezoneOffset(f);b=f.getTime()-b;f.setTime(b);f["setUTC"+h](c);h=m.getTimezoneOffset(f);b=f.getTime()+h;f.setTime(b)}}):q?(this.get=function(h,f){return f["getUTC"+h]()},this.set= |
|
|
|
function(h,f,c){return f["setUTC"+h](c)}):(this.get=function(h,f){return f["get"+h]()},this.set=function(h,f,c){return f["set"+h](c)})},makeTime:function(m,q,g,h,f,c){if(this.useUTC){var b=this.Date.UTC.apply(0,arguments);var a=this.getTimezoneOffset(b);b+=a;var l=this.getTimezoneOffset(b);a!==l?b+=l-a:a-36E5!==this.getTimezoneOffset(b-36E5)||d.isSafari||(b-=36E5)}else b=(new this.Date(m,q,v(g,1),v(h,0),v(f,0),v(c,0))).getTime();return b},timezoneOffsetFunction:function(){var m=this,q=this.options, |
|
|
|
g=z.moment;if(!this.useUTC)return function(h){return 6E4*(new Date(h)).getTimezoneOffset()};if(q.timezone){if(g)return function(h){return 6E4*-g.tz(h,q.timezone).utcOffset()};d.error(25)}return this.useUTC&&q.getTimezoneOffset?function(h){return 6E4*q.getTimezoneOffset(h)}:function(){return 6E4*(m.timezoneOffset||0)}},dateFormat:function(m,q,g){if(!M(q)||isNaN(q))return d.defaultOptions.lang.invalidDate||"";m=v(m,"%Y-%m-%d %H:%M:%S");var h=this,f=new this.Date(q),c=this.get("Hours",f),b=this.get("Day", |
|
|
|
f),a=this.get("Date",f),l=this.get("Month",f),n=this.get("FullYear",f),t=d.defaultOptions.lang,I=t.weekdays,r=t.shortWeekdays;f=F({a:r?r[b]:I[b].substr(0,3),A:I[b],d:x(a),e:x(a,2," "),w:b,b:t.shortMonths[l],B:t.months[l],m:x(l+1),o:l+1,y:n.toString().substr(2,2),Y:n,H:x(c),k:c,I:x(c%12||12),l:c%12||12,M:x(h.get("Minutes",f)),p:12>c?"AM":"PM",P:12>c?"am":"pm",S:x(f.getSeconds()),L:x(Math.floor(q%1E3),3)},d.dateFormats);D(f,function(a,b){for(;-1!==m.indexOf("%"+b);)m=m.replace("%"+b,"function"===typeof a? |
|
|
|
a.call(h,q):a)});return g?m.substr(0,1).toUpperCase()+m.substr(1):m},resolveDTLFormat:function(d){return E(d,!0)?d:(d=C(d),{main:d[0],from:d[1],to:d[2]})},getTimeTicks:function(d,q,g,h){var f=this,c=[],b={};var a=new f.Date(q);var l=d.unitRange,n=d.count||1,t;h=v(h,1);if(M(q)){f.set("Milliseconds",a,l>=p.second?0:n*Math.floor(f.get("Milliseconds",a)/n));l>=p.second&&f.set("Seconds",a,l>=p.minute?0:n*Math.floor(f.get("Seconds",a)/n));l>=p.minute&&f.set("Minutes",a,l>=p.hour?0:n*Math.floor(f.get("Minutes", |
|
|
|
a)/n));l>=p.hour&&f.set("Hours",a,l>=p.day?0:n*Math.floor(f.get("Hours",a)/n));l>=p.day&&f.set("Date",a,l>=p.month?1:Math.max(1,n*Math.floor(f.get("Date",a)/n)));if(l>=p.month){f.set("Month",a,l>=p.year?0:n*Math.floor(f.get("Month",a)/n));var m=f.get("FullYear",a)}l>=p.year&&f.set("FullYear",a,m-m%n);l===p.week&&(m=f.get("Day",a),f.set("Date",a,f.get("Date",a)-m+h+(m<h?-7:0)));m=f.get("FullYear",a);h=f.get("Month",a);var r=f.get("Date",a),e=f.get("Hours",a);q=a.getTime();f.variableTimezone&&(t=g- |
|
|
|
q>4*p.month||f.getTimezoneOffset(q)!==f.getTimezoneOffset(g));q=a.getTime();for(a=1;q<g;)c.push(q),q=l===p.year?f.makeTime(m+a*n,0):l===p.month?f.makeTime(m,h+a*n):!t||l!==p.day&&l!==p.week?t&&l===p.hour&&1<n?f.makeTime(m,h,r,e+a*n):q+l*n:f.makeTime(m,h,r+a*n*(l===p.day?1:7)),a++;c.push(q);l<=p.hour&&1E4>c.length&&c.forEach(function(a){0===a%18E5&&"000000000"===f.dateFormat("%H%M%S%L",a)&&(b[a]="day")})}c.info=F(d,{higherRanks:b,totalRange:l*n});return c}}});K(y,"parts/Options.js",[y["parts/Globals.js"]], |
|
|
|
function(d){var g=d.color,M=d.merge;d.defaultOptions={colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #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:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:d.Time.prototype.defaultOptions,chart:{styledMode:!1,borderRadius:0,colorCount:10,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}},width:null,height:null,borderColor:"#335cad",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"},title:{text:"Chart title",align:"center", |
|
|
|
margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",alignColumns:!0,layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"}, |
|
|
|
itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:d.svg,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"},footerFormat:"",padding:8,snap:d.isTouchDevice?25:10,headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">\u25cf</span> {series.name}: <b>{point.y}</b><br/>',backgroundColor:g("#f7f7f7").setOpacity(.85).get(),borderWidth:1,shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px", |
|
|
|
pointerEvents:"none",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};d.setOptions=function(g){d.defaultOptions=M(!0,d.defaultOptions,g);(g.time||g.global)&&d.time.update(M(d.defaultOptions.global,d.defaultOptions.time,g.global,g.time));return d.defaultOptions};d.getOptions=function(){return d.defaultOptions};d.defaultPlotOptions= |
|
|
|
d.defaultOptions.plotOptions;d.time=new d.Time(M(d.defaultOptions.global,d.defaultOptions.time));d.dateFormat=function(g,E,D){return d.time.dateFormat(g,E,D)};""});K(y,"parts/Tick.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var M=g.clamp,F=g.correctFloat,E=g.defined,D=g.destroyObjectProperties,x=g.extend,v=g.isNumber,C=g.objectEach,B=g.pick,p=d.fireEvent,z=d.merge,m=d.deg2rad;d.Tick=function(d,m,h,f,c){this.axis=d;this.pos=m;this.type=h||"";this.isNewLabel=this.isNew=!0;this.parameters= |
|
|
|
c||{};this.tickmarkOffset=this.parameters.tickmarkOffset;this.options=this.parameters.options;h||f||this.addLabel()};d.Tick.prototype={addLabel:function(){var d=this,m=d.axis,h=m.options,f=m.chart,c=m.categories,b=m.names,a=d.pos,l=B(d.options&&d.options.labels,h.labels),n=m.tickPositions,t=a===n[0],g=a===n[n.length-1];b=this.parameters.category||(c?B(c[a],b[a],a):a);var r=d.label;c=(!l.step||1===l.step)&&1===m.tickInterval;n=n.info;var e,k;if(m.isDatetimeAxis&&n){var u=f.time.resolveDTLFormat(h.dateTimeLabelFormats[!h.grid&& |
|
|
|
n.higherRanks[a]||n.unitName]);var H=u.main}d.isFirst=t;d.isLast=g;d.formatCtx={axis:m,chart:f,isFirst:t,isLast:g,dateTimeLabelFormat:H,tickPositionInfo:n,value:m.isLog?F(m.lin2log(b)):b,pos:a};h=m.labelFormatter.call(d.formatCtx,this.formatCtx);if(k=u&&u.list)d.shortenLabel=function(){for(e=0;e<k.length;e++)if(r.attr({text:m.labelFormatter.call(x(d.formatCtx,{dateTimeLabelFormat:k[e]}))}),r.getBBox().width<m.getSlotWidth(d)-2*B(l.padding,5))return;r.attr({text:""})};c&&m._addedPlotLB&&m.isXAxis&& |
|
|
|
d.moveLabel(h,l);E(r)||d.movedLabel?r&&r.textStr!==h&&!c&&(!r.textWidth||l.style&&l.style.width||r.styles.width||r.css({width:null}),r.attr({text:h}),r.textPxLength=r.getBBox().width):(d.label=r=d.createLabel({x:0,y:0},h,l),d.rotation=0)},moveLabel:function(d,m){var h=this,f=h.label,c=!1,b=h.axis,a=b.reversed,l=b.chart.inverted;f&&f.textStr===d?(h.movedLabel=f,c=!0,delete h.label):C(b.ticks,function(a){c||a.isNew||a===h||!a.label||a.label.textStr!==d||(h.movedLabel=a.label,c=!0,a.labelPos=h.movedLabel.xy, |
|
|
|
delete a.label)});if(!c&&(h.labelPos||f)){var n=h.labelPos||f.xy;f=l?n.x:a?0:b.width+b.left;b=l?a?b.width+b.left:0:n.y;h.movedLabel=h.createLabel({x:f,y:b},d,m);h.movedLabel&&h.movedLabel.attr({opacity:0})}},createLabel:function(d,m,h){var f=this.axis,c=f.chart;if(d=E(m)&&h.enabled?c.renderer.text(m,d.x,d.y,h.useHTML).add(f.labelGroup):null)c.styledMode||d.css(z(h.style)),d.textPxLength=d.getBBox().width;return d},replaceMovedLabel:function(){var d=this.label,m=this.axis,h=m.reversed,f=this.axis.chart.inverted; |
|
|
|
if(d&&!this.isNew){var c=f?d.xy.x:h?m.left:m.width+m.left;h=f?h?m.width+m.top:m.top:d.xy.y;d.animate({x:c,y:h,opacity:0},void 0,d.destroy);delete this.label}m.isDirty=!0;this.label=this.movedLabel;delete this.movedLabel},getLabelSize:function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},handleOverflow:function(d){var g=this.axis,h=g.options.labels,f=d.x,c=g.chart.chartWidth,b=g.chart.spacing,a=B(g.labelLeft,Math.min(g.pos,b[3]));b=B(g.labelRight,Math.max(g.isRadial? |
|
|
|
0:g.pos+g.len,c-b[1]));var l=this.label,n=this.rotation,t={left:0,center:.5,right:1}[g.labelAlign||l.attr("align")],q=l.getBBox().width,r=g.getSlotWidth(this),e=r,k=1,u,H={};if(n||"justify"!==B(h.overflow,"justify"))0>n&&f-t*q<a?u=Math.round(f/Math.cos(n*m)-a):0<n&&f+t*q>b&&(u=Math.round((c-f)/Math.cos(n*m)));else if(c=f+(1-t)*q,f-t*q<a?e=d.x+e*(1-t)-a:c>b&&(e=b-d.x+e*t,k=-1),e=Math.min(r,e),e<r&&"center"===g.labelAlign&&(d.x+=k*(r-e-t*(r-Math.min(q,e)))),q>e||g.autoRotation&&(l.styles||{}).width)u= |
|
|
|
e;u&&(this.shortenLabel?this.shortenLabel():(H.width=Math.floor(u),(h.style||{}).textOverflow||(H.textOverflow="ellipsis"),l.css(H)))},getPosition:function(d,m,h,f){var c=this.axis,b=c.chart,a=f&&b.oldChartHeight||b.chartHeight;d={x:d?F(c.translate(m+h,null,null,f)+c.transB):c.left+c.offset+(c.opposite?(f&&b.oldChartWidth||b.chartWidth)-c.right-c.left:0),y:d?a-c.bottom+c.offset-(c.opposite?c.height:0):F(a-c.translate(m+h,null,null,f)-c.transB)};d.y=M(d.y,-1E5,1E5);p(this,"afterGetPosition",{pos:d}); |
|
|
|
return d},getLabelPosition:function(d,g,h,f,c,b,a,l){var n=this.axis,t=n.transA,q=n.isLinked&&n.linkedParent?n.linkedParent.reversed:n.reversed,r=n.staggerLines,e=n.tickRotCorr||{x:0,y:0},k=c.y,u=f||n.reserveSpaceDefault?0:-n.labelOffset*("center"===n.labelAlign?.5:1),H={};E(k)||(k=0===n.side?h.rotation?-8:-h.getBBox().height:2===n.side?e.y+8:Math.cos(h.rotation*m)*(e.y-h.getBBox(!1,0).height/2));d=d+c.x+u+e.x-(b&&f?b*t*(q?-1:1):0);g=g+k-(b&&!f?b*t*(q?1:-1):0);r&&(h=a/(l||1)%r,n.opposite&&(h=r-h- |
|
|
|
1),g+=n.labelOffset/r*h);H.x=d;H.y=Math.round(g);p(this,"afterGetLabelPosition",{pos:H,tickmarkOffset:b,index:a});return H},getMarkPath:function(d,m,h,f,c,b){return b.crispLine(["M",d,m,"L",d+(c?0:-h),m+(c?h:0)],f)},renderGridLine:function(d,m,h){var f=this.axis,c=f.options,b=this.gridLine,a={},l=this.pos,n=this.type,t=B(this.tickmarkOffset,f.tickmarkOffset),g=f.chart.renderer,r=n?n+"Grid":"grid",e=c[r+"LineWidth"],k=c[r+"LineColor"];c=c[r+"LineDashStyle"];b||(f.chart.styledMode||(a.stroke=k,a["stroke-width"]= |
|
|
|
e,c&&(a.dashstyle=c)),n||(a.zIndex=1),d&&(m=0),this.gridLine=b=g.path().attr(a).addClass("highcharts-"+(n?n+"-":"")+"grid-line").add(f.gridGroup));if(b&&(h=f.getPlotLinePath({value:l+t,lineWidth:b.strokeWidth()*h,force:"pass",old:d})))b[d||this.isNew?"attr":"animate"]({d:h,opacity:m})},renderMark:function(d,m,h){var f=this.axis,c=f.options,b=f.chart.renderer,a=this.type,l=a?a+"Tick":"tick",n=f.tickSize(l),t=this.mark,g=!t,r=d.x;d=d.y;var e=B(c[l+"Width"],!a&&f.isXAxis?1:0);c=c[l+"Color"];n&&(f.opposite&& |
|
|
|
(n[0]=-n[0]),g&&(this.mark=t=b.path().addClass("highcharts-"+(a?a+"-":"")+"tick").add(f.axisGroup),f.chart.styledMode||t.attr({stroke:c,"stroke-width":e})),t[g?"attr":"animate"]({d:this.getMarkPath(r,d,n[0],t.strokeWidth()*h,f.horiz,b),opacity:m}))},renderLabel:function(d,m,h,f){var c=this.axis,b=c.horiz,a=c.options,l=this.label,n=a.labels,t=n.step;c=B(this.tickmarkOffset,c.tickmarkOffset);var g=!0,r=d.x;d=d.y;l&&v(r)&&(l.xy=d=this.getLabelPosition(r,d,l,b,n,c,f,t),this.isFirst&&!this.isLast&&!B(a.showFirstLabel, |
|
|
|
1)||this.isLast&&!this.isFirst&&!B(a.showLastLabel,1)?g=!1:!b||n.step||n.rotation||m||0===h||this.handleOverflow(d),t&&f%t&&(g=!1),g&&v(d.y)?(d.opacity=h,l[this.isNewLabel?"attr":"animate"](d),this.isNewLabel=!1):(l.attr("y",-9999),this.isNewLabel=!0))},render:function(m,g,h){var f=this.axis,c=f.horiz,b=this.pos,a=B(this.tickmarkOffset,f.tickmarkOffset);b=this.getPosition(c,b,a,g);a=b.x;var l=b.y;f=c&&a===f.pos+f.len||!c&&l===f.pos?-1:1;h=B(h,1);this.isActive=!0;this.renderGridLine(g,h,f);this.renderMark(b, |
|
|
|
h,f);this.renderLabel(b,g,h,m);this.isNew=!1;d.fireEvent(this,"afterRender")},destroy:function(){D(this,this.axis)}}});K(y,"parts/Axis.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var M=g.animObject,F=g.arrayMax,E=g.arrayMin,D=g.clamp,x=g.correctFloat,v=g.defined,C=g.destroyObjectProperties,B=g.extend,p=g.isArray,z=g.isNumber,m=g.isString,q=g.objectEach,w=g.pick,h=g.relativeLength,f=g.splat,c=g.syncTimeout,b=d.addEvent,a=d.color,l=d.defaultOptions,n=d.deg2rad,t=d.fireEvent,I= |
|
|
|
d.format,r=d.getMagnitude,e=d.merge,k=d.normalizeTickInterval,u=d.removeEvent,H=d.seriesTypes,G=d.Tick;g=function(){this.init.apply(this,arguments)};B(g.prototype,{defaultOptions:{dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L",range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e. %b"},week:{main:"%e. %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,labels:{enabled:!0,indentation:10,x:0,style:{color:"#666666",cursor:"default", |
|
|
|
fontSize:"11px"}},maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",minPadding:.01,showEmpty:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle",style:{color:"#666666"}},type:"linear",minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",tickColor:"#ccd6eb"},defaultYAxisOptions:{endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72, |
|
|
|
showLastLabel:!0,labels:{x:-8},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){var a=this.axis.chart.numberFormatter;return a(this.total,-1)},style:{color:"#000000",fontSize:"11px",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},defaultLeftAxisOptions:{labels:{x:-15},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45], |
|
|
|
x:0},margin:15,title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}},init:function(a,e){var c=e.isX,k=this;k.chart=a;k.horiz=a.inverted&&!k.isZAxis?!c:c;k.isXAxis=c;k.coll=k.coll||(c?"xAxis":"yAxis");t(this,"init",{userOptions:e});k.opposite=e.opposite;k.side=e.side||(k.horiz?k.opposite?0:2:k.opposite?1:3);k.setOptions(e);var A=this.options,l=A.type;k.labelFormatter=A.labels.formatter||k.defaultLabelFormatter;k.userOptions=e;k.minPixelPadding=0;k.reversed= |
|
|
|
A.reversed;k.visible=!1!==A.visible;k.zoomEnabled=!1!==A.zoomEnabled;k.hasNames="category"===l||!0===A.categories;k.categories=A.categories||k.hasNames;k.names||(k.names=[],k.names.keys={});k.plotLinesAndBandsGroups={};k.isLog="logarithmic"===l;k.isDatetimeAxis="datetime"===l;k.positiveValuesOnly=k.isLog&&!k.allowNegativeLog;k.isLinked=v(A.linkedTo);k.ticks={};k.labelEdge=[];k.minorTicks={};k.plotLinesAndBands=[];k.alternateBands={};k.len=0;k.minRange=k.userMinRange=A.minRange||A.maxZoom;k.range= |
|
|
|
A.range;k.offset=A.offset||0;k.stacks={};k.oldStacks={};k.stacksTouched=0;k.max=null;k.min=null;k.crosshair=w(A.crosshair,f(a.options.tooltip.crosshairs)[c?0:1],!1);e=k.options.events;-1===a.axes.indexOf(k)&&(c?a.axes.splice(a.xAxis.length,0,k):a.axes.push(k),a[k.coll].push(k));k.series=k.series||[];a.inverted&&!k.isZAxis&&c&&"undefined"===typeof k.reversed&&(k.reversed=!0);q(e,function(a,e){d.isFunction(a)&&b(k,e,a)});k.lin2log=A.linearToLogConverter||k.lin2log;k.isLog&&(k.val2lin=k.log2lin,k.lin2val= |
|
|
|
k.lin2log);t(this,"afterInit")},setOptions:function(a){this.options=e(this.defaultOptions,"yAxis"===this.coll&&this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],e(l[this.coll],a));t(this,"afterSetOptions",{userOptions:a})},defaultLabelFormatter:function(){var a=this.axis,e=this.value,b=a.chart.time,c=a.categories,k=this.dateTimeLabelFormat,f=l.lang,u=f.numericSymbols;f=f.numericSymbolMagnitude||1E3; |
|
|
|
var d=u&&u.length,h=a.options.labels.format;a=a.isLog?Math.abs(e):a.tickInterval;var t=this.chart,n=t.numberFormatter;if(h)var r=I(h,this,t);else if(c)r=e;else if(k)r=b.dateFormat(k,e);else if(d&&1E3<=a)for(;d--&&"undefined"===typeof r;)b=Math.pow(f,d+1),a>=b&&0===10*e%b&&null!==u[d]&&0!==e&&(r=n(e/b,-1)+u[d]);"undefined"===typeof r&&(r=1E4<=Math.abs(e)?n(e,-1):n(e,-1,void 0,""));return r},getSeriesExtremes:function(){var a=this,e=a.chart,b;t(this,"getSeriesExtremes",null,function(){a.hasVisibleSeries= |
|
|
|
!1;a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.buildStacks&&a.buildStacks();a.series.forEach(function(c){if(c.visible||!e.options.chart.ignoreHiddenSeries){var k=c.options,f=k.threshold;a.hasVisibleSeries=!0;a.positiveValuesOnly&&0>=f&&(f=null);if(a.isXAxis){if(k=c.xData,k.length){b=c.getXExtremes(k);var A=b.min;var l=b.max;z(A)||A instanceof Date||(k=k.filter(z),b=c.getXExtremes(k),A=b.min,l=b.max);k.length&&(a.dataMin=Math.min(w(a.dataMin,A),A),a.dataMax=Math.max(w(a.dataMax, |
|
|
|
l),l))}}else if(c.getExtremes(),l=c.dataMax,A=c.dataMin,v(A)&&v(l)&&(a.dataMin=Math.min(w(a.dataMin,A),A),a.dataMax=Math.max(w(a.dataMax,l),l)),v(f)&&(a.threshold=f),!k.softThreshold||a.positiveValuesOnly)a.softThreshold=!1}})});t(this,"afterGetSeriesExtremes")},translate:function(a,e,b,c,k,f){var A=this.linkedParent||this,l=1,u=0,J=c?A.oldTransA:A.transA;c=c?A.oldMin:A.min;var d=A.minPixelPadding;k=(A.isOrdinal||A.isBroken||A.isLog&&k)&&A.lin2val;J||(J=A.transA);b&&(l*=-1,u=A.len);A.reversed&&(l*= |
|
|
|
-1,u-=l*(A.sector||A.len));e?(a=(a*l+u-d)/J+c,k&&(a=A.lin2val(a))):(k&&(a=A.val2lin(a)),a=z(c)?l*(a-c)*J+u+l*d+(z(f)?J*f:0):void 0);return a},toPixels:function(a,e){return this.translate(a,!1,!this.horiz,null,!0)+(e?0:this.pos)},toValue:function(a,e){return this.translate(a-(e?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a){var e=this,b=e.chart,c=e.left,k=e.top,f=a.old,A=a.value,l=a.translatedValue,u=a.lineWidth,d=a.force,h,n,r,H,G=f&&b.oldChartHeight||b.chartHeight,m=f&&b.oldChartWidth|| |
|
|
|
b.chartWidth,g,q=e.transB,I=function(a,e,b){if("pass"!==d&&a<e||a>b)d?a=D(a,e,b):g=!0;return a};a={value:A,lineWidth:u,old:f,force:d,acrossPanes:a.acrossPanes,translatedValue:l};t(this,"getPlotLinePath",a,function(a){l=w(l,e.translate(A,null,null,f));l=D(l,-1E5,1E5);h=r=Math.round(l+q);n=H=Math.round(G-l-q);z(l)?e.horiz?(n=k,H=G-e.bottom,h=r=I(h,c,c+e.width)):(h=c,r=m-e.right,n=H=I(n,k,k+e.height)):(g=!0,d=!1);a.path=g&&!d?null:b.renderer.crispLine(["M",h,n,"L",r,H],u||1)});return a.path},getLinearTickPositions:function(a, |
|
|
|
e,b){var c=x(Math.floor(e/a)*a);b=x(Math.ceil(b/a)*a);var k=[],f;x(c+a)===c&&(f=20);if(this.single)return[e];for(e=c;e<=b;){k.push(e);e=x(e+a,f);if(e===l)break;var l=e}return k},getMinorTickInterval:function(){var a=this.options;return!0===a.minorTicks?w(a.minorTickInterval,"auto"):!1===a.minorTicks?null:a.minorTickInterval},getMinorTickPositions:function(){var a=this,e=a.options,b=a.tickPositions,c=a.minorTickInterval,k=[],f=a.pointRangePadding||0,l=a.min-f;f=a.max+f;var u=f-l;if(u&&u/c<a.len/3)if(a.isLog)this.paddedTicks.forEach(function(e, |
|
|
|
b,f){b&&k.push.apply(k,a.getLogTickPositions(c,f[b-1],f[b],!0))});else if(a.isDatetimeAxis&&"auto"===this.getMinorTickInterval())k=k.concat(a.getTimeTicks(a.normalizeTimeTickInterval(c),l,f,e.startOfWeek));else for(e=l+(b[0]-l)%c;e<=f&&e!==k[0];e+=c)k.push(e);0!==k.length&&a.trimTicks(k);return k},adjustForMinRange:function(){var a=this.options,e=this.min,b=this.max,c,k,f,l,u;this.isXAxis&&"undefined"===typeof this.minRange&&!this.isLog&&(v(a.min)||v(a.max)?this.minRange=null:(this.series.forEach(function(a){l= |
|
|
|
a.xData;for(k=u=a.xIncrement?1:l.length-1;0<k;k--)if(f=l[k]-l[k-1],"undefined"===typeof c||f<c)c=f}),this.minRange=Math.min(5*c,this.dataMax-this.dataMin)));if(b-e<this.minRange){var d=this.dataMax-this.dataMin>=this.minRange;var h=this.minRange;var t=(h-b+e)/2;t=[e-t,w(a.min,e-t)];d&&(t[2]=this.isLog?this.log2lin(this.dataMin):this.dataMin);e=F(t);b=[e+h,w(a.max,e+h)];d&&(b[2]=this.isLog?this.log2lin(this.dataMax):this.dataMax);b=E(b);b-e<h&&(t[0]=b-h,t[1]=w(a.min,b-h),e=F(t))}this.min=e;this.max= |
|
|
|
b},getClosest:function(){var a;this.categories?a=1:this.series.forEach(function(e){var b=e.closestPointRange,c=e.visible||!e.chart.options.chart.ignoreHiddenSeries;!e.noSharedTooltip&&v(b)&&c&&(a=v(a)?Math.min(a,b):b)});return a},nameToX:function(a){var e=p(this.categories),b=e?this.categories:this.names,c=a.options.x;a.series.requireSorting=!1;v(c)||(c=!1===this.options.uniqueNames?a.series.autoIncrement():e?b.indexOf(a.name):w(b.keys[a.name],-1));if(-1===c){if(!e)var k=b.length}else k=c;"undefined"!== |
|
|
|
typeof k&&(this.names[k]=a.name,this.names.keys[a.name]=k);return k},updateNames:function(){var a=this,e=this.names;0<e.length&&(Object.keys(e.keys).forEach(function(a){delete e.keys[a]}),e.length=0,this.minRange=this.userMinRange,(this.series||[]).forEach(function(e){e.xIncrement=null;if(!e.points||e.isDirtyData)a.max=Math.max(a.max,e.xData.length-1),e.processData(),e.generatePoints();e.data.forEach(function(b,c){if(b&&b.options&&"undefined"!==typeof b.name){var k=a.nameToX(b);"undefined"!==typeof k&& |
|
|
|
k!==b.x&&(b.x=k,e.xData[c]=k)}})}))},setAxisTranslation:function(a){var e=this,b=e.max-e.min,c=e.axisPointRange||0,k=0,f=0,l=e.linkedParent,u=!!e.categories,A=e.transA,d=e.isXAxis;if(d||u||c){var h=e.getClosest();l?(k=l.minPointOffset,f=l.pointRangePadding):e.series.forEach(function(a){var b=u?1:d?w(a.options.pointRange,h,0):e.axisPointRange||0,l=a.options.pointPlacement;c=Math.max(c,b);if(!e.single||u)a=H.xrange&&a instanceof H.xrange?!d:d,k=Math.max(k,a&&m(l)?0:b/2),f=Math.max(f,a&&"on"===l?0:b)}); |
|
|
|
l=e.ordinalSlope&&h?e.ordinalSlope/h:1;e.minPointOffset=k*=l;e.pointRangePadding=f*=l;e.pointRange=Math.min(c,e.single&&u?1:b);d&&(e.closestPointRange=h)}a&&(e.oldTransA=A);e.translationSlope=e.transA=A=e.staticScale||e.len/(b+f||1);e.transB=e.horiz?e.left:e.bottom;e.minPixelPadding=A*k;t(this,"afterSetAxisTranslation")},minFromRange:function(){return this.max-this.range},setTickInterval:function(a){var e=this,b=e.chart,c=e.options,f=e.isLog,l=e.isDatetimeAxis,u=e.isXAxis,A=e.isLinked,h=c.maxPadding, |
|
|
|
n=c.minPadding,H=c.tickInterval,G=c.tickPixelInterval,m=e.categories,g=z(e.threshold)?e.threshold:null,q=e.softThreshold;l||m||A||this.getTickAmount();var I=w(e.userMin,c.min);var p=w(e.userMax,c.max);if(A){e.linkedParent=b[e.coll][c.linkedTo];var C=e.linkedParent.getExtremes();e.min=w(C.min,C.dataMin);e.max=w(C.max,C.dataMax);c.type!==e.linkedParent.options.type&&d.error(11,1,b)}else{if(!q&&v(g))if(e.dataMin>=g)C=g,n=0;else if(e.dataMax<=g){var B=g;h=0}e.min=w(I,C,e.dataMin);e.max=w(p,B,e.dataMax)}f&& |
|
|
|
(e.positiveValuesOnly&&!a&&0>=Math.min(e.min,w(e.dataMin,e.min))&&d.error(10,1,b),e.min=x(e.log2lin(e.min),16),e.max=x(e.log2lin(e.max),16));e.range&&v(e.max)&&(e.userMin=e.min=I=Math.max(e.dataMin,e.minFromRange()),e.userMax=p=e.max,e.range=null);t(e,"foundExtremes");e.beforePadding&&e.beforePadding();e.adjustForMinRange();!(m||e.axisPointRange||e.usePercentage||A)&&v(e.min)&&v(e.max)&&(b=e.max-e.min)&&(!v(I)&&n&&(e.min-=b*n),!v(p)&&h&&(e.max+=b*h));z(e.userMin)||(z(c.softMin)&&c.softMin<e.min&& |
|
|
|
(e.min=I=c.softMin),z(c.floor)&&(e.min=Math.max(e.min,c.floor)));z(e.userMax)||(z(c.softMax)&&c.softMax>e.max&&(e.max=p=c.softMax),z(c.ceiling)&&(e.max=Math.min(e.max,c.ceiling)));q&&v(e.dataMin)&&(g=g||0,!v(I)&&e.min<g&&e.dataMin>=g?e.min=e.options.minRange?Math.min(g,e.max-e.minRange):g:!v(p)&&e.max>g&&e.dataMax<=g&&(e.max=e.options.minRange?Math.max(g,e.min+e.minRange):g));e.tickInterval=e.min===e.max||"undefined"===typeof e.min||"undefined"===typeof e.max?1:A&&!H&&G===e.linkedParent.options.tickPixelInterval? |
|
|
|
H=e.linkedParent.tickInterval:w(H,this.tickAmount?(e.max-e.min)/Math.max(this.tickAmount-1,1):void 0,m?1:(e.max-e.min)*G/Math.max(e.len,G));u&&!a&&e.series.forEach(function(a){a.processData(e.min!==e.oldMin||e.max!==e.oldMax)});e.setAxisTranslation(!0);e.beforeSetTickPositions&&e.beforeSetTickPositions();e.postProcessTickInterval&&(e.tickInterval=e.postProcessTickInterval(e.tickInterval));e.pointRange&&!H&&(e.tickInterval=Math.max(e.pointRange,e.tickInterval));a=w(c.minTickInterval,e.isDatetimeAxis&& |
|
|
|
e.closestPointRange);!H&&e.tickInterval<a&&(e.tickInterval=a);l||f||H||(e.tickInterval=k(e.tickInterval,null,r(e.tickInterval),w(c.allowDecimals,!(.5<e.tickInterval&&5>e.tickInterval&&1E3<e.max&&9999>e.max)),!!this.tickAmount));this.tickAmount||(e.tickInterval=e.unsquish());this.setTickPositions()},setTickPositions:function(){var a=this.options,e=a.tickPositions;var b=this.getMinorTickInterval();var c=a.tickPositioner,k=a.startOnTick,f=a.endOnTick;this.tickmarkOffset=this.categories&&"between"=== |
|
|
|
a.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval="auto"===b&&this.tickInterval?this.tickInterval/5:b;this.single=this.min===this.max&&v(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||!1!==a.allowDecimals);this.tickPositions=b=e&&e.slice();!b&&(!this.ordinalPositions&&(this.max-this.min)/this.tickInterval>Math.max(2*this.len,200)?(b=[this.min,this.max],d.error(19,!1,this.chart)):b=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval, |
|
|
|
a.units),this.min,this.max,a.startOfWeek,this.ordinalPositions,this.closestPointRange,!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max),b.length>this.len&&(b=[b[0],b.pop()],b[0]===b[1]&&(b.length=1)),this.tickPositions=b,c&&(c=c.apply(this,[this.min,this.max])))&&(this.tickPositions=b=c);this.paddedTicks=b.slice(0);this.trimTicks(b,k,f);this.isLinked||(this.single&&2>b.length&&!this.categories&&(this.min-= |
|
|
|
.5,this.max+=.5),e||c||this.adjustTickAmount());t(this,"afterSetTickPositions")},trimTicks:function(a,e,b){var c=a[0],k=a[a.length-1],f=this.minPointOffset||0;t(this,"trimTicks");if(!this.isLinked){if(e&&-Infinity!==c)this.min=c;else for(;this.min-f>a[0];)a.shift();if(b)this.max=k;else for(;this.max+f<a[a.length-1];)a.pop();0===a.length&&v(c)&&!this.options.tickPositions&&a.push((k+c)/2)}},alignToOthers:function(){var a={},e,b=this.options;!1===this.chart.options.chart.alignTicks||!1===b.alignTicks|| |
|
|
|
!1===b.startOnTick||!1===b.endOnTick||this.isLog||this.chart[this.coll].forEach(function(b){var c=b.options;c=[b.horiz?c.left:c.top,c.width,c.height,c.pane].join();b.series.length&&(a[c]?e=!0:a[c]=1)});return e},getTickAmount:function(){var a=this.options,e=a.tickAmount,b=a.tickPixelInterval;!v(a.tickInterval)&&this.len<b&&!this.isRadial&&!this.isLog&&a.startOnTick&&a.endOnTick&&(e=2);!e&&this.alignToOthers()&&(e=Math.ceil(this.len/b)+1);4>e&&(this.finalTickAmt=e,e=5);this.tickAmount=e},adjustTickAmount:function(){var a= |
|
|
|
this.options,e=this.tickInterval,b=this.tickPositions,c=this.tickAmount,k=this.finalTickAmt,f=b&&b.length,l=w(this.threshold,this.softThreshold?0:null),u;if(this.hasData()){if(f<c){for(u=this.min;b.length<c;)b.length%2||u===l?b.push(x(b[b.length-1]+e)):b.unshift(x(b[0]-e));this.transA*=(f-1)/(c-1);this.min=a.startOnTick?b[0]:Math.min(this.min,b[0]);this.max=a.endOnTick?b[b.length-1]:Math.max(this.max,b[b.length-1])}else f>c&&(this.tickInterval*=2,this.setTickPositions());if(v(k)){for(e=a=b.length;e--;)(3=== |
|
|
|
k&&1===e%2||2>=k&&0<e&&e<a-1)&&b.splice(e,1);this.finalTickAmt=void 0}}},setScale:function(){var a=this.series.some(function(a){return a.isDirtyData||a.isDirty||a.xAxis&&a.xAxis.isDirty}),e;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();(e=this.len!==this.oldAxisLength)||a||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax||this.alignToOthers()?(this.resetStacks&&this.resetStacks(),this.forceRedraw=!1,this.getSeriesExtremes(), |
|
|
|
this.setTickInterval(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax,this.isDirty||(this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax)):this.cleanStacks&&this.cleanStacks();t(this,"afterSetScale")},setExtremes:function(a,e,b,c,k){var f=this,l=f.chart;b=w(b,!0);f.series.forEach(function(a){delete a.kdTree});k=B(k,{min:a,max:e});t(f,"setExtremes",k,function(){f.userMin=a;f.userMax=e;f.eventArgs=k;b&&l.redraw(c)})},zoom:function(a,e){var b=this.dataMin,c=this.dataMax,k=this.options, |
|
|
|
f=Math.min(b,w(k.min,b)),l=Math.max(c,w(k.max,c));a={newMin:a,newMax:e};t(this,"zoom",a,function(a){var e=a.newMin,k=a.newMax;if(e!==this.min||k!==this.max)this.allowZoomOutside||(v(b)&&(e<f&&(e=f),e>l&&(e=l)),v(c)&&(k<f&&(k=f),k>l&&(k=l))),this.displayBtn="undefined"!==typeof e||"undefined"!==typeof k,this.setExtremes(e,k,!1,void 0,{trigger:"zoom"});a.zoomed=!0});return a.zoomed},setAxisSize:function(){var a=this.chart,e=this.options,b=e.offsets||[0,0,0,0],c=this.horiz,k=this.width=Math.round(h(w(e.width, |
|
|
|
a.plotWidth-b[3]+b[1]),a.plotWidth)),f=this.height=Math.round(h(w(e.height,a.plotHeight-b[0]+b[2]),a.plotHeight)),l=this.top=Math.round(h(w(e.top,a.plotTop+b[0]),a.plotHeight,a.plotTop));e=this.left=Math.round(h(w(e.left,a.plotLeft+b[3]),a.plotWidth,a.plotLeft));this.bottom=a.chartHeight-f-l;this.right=a.chartWidth-k-e;this.len=Math.max(c?k:f,0);this.pos=c?e:l},getExtremes:function(){var a=this.isLog;return{min:a?x(this.lin2log(this.min)):this.min,max:a?x(this.lin2log(this.max)):this.max,dataMin:this.dataMin, |
|
|
|
dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var e=this.isLog,b=e?this.lin2log(this.min):this.min;e=e?this.lin2log(this.max):this.max;null===a||-Infinity===a?a=b:Infinity===a?a=e:b>a?a=b:e<a&&(a=e);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){var e=(w(a,0)-90*this.side+720)%360;a={align:"center"};t(this,"autoLabelAlign",a,function(a){15<e&&165>e?a.align="right":195<e&&345>e&&(a.align="left")});return a.align},tickSize:function(a){var e= |
|
|
|
this.options,b=e[a+"Length"],c=w(e[a+"Width"],"tick"===a&&this.isXAxis&&!this.categories?1:0);if(c&&b){"inside"===e[a+"Position"]&&(b=-b);var k=[b,c]}a={tickSize:k};t(this,"afterTickSize",a);return a.tickSize},labelMetrics:function(){var a=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize,this.ticks[a]&&this.ticks[a].label)},unsquish:function(){var a=this.options.labels,e=this.horiz,b=this.tickInterval, |
|
|
|
c=b,k=this.len/(((this.categories?1:0)+this.max-this.min)/b),f,l=a.rotation,u=this.labelMetrics(),d,h=Number.MAX_VALUE,t,r=this.max-this.min,H=function(a){var e=a/(k||1);e=1<e?Math.ceil(e):1;e*b>r&&Infinity!==a&&Infinity!==k&&r&&(e=Math.ceil(r/b));return x(e*b)};e?(t=!a.staggerLines&&!a.step&&(v(l)?[l]:k<w(a.autoRotationLimit,80)&&a.autoRotation))&&t.forEach(function(a){if(a===l||a&&-90<=a&&90>=a){d=H(Math.abs(u.h/Math.sin(n*a)));var e=d+Math.abs(a/360);e<h&&(h=e,f=a,c=d)}}):a.step||(c=H(u.h));this.autoRotation= |
|
|
|
t;this.labelRotation=w(f,l);return c},getSlotWidth:function(a){var e=this.chart,b=this.horiz,c=this.options.labels,k=Math.max(this.tickPositions.length-(this.categories?0:1),1),f=e.margin[3];return a&&a.slotWidth||b&&2>(c.step||0)&&!c.rotation&&(this.staggerLines||1)*this.len/k||!b&&(c.style&&parseInt(c.style.width,10)||f&&f-e.spacing[3]||.33*e.chartWidth)},renderUnsquish:function(){var a=this.chart,e=a.renderer,b=this.tickPositions,c=this.ticks,k=this.options.labels,f=k&&k.style||{},l=this.horiz, |
|
|
|
u=this.getSlotWidth(),d=Math.max(1,Math.round(u-2*(k.padding||5))),h={},t=this.labelMetrics(),n=k.style&&k.style.textOverflow,r=0;m(k.rotation)||(h.rotation=k.rotation||0);b.forEach(function(a){a=c[a];a.movedLabel&&a.replaceMovedLabel();a&&a.label&&a.label.textPxLength>r&&(r=a.label.textPxLength)});this.maxLabelLength=r;if(this.autoRotation)r>d&&r>t.h?h.rotation=this.labelRotation:this.labelRotation=0;else if(u){var H=d;if(!n){var G="clip";for(d=b.length;!l&&d--;){var g=b[d];if(g=c[g].label)g.styles&& |
|
|
|
"ellipsis"===g.styles.textOverflow?g.css({textOverflow:"clip"}):g.textPxLength>u&&g.css({width:u+"px"}),g.getBBox().height>this.len/b.length-(t.h-t.f)&&(g.specificTextOverflow="ellipsis")}}}h.rotation&&(H=r>.5*a.chartHeight?.33*a.chartHeight:r,n||(G="ellipsis"));if(this.labelAlign=k.align||this.autoLabelAlign(this.labelRotation))h.align=this.labelAlign;b.forEach(function(a){var e=(a=c[a])&&a.label,b=f.width,k={};e&&(e.attr(h),a.shortenLabel?a.shortenLabel():H&&!b&&"nowrap"!==f.whiteSpace&&(H<e.textPxLength|| |
|
|
|
"SPAN"===e.element.tagName)?(k.width=H,n||(k.textOverflow=e.specificTextOverflow||G),e.css(k)):e.styles&&e.styles.width&&!k.width&&!b&&e.css({width:null}),delete e.specificTextOverflow,a.rotation=h.rotation)},this);this.tickRotCorr=e.rotCorr(t.b,this.labelRotation||0,0!==this.side)},hasData:function(){return this.series.some(function(a){return a.hasData()})||this.options.showEmpty&&v(this.min)&&v(this.max)},addTitle:function(a){var b=this.chart.renderer,c=this.horiz,k=this.opposite,f=this.options.title, |
|
|
|
l,u=this.chart.styledMode;this.axisTitle||((l=f.textAlign)||(l=(c?{low:"left",middle:"center",high:"right"}:{low:k?"right":"left",middle:"center",high:k?"left":"right"})[f.align]),this.axisTitle=b.text(f.text,0,0,f.useHTML).attr({zIndex:7,rotation:f.rotation||0,align:l}).addClass("highcharts-axis-title"),u||this.axisTitle.css(e(f.style)),this.axisTitle.add(this.axisGroup),this.axisTitle.isNew=!0);u||f.style.width||this.isRadial||this.axisTitle.css({width:this.len});this.axisTitle[a?"show":"hide"](a)}, |
|
|
|
generateTick:function(a){var e=this.ticks;e[a]?e[a].addLabel():e[a]=new G(this,a)},getOffset:function(){var a=this,e=a.chart,b=e.renderer,c=a.options,k=a.tickPositions,f=a.ticks,l=a.horiz,u=a.side,d=e.inverted&&!a.isZAxis?[1,0,3,2][u]:u,h,n=0,r=0,H=c.title,G=c.labels,g=0,m=e.axisOffset;e=e.clipOffset;var I=[-1,1,1,-1][u],p=c.className,z=a.axisParent;var x=a.hasData();a.showAxis=h=x||w(c.showEmpty,!0);a.staggerLines=a.horiz&&G.staggerLines;a.axisGroup||(a.gridGroup=b.g("grid").attr({zIndex:c.gridZIndex|| |
|
|
|
1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+(p||"")).add(z),a.axisGroup=b.g("axis").attr({zIndex:c.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(p||"")).add(z),a.labelGroup=b.g("axis-labels").attr({zIndex:G.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels "+(p||"")).add(z));x||a.isLinked?(k.forEach(function(e,b){a.generateTick(e,b)}),a.renderUnsquish(),a.reserveSpaceDefault=0===u||2===u||{1:"left",3:"right"}[u]===a.labelAlign,w(G.reserveSpace,"center"=== |
|
|
|
a.labelAlign?!0:null,a.reserveSpaceDefault)&&k.forEach(function(a){g=Math.max(f[a].getLabelSize(),g)}),a.staggerLines&&(g*=a.staggerLines),a.labelOffset=g*(a.opposite?-1:1)):q(f,function(a,e){a.destroy();delete f[e]});if(H&&H.text&&!1!==H.enabled&&(a.addTitle(h),h&&!1!==H.reserveSpace)){a.titleOffset=n=a.axisTitle.getBBox()[l?"height":"width"];var C=H.offset;r=v(C)?0:w(H.margin,l?5:10)}a.renderLine();a.offset=I*w(c.offset,m[u]?m[u]+(c.margin||0):0);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};b=0===u?-a.labelMetrics().h: |
|
|
|
2===u?a.tickRotCorr.y:0;r=Math.abs(g)+r;g&&(r=r-b+I*(l?w(G.y,a.tickRotCorr.y+8*I):G.x));a.axisTitleMargin=w(C,r);a.getMaxLabelDimensions&&(a.maxLabelDimensions=a.getMaxLabelDimensions(f,k));l=this.tickSize("tick");m[u]=Math.max(m[u],a.axisTitleMargin+n+I*a.offset,r,k&&k.length&&l?l[0]+I*a.offset:0);c=c.offset?0:2*Math.floor(a.axisLine.strokeWidth()/2);e[d]=Math.max(e[d],c);t(this,"afterGetOffset")},getLinePath:function(a){var e=this.chart,b=this.opposite,c=this.offset,k=this.horiz,f=this.left+(b? |
|
|
|
this.width:0)+c;c=e.chartHeight-this.bottom-(b?this.height:0)+c;b&&(a*=-1);return e.renderer.crispLine(["M",k?this.left:f,k?c:this.top,"L",k?e.chartWidth-this.right:f,k?c:e.chartHeight-this.bottom],a)},renderLine:function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.chart.styledMode||this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))},getTitlePosition:function(){var a=this.horiz, |
|
|
|
e=this.left,b=this.top,c=this.len,k=this.options.title,f=a?e:b,l=this.opposite,u=this.offset,d=k.x||0,h=k.y||0,n=this.axisTitle,r=this.chart.renderer.fontMetrics(k.style&&k.style.fontSize,n);n=Math.max(n.getBBox(null,0).height-r.h-1,0);c={low:f+(a?0:c),middle:f+c/2,high:f+(a?c:0)}[k.align];e=(a?b+this.height:e)+(a?1:-1)*(l?-1:1)*this.axisTitleMargin+[-n,n,r.f,-n][this.side];a={x:a?c+d:e+(l?this.width:0)+u+d,y:a?e+h-(l?this.height:0)+u:c+h};t(this,"afterGetTitlePosition",{titlePosition:a});return a}, |
|
|
|
renderMinorTick:function(a){var e=this.chart.hasRendered&&z(this.oldMin),b=this.minorTicks;b[a]||(b[a]=new G(this,a,"minor"));e&&b[a].isNew&&b[a].render(null,!0);b[a].render(null,!1,1)},renderTick:function(a,e){var b=this.isLinked,c=this.ticks,k=this.chart.hasRendered&&z(this.oldMin);if(!b||a>=this.min&&a<=this.max)c[a]||(c[a]=new G(this,a)),k&&c[a].isNew&&c[a].render(e,!0,-1),c[a].render(e)},render:function(){var a=this,e=a.chart,b=a.options,k=a.isLog,f=a.isLinked,l=a.tickPositions,u=a.axisTitle, |
|
|
|
h=a.ticks,n=a.minorTicks,r=a.alternateBands,H=b.stackLabels,g=b.alternateGridColor,m=a.tickmarkOffset,I=a.axisLine,p=a.showAxis,w=M(e.renderer.globalAnimation),v,x;a.labelEdge.length=0;a.overlap=!1;[h,n,r].forEach(function(a){q(a,function(a){a.isActive=!1})});if(a.hasData()||f)a.minorTickInterval&&!a.categories&&a.getMinorTickPositions().forEach(function(e){a.renderMinorTick(e)}),l.length&&(l.forEach(function(e,b){a.renderTick(e,b)}),m&&(0===a.min||a.single)&&(h[-1]||(h[-1]=new G(a,-1,null,!0)),h[-1].render(-1))), |
|
|
|
g&&l.forEach(function(b,c){x="undefined"!==typeof l[c+1]?l[c+1]+m:a.max-m;0===c%2&&b<a.max&&x<=a.max+(e.polar?-m:m)&&(r[b]||(r[b]=new d.PlotLineOrBand(a)),v=b+m,r[b].options={from:k?a.lin2log(v):v,to:k?a.lin2log(x):x,color:g},r[b].render(),r[b].isActive=!0)}),a._addedPlotLB||((b.plotLines||[]).concat(b.plotBands||[]).forEach(function(e){a.addPlotBandOrLine(e)}),a._addedPlotLB=!0);[h,n,r].forEach(function(a){var b,k=[],f=w.duration;q(a,function(a,e){a.isActive||(a.render(e,!1,0),a.isActive=!1,k.push(e))}); |
|
|
|
c(function(){for(b=k.length;b--;)a[k[b]]&&!a[k[b]].isActive&&(a[k[b]].destroy(),delete a[k[b]])},a!==r&&e.hasRendered&&f?f:0)});I&&(I[I.isPlaced?"animate":"attr"]({d:this.getLinePath(I.strokeWidth())}),I.isPlaced=!0,I[p?"show":"hide"](p));u&&p&&(b=a.getTitlePosition(),z(b.y)?(u[u.isNew?"attr":"animate"](b),u.isNew=!1):(u.attr("y",-9999),u.isNew=!0));H&&H.enabled&&a.renderStackTotals();a.isDirty=!1;t(this,"afterRender")},redraw:function(){this.visible&&(this.render(),this.plotLinesAndBands.forEach(function(a){a.render()})); |
|
|
|
this.series.forEach(function(a){a.isDirty=!0})},keepProps:"extKey hcEvents names series userMax userMin".split(" "),destroy:function(a){var e=this,b=e.stacks,c=e.plotLinesAndBands,k;t(this,"destroy",{keepEvents:a});a||u(e);q(b,function(a,e){C(a);b[e]=null});[e.ticks,e.minorTicks,e.alternateBands].forEach(function(a){C(a)});if(c)for(a=c.length;a--;)c[a].destroy();"stackTotalGroup axisLine axisTitle axisGroup gridGroup labelGroup cross scrollbar".split(" ").forEach(function(a){e[a]&&(e[a]=e[a].destroy())}); |
|
|
|
for(k in e.plotLinesAndBandsGroups)e.plotLinesAndBandsGroups[k]=e.plotLinesAndBandsGroups[k].destroy();q(e,function(a,b){-1===e.keepProps.indexOf(b)&&delete e[b]})},drawCrosshair:function(e,b){var c=this.crosshair,k=w(c.snap,!0),f,l=this.cross;t(this,"drawCrosshair",{e:e,point:b});e||(e=this.cross&&this.cross.e);if(this.crosshair&&!1!==(v(b)||!k)){k?v(b)&&(f=w("colorAxis"!==this.coll?b.crosshairPos:null,this.isXAxis?b.plotX:this.len-b.plotY)):f=e&&(this.horiz?e.chartX-this.pos:this.len-e.chartY+this.pos); |
|
|
|
if(v(f)){var u={value:b&&(this.isXAxis?b.x:w(b.stackY,b.y)),translatedValue:f};this.chart.polar&&B(u,{isCrosshair:!0,chartX:e&&e.chartX,chartY:e&&e.chartY,point:b});u=this.getPlotLinePath(u)||null}if(!v(u)){this.hideCrosshair();return}k=this.categories&&!this.isRadial;l||(this.cross=l=this.chart.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+(k?"category ":"thin ")+c.className).attr({zIndex:w(c.zIndex,2)}).add(),this.chart.styledMode||(l.attr({stroke:c.color||(k?a("#ccd6eb").setOpacity(.25).get(): |
|
|
|
"#cccccc"),"stroke-width":w(c.width,1)}).css({"pointer-events":"none"}),c.dashStyle&&l.attr({dashstyle:c.dashStyle})));l.show().attr({d:u});k&&!c.width&&l.attr({"stroke-width":this.transA});this.cross.e=e}else this.hideCrosshair();t(this,"afterDrawCrosshair",{e:e,point:b})},hideCrosshair:function(){this.cross&&this.cross.hide();t(this,"afterHideCrosshair")}});return d.Axis=g});K(y,"parts/DateTimeAxis.js",[y["parts/Globals.js"]],function(d){var g=d.Axis,M=d.getMagnitude,F=d.normalizeTickInterval,E= |
|
|
|
d.timeUnits;g.prototype.getTimeTicks=function(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)};g.prototype.normalizeTimeTickInterval=function(d,g){var v=g||[["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]];g=v[v.length-1];var x=E[g[0]],B=g[1],p;for(p=0;p<v.length&&!(g=v[p],x=E[g[0]],B=g[1],v[p+1]&&d<=(x*B[B.length-1]+E[v[p+1][0]])/ |
|
|
|
2);p++);x===E.year&&d<5*x&&(B=[1,2,5]);d=F(d/x,B,"year"===g[0]?Math.max(M(d/x),1):1);return{unitRange:x,count:d,unitName:g[0]}}});K(y,"parts/LogarithmicAxis.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var M=g.pick;g=d.Axis;var F=d.getMagnitude,E=d.normalizeTickInterval;g.prototype.getLogTickPositions=function(d,g,v,C){var x=this.options,p=this.len,z=[];C||(this._minorAutoInterval=null);if(.5<=d)d=Math.round(d),z=this.getLinearTickPositions(d,g,v);else if(.08<=d){p=Math.floor(g); |
|
|
|
var m,q;for(x=.3<d?[1,2,4]:.15<d?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];p<v+1&&!q;p++){var w=x.length;for(m=0;m<w&&!q;m++){var h=this.log2lin(this.lin2log(p)*x[m]);h>g&&(!C||f<=v)&&"undefined"!==typeof f&&z.push(f);f>v&&(q=!0);var f=h}}}else g=this.lin2log(g),v=this.lin2log(v),d=C?this.getMinorTickInterval():x.tickInterval,d=M("auto"===d?null:d,this._minorAutoInterval,x.tickPixelInterval/(C?5:1)*(v-g)/((C?p/this.tickPositions.length:p)||1)),d=E(d,null,F(d)),z=this.getLinearTickPositions(d,g,v).map(this.log2lin), |
|
|
|
C||(this._minorAutoInterval=d/5);C||(this.tickInterval=d);return z};g.prototype.log2lin=function(d){return Math.log(d)/Math.LN10};g.prototype.lin2log=function(d){return Math.pow(10,d)}});K(y,"parts/PlotLineOrBand.js",[y["parts/Globals.js"],y["parts/Axis.js"],y["parts/Utilities.js"]],function(d,g,M){var F=M.arrayMax,E=M.arrayMin,D=M.defined,x=M.destroyObjectProperties,v=M.erase,C=M.extend,B=M.objectEach,p=M.pick,z=d.merge;d.PlotLineOrBand=function(d,g){this.axis=d;g&&(this.options=g,this.id=g.id)}; |
|
|
|
d.PlotLineOrBand.prototype={render:function(){d.fireEvent(this,"render");var g=this,q=g.axis,w=q.horiz,h=g.options,f=h.label,c=g.label,b=h.to,a=h.from,l=h.value,n=D(a)&&D(b),t=D(l),I=g.svgElem,r=!I,e=[],k=h.color,u=p(h.zIndex,0),H=h.events;e={"class":"highcharts-plot-"+(n?"band ":"line ")+(h.className||"")};var G={},A=q.chart.renderer,J=n?"bands":"lines";q.isLog&&(a=q.log2lin(a),b=q.log2lin(b),l=q.log2lin(l));q.chart.styledMode||(t?(e.stroke=k||"#999999",e["stroke-width"]=p(h.width,1),h.dashStyle&& |
|
|
|
(e.dashstyle=h.dashStyle)):n&&(e.fill=k||"#e6ebf5",h.borderWidth&&(e.stroke=h.borderColor,e["stroke-width"]=h.borderWidth)));G.zIndex=u;J+="-"+u;(k=q.plotLinesAndBandsGroups[J])||(q.plotLinesAndBandsGroups[J]=k=A.g("plot-"+J).attr(G).add());r&&(g.svgElem=I=A.path().attr(e).add(k));if(t)e=q.getPlotLinePath({value:l,lineWidth:I.strokeWidth(),acrossPanes:h.acrossPanes});else if(n)e=q.getPlotBandPath(a,b,h);else return;(r||!I.d)&&e&&e.length?(I.attr({d:e}),H&&B(H,function(a,e){I.on(e,function(a){H[e].apply(g, |
|
|
|
[a])})})):I&&(e?(I.show(!0),I.animate({d:e})):I.d&&(I.hide(),c&&(g.label=c=c.destroy())));f&&(D(f.text)||D(f.formatter))&&e&&e.length&&0<q.width&&0<q.height&&!e.isFlat?(f=z({align:w&&n&&"center",x:w?!n&&4:10,verticalAlign:!w&&n&&"middle",y:w?n?16:10:n?6:-4,rotation:w&&!n&&90},f),this.renderLabel(f,e,n,u)):c&&c.hide();return g},renderLabel:function(d,g,p,h){var f=this.label,c=this.axis.chart.renderer;f||(f={align:d.textAlign||d.align,rotation:d.rotation,"class":"highcharts-plot-"+(p?"band":"line")+ |
|
|
|
"-label "+(d.className||"")},f.zIndex=h,h=this.getLabelText(d),this.label=f=c.text(h,0,0,d.useHTML).attr(f).add(),this.axis.chart.styledMode||f.css(d.style));c=g.xBounds||[g[1],g[4],p?g[6]:g[1]];g=g.yBounds||[g[2],g[5],p?g[7]:g[2]];p=E(c);h=E(g);f.align(d,!1,{x:p,y:h,width:F(c)-p,height:F(g)-h});f.show(!0)},getLabelText:function(d){return D(d.formatter)?d.formatter.call(this):d.text},destroy:function(){v(this.axis.plotLinesAndBands,this);delete this.axis;x(this)}};C(g.prototype,{getPlotBandPath:function(d, |
|
|
|
g){var m=this.getPlotLinePath({value:g,force:!0,acrossPanes:this.options.acrossPanes}),h=this.getPlotLinePath({value:d,force:!0,acrossPanes:this.options.acrossPanes}),f=[],c=this.horiz,b=1;d=d<this.min&&g<this.min||d>this.max&&g>this.max;if(h&&m){if(d){var a=h.toString()===m.toString();b=0}for(d=0;d<h.length;d+=6)c&&m[d+1]===h[d+1]?(m[d+1]+=b,m[d+4]+=b):c||m[d+2]!==h[d+2]||(m[d+2]+=b,m[d+5]+=b),f.push("M",h[d+1],h[d+2],"L",h[d+4],h[d+5],m[d+4],m[d+5],m[d+1],m[d+2],"z"),f.isFlat=a}return f},addPlotBand:function(d){return this.addPlotBandOrLine(d, |
|
|
|
"plotBands")},addPlotLine:function(d){return this.addPlotBandOrLine(d,"plotLines")},addPlotBandOrLine:function(g,q){var m=(new d.PlotLineOrBand(this,g)).render(),h=this.userOptions;if(m){if(q){var f=h[q]||[];f.push(g);h[q]=f}this.plotLinesAndBands.push(m)}return m},removePlotBandOrLine:function(d){for(var g=this.plotLinesAndBands,m=this.options,h=this.userOptions,f=g.length;f--;)g[f].id===d&&g[f].destroy();[m.plotLines||[],h.plotLines||[],m.plotBands||[],h.plotBands||[]].forEach(function(c){for(f= |
|
|
|
c.length;f--;)c[f].id===d&&v(c,c[f])})},removePlotBand:function(d){this.removePlotBandOrLine(d)},removePlotLine:function(d){this.removePlotBandOrLine(d)}})});K(y,"parts/Tooltip.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var M=g.clamp,F=g.defined,E=g.discardElement,D=g.extend,x=g.isNumber,v=g.isString,C=g.pick,B=g.splat,p=g.syncTimeout;"";var z=d.doc,m=d.format,q=d.merge,w=d.timeUnits;d.Tooltip=function(){this.init.apply(this,arguments)};d.Tooltip.prototype={init:function(d, |
|
|
|
f){this.chart=d;this.options=f;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.split=f.split&&!d.inverted&&!d.polar;this.shared=f.shared||this.split;this.outside=C(f.outside,!(!d.scrollablePixelsX&&!d.scrollablePixelsY))},cleanSplit:function(d){this.chart.series.forEach(function(f){var c=f&&f.tt;c&&(!c.isActive||d?f.tt=c.destroy():c.isActive=!1)})},applyFilter:function(){var d=this.chart;d.renderer.definition({tagName:"filter",id:"drop-shadow-"+d.index,opacity:.5,children:[{tagName:"feGaussianBlur", |
|
|
|
"in":"SourceAlpha",stdDeviation:1},{tagName:"feOffset",dx:1,dy:1},{tagName:"feComponentTransfer",children:[{tagName:"feFuncA",type:"linear",slope:.3}]},{tagName:"feMerge",children:[{tagName:"feMergeNode"},{tagName:"feMergeNode","in":"SourceGraphic"}]}]});d.renderer.definition({tagName:"style",textContent:".highcharts-tooltip-"+d.index+"{filter:url(#drop-shadow-"+d.index+")}"})},getLabel:function(){var h=this,f=this.chart.renderer,c=this.chart.styledMode,b=this.options,a="tooltip"+(F(b.className)? |
|
|
|
" "+b.className:""),l;if(!this.label){this.outside&&(this.container=l=d.doc.createElement("div"),l.className="highcharts-tooltip-container",d.css(l,{position:"absolute",top:"1px",pointerEvents:b.style&&b.style.pointerEvents,zIndex:3}),d.doc.body.appendChild(l),this.renderer=f=new d.Renderer(l,0,0,{},void 0,void 0,f.styledMode));this.split?this.label=f.g(a):(this.label=f.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,a).attr({padding:b.padding,r:b.borderRadius}),c||this.label.attr({fill:b.backgroundColor, |
|
|
|
"stroke-width":b.borderWidth}).css(b.style).shadow(b.shadow));c&&(this.applyFilter(),this.label.addClass("highcharts-tooltip-"+this.chart.index));if(h.outside&&!h.split){var n={x:this.label.xSetter,y:this.label.ySetter};this.label.xSetter=function(a,b){n[b].call(this.label,h.distance);l.style.left=a+"px"};this.label.ySetter=function(a,b){n[b].call(this.label,h.distance);l.style.top=a+"px"}}this.label.attr({zIndex:8}).add()}return this.label},update:function(d){this.destroy();q(!0,this.chart.options.tooltip.userOptions, |
|
|
|
d);this.init(this.chart,q(!0,this.options,d))},destroy:function(){this.label&&(this.label=this.label.destroy());this.split&&this.tt&&(this.cleanSplit(this.chart,!0),this.tt=this.tt.destroy());this.renderer&&(this.renderer=this.renderer.destroy(),E(this.container));d.clearTimeout(this.hideTimer);d.clearTimeout(this.tooltipTimeout)},move:function(h,f,c,b){var a=this,l=a.now,n=!1!==a.options.animation&&!a.isHidden&&(1<Math.abs(h-l.x)||1<Math.abs(f-l.y)),t=a.followPointer||1<a.len;D(l,{x:n?(2*l.x+h)/ |
|
|
|
3:h,y:n?(l.y+f)/2:f,anchorX:t?void 0:n?(2*l.anchorX+c)/3:c,anchorY:t?void 0:n?(l.anchorY+b)/2:b});a.getLabel().attr(l);n&&(d.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){a&&a.move(h,f,c,b)},32))},hide:function(h){var f=this;d.clearTimeout(this.hideTimer);h=C(h,this.options.hideDelay,500);this.isHidden||(this.hideTimer=p(function(){f.getLabel()[h?"fadeOut":"hide"]();f.isHidden=!0},h))},getAnchor:function(d,f){var c=this.chart,b=c.pointer,a=c.inverted,l=c.plotTop,h=c.plotLeft, |
|
|
|
t=0,g=0,r,e;d=B(d);this.followPointer&&f?("undefined"===typeof f.chartX&&(f=b.normalize(f)),d=[f.chartX-c.plotLeft,f.chartY-l]):d[0].tooltipPos?d=d[0].tooltipPos:(d.forEach(function(b){r=b.series.yAxis;e=b.series.xAxis;t+=b.plotX+(!a&&e?e.left-h:0);g+=(b.plotLow?(b.plotLow+b.plotHigh)/2:b.plotY)+(!a&&r?r.top-l:0)}),t/=d.length,g/=d.length,d=[a?c.plotWidth-g:t,this.shared&&!a&&1<d.length&&f?f.chartY-l:a?c.plotHeight-t:g]);return d.map(Math.round)},getPosition:function(d,f,c){var b=this.chart,a=this.distance, |
|
|
|
l={},h=b.inverted&&c.h||0,t,g=this.outside,r=g?z.documentElement.clientWidth-2*a:b.chartWidth,e=g?Math.max(z.body.scrollHeight,z.documentElement.scrollHeight,z.body.offsetHeight,z.documentElement.offsetHeight,z.documentElement.clientHeight):b.chartHeight,k=b.pointer.getChartPosition(),u=b.containerScaling,H=function(a){return u?a*u.scaleX:a},G=function(a){return u?a*u.scaleY:a},A=function(l){var u="x"===l;return[l,u?r:e,u?d:f].concat(g?[u?H(d):G(f),u?k.left-a+H(c.plotX+b.plotLeft):k.top-a+G(c.plotY+ |
|
|
|
b.plotTop),0,u?r:e]:[u?d:f,u?c.plotX+b.plotLeft:c.plotY+b.plotTop,u?b.plotLeft:b.plotTop,u?b.plotLeft+b.plotWidth:b.plotTop+b.plotHeight])},m=A("y"),L=A("x"),q=!this.followPointer&&C(c.ttBelow,!b.inverted===!!c.negative),p=function(e,b,c,k,f,u,d){var t="y"===e?G(a):H(a),n=(c-k)/2,r=k<f-a,A=f+a+k<b,g=f-t-c+n;f=f+t-n;if(q&&A)l[e]=f;else if(!q&&r)l[e]=g;else if(r)l[e]=Math.min(d-k,0>g-h?g:g-h);else if(A)l[e]=Math.max(u,f+h+c>b?f:f+h);else return!1},v=function(e,b,c,k,f){var u;f<a||f>b-a?u=!1:l[e]=f< |
|
|
|
c/2?1:f>b-k/2?b-k-2:f-c/2;return u},w=function(a){var e=m;m=L;L=e;t=a},x=function(){!1!==p.apply(0,m)?!1!==v.apply(0,L)||t||(w(!0),x()):t?l.x=l.y=0:(w(!0),x())};(b.inverted||1<this.len)&&w();x();return l},defaultFormatter:function(d){var f=this.points||B(this);var c=[d.tooltipFooterHeaderFormatter(f[0])];c=c.concat(d.bodyFormatter(f));c.push(d.tooltipFooterHeaderFormatter(f[0],!0));return c},refresh:function(h,f){var c=this.chart,b=this.options,a=h,l={},n=[],t=b.formatter||this.defaultFormatter;l= |
|
|
|
this.shared;var g=c.styledMode;if(b.enabled){d.clearTimeout(this.hideTimer);this.followPointer=B(a)[0].series.tooltipOptions.followPointer;var r=this.getAnchor(a,f);f=r[0];var e=r[1];!l||a.series&&a.series.noSharedTooltip?l=a.getLabelConfig():(c.pointer.applyInactiveState(a),a.forEach(function(a){a.setState("hover");n.push(a.getLabelConfig())}),l={x:a[0].category,y:a[0].y},l.points=n,a=a[0]);this.len=n.length;c=t.call(l,this);t=a.series;this.distance=C(t.tooltipOptions.distance,16);!1===c?this.hide(): |
|
|
|
(this.split?this.renderSplit(c,B(h)):(h=this.getLabel(),b.style.width&&!g||h.css({width:this.chart.spacingBox.width}),h.attr({text:c&&c.join?c.join(""):c}),h.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+C(a.colorIndex,t.colorIndex)),g||h.attr({stroke:b.borderColor||a.color||t.color||"#666666"}),this.updatePosition({plotX:f,plotY:e,negative:a.negative,ttBelow:a.ttBelow,h:r[2]||0})),this.isHidden&&this.label&&this.label.attr({opacity:1}).show(),this.isHidden=!1);d.fireEvent(this, |
|
|
|
"refresh")}},renderSplit:function(h,f){function c(a,e,b,c,k){void 0===k&&(k=!0);b?(e=B?0:y,a=M(a-c/2,N.left,N.right-c)):(e-=E,a=k?a-c-z:a+z,a=M(a,k?a:N.left,N.right));return{x:a,y:e}}var b=this,a=b.chart,l=b.chart,n=l.chartWidth,t=l.chartHeight,g=l.plotHeight,r=l.plotLeft,e=l.plotTop,k=l.plotWidth,u=l.pointer,H=l.renderer,G=l.scrollablePixelsX;G=void 0===G?0:G;var A=l.scrollablePixelsY,m=void 0===A?0:A;A=l.scrollingContainer;A=void 0===A?{scrollLeft:0,scrollTop:0}:A;var L=A.scrollLeft,q=A.scrollTop, |
|
|
|
p=l.styledMode,z=b.distance,w=b.options,x=b.options.positioner,N={left:G?r:0,right:G?r+k-G:n,top:m?e:0,bottom:m?e+g-m:t},ba=b.getLabel(),B=!(!a.xAxis[0]||!a.xAxis[0].opposite),E=e,F=0,y=g-m;v(h)&&(h=[!1,h]);h=h.slice(0,f.length+1).reduce(function(a,k,l){if(!1!==k&&""!==k){l=f[l-1]||{isHeader:!0,plotX:f[0].plotX,plotY:g,series:{}};var u=l.isHeader,d=u?b:l.series,h=d.tt,t=l.isHeader;var n=l.series;var A="highcharts-color-"+C(l.colorIndex,n.colorIndex,"none");h||(h={padding:w.padding,r:w.borderRadius}, |
|
|
|
p||(h.fill=w.backgroundColor,h["stroke-width"]=w.borderWidth),h=H.label(null,null,null,w[t?"headerShape":"shape"]||"callout",null,null,w.useHTML).addClass(t?"highcharts-tooltip-header ":"highcharts-tooltip-box "+A).attr(h).add(ba));h.isActive=!0;h.attr({text:k});p||h.css(w.style).shadow(w.shadow).attr({stroke:w.borderColor||l.color||n.color||"#333333"});k=d.tt=h;t=k.getBBox();d=t.width+k.strokeWidth();u&&(F=t.height,y+=F,B&&(E-=F));n=l.plotX;n=void 0===n?0:n;A=l.plotY;A=void 0===A?0:A;var G=l.series; |
|
|
|
l.isHeader?(n=r+n-L,A=e+(g-m)/2):(h=G.xAxis,G=G.yAxis,n=h.pos+M(n,-z,h.len+z)-L,A=G.pos+M(A,0,G.len)-q);n=M(n,N.left-z,N.right+z);A=M(A,N.top,N.bottom);t=t.height+1;h=x?x.call(b,d,t,l):c(n,A,u,d);a.push({align:x?0:void 0,anchorX:n,anchorY:A,boxWidth:d,point:l,rank:C(h.rank,u?1:0),size:t,target:h.y,tt:k,x:h.x})}return a},[]);!x&&h.some(function(a){return 0>a.x})&&(h=h.map(function(a){var e=c(a.anchorX,a.anchorY,a.point.isHeader,a.boxWidth,!1);return D(a,{target:e.y,x:e.x})}));b.cleanSplit();d.distribute(h, |
|
|
|
y,void 0);h.forEach(function(a){var e=a.pos;a.tt.attr({visibility:"undefined"===typeof e?"hidden":"inherit",x:a.x,y:e+E,anchorX:a.anchorX,anchorY:a.anchorY})});h=b.container;a=b.renderer;b.outside&&h&&a&&(l=ba.getBBox(),a.setSize(l.width+l.x,l.height+l.y,!1),u=u.getChartPosition(),h.style.left=u.left+"px",h.style.top=u.top+"px")},updatePosition:function(h){var f=this.chart,c=f.pointer,b=this.getLabel(),a=h.plotX+f.plotLeft,l=h.plotY+f.plotTop;c=c.getChartPosition();h=(this.options.positioner||this.getPosition).call(this, |
|
|
|
b.width,b.height,h);if(this.outside){var n=(this.options.borderWidth||0)+2*this.distance;this.renderer.setSize(b.width+n,b.height+n,!1);if(f=f.containerScaling)d.css(this.container,{transform:"scale("+f.scaleX+", "+f.scaleY+")"}),a*=f.scaleX,l*=f.scaleY;a+=c.left-h.x;l+=c.top-h.y}this.move(Math.round(h.x),Math.round(h.y||0),a,l)},getDateFormat:function(d,f,c,b){var a=this.chart.time,l=a.dateFormat("%m-%d %H:%M:%S.%L",f),h={millisecond:15,second:12,minute:9,hour:6,day:3},t="millisecond";for(g in w){if(d=== |
|
|
|
w.week&&+a.dateFormat("%w",f)===c&&"00:00:00.000"===l.substr(6)){var g="week";break}if(w[g]>d){g=t;break}if(h[g]&&l.substr(h[g])!=="01-01 00:00:00.000".substr(h[g]))break;"week"!==g&&(t=g)}if(g)var r=a.resolveDTLFormat(b[g]).main;return r},getXDateFormat:function(d,f,c){f=f.dateTimeLabelFormats;var b=c&&c.closestPointRange;return(b?this.getDateFormat(b,d.x,c.options.startOfWeek,f):f.day)||f.year},tooltipFooterHeaderFormatter:function(h,f){var c=f?"footer":"header",b=h.series,a=b.tooltipOptions,l= |
|
|
|
a.xDateFormat,n=b.xAxis,t=n&&"datetime"===n.options.type&&x(h.key),g=a[c+"Format"];f={isFooter:f,labelConfig:h};d.fireEvent(this,"headerFormatter",f,function(c){t&&!l&&(l=this.getXDateFormat(h,a,n));t&&l&&(h.point&&h.point.tooltipDateKeys||["key"]).forEach(function(a){g=g.replace("{point."+a+"}","{point."+a+":"+l+"}")});b.chart.styledMode&&(g=this.styledModeFormat(g));c.text=m(g,{point:h,series:b},this.chart)});return f.text},bodyFormatter:function(d){return d.map(function(f){var c=f.series.tooltipOptions; |
|
|
|
return(c[(f.point.formatPrefix||"point")+"Formatter"]||f.point.tooltipFormatter).call(f.point,c[(f.point.formatPrefix||"point")+"Format"]||"")})},styledModeFormat:function(d){return d.replace('style="font-size: 10px"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')}}});K(y,"parts/Pointer.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.attr,F=g.defined,E=g.extend,D=g.isNumber,x=g.isObject,v=g.objectEach, |
|
|
|
C=g.offset,B=g.pick,p=g.splat,z=d.addEvent,m=d.charts,q=d.color,w=d.css,h=d.find,f=d.fireEvent,c=d.Tooltip;d.Pointer=function(b,a){this.init(b,a)};d.Pointer.prototype={init:function(b,a){this.options=a;this.chart=b;this.runChartClick=a.chart.events&&!!a.chart.events.click;this.pinchDown=[];this.lastValidTouch={};c&&(b.tooltip=new c(b,a.tooltip),this.followTouchMove=B(a.tooltip.followTouchMove,!0));this.setDOMEvents()},zoomOption:function(b){var a=this.chart,c=a.options.chart,f=c.zoomType||"";a=a.inverted; |
|
|
|
/touch/.test(b.type)&&(f=B(c.pinchType,f));this.zoomX=b=/x/.test(f);this.zoomY=f=/y/.test(f);this.zoomHor=b&&!a||f&&a;this.zoomVert=f&&!a||b&&a;this.hasZoom=b||f},getChartPosition:function(){var b=this.chart;b=b.scrollingContainer||b.container;return this.chartPosition||(this.chartPosition=C(b))},normalize:function(b,a){var c=b.touches?b.touches.length?b.touches.item(0):b.changedTouches[0]:b;a||(a=this.getChartPosition());var f=c.pageX-a.left;a=c.pageY-a.top;if(c=this.chart.containerScaling)f/=c.scaleX, |
|
|
|
a/=c.scaleY;return E(b,{chartX:Math.round(f),chartY:Math.round(a)})},getCoordinates:function(b){var a={xAxis:[],yAxis:[]};this.chart.axes.forEach(function(c){a[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(b[c.horiz?"chartX":"chartY"])})});return a},findNearestKDPoint:function(b,a,c){var f;b.forEach(function(b){var l=!(b.noSharedTooltip&&a)&&0>b.options.findNearestPointBy.indexOf("y");b=b.searchPoint(c,l);if((l=x(b,!0))&&!(l=!x(f,!0))){l=f.distX-b.distX;var d=f.dist-b.dist,e=(b.series.group&& |
|
|
|
b.series.group.zIndex)-(f.series.group&&f.series.group.zIndex);l=0<(0!==l&&a?l:0!==d?d:0!==e?e:f.series.index>b.series.index?-1:1)}l&&(f=b)});return f},getPointFromEvent:function(b){b=b.target;for(var a;b&&!a;)a=b.point,b=b.parentNode;return a},getChartCoordinatesFromPoint:function(b,a){var c=b.series,f=c.xAxis;c=c.yAxis;var d=B(b.clientX,b.plotX),h=b.shapeArgs;if(f&&c)return a?{chartX:f.len+f.pos-d,chartY:c.len+c.pos-b.plotY}:{chartX:d+f.pos,chartY:b.plotY+c.pos};if(h&&h.x&&h.y)return{chartX:h.x, |
|
|
|
chartY:h.y}},getHoverData:function(b,a,c,f,d,g){var l,e=[];f=!(!f||!b);var k=a&&!a.stickyTracking?[a]:c.filter(function(a){return a.visible&&!(!d&&a.directTouch)&&B(a.options.enableMouseTracking,!0)&&a.stickyTracking});a=(l=f||!g?b:this.findNearestKDPoint(k,d,g))&&l.series;l&&(d&&!a.noSharedTooltip?(k=c.filter(function(a){return a.visible&&!(!d&&a.directTouch)&&B(a.options.enableMouseTracking,!0)&&!a.noSharedTooltip}),k.forEach(function(a){var b=h(a.points,function(a){return a.x===l.x&&!a.isNull}); |
|
|
|
x(b)&&(a.chart.isBoosting&&(b=a.getPoint(b)),e.push(b))})):e.push(l));return{hoverPoint:l,hoverSeries:a,hoverPoints:e}},runPointActions:function(b,a){var c=this.chart,f=c.tooltip&&c.tooltip.options.enabled?c.tooltip:void 0,h=f?f.shared:!1,g=a||c.hoverPoint,r=g&&g.series||c.hoverSeries;r=this.getHoverData(g,r,c.series,(!b||"touchmove"!==b.type)&&(!!a||r&&r.directTouch&&this.isDirectTouch),h,b);g=r.hoverPoint;var e=r.hoverPoints;a=(r=r.hoverSeries)&&r.tooltipOptions.followPointer;h=h&&r&&!r.noSharedTooltip; |
|
|
|
if(g&&(g!==c.hoverPoint||f&&f.isHidden)){(c.hoverPoints||[]).forEach(function(a){-1===e.indexOf(a)&&a.setState()});if(c.hoverSeries!==r)r.onMouseOver();this.applyInactiveState(e);(e||[]).forEach(function(a){a.setState("hover")});c.hoverPoint&&c.hoverPoint.firePointEvent("mouseOut");if(!g.series)return;g.firePointEvent("mouseOver");c.hoverPoints=e;c.hoverPoint=g;f&&f.refresh(h?e:g,b)}else a&&f&&!f.isHidden&&(g=f.getAnchor([{}],b),f.updatePosition({plotX:g[0],plotY:g[1]}));this.unDocMouseMove||(this.unDocMouseMove= |
|
|
|
z(c.container.ownerDocument,"mousemove",function(a){var e=m[d.hoverChartIndex];if(e)e.pointer.onDocumentMouseMove(a)}));c.axes.forEach(function(a){var c=B(a.crosshair.snap,!0),k=c?d.find(e,function(e){return e.series[a.coll]===a}):void 0;k||!c?a.drawCrosshair(b,k):a.hideCrosshair()})},applyInactiveState:function(b){var a=[],c;(b||[]).forEach(function(b){c=b.series;a.push(c);c.linkedParent&&a.push(c.linkedParent);c.linkedSeries&&(a=a.concat(c.linkedSeries));c.navigatorSeries&&a.push(c.navigatorSeries)}); |
|
|
|
this.chart.series.forEach(function(b){-1===a.indexOf(b)?b.setState("inactive",!0):b.options.inactiveOtherPoints&&b.setAllPointsToState("inactive")})},reset:function(b,a){var c=this.chart,f=c.hoverSeries,d=c.hoverPoint,h=c.hoverPoints,r=c.tooltip,e=r&&r.shared?h:d;b&&e&&p(e).forEach(function(a){a.series.isCartesian&&"undefined"===typeof a.plotX&&(b=!1)});if(b)r&&e&&p(e).length&&(r.refresh(e),r.shared&&h?h.forEach(function(a){a.setState(a.state,!0);a.series.isCartesian&&(a.series.xAxis.crosshair&&a.series.xAxis.drawCrosshair(null, |
|
|
|
a),a.series.yAxis.crosshair&&a.series.yAxis.drawCrosshair(null,a))}):d&&(d.setState(d.state,!0),c.axes.forEach(function(a){a.crosshair&&d.series[a.coll]===a&&a.drawCrosshair(null,d)})));else{if(d)d.onMouseOut();h&&h.forEach(function(a){a.setState()});if(f)f.onMouseOut();r&&r.hide(a);this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove());c.axes.forEach(function(a){a.hideCrosshair()});this.hoverX=c.hoverPoints=c.hoverPoint=null}},scaleGroups:function(b,a){var c=this.chart,f;c.series.forEach(function(d){f= |
|
|
|
b||d.getPlotBox();d.xAxis&&d.xAxis.zoomEnabled&&d.group&&(d.group.attr(f),d.markerGroup&&(d.markerGroup.attr(f),d.markerGroup.clip(a?c.clipRect:null)),d.dataLabelsGroup&&d.dataLabelsGroup.attr(f))});c.clipRect.attr(a||c.clipBox)},dragStart:function(b){var a=this.chart;a.mouseIsDown=b.type;a.cancelClick=!1;a.mouseDownX=this.mouseDownX=b.chartX;a.mouseDownY=this.mouseDownY=b.chartY},drag:function(b){var a=this.chart,c=a.options.chart,f=b.chartX,d=b.chartY,h=this.zoomHor,r=this.zoomVert,e=a.plotLeft, |
|
|
|
k=a.plotTop,u=a.plotWidth,g=a.plotHeight,G=this.selectionMarker,A=this.mouseDownX,m=this.mouseDownY,L=x(c.panning)?c.panning&&c.panning.enabled:c.panning,p=c.panKey&&b[c.panKey+"Key"];if(!G||!G.touch)if(f<e?f=e:f>e+u&&(f=e+u),d<k?d=k:d>k+g&&(d=k+g),this.hasDragged=Math.sqrt(Math.pow(A-f,2)+Math.pow(m-d,2)),10<this.hasDragged){var v=a.isInsidePlot(A-e,m-k);a.hasCartesianSeries&&(this.zoomX||this.zoomY)&&v&&!p&&!G&&(this.selectionMarker=G=a.renderer.rect(e,k,h?1:u,r?1:g,0).attr({"class":"highcharts-selection-marker", |
|
|
|
zIndex:7}).add(),a.styledMode||G.attr({fill:c.selectionMarkerFill||q("#335cad").setOpacity(.25).get()}));G&&h&&(f-=A,G.attr({width:Math.abs(f),x:(0<f?0:f)+A}));G&&r&&(f=d-m,G.attr({height:Math.abs(f),y:(0<f?0:f)+m}));v&&!G&&L&&a.pan(b,c.panning)}},drop:function(b){var a=this,c=this.chart,d=this.hasPinched;if(this.selectionMarker){var h={originalEvent:b,xAxis:[],yAxis:[]},g=this.selectionMarker,r=g.attr?g.attr("x"):g.x,e=g.attr?g.attr("y"):g.y,k=g.attr?g.attr("width"):g.width,u=g.attr?g.attr("height"): |
|
|
|
g.height,H;if(this.hasDragged||d)c.axes.forEach(function(c){if(c.zoomEnabled&&F(c.min)&&(d||a[{xAxis:"zoomX",yAxis:"zoomY"}[c.coll]])){var f=c.horiz,l="touchend"===b.type?c.minPixelPadding:0,t=c.toValue((f?r:e)+l);f=c.toValue((f?r+k:e+u)-l);h[c.coll].push({axis:c,min:Math.min(t,f),max:Math.max(t,f)});H=!0}}),H&&f(c,"selection",h,function(a){c.zoom(E(a,d?{animation:!1}:null))});D(c.index)&&(this.selectionMarker=this.selectionMarker.destroy());d&&this.scaleGroups()}c&&D(c.index)&&(w(c.container,{cursor:c._cursor}), |
|
|
|
c.cancelClick=10<this.hasDragged,c.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(b){b=this.normalize(b);2!==b.button&&(this.zoomOption(b),b.preventDefault&&b.preventDefault(),this.dragStart(b))},onDocumentMouseUp:function(b){m[d.hoverChartIndex]&&m[d.hoverChartIndex].pointer.drop(b)},onDocumentMouseMove:function(b){var a=this.chart,c=this.chartPosition;b=this.normalize(b,c);!c||this.inClass(b.target,"highcharts-tracker")||a.isInsidePlot(b.chartX- |
|
|
|
a.plotLeft,b.chartY-a.plotTop)||this.reset()},onContainerMouseLeave:function(b){var a=m[d.hoverChartIndex];a&&(b.relatedTarget||b.toElement)&&(a.pointer.reset(),a.pointer.chartPosition=void 0)},onContainerMouseMove:function(b){var a=this.chart;F(d.hoverChartIndex)&&m[d.hoverChartIndex]&&m[d.hoverChartIndex].mouseIsDown||(d.hoverChartIndex=a.index);b=this.normalize(b);b.preventDefault||(b.returnValue=!1);"mousedown"===a.mouseIsDown&&this.drag(b);!this.inClass(b.target,"highcharts-tracker")&&!a.isInsidePlot(b.chartX- |
|
|
|
a.plotLeft,b.chartY-a.plotTop)||a.openMenu||this.runPointActions(b)},inClass:function(b,a){for(var c;b;){if(c=y(b,"class")){if(-1!==c.indexOf(a))return!0;if(-1!==c.indexOf("highcharts-container"))return!1}b=b.parentNode}},onTrackerMouseOut:function(b){var a=this.chart.hoverSeries;b=b.relatedTarget||b.toElement;this.isDirectTouch=!1;if(!(!a||!b||a.stickyTracking||this.inClass(b,"highcharts-tooltip")||this.inClass(b,"highcharts-series-"+a.index)&&this.inClass(b,"highcharts-tracker")))a.onMouseOut()}, |
|
|
|
onContainerClick:function(b){var a=this.chart,c=a.hoverPoint,d=a.plotLeft,h=a.plotTop;b=this.normalize(b);a.cancelClick||(c&&this.inClass(b.target,"highcharts-tracker")?(f(c.series,"click",E(b,{point:c})),a.hoverPoint&&c.firePointEvent("click",b)):(E(b,this.getCoordinates(b)),a.isInsidePlot(b.chartX-d,b.chartY-h)&&f(a,"click",b)))},setDOMEvents:function(){var b=this,a=b.chart.container,c=a.ownerDocument;a.onmousedown=function(a){b.onContainerMouseDown(a)};a.onmousemove=function(a){b.onContainerMouseMove(a)}; |
|
|
|
a.onclick=function(a){b.onContainerClick(a)};this.unbindContainerMouseLeave=z(a,"mouseleave",b.onContainerMouseLeave);d.unbindDocumentMouseUp||(d.unbindDocumentMouseUp=z(c,"mouseup",b.onDocumentMouseUp));d.hasTouch&&(z(a,"touchstart",function(a){b.onContainerTouchStart(a)}),z(a,"touchmove",function(a){b.onContainerTouchMove(a)}),d.unbindDocumentTouchEnd||(d.unbindDocumentTouchEnd=z(c,"touchend",b.onDocumentTouchEnd)))},destroy:function(){var b=this;b.unDocMouseMove&&b.unDocMouseMove();this.unbindContainerMouseLeave(); |
|
|
|
d.chartCount||(d.unbindDocumentMouseUp&&(d.unbindDocumentMouseUp=d.unbindDocumentMouseUp()),d.unbindDocumentTouchEnd&&(d.unbindDocumentTouchEnd=d.unbindDocumentTouchEnd()));clearInterval(b.tooltipTimeout);v(b,function(a,c){b[c]=null})}}});K(y,"parts/TouchPointer.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.extend,F=g.pick,E=d.charts,D=d.noop;y(d.Pointer.prototype,{pinchTranslate:function(d,g,C,B,p,z){this.zoomHor&&this.pinchTranslateDirection(!0,d,g,C,B,p,z);this.zoomVert&& |
|
|
|
this.pinchTranslateDirection(!1,d,g,C,B,p,z)},pinchTranslateDirection:function(d,g,C,B,p,z,m,q){var v=this.chart,h=d?"x":"y",f=d?"X":"Y",c="chart"+f,b=d?"width":"height",a=v["plot"+(d?"Left":"Top")],l,n,t=q||1,I=v.inverted,r=v.bounds[d?"h":"v"],e=1===g.length,k=g[0][c],u=C[0][c],H=!e&&g[1][c],G=!e&&C[1][c];C=function(){!e&&20<Math.abs(k-H)&&(t=q||Math.abs(u-G)/Math.abs(k-H));n=(a-u)/t+k;l=v["plot"+(d?"Width":"Height")]/t};C();g=n;if(g<r.min){g=r.min;var A=!0}else g+l>r.max&&(g=r.max-l,A=!0);A?(u-= |
|
|
|
.8*(u-m[h][0]),e||(G-=.8*(G-m[h][1])),C()):m[h]=[u,G];I||(z[h]=n-a,z[b]=l);z=I?1/t:t;p[b]=l;p[h]=g;B[I?d?"scaleY":"scaleX":"scale"+f]=t;B["translate"+f]=z*a+(u-z*k)},pinch:function(d){var g=this,x=g.chart,B=g.pinchDown,p=d.touches,z=p.length,m=g.lastValidTouch,q=g.hasZoom,w=g.selectionMarker,h={},f=1===z&&(g.inClass(d.target,"highcharts-tracker")&&x.runTrackerClick||g.runChartClick),c={};1<z&&(g.initiated=!0);q&&g.initiated&&!f&&d.preventDefault();[].map.call(p,function(b){return g.normalize(b)}); |
|
|
|
"touchstart"===d.type?([].forEach.call(p,function(b,a){B[a]={chartX:b.chartX,chartY:b.chartY}}),m.x=[B[0].chartX,B[1]&&B[1].chartX],m.y=[B[0].chartY,B[1]&&B[1].chartY],x.axes.forEach(function(b){if(b.zoomEnabled){var a=x.bounds[b.horiz?"h":"v"],c=b.minPixelPadding,f=b.toPixels(Math.min(F(b.options.min,b.dataMin),b.dataMin)),d=b.toPixels(Math.max(F(b.options.max,b.dataMax),b.dataMax)),h=Math.max(f,d);a.min=Math.min(b.pos,Math.min(f,d)-c);a.max=Math.max(b.pos+b.len,h+c)}}),g.res=!0):g.followTouchMove&& |
|
|
|
1===z?this.runPointActions(g.normalize(d)):B.length&&(w||(g.selectionMarker=w=y({destroy:D,touch:!0},x.plotBox)),g.pinchTranslate(B,p,h,w,c,m),g.hasPinched=q,g.scaleGroups(h,c),g.res&&(g.res=!1,this.reset(!1,0)))},touch:function(g,v){var x=this.chart,B;if(x.index!==d.hoverChartIndex)this.onContainerMouseLeave({relatedTarget:!0});d.hoverChartIndex=x.index;if(1===g.touches.length)if(g=this.normalize(g),(B=x.isInsidePlot(g.chartX-x.plotLeft,g.chartY-x.plotTop))&&!x.openMenu){v&&this.runPointActions(g); |
|
|
|
if("touchmove"===g.type){v=this.pinchDown;var p=v[0]?4<=Math.sqrt(Math.pow(v[0].chartX-g.chartX,2)+Math.pow(v[0].chartY-g.chartY,2)):!1}F(p,!0)&&this.pinch(g)}else v&&this.reset();else 2===g.touches.length&&this.pinch(g)},onContainerTouchStart:function(d){this.zoomOption(d);this.touch(d,!0)},onContainerTouchMove:function(d){this.touch(d)},onDocumentTouchEnd:function(g){E[d.hoverChartIndex]&&E[d.hoverChartIndex].pointer.drop(g)}})});K(y,"parts/MSPointer.js",[y["parts/Globals.js"],y["parts/Utilities.js"]], |
|
|
|
function(d,g){var y=g.extend,F=g.objectEach;g=g.wrap;var E=d.addEvent,D=d.charts,x=d.css,v=d.doc,C=d.noop,B=d.Pointer,p=d.removeEvent,z=d.win;if(!d.hasTouch&&(z.PointerEvent||z.MSPointerEvent)){var m={},q=!!z.PointerEvent,w=function(){var f=[];f.item=function(c){return this[c]};F(m,function(c){f.push({pageX:c.pageX,pageY:c.pageY,target:c.target})});return f},h=function(f,c,b,a){"touch"!==f.pointerType&&f.pointerType!==f.MSPOINTER_TYPE_TOUCH||!D[d.hoverChartIndex]||(a(f),a=D[d.hoverChartIndex].pointer, |
|
|
|
a[c]({type:b,target:f.currentTarget,preventDefault:C,touches:w()}))};y(B.prototype,{onContainerPointerDown:function(f){h(f,"onContainerTouchStart","touchstart",function(c){m[c.pointerId]={pageX:c.pageX,pageY:c.pageY,target:c.currentTarget}})},onContainerPointerMove:function(f){h(f,"onContainerTouchMove","touchmove",function(c){m[c.pointerId]={pageX:c.pageX,pageY:c.pageY};m[c.pointerId].target||(m[c.pointerId].target=c.currentTarget)})},onDocumentPointerUp:function(f){h(f,"onDocumentTouchEnd","touchend", |
|
|
|
function(c){delete m[c.pointerId]})},batchMSEvents:function(f){f(this.chart.container,q?"pointerdown":"MSPointerDown",this.onContainerPointerDown);f(this.chart.container,q?"pointermove":"MSPointerMove",this.onContainerPointerMove);f(v,q?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});g(B.prototype,"init",function(f,c,b){f.call(this,c,b);this.hasZoom&&x(c.container,{"-ms-touch-action":"none","touch-action":"none"})});g(B.prototype,"setDOMEvents",function(f){f.apply(this);(this.hasZoom||this.followTouchMove)&& |
|
|
|
this.batchMSEvents(E)});g(B.prototype,"destroy",function(f){this.batchMSEvents(p);f.call(this)})}});K(y,"parts/Legend.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.defined,F=g.discardElement,E=g.isNumber,D=g.pick,x=g.relativeLength,v=g.setAnimation,C=g.syncTimeout;g=g.wrap;var B=d.addEvent,p=d.css,z=d.fireEvent,m=d.isFirefox,q=d.marginNames,w=d.merge,h=d.stableSort,f=d.win;d.Legend=function(c,b){this.init(c,b)};d.Legend.prototype={init:function(c,b){this.chart=c;this.setOptions(b); |
|
|
|
b.enabled&&(this.render(),B(this.chart,"endResize",function(){this.legend.positionCheckboxes()}),this.proximate?this.unchartrender=B(this.chart,"render",function(){this.legend.proximatePositions();this.legend.positionItems()}):this.unchartrender&&this.unchartrender())},setOptions:function(c){var b=D(c.padding,8);this.options=c;this.chart.styledMode||(this.itemStyle=c.itemStyle,this.itemHiddenStyle=w(this.itemStyle,c.itemHiddenStyle));this.itemMarginTop=c.itemMarginTop||0;this.itemMarginBottom=c.itemMarginBottom|| |
|
|
|
0;this.padding=b;this.initialItemY=b-5;this.symbolWidth=D(c.symbolWidth,16);this.pages=[];this.proximate="proximate"===c.layout&&!this.chart.inverted},update:function(c,b){var a=this.chart;this.setOptions(w(!0,this.options,c));this.destroy();a.isDirtyLegend=a.isDirtyBox=!0;D(b,!0)&&a.redraw();z(this,"afterUpdate")},colorizeItem:function(c,b){c.legendGroup[b?"removeClass":"addClass"]("highcharts-legend-item-hidden");if(!this.chart.styledMode){var a=this.options,f=c.legendItem,d=c.legendLine,h=c.legendSymbol, |
|
|
|
g=this.itemHiddenStyle.color;a=b?a.itemStyle.color:g;var r=b?c.color||g:g,e=c.options&&c.options.marker,k={fill:r};f&&f.css({fill:a,color:a});d&&d.attr({stroke:r});h&&(e&&h.isMarker&&(k=c.pointAttribs(),b||(k.stroke=k.fill=g)),h.attr(k))}z(this,"afterColorizeItem",{item:c,visible:b})},positionItems:function(){this.allItems.forEach(this.positionItem,this);this.chart.isResizing||this.positionCheckboxes()},positionItem:function(c){var b=this.options,a=b.symbolPadding;b=!b.rtl;var f=c._legendItemPos, |
|
|
|
d=f[0];f=f[1];var h=c.checkbox;if((c=c.legendGroup)&&c.element)c[y(c.translateY)?"animate":"attr"]({translateX:b?d:this.legendWidth-d-2*a-4,translateY:f});h&&(h.x=d,h.y=f)},destroyItem:function(c){var b=c.checkbox;["legendItem","legendLine","legendSymbol","legendGroup"].forEach(function(a){c[a]&&(c[a]=c[a].destroy())});b&&F(c.checkbox)},destroy:function(){function c(b){this[b]&&(this[b]=this[b].destroy())}this.getAllItems().forEach(function(b){["legendItem","legendGroup"].forEach(c,b)});"clipRect up down pager nav box title group".split(" ").forEach(c, |
|
|
|
this);this.display=null},positionCheckboxes:function(){var c=this.group&&this.group.alignAttr,b=this.clipHeight||this.legendHeight,a=this.titleHeight;if(c){var f=c.translateY;this.allItems.forEach(function(d){var l=d.checkbox;if(l){var h=f+a+l.y+(this.scrollOffset||0)+3;p(l,{left:c.translateX+d.checkboxOffset+l.x-20+"px",top:h+"px",display:this.proximate||h>f-6&&h<f+b-6?"":"none"})}},this)}},renderTitle:function(){var c=this.options,b=this.padding,a=c.title,f=0;a.text&&(this.title||(this.title=this.chart.renderer.label(a.text, |
|
|
|
b-3,b-4,null,null,null,c.useHTML,null,"legend-title").attr({zIndex:1}),this.chart.styledMode||this.title.css(a.style),this.title.add(this.group)),a.width||this.title.css({width:this.maxLegendWidth+"px"}),c=this.title.getBBox(),f=c.height,this.offsetWidth=c.width,this.contentGroup.attr({translateY:f}));this.titleHeight=f},setText:function(c){var b=this.options;c.legendItem.attr({text:b.labelFormat?d.format(b.labelFormat,c,this.chart):b.labelFormatter.call(c)})},renderItem:function(c){var b=this.chart, |
|
|
|
a=b.renderer,f=this.options,d=this.symbolWidth,h=f.symbolPadding,g=this.itemStyle,r=this.itemHiddenStyle,e="horizontal"===f.layout?D(f.itemDistance,20):0,k=!f.rtl,u=c.legendItem,H=!c.series,G=!H&&c.series.drawLegendSymbol?c.series:c,A=G.options;A=this.createCheckboxForItem&&A&&A.showCheckbox;e=d+h+e+(A?20:0);var m=f.useHTML,L=c.options.className;u||(c.legendGroup=a.g("legend-item").addClass("highcharts-"+G.type+"-series highcharts-color-"+c.colorIndex+(L?" "+L:"")+(H?" highcharts-series-"+c.index: |
|
|
|
"")).attr({zIndex:1}).add(this.scrollGroup),c.legendItem=u=a.text("",k?d+h:-h,this.baseline||0,m),b.styledMode||u.css(w(c.visible?g:r)),u.attr({align:k?"left":"right",zIndex:2}).add(c.legendGroup),this.baseline||(this.fontMetrics=a.fontMetrics(b.styledMode?12:g.fontSize,u),this.baseline=this.fontMetrics.f+3+this.itemMarginTop,u.attr("y",this.baseline)),this.symbolHeight=f.symbolHeight||this.fontMetrics.f,G.drawLegendSymbol(this,c),this.setItemEvents&&this.setItemEvents(c,u,m));A&&!c.checkbox&&this.createCheckboxForItem(c); |
|
|
|
this.colorizeItem(c,c.visible);!b.styledMode&&g.width||u.css({width:(f.itemWidth||this.widthOption||b.spacingBox.width)-e});this.setText(c);b=u.getBBox();c.itemWidth=c.checkboxOffset=f.itemWidth||c.legendItemWidth||b.width+e;this.maxItemWidth=Math.max(this.maxItemWidth,c.itemWidth);this.totalItemWidth+=c.itemWidth;this.itemHeight=c.itemHeight=Math.round(c.legendItemHeight||b.height||this.symbolHeight)},layoutItem:function(c){var b=this.options,a=this.padding,f="horizontal"===b.layout,d=c.itemHeight, |
|
|
|
h=this.itemMarginBottom,g=this.itemMarginTop,r=f?D(b.itemDistance,20):0,e=this.maxLegendWidth;b=b.alignColumns&&this.totalItemWidth>e?this.maxItemWidth:c.itemWidth;f&&this.itemX-a+b>e&&(this.itemX=a,this.lastLineHeight&&(this.itemY+=g+this.lastLineHeight+h),this.lastLineHeight=0);this.lastItemY=g+this.itemY+h;this.lastLineHeight=Math.max(d,this.lastLineHeight);c._legendItemPos=[this.itemX,this.itemY];f?this.itemX+=b:(this.itemY+=g+d+h,this.lastLineHeight=d);this.offsetWidth=this.widthOption||Math.max((f? |
|
|
|
this.itemX-a-(c.checkbox?0:r):b)+a,this.offsetWidth)},getAllItems:function(){var c=[];this.chart.series.forEach(function(b){var a=b&&b.options;b&&D(a.showInLegend,y(a.linkedTo)?!1:void 0,!0)&&(c=c.concat(b.legendItems||("point"===a.legendType?b.data:b)))});z(this,"afterGetAllItems",{allItems:c});return c},getAlignment:function(){var c=this.options;return this.proximate?c.align.charAt(0)+"tv":c.floating?"":c.align.charAt(0)+c.verticalAlign.charAt(0)+c.layout.charAt(0)},adjustMargins:function(c,b){var a= |
|
|
|
this.chart,f=this.options,d=this.getAlignment();d&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach(function(l,h){l.test(d)&&!y(c[h])&&(a[q[h]]=Math.max(a[q[h]],a.legend[(h+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][h]*f[h%2?"x":"y"]+D(f.margin,12)+b[h]+(a.titleOffset[h]||0)))})},proximatePositions:function(){var c=this.chart,b=[],a="left"===this.options.align;this.allItems.forEach(function(f){var l=a;if(f.yAxis&&f.points){f.xAxis.options.reversed&&(l=!l);var h=d.find(l?f.points: |
|
|
|
f.points.slice(0).reverse(),function(a){return E(a.plotY)});l=this.itemMarginTop+f.legendItem.getBBox().height+this.itemMarginBottom;var g=f.yAxis.top-c.plotTop;f.visible?(h=h?h.plotY:f.yAxis.height,h+=g-.3*l):h=g+f.yAxis.height;b.push({target:h,size:l,item:f})}},this);d.distribute(b,c.plotHeight);b.forEach(function(a){a.item._legendItemPos[1]=c.plotTop-c.spacing[0]+a.pos})},render:function(){var c=this.chart,b=c.renderer,a=this.group,f,d=this.box,g=this.options,m=this.padding;this.itemX=m;this.itemY= |
|
|
|
this.initialItemY;this.lastItemY=this.offsetWidth=0;this.widthOption=x(g.width,c.spacingBox.width-m);var r=c.spacingBox.width-2*m-g.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(r/=2);this.maxLegendWidth=this.widthOption||r;a||(this.group=a=b.g("legend").attr({zIndex:7}).add(),this.contentGroup=b.g().attr({zIndex:1}).add(a),this.scrollGroup=b.g().add(this.contentGroup));this.renderTitle();r=this.getAllItems();h(r,function(a,e){return(a.options&&a.options.legendIndex||0)-(e.options&& |
|
|
|
e.options.legendIndex||0)});g.reversed&&r.reverse();this.allItems=r;this.display=f=!!r.length;this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0;r.forEach(this.renderItem,this);r.forEach(this.layoutItem,this);r=(this.widthOption||this.offsetWidth)+m;var e=this.lastItemY+this.lastLineHeight+this.titleHeight;e=this.handleOverflow(e);e+=m;d||(this.box=d=b.rect().addClass("highcharts-legend-box").attr({r:g.borderRadius}).add(a),d.isNew=!0);c.styledMode||d.attr({stroke:g.borderColor, |
|
|
|
"stroke-width":g.borderWidth||0,fill:g.backgroundColor||"none"}).shadow(g.shadow);0<r&&0<e&&(d[d.isNew?"attr":"animate"](d.crisp.call({},{x:0,y:0,width:r,height:e},d.strokeWidth())),d.isNew=!1);d[f?"show":"hide"]();c.styledMode&&"none"===a.getStyle("display")&&(r=e=0);this.legendWidth=r;this.legendHeight=e;f&&(b=c.spacingBox,d=b.y,/(lth|ct|rth)/.test(this.getAlignment())&&0<c.titleOffset[0]?d+=c.titleOffset[0]:/(lbh|cb|rbh)/.test(this.getAlignment())&&0<c.titleOffset[2]&&(d-=c.titleOffset[2]),d!== |
|
|
|
b.y&&(b=w(b,{y:d})),a.align(w(g,{width:r,height:e,verticalAlign:this.proximate?"top":g.verticalAlign}),!0,b));this.proximate||this.positionItems();z(this,"afterRender")},handleOverflow:function(c){var b=this,a=this.chart,f=a.renderer,d=this.options,h=d.y,g=this.padding;h=a.spacingBox.height+("top"===d.verticalAlign?-h:h)-g;var r=d.maxHeight,e,k=this.clipRect,u=d.navigation,H=D(u.animation,!0),G=u.arrowSize||12,A=this.nav,m=this.pages,L,q=this.allItems,p=function(a){"number"===typeof a?k.attr({height:a}): |
|
|
|
k&&(b.clipRect=k.destroy(),b.contentGroup.clip());b.contentGroup.div&&(b.contentGroup.div.style.clip=a?"rect("+g+"px,9999px,"+(g+a)+"px,0)":"auto")},z=function(e){b[e]=f.circle(0,0,1.3*G).translate(G/2,G/2).add(A);a.styledMode||b[e].attr("fill","rgba(0,0,0,0.0001)");return b[e]};"horizontal"!==d.layout||"middle"===d.verticalAlign||d.floating||(h/=2);r&&(h=Math.min(h,r));m.length=0;c>h&&!1!==u.enabled?(this.clipHeight=e=Math.max(h-20-this.titleHeight-g,0),this.currentPage=D(this.currentPage,1),this.fullHeight= |
|
|
|
c,q.forEach(function(a,b){var c=a._legendItemPos[1],k=Math.round(a.legendItem.getBBox().height),f=m.length;if(!f||c-m[f-1]>e&&(L||c)!==m[f-1])m.push(L||c),f++;a.pageIx=f-1;L&&(q[b-1].pageIx=f-1);b===q.length-1&&c+k-m[f-1]>e&&c!==L&&(m.push(c),a.pageIx=f);c!==L&&(L=c)}),k||(k=b.clipRect=f.clipRect(0,g,9999,0),b.contentGroup.clip(k)),p(e),A||(this.nav=A=f.g().attr({zIndex:1}).add(this.group),this.up=f.symbol("triangle",0,0,G,G).add(A),z("upTracker").on("click",function(){b.scroll(-1,H)}),this.pager= |
|
|
|
f.text("",15,10).addClass("highcharts-legend-navigation"),a.styledMode||this.pager.css(u.style),this.pager.add(A),this.down=f.symbol("triangle-down",0,0,G,G).add(A),z("downTracker").on("click",function(){b.scroll(1,H)})),b.scroll(0),c=h):A&&(p(),this.nav=A.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return c},scroll:function(c,b){var a=this,f=this.chart,h=this.pages,g=h.length,m=this.currentPage+c;c=this.clipHeight;var r=this.options.navigation,e=this.pager,k=this.padding;m> |
|
|
|
g&&(m=g);0<m&&("undefined"!==typeof b&&v(b,f),this.nav.attr({translateX:k,translateY:c+this.padding+7+this.titleHeight,visibility:"visible"}),[this.up,this.upTracker].forEach(function(a){a.attr({"class":1===m?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})}),e.attr({text:m+"/"+g}),[this.down,this.downTracker].forEach(function(a){a.attr({x:18+this.pager.getBBox().width,"class":m===g?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})},this),f.styledMode||(this.up.attr({fill:1=== |
|
|
|
m?r.inactiveColor:r.activeColor}),this.upTracker.css({cursor:1===m?"default":"pointer"}),this.down.attr({fill:m===g?r.inactiveColor:r.activeColor}),this.downTracker.css({cursor:m===g?"default":"pointer"})),this.scrollOffset=-h[m-1]+this.initialItemY,this.scrollGroup.animate({translateY:this.scrollOffset}),this.currentPage=m,this.positionCheckboxes(),b=d.animObject(D(b,f.renderer.globalAnimation,!0)),C(function(){z(a,"afterScroll",{currentPage:m})},b.duration||0))}};d.LegendSymbolMixin={drawRectangle:function(c, |
|
|
|
b){var a=c.symbolHeight,f=c.options.squareSymbol;b.legendSymbol=this.chart.renderer.rect(f?(c.symbolWidth-a)/2:0,c.baseline-a+1,f?a:c.symbolWidth,a,D(c.options.symbolRadius,a/2)).addClass("highcharts-point").attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(c){var b=this.options,a=b.marker,f=c.symbolWidth,d=c.symbolHeight,h=d/2,g=this.chart.renderer,r=this.legendGroup;c=c.baseline-Math.round(.3*c.fontMetrics.b);var e={};this.chart.styledMode||(e={"stroke-width":b.lineWidth||0},b.dashStyle&& |
|
|
|
(e.dashstyle=b.dashStyle));this.legendLine=g.path(["M",0,c,"L",f,c]).addClass("highcharts-graph").attr(e).add(r);a&&!1!==a.enabled&&f&&(b=Math.min(D(a.radius,h),h),0===this.symbol.indexOf("url")&&(a=w(a,{width:d,height:d}),b=0),this.legendSymbol=a=g.symbol(this.symbol,f/2-b,c-b,2*b,2*b,a).addClass("highcharts-point").add(r),a.isMarker=!0)}};(/Trident\/7\.0/.test(f.navigator&&f.navigator.userAgent)||m)&&g(d.Legend.prototype,"positionItem",function(c,b){var a=this,f=function(){b._legendItemPos&&c.call(a, |
|
|
|
b)};f();a.bubbleLegend||setTimeout(f)})});K(y,"parts/Chart.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.animObject,F=g.attr,E=g.defined,D=g.discardElement,x=g.erase,v=g.extend,C=g.isArray,B=g.isNumber,p=g.isObject,z=g.isString,m=g.numberFormat,q=g.objectEach,w=g.pick,h=g.pInt,f=g.relativeLength,c=g.setAnimation,b=g.splat,a=g.syncTimeout,l=d.addEvent,n=d.animate,t=d.doc,I=d.Axis,r=d.createElement,e=d.defaultOptions,k=d.charts,u=d.css,H=d.find,G=d.fireEvent,A=d.Legend,J= |
|
|
|
d.marginNames,L=d.merge,Q=d.Pointer,V=d.removeEvent,U=d.seriesTypes,P=d.win,O=d.Chart=function(){this.getArgs.apply(this,arguments)};d.chart=function(a,e,b){return new O(a,e,b)};v(O.prototype,{callbacks:[],getArgs:function(){var a=[].slice.call(arguments);if(z(a[0])||a[0].nodeName)this.renderTo=a.shift();this.init(a[0],a[1])},init:function(a,b){var c,f=a.series,u=a.plotOptions||{};G(this,"init",{args:arguments},function(){a.series=null;c=L(e,a);q(c.plotOptions,function(a,e){p(a)&&(a.tooltip=u[e]&& |
|
|
|
L(u[e].tooltip)||void 0)});c.tooltip.userOptions=a.chart&&a.chart.forExport&&a.tooltip.userOptions||a.tooltip;c.series=a.series=f;this.userOptions=a;var h=c.chart,g=h.events;this.margin=[];this.spacing=[];this.bounds={h:{},v:{}};this.labelCollectors=[];this.callback=b;this.isResizing=0;this.options=c;this.axes=[];this.series=[];this.time=a.time&&Object.keys(a.time).length?new d.Time(a.time):d.time;this.numberFormatter=h.numberFormatter||m;this.styledMode=h.styledMode;this.hasCartesianSeries=h.showAxes; |
|
|
|
var r=this;r.index=k.length;k.push(r);d.chartCount++;g&&q(g,function(a,e){d.isFunction(a)&&l(r,e,a)});r.xAxis=[];r.yAxis=[];r.pointCount=r.colorCounter=r.symbolCounter=0;G(r,"afterInit");r.firstRender()})},initSeries:function(a){var e=this.options.chart;e=a.type||e.type||e.defaultSeriesType;var b=U[e];b||d.error(17,!0,this,{missingModuleFor:e});e=new b;e.init(this,a);return e},setSeriesData:function(){this.getSeriesOrderByLinks().forEach(function(a){a.points||a.data||!a.enabledDataSorting||a.setData(a.options.data, |
|
|
|
!1)})},getSeriesOrderByLinks:function(){return this.series.concat().sort(function(a,e){return a.linkedSeries.length||e.linkedSeries.length?e.linkedSeries.length-a.linkedSeries.length:0})},orderSeries:function(a){var e=this.series;for(a=a||0;a<e.length;a++)e[a]&&(e[a].index=a,e[a].name=e[a].getName())},isInsidePlot:function(a,e,b){var c=b?e:a;a=b?a:e;return 0<=c&&c<=this.plotWidth&&0<=a&&a<=this.plotHeight},redraw:function(a){G(this,"beforeRedraw");var e=this.axes,b=this.series,k=this.pointer,f=this.legend, |
|
|
|
d=this.userOptions.legend,u=this.isDirtyLegend,l=this.hasCartesianSeries,h=this.isDirtyBox,g=this.renderer,r=g.isHidden(),A=[];this.setResponsive&&this.setResponsive(!1);c(a,this);r&&this.temporaryDisplay();this.layOutTitles();for(a=b.length;a--;){var H=b[a];if(H.options.stacking){var t=!0;if(H.isDirty){var n=!0;break}}}if(n)for(a=b.length;a--;)H=b[a],H.options.stacking&&(H.isDirty=!0);b.forEach(function(a){a.isDirty&&("point"===a.options.legendType?(a.updateTotals&&a.updateTotals(),u=!0):d&&(d.labelFormatter|| |
|
|
|
d.labelFormat)&&(u=!0));a.isDirtyData&&G(a,"updatedData")});u&&f&&f.options.enabled&&(f.render(),this.isDirtyLegend=!1);t&&this.getStacks();l&&e.forEach(function(a){a.updateNames();a.setScale()});this.getMargins();l&&(e.forEach(function(a){a.isDirty&&(h=!0)}),e.forEach(function(a){var e=a.min+","+a.max;a.extKey!==e&&(a.extKey=e,A.push(function(){G(a,"afterSetExtremes",v(a.eventArgs,a.getExtremes()));delete a.eventArgs}));(h||t)&&a.redraw()}));h&&this.drawChartBox();G(this,"predraw");b.forEach(function(a){(h|| |
|
|
|
a.isDirty)&&a.visible&&a.redraw();a.isDirtyData=!1});k&&k.reset(!0);g.draw();G(this,"redraw");G(this,"render");r&&this.temporaryDisplay(!0);A.forEach(function(a){a.call()})},get:function(a){function e(e){return e.id===a||e.options&&e.options.id===a}var b=this.series,c;var k=H(this.axes,e)||H(this.series,e);for(c=0;!k&&c<b.length;c++)k=H(b[c].points||[],e);return k},getAxes:function(){var a=this,e=this.options,c=e.xAxis=b(e.xAxis||{});e=e.yAxis=b(e.yAxis||{});G(this,"getAxes");c.forEach(function(a, |
|
|
|
e){a.index=e;a.isX=!0});e.forEach(function(a,e){a.index=e});c.concat(e).forEach(function(e){new I(a,e)});G(this,"afterGetAxes")},getSelectedPoints:function(){var a=[];this.series.forEach(function(e){a=a.concat((e[e.hasGroupedData?"points":"data"]||[]).filter(function(a){return w(a.selectedStaging,a.selected)}))});return a},getSelectedSeries:function(){return this.series.filter(function(a){return a.selected})},setTitle:function(a,e,b){this.applyDescription("title",a);this.applyDescription("subtitle", |
|
|
|
e);this.applyDescription("caption",void 0);this.layOutTitles(b)},applyDescription:function(a,e){var b=this,c="title"===a?{color:"#333333",fontSize:this.options.isStock?"16px":"18px"}:{color:"#666666"};c=this.options[a]=L(!this.styledMode&&{style:c},this.options[a],e);var k=this[a];k&&e&&(this[a]=k=k.destroy());c&&!k&&(k=this.renderer.text(c.text,0,0,c.useHTML).attr({align:c.align,"class":"highcharts-"+a,zIndex:c.zIndex||4}).add(),k.update=function(e){b[{title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"}[a]](e)}, |
|
|
|
this.styledMode||k.css(c.style),this[a]=k)},layOutTitles:function(a){var e=[0,0,0],b=this.renderer,c=this.spacingBox;["title","subtitle","caption"].forEach(function(a){var k=this[a],f=this.options[a],d=f.verticalAlign||"top";a="title"===a?-3:"top"===d?e[0]+2:0;if(k){if(!this.styledMode)var u=f.style.fontSize;u=b.fontMetrics(u,k).b;k.css({width:(f.width||c.width+(f.widthAdjust||0))+"px"});var l=Math.round(k.getBBox(f.useHTML).height);k.align(v({y:"bottom"===d?u:a+u,height:l},f),!1,"spacingBox");f.floating|| |
|
|
|
("top"===d?e[0]=Math.ceil(e[0]+l):"bottom"===d&&(e[2]=Math.ceil(e[2]+l)))}},this);e[0]&&"top"===(this.options.title.verticalAlign||"top")&&(e[0]+=this.options.title.margin);e[2]&&"bottom"===this.options.caption.verticalAlign&&(e[2]+=this.options.caption.margin);var k=!this.titleOffset||this.titleOffset.join(",")!==e.join(",");this.titleOffset=e;G(this,"afterLayOutTitles");!this.isDirtyBox&&k&&(this.isDirtyBox=this.isDirtyLegend=k,this.hasRendered&&w(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a= |
|
|
|
this.options.chart,e=a.width;a=a.height;var b=this.renderTo;E(e)||(this.containerWidth=d.getStyle(b,"width"));E(a)||(this.containerHeight=d.getStyle(b,"height"));this.chartWidth=Math.max(0,e||this.containerWidth||600);this.chartHeight=Math.max(0,f(a,this.chartWidth)||(1<this.containerHeight?this.containerHeight:400))},temporaryDisplay:function(a){var e=this.renderTo;if(a)for(;e&&e.style;)e.hcOrigStyle&&(d.css(e,e.hcOrigStyle),delete e.hcOrigStyle),e.hcOrigDetached&&(t.body.removeChild(e),e.hcOrigDetached= |
|
|
|
!1),e=e.parentNode;else for(;e&&e.style;){t.body.contains(e)||e.parentNode||(e.hcOrigDetached=!0,t.body.appendChild(e));if("none"===d.getStyle(e,"display",!1)||e.hcOricDetached)e.hcOrigStyle={display:e.style.display,height:e.style.height,overflow:e.style.overflow},a={display:"block",overflow:"hidden"},e!==this.renderTo&&(a.height=0),d.css(e,a),e.offsetWidth||e.style.setProperty("display","block","important");e=e.parentNode;if(e===t.body)break}},setClassName:function(a){this.container.className="highcharts-container "+ |
|
|
|
(a||"")},getContainer:function(){var a=this.options,e=a.chart;var b=this.renderTo;var c=d.uniqueKey(),f,l;b||(this.renderTo=b=e.renderTo);z(b)&&(this.renderTo=b=t.getElementById(b));b||d.error(13,!0,this);var g=h(F(b,"data-highcharts-chart"));B(g)&&k[g]&&k[g].hasRendered&&k[g].destroy();F(b,"data-highcharts-chart",this.index);b.innerHTML="";e.skipClone||b.offsetWidth||this.temporaryDisplay();this.getChartSize();g=this.chartWidth;var A=this.chartHeight;u(b,{overflow:"hidden"});this.styledMode||(f= |
|
|
|
v({position:"relative",overflow:"hidden",width:g+"px",height:A+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},e.style));this.container=b=r("div",{id:c},f,b);this._cursor=b.style.cursor;this.renderer=new (d[e.renderer]||d.Renderer)(b,g,A,null,e.forExport,a.exporting&&a.exporting.allowHTML,this.styledMode);this.setClassName(e.className);if(this.styledMode)for(l in a.defs)this.renderer.definition(a.defs[l]);else this.renderer.setStyle(e.style);this.renderer.chartIndex= |
|
|
|
this.index;G(this,"afterGetContainer")},getMargins:function(a){var e=this.spacing,b=this.margin,c=this.titleOffset;this.resetMargins();c[0]&&!E(b[0])&&(this.plotTop=Math.max(this.plotTop,c[0]+e[0]));c[2]&&!E(b[2])&&(this.marginBottom=Math.max(this.marginBottom,c[2]+e[2]));this.legend&&this.legend.display&&this.legend.adjustMargins(b,e);G(this,"getMargins");a||this.getAxisMargins()},getAxisMargins:function(){var a=this,e=a.axisOffset=[0,0,0,0],b=a.colorAxis,c=a.margin,k=function(a){a.forEach(function(a){a.visible&& |
|
|
|
a.getOffset()})};a.hasCartesianSeries?k(a.axes):b&&b.length&&k(b);J.forEach(function(b,k){E(c[k])||(a[b]+=e[k])});a.setChartSize()},reflow:function(e){var b=this,c=b.options.chart,k=b.renderTo,f=E(c.width)&&E(c.height),u=c.width||d.getStyle(k,"width");c=c.height||d.getStyle(k,"height");k=e?e.target:P;if(!f&&!b.isPrinting&&u&&c&&(k===P||k===t)){if(u!==b.containerWidth||c!==b.containerHeight)d.clearTimeout(b.reflowTimeout),b.reflowTimeout=a(function(){b.container&&b.setSize(void 0,void 0,!1)},e?100: |
|
|
|
0);b.containerWidth=u;b.containerHeight=c}},setReflow:function(a){var e=this;!1===a||this.unbindReflow?!1===a&&this.unbindReflow&&(this.unbindReflow=this.unbindReflow()):(this.unbindReflow=l(P,"resize",function(a){e.options&&e.reflow(a)}),l(this,"destroy",this.unbindReflow))},setSize:function(e,b,k){var f=this,d=f.renderer;f.isResizing+=1;c(k,f);f.oldChartHeight=f.chartHeight;f.oldChartWidth=f.chartWidth;"undefined"!==typeof e&&(f.options.chart.width=e);"undefined"!==typeof b&&(f.options.chart.height= |
|
|
|
b);f.getChartSize();if(!f.styledMode){var l=d.globalAnimation;(l?n:u)(f.container,{width:f.chartWidth+"px",height:f.chartHeight+"px"},l)}f.setChartSize(!0);d.setSize(f.chartWidth,f.chartHeight,k);f.axes.forEach(function(a){a.isDirty=!0;a.setScale()});f.isDirtyLegend=!0;f.isDirtyBox=!0;f.layOutTitles();f.getMargins();f.redraw(k);f.oldChartHeight=null;G(f,"resize");a(function(){f&&G(f,"endResize",null,function(){--f.isResizing})},y(l).duration||0)},setChartSize:function(a){var e=this.inverted,b=this.renderer, |
|
|
|
c=this.chartWidth,k=this.chartHeight,f=this.options.chart,d=this.spacing,u=this.clipOffset,l,h,g,r;this.plotLeft=l=Math.round(this.plotLeft);this.plotTop=h=Math.round(this.plotTop);this.plotWidth=g=Math.max(0,Math.round(c-l-this.marginRight));this.plotHeight=r=Math.max(0,Math.round(k-h-this.marginBottom));this.plotSizeX=e?r:g;this.plotSizeY=e?g:r;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=b.spacingBox={x:d[3],y:d[0],width:c-d[3]-d[1],height:k-d[0]-d[2]};this.plotBox=b.plotBox={x:l, |
|
|
|
y:h,width:g,height:r};c=2*Math.floor(this.plotBorderWidth/2);e=Math.ceil(Math.max(c,u[3])/2);b=Math.ceil(Math.max(c,u[0])/2);this.clipBox={x:e,y:b,width:Math.floor(this.plotSizeX-Math.max(c,u[1])/2-e),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(c,u[2])/2-b))};a||this.axes.forEach(function(a){a.setAxisSize();a.setAxisTranslation()});G(this,"afterSetChartSize",{skipAxes:a})},resetMargins:function(){G(this,"resetMargins");var a=this,e=a.options.chart;["margin","spacing"].forEach(function(b){var c= |
|
|
|
e[b],k=p(c)?c:[c,c,c,c];["Top","Right","Bottom","Left"].forEach(function(c,f){a[b][f]=w(e[b+c],k[f])})});J.forEach(function(e,b){a[e]=w(a.margin[b],a.spacing[b])});a.axisOffset=[0,0,0,0];a.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,e=this.renderer,b=this.chartWidth,c=this.chartHeight,k=this.chartBackground,f=this.plotBackground,d=this.plotBorder,u=this.styledMode,l=this.plotBGImage,h=a.backgroundColor,g=a.plotBackgroundColor,r=a.plotBackgroundImage,A,H=this.plotLeft,t= |
|
|
|
this.plotTop,n=this.plotWidth,m=this.plotHeight,L=this.plotBox,J=this.clipRect,q=this.clipBox,p="animate";k||(this.chartBackground=k=e.rect().addClass("highcharts-background").add(),p="attr");if(u)var z=A=k.strokeWidth();else{z=a.borderWidth||0;A=z+(a.shadow?8:0);h={fill:h||"none"};if(z||k["stroke-width"])h.stroke=a.borderColor,h["stroke-width"]=z;k.attr(h).shadow(a.shadow)}k[p]({x:A/2,y:A/2,width:b-A-z%2,height:c-A-z%2,r:a.borderRadius});p="animate";f||(p="attr",this.plotBackground=f=e.rect().addClass("highcharts-plot-background").add()); |
|
|
|
f[p](L);u||(f.attr({fill:g||"none"}).shadow(a.plotShadow),r&&(l?(r!==l.attr("href")&&l.attr("href",r),l.animate(L)):this.plotBGImage=e.image(r,H,t,n,m).add()));J?J.animate({width:q.width,height:q.height}):this.clipRect=e.clipRect(q);p="animate";d||(p="attr",this.plotBorder=d=e.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add());u||d.attr({stroke:a.plotBorderColor,"stroke-width":a.plotBorderWidth||0,fill:"none"});d[p](d.crisp({x:H,y:t,width:n,height:m},-d.strokeWidth()));this.isDirtyBox= |
|
|
|
!1;G(this,"afterDrawChartBox")},propFromSeries:function(){var a=this,e=a.options.chart,b,c=a.options.series,k,f;["inverted","angular","polar"].forEach(function(d){b=U[e.type||e.defaultSeriesType];f=e[d]||b&&b.prototype[d];for(k=c&&c.length;!f&&k--;)(b=U[c[k].type])&&b.prototype[d]&&(f=!0);a[d]=f})},linkSeries:function(){var a=this,e=a.series;e.forEach(function(a){a.linkedSeries.length=0});e.forEach(function(e){var b=e.options.linkedTo;z(b)&&(b=":previous"===b?a.series[e.index-1]:a.get(b))&&b.linkedParent!== |
|
|
|
e&&(b.linkedSeries.push(e),e.linkedParent=b,b.enabledDataSorting&&e.setDataSortingOptions(),e.visible=w(e.options.visible,b.options.visible,e.visible))});G(this,"afterLinkSeries")},renderSeries:function(){this.series.forEach(function(a){a.translate();a.render()})},renderLabels:function(){var a=this,e=a.options.labels;e.items&&e.items.forEach(function(b){var c=v(e.style,b.style),k=h(c.left)+a.plotLeft,f=h(c.top)+a.plotTop+12;delete c.left;delete c.top;a.renderer.text(b.html,k,f).attr({zIndex:2}).css(c).add()})}, |
|
|
|
render:function(){var a=this.axes,e=this.colorAxis,b=this.renderer,c=this.options,k=0,f=function(a){a.forEach(function(a){a.visible&&a.render()})};this.setTitle();this.legend=new A(this,c.legend);this.getStacks&&this.getStacks();this.getMargins(!0);this.setChartSize();c=this.plotWidth;a.some(function(a){if(a.horiz&&a.visible&&a.options.labels.enabled&&a.series.length)return k=21,!0});var d=this.plotHeight=Math.max(this.plotHeight-k,0);a.forEach(function(a){a.setScale()});this.getAxisMargins();var u= |
|
|
|
1.1<c/this.plotWidth;var l=1.05<d/this.plotHeight;if(u||l)a.forEach(function(a){(a.horiz&&u||!a.horiz&&l)&&a.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries?f(a):e&&e.length&&f(e);this.seriesGroup||(this.seriesGroup=b.g("series-group").attr({zIndex:3}).add());this.renderSeries();this.renderLabels();this.addCredits();this.setResponsive&&this.setResponsive();this.updateContainerScaling();this.hasRendered=!0},addCredits:function(a){var e=this;a=L(!0,this.options.credits, |
|
|
|
a);a.enabled&&!this.credits&&(this.credits=this.renderer.text(a.text+(this.mapCredits||""),0,0).addClass("highcharts-credits").on("click",function(){a.href&&(P.location.href=a.href)}).attr({align:a.position.align,zIndex:8}),e.styledMode||this.credits.css(a.style),this.credits.add().align(a.position),this.credits.update=function(a){e.credits=e.credits.destroy();e.addCredits(a)})},updateContainerScaling:function(){var a=this.container;if(a.offsetWidth&&a.offsetHeight&&a.getBoundingClientRect){var e= |
|
|
|
a.getBoundingClientRect(),b=e.width/a.offsetWidth;a=e.height/a.offsetHeight;1!==b||1!==a?this.containerScaling={scaleX:b,scaleY:a}:delete this.containerScaling}},destroy:function(){var a=this,e=a.axes,b=a.series,c=a.container,f,u=c&&c.parentNode;G(a,"destroy");a.renderer.forExport?x(k,a):k[a.index]=void 0;d.chartCount--;a.renderTo.removeAttribute("data-highcharts-chart");V(a);for(f=e.length;f--;)e[f]=e[f].destroy();this.scroller&&this.scroller.destroy&&this.scroller.destroy();for(f=b.length;f--;)b[f]= |
|
|
|
b[f].destroy();"title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" ").forEach(function(e){var b=a[e];b&&b.destroy&&(a[e]=b.destroy())});c&&(c.innerHTML="",V(c),u&&D(c));q(a,function(e,b){delete a[b]})},firstRender:function(){var a=this,e=a.options;if(!a.isReadyToRender||a.isReadyToRender()){a.getContainer();a.resetMargins();a.setChartSize();a.propFromSeries();a.getAxes();(C(e.series)? |
|
|
|
e.series:[]).forEach(function(e){a.initSeries(e)});a.linkSeries();a.setSeriesData();G(a,"beforeRender");Q&&(a.pointer=new Q(a,e));a.render();if(!a.renderer.imgCount&&a.onload)a.onload();a.temporaryDisplay(!0)}},onload:function(){this.callbacks.concat([this.callback]).forEach(function(a){a&&"undefined"!==typeof this.index&&a.apply(this,[this])},this);G(this,"load");G(this,"render");E(this.index)&&this.setReflow(this.options.chart.reflow);this.onload=null}})});K(y,"parts/ScrollablePlotArea.js",[y["parts/Globals.js"], |
|
|
|
y["parts/Utilities.js"]],function(d,g){var y=g.pick,F=d.addEvent;g=d.Chart;"";F(g,"afterSetChartSize",function(g){var D=this.options.chart.scrollablePlotArea,x=D&&D.minWidth;D=D&&D.minHeight;if(!this.renderer.forExport){if(x){if(this.scrollablePixelsX=x=Math.max(0,x-this.chartWidth)){this.plotWidth+=x;this.inverted?(this.clipBox.height+=x,this.plotBox.height+=x):(this.clipBox.width+=x,this.plotBox.width+=x);var v={1:{name:"right",value:x}}}}else D&&(this.scrollablePixelsY=x=Math.max(0,D-this.chartHeight))&& |
|
|
|
(this.plotHeight+=x,this.inverted?(this.clipBox.width+=x,this.plotBox.width+=x):(this.clipBox.height+=x,this.plotBox.height+=x),v={2:{name:"bottom",value:x}});v&&!g.skipAxes&&this.axes.forEach(function(g){v[g.side]?g.getPlotLinePath=function(){var x=v[g.side].name,p=this[x];this[x]=p-v[g.side].value;var z=d.Axis.prototype.getPlotLinePath.apply(this,arguments);this[x]=p;return z}:(g.setAxisSize(),g.setAxisTranslation())})}});F(g,"render",function(){this.scrollablePixelsX||this.scrollablePixelsY?(this.setUpScrolling&& |
|
|
|
this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()});g.prototype.setUpScrolling=function(){var g={WebkitOverflowScrolling:"touch",overflowX:"hidden",overflowY:"hidden"};this.scrollablePixelsX&&(g.overflowX="auto");this.scrollablePixelsY&&(g.overflowY="auto");this.scrollingContainer=d.createElement("div",{className:"highcharts-scrolling"},g,this.renderTo);this.innerContainer=d.createElement("div",{className:"highcharts-inner-container"},null,this.scrollingContainer);this.innerContainer.appendChild(this.container); |
|
|
|
this.setUpScrolling=null};g.prototype.moveFixedElements=function(){var d=this.container,g=this.fixedRenderer,x=".highcharts-contextbutton .highcharts-credits .highcharts-legend .highcharts-legend-checkbox .highcharts-navigator-series .highcharts-navigator-xaxis .highcharts-navigator-yaxis .highcharts-navigator .highcharts-reset-zoom .highcharts-scrollbar .highcharts-subtitle .highcharts-title".split(" "),v;this.scrollablePixelsX&&!this.inverted?v=".highcharts-yaxis":this.scrollablePixelsX&&this.inverted? |
|
|
|
v=".highcharts-xaxis":this.scrollablePixelsY&&!this.inverted?v=".highcharts-xaxis":this.scrollablePixelsY&&this.inverted&&(v=".highcharts-yaxis");x.push(v,v+"-labels");x.forEach(function(v){[].forEach.call(d.querySelectorAll(v),function(d){(d.namespaceURI===g.SVG_NS?g.box:g.box.parentNode).appendChild(d);d.style.pointerEvents="auto"})})};g.prototype.applyFixed=function(){var g,D=!this.fixedDiv,x=this.options.chart.scrollablePlotArea;D?(this.fixedDiv=d.createElement("div",{className:"highcharts-fixed"}, |
|
|
|
{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:2},null,!0),this.renderTo.insertBefore(this.fixedDiv,this.renderTo.firstChild),this.renderTo.style.overflow="visible",this.fixedRenderer=g=new d.Renderer(this.fixedDiv,this.chartWidth,this.chartHeight),this.scrollableMask=g.path().attr({fill:this.options.chart.backgroundColor||"#fff","fill-opacity":y(x.opacity,.85),zIndex:-1}).addClass("highcharts-scrollable-mask").add(),this.moveFixedElements(),F(this,"afterShowResetZoom",this.moveFixedElements), |
|
|
|
F(this,"afterLayOutTitles",this.moveFixedElements)):this.fixedRenderer.setSize(this.chartWidth,this.chartHeight);g=this.chartWidth+(this.scrollablePixelsX||0);var v=this.chartHeight+(this.scrollablePixelsY||0);d.stop(this.container);this.container.style.width=g+"px";this.container.style.height=v+"px";this.renderer.boxWrapper.attr({width:g,height:v,viewBox:[0,0,g,v].join(" ")});this.chartBackground.attr({width:g,height:v});this.scrollablePixelsY&&(this.scrollingContainer.style.height=this.chartHeight+ |
|
|
|
"px");D&&(x.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixelsX*x.scrollPositionX),x.scrollPositionY&&(this.scrollingContainer.scrollTop=this.scrollablePixelsY*x.scrollPositionY));v=this.axisOffset;D=this.plotTop-v[0]-1;x=this.plotLeft-v[3]-1;g=this.plotTop+this.plotHeight+v[2]+1;v=this.plotLeft+this.plotWidth+v[1]+1;var C=this.plotLeft+this.plotWidth-(this.scrollablePixelsX||0),B=this.plotTop+this.plotHeight-(this.scrollablePixelsY||0);D=this.scrollablePixelsX?["M",0,D,"L", |
|
|
|
this.plotLeft-1,D,"L",this.plotLeft-1,g,"L",0,g,"Z","M",C,D,"L",this.chartWidth,D,"L",this.chartWidth,g,"L",C,g,"Z"]:this.scrollablePixelsY?["M",x,0,"L",x,this.plotTop-1,"L",v,this.plotTop-1,"L",v,0,"Z","M",x,B,"L",x,this.chartHeight,"L",v,this.chartHeight,"L",v,B,"Z"]:["M",0,0];"adjustHeight"!==this.redrawTrigger&&this.scrollableMask.attr({d:D})}});K(y,"parts/Point.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.animObject,F=g.defined,E=g.erase,D=g.extend,x=g.isArray,v= |
|
|
|
g.isNumber,C=g.isObject,B=g.syncTimeout,p=g.pick,z,m=d.fireEvent,q=d.format,w=d.uniqueKey,h=d.removeEvent;d.Point=z=function(){};d.Point.prototype={init:function(f,c,b){this.series=f;this.applyOptions(c,b);this.id=F(this.id)?this.id:w();this.resolveColor();f.chart.pointCount++;m(this,"afterInit");return this},resolveColor:function(){var f=this.series;var c=f.chart.options.chart.colorCount;var b=f.chart.styledMode;b||this.options.color||(this.color=f.color);f.options.colorByPoint?(b||(c=f.options.colors|| |
|
|
|
f.chart.options.colors,this.color=this.color||c[f.colorCounter],c=c.length),b=f.colorCounter,f.colorCounter++,f.colorCounter===c&&(f.colorCounter=0)):b=f.colorIndex;this.colorIndex=p(this.colorIndex,b)},applyOptions:function(f,c){var b=this.series,a=b.options.pointValKey||b.pointValKey;f=z.prototype.optionsToObject.call(this,f);D(this,f);this.options=this.options?D(this.options,f):f;f.group&&delete this.group;f.dataLabels&&delete this.dataLabels;a&&(this.y=this[a]);this.formatPrefix=(this.isNull= |
|
|
|
p(this.isValid&&!this.isValid(),null===this.x||!v(this.y)))?"null":"point";this.selected&&(this.state="select");"name"in this&&"undefined"===typeof c&&b.xAxis&&b.xAxis.hasNames&&(this.x=b.xAxis.nameToX(this));"undefined"===typeof this.x&&b&&(this.x="undefined"===typeof c?b.autoIncrement(this):c);return this},setNestedProperty:function(f,c,b){b.split(".").reduce(function(a,b,f,d){a[b]=d.length-1===f?c:C(a[b],!0)?a[b]:{};return a[b]},f);return f},optionsToObject:function(f){var c={},b=this.series,a= |
|
|
|
b.options.keys,l=a||b.pointArrayMap||["y"],h=l.length,g=0,m=0;if(v(f)||null===f)c[l[0]]=f;else if(x(f))for(!a&&f.length>h&&(b=typeof f[0],"string"===b?c.name=f[0]:"number"===b&&(c.x=f[0]),g++);m<h;)a&&"undefined"===typeof f[g]||(0<l[m].indexOf(".")?d.Point.prototype.setNestedProperty(c,f[g],l[m]):c[l[m]]=f[g]),g++,m++;else"object"===typeof f&&(c=f,f.dataLabels&&(b._hasPointLabels=!0),f.marker&&(b._hasPointMarkers=!0));return c},getClassName:function(){return"highcharts-point"+(this.selected?" highcharts-point-select": |
|
|
|
"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+("undefined"!==typeof this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")},getZone:function(){var f=this.series,c=f.zones;f=f.zoneAxis||"y";var b=0,a;for(a=c[b];this[f]>=a.value;)a=c[++b];this.nonZonedColor||(this.nonZonedColor=this.color);this.color=a&&a.color&& |
|
|
|
!this.options.color?a.color:this.nonZonedColor;return a},hasNewShapeType:function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType},destroy:function(){function f(){d&&(c.setState(),E(d,c),d.length||(a.hoverPoints=null));if(c===a.hoverPoint)c.onMouseOut();if(c.graphic||c.dataLabel||c.dataLabels)h(c),c.destroyElements();for(t in c)c[t]=null}var c=this,b=c.series,a=b.chart;b=b.options.dataSorting;var d=a.hoverPoints,g=y(c.series.chart.renderer.globalAnimation), |
|
|
|
t;b&&b.enabled?(this.animateBeforeDestroy(),B(f,g.duration)):f();a.pointCount--;c.legendItem&&a.legend.destroyItem(c)},animateBeforeDestroy:function(){var f=this,c={x:f.startXPos,opacity:0},b,a=f.getGraphicalProps();a.singular.forEach(function(a){b="dataLabel"===a;f[a]=f[a].animate(b?{x:f[a].startXPos,y:f[a].startYPos,opacity:0}:c)});a.plural.forEach(function(a){f[a].forEach(function(a){a.element&&a.animate(D({x:f.startXPos},a.startYPos?{x:a.startXPos,y:a.startYPos}:{}))})})},destroyElements:function(f){var c= |
|
|
|
this;f=c.getGraphicalProps(f);f.singular.forEach(function(b){c[b]=c[b].destroy()});f.plural.forEach(function(b){c[b].forEach(function(a){a.element&&a.destroy()});delete c[b]})},getGraphicalProps:function(f){var c=this,b=[],a,d={singular:[],plural:[]};f=f||{graphic:1,dataLabel:1};f.graphic&&b.push("graphic","shadowGroup");f.dataLabel&&b.push("dataLabel","dataLabelUpper","connector");for(a=b.length;a--;){var h=b[a];c[h]&&d.singular.push(h)}["dataLabel","connector"].forEach(function(a){var b=a+"s";f[a]&& |
|
|
|
c[b]&&d.plural.push(b)});return d},getLabelConfig:function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(f){var c=this.series,b=c.tooltipOptions,a=p(b.valueDecimals,""),d=b.valuePrefix||"",h=b.valueSuffix||"";c.chart.styledMode&&(f=c.chart.tooltip.styledModeFormat(f));(c.pointArrayMap||["y"]).forEach(function(b){b="{point."+ |
|
|
|
b;if(d||h)f=f.replace(RegExp(b+"}","g"),d+b+"}"+h);f=f.replace(RegExp(b+"}","g"),b+":,."+a+"f}")});return q(f,{point:this,series:this.series},c.chart)},firePointEvent:function(f,c,b){var a=this,d=this.series.options;(d.point.events[f]||a.options&&a.options.events&&a.options.events[f])&&this.importEvents();"click"===f&&d.allowPointSelect&&(b=function(b){a.select&&a.select(null,b.ctrlKey||b.metaKey||b.shiftKey)});m(this,f,c,b)},visible:!0}});K(y,"parts/Series.js",[y["parts/Globals.js"],y["parts/Utilities.js"]], |
|
|
|
function(d,g){var y=g.animObject,F=g.arrayMax,E=g.arrayMin,D=g.clamp,x=g.correctFloat,v=g.defined,C=g.erase,B=g.extend,p=g.isArray,z=g.isNumber,m=g.isString,q=g.objectEach,w=g.pick,h=g.splat,f=g.syncTimeout,c=d.addEvent,b=d.defaultOptions,a=d.defaultPlotOptions,l=d.fireEvent,n=d.merge,t=d.removeEvent,I=d.SVGElement,r=d.win;d.Series=d.seriesType("line",null,{lineWidth:2,allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},marker:{enabledThreshold:2,lineColor:"#ffffff",lineWidth:0, |
|
|
|
radius:4,states:{normal:{animation:!0},hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){var a=this.series.chart.numberFormatter;return null===this.y?"":a(this.y,-1)},padding:5,style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0, |
|
|
|
states:{normal:{animation:!0},hover:{animation:{duration:50},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:50},opacity:.2}},stickyTracking:!0,turboThreshold:1E3,findNearestPointBy:"x"},{axisTypes:["xAxis","yAxis"],coll:"series",colorCounter:0,cropShoulder:1,directTouch:!1,eventsToUnbind:[],isCartesian:!0,parallelArrays:["x","y"],pointClass:d.Point,requireSorting:!0,sorted:!0,init:function(a,b){l(this,"init",{options:b});var e=this, |
|
|
|
k=a.series,f;this.eventOptions=this.eventOptions||{};e.chart=a;e.options=b=e.setOptions(b);e.linkedSeries=[];e.bindAxes();B(e,{name:b.name,state:"",visible:!1!==b.visible,selected:!0===b.selected});var h=b.events;q(h,function(a,b){d.isFunction(a)&&e.eventOptions[b]!==a&&(d.isFunction(e.eventOptions[b])&&t(e,b,e.eventOptions[b]),e.eventOptions[b]=a,c(e,b,a))});if(h&&h.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=!0;e.getColor();e.getSymbol();e.parallelArrays.forEach(function(a){e[a+ |
|
|
|
"Data"]||(e[a+"Data"]=[])});e.isCartesian&&(a.hasCartesianSeries=!0);k.length&&(f=k[k.length-1]);e._i=w(f&&f._i,-1)+1;a.orderSeries(this.insert(k));b.dataSorting&&b.dataSorting.enabled?e.setDataSortingOptions():e.points||e.data||e.setData(b.data,!1);l(this,"afterInit")},insert:function(a){var e=this.options.index,b;if(z(e)){for(b=a.length;b--;)if(e>=w(a[b].options.index,a[b]._i)){a.splice(b+1,0,this);break}-1===b&&a.unshift(this);b+=1}else a.push(this);return w(b,a.length-1)},bindAxes:function(){var a= |
|
|
|
this,b=a.options,c=a.chart,f;l(this,"bindAxes",null,function(){(a.axisTypes||[]).forEach(function(e){c[e].forEach(function(c){f=c.options;if(b[e]===f.index||"undefined"!==typeof b[e]&&b[e]===f.id||"undefined"===typeof b[e]&&0===f.index)a.insert(c.series),a[e]=c,c.isDirty=!0});a[e]||a.optionalAxis===e||d.error(18,!0,c)})})},updateParallelArrays:function(a,b){var e=a.series,c=arguments,k=z(b)?function(c){var k="y"===c&&e.toYData?e.toYData(a):a[c];e[c+"Data"][b]=k}:function(a){Array.prototype[b].apply(e[a+ |
|
|
|
"Data"],Array.prototype.slice.call(c,2))};e.parallelArrays.forEach(k)},hasData:function(){return this.visible&&"undefined"!==typeof this.dataMax&&"undefined"!==typeof this.dataMin||this.visible&&this.yData&&0<this.yData.length},autoIncrement:function(){var a=this.options,b=this.xIncrement,c,f=a.pointIntervalUnit,d=this.chart.time;b=w(b,a.pointStart,0);this.pointInterval=c=w(this.pointInterval,a.pointInterval,1);f&&(a=new d.Date(b),"day"===f?d.set("Date",a,d.get("Date",a)+c):"month"===f?d.set("Month", |
|
|
|
a,d.get("Month",a)+c):"year"===f&&d.set("FullYear",a,d.get("FullYear",a)+c),c=a.getTime()-b);this.xIncrement=b+c;return b},setDataSortingOptions:function(){var a=this.options;B(this,{requireSorting:!1,sorted:!1,enabledDataSorting:!0,allowDG:!1});v(a.pointRange)||(a.pointRange=1)},setOptions:function(a){var e=this.chart,c=e.options,f=c.plotOptions,d=e.userOptions||{};a=n(a);e=e.styledMode;var h={plotOptions:f,userOptions:a};l(this,"setOptions",h);var g=h.plotOptions[this.type],r=d.plotOptions||{}; |
|
|
|
this.userOptions=h.userOptions;d=n(g,f.series,d.plotOptions&&d.plotOptions[this.type],a);this.tooltipOptions=n(b.tooltip,b.plotOptions.series&&b.plotOptions.series.tooltip,b.plotOptions[this.type].tooltip,c.tooltip.userOptions,f.series&&f.series.tooltip,f[this.type].tooltip,a.tooltip);this.stickyTracking=w(a.stickyTracking,r[this.type]&&r[this.type].stickyTracking,r.series&&r.series.stickyTracking,this.tooltipOptions.shared&&!this.noSharedTooltip?!0:d.stickyTracking);null===g.marker&&delete d.marker; |
|
|
|
this.zoneAxis=d.zoneAxis;c=this.zones=(d.zones||[]).slice();!d.negativeColor&&!d.negativeFillColor||d.zones||(f={value:d[this.zoneAxis+"Threshold"]||d.threshold||0,className:"highcharts-negative"},e||(f.color=d.negativeColor,f.fillColor=d.negativeFillColor),c.push(f));c.length&&v(c[c.length-1].value)&&c.push(e?{}:{color:this.color,fillColor:this.fillColor});l(this,"afterSetOptions",{options:d});return d},getName:function(){return w(this.options.name,"Series "+(this.index+1))},getCyclic:function(a, |
|
|
|
b,c){var e=this.chart,f=this.userOptions,k=a+"Index",d=a+"Counter",u=c?c.length:w(e.options.chart[a+"Count"],e[a+"Count"]);if(!b){var h=w(f[k],f["_"+k]);v(h)||(e.series.length||(e[d]=0),f["_"+k]=h=e[d]%u,e[d]+=1);c&&(b=c[h])}"undefined"!==typeof h&&(this[k]=h);this[a]=b},getColor:function(){this.chart.styledMode?this.getCyclic("color"):this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||a[this.type].color,this.chart.options.colors)},getSymbol:function(){this.getCyclic("symbol", |
|
|
|
this.options.marker.symbol,this.chart.options.symbols)},findPointIndex:function(a,b){var e=a.id,c=a.x,f=this.points,k,h=this.options.dataSorting;if(e)var l=this.chart.get(e);else if(this.linkedParent||this.enabledDataSorting){var g=h&&h.matchByName?"name":"index";l=d.find(f,function(e){return!e.touched&&e[g]===a[g]});if(!l)return}if(l){var r=l&&l.index;"undefined"!==typeof r&&(k=!0)}"undefined"===typeof r&&z(c)&&(r=this.xData.indexOf(c,b));-1!==r&&"undefined"!==typeof r&&this.cropped&&(r=r>=this.cropStart? |
|
|
|
r-this.cropStart:r);!k&&f[r]&&f[r].touched&&(r=void 0);return r},drawLegendSymbol:d.LegendSymbolMixin.drawLineMarker,updateData:function(a,b){var e=this.options,c=e.dataSorting,f=this.points,k=[],d,h,l,g=this.requireSorting,r=a.length===f.length,t=!0;this.xIncrement=null;a.forEach(function(a,b){var h=v(a)&&this.pointClass.prototype.optionsToObject.call({series:this},a)||{};var u=h.x;if(h.id||z(u)){if(u=this.findPointIndex(h,l),-1===u||"undefined"===typeof u?k.push(a):f[u]&&a!==e.data[u]?(f[u].update(a, |
|
|
|
!1,null,!1),f[u].touched=!0,g&&(l=u+1)):f[u]&&(f[u].touched=!0),!r||b!==u||c&&c.enabled||this.hasDerivedData)d=!0}else k.push(a)},this);if(d)for(a=f.length;a--;)(h=f[a])&&!h.touched&&h.remove&&h.remove(!1,b);else!r||c&&c.enabled?t=!1:(a.forEach(function(a,e){f[e].update&&a!==f[e].y&&f[e].update(a,!1,null,!1)}),k.length=0);f.forEach(function(a){a&&(a.touched=!1)});if(!t)return!1;k.forEach(function(a){this.addPoint(a,!1,null,null,!1)},this);null===this.xIncrement&&this.xData&&this.xData.length&&(this.xIncrement= |
|
|
|
F(this.xData),this.autoIncrement());return!0},setData:function(a,b,c,f){var e=this,k=e.points,h=k&&k.length||0,l,u=e.options,g=e.chart,r=u.dataSorting,t=null,H=e.xAxis;t=u.turboThreshold;var n=this.xData,q=this.yData,v=(l=e.pointArrayMap)&&l.length,I=u.keys,x=0,C=1,B;a=a||[];l=a.length;b=w(b,!0);r&&r.enabled&&(a=this.sortData(a));!1!==f&&l&&h&&!e.cropped&&!e.hasGroupedData&&e.visible&&!e.isSeriesBoosting&&(B=this.updateData(a,c));if(!B){e.xIncrement=null;e.colorCounter=0;this.parallelArrays.forEach(function(a){e[a+ |
|
|
|
"Data"].length=0});if(t&&l>t)if(t=e.getFirstValidPoint(a),z(t))for(c=0;c<l;c++)n[c]=this.autoIncrement(),q[c]=a[c];else if(p(t))if(v)for(c=0;c<l;c++)f=a[c],n[c]=f[0],q[c]=f.slice(1,v+1);else for(I&&(x=I.indexOf("x"),C=I.indexOf("y"),x=0<=x?x:0,C=0<=C?C:1),c=0;c<l;c++)f=a[c],n[c]=f[x],q[c]=f[C];else d.error(12,!1,g);else for(c=0;c<l;c++)"undefined"!==typeof a[c]&&(f={series:e},e.pointClass.prototype.applyOptions.apply(f,[a[c]]),e.updateParallelArrays(f,c));q&&m(q[0])&&d.error(14,!0,g);e.data=[];e.options.data= |
|
|
|
e.userOptions.data=a;for(c=h;c--;)k[c]&&k[c].destroy&&k[c].destroy();H&&(H.minRange=H.userMinRange);e.isDirty=g.isDirtyBox=!0;e.isDirtyData=!!k;c=!1}"point"===u.legendType&&(this.processData(),this.generatePoints());b&&g.redraw(c)},sortData:function(a){var e=this,b=e.options.dataSorting.sortKey||"y",c=function(a,e){return v(e)&&a.pointClass.prototype.optionsToObject.call({series:a},e)||{}};a.forEach(function(b,f){a[f]=c(e,b);a[f].index=f},this);a.concat().sort(function(a,e){return z(e[b])?e[b]-a[b]: |
|
|
|
-1}).forEach(function(a,e){a.x=e},this);e.linkedSeries&&e.linkedSeries.forEach(function(e){var b=e.options,f=b.data;b.dataSorting&&b.dataSorting.enabled||!f||(f.forEach(function(b,k){f[k]=c(e,b);a[k]&&(f[k].x=a[k].x,f[k].index=k)}),e.setData(f,!1))});return a},processData:function(a){var e=this.xData,b=this.yData,c=e.length;var f=0;var h=this.xAxis,l=this.options;var g=l.cropThreshold;var r=this.getExtremesFromAll||l.getExtremesFromAll,t=this.isCartesian;l=h&&h.val2lin;var n=h&&h.isLog,m=this.requireSorting; |
|
|
|
if(t&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;if(h){a=h.getExtremes();var q=a.min;var p=a.max}if(t&&this.sorted&&!r&&(!g||c>g||this.forceCrop))if(e[c-1]<q||e[0]>p)e=[],b=[];else if(this.yData&&(e[0]<q||e[c-1]>p)){f=this.cropData(this.xData,this.yData,q,p);e=f.xData;b=f.yData;f=f.start;var z=!0}for(g=e.length||1;--g;)if(c=n?l(e[g])-l(e[g-1]):e[g]-e[g-1],0<c&&("undefined"===typeof w||c<w))var w=c;else 0>c&&m&&(d.error(15,!1,this.chart),m=!1);this.cropped=z;this.cropStart=f;this.processedXData= |
|
|
|
e;this.processedYData=b;this.closestPointRange=this.basePointRange=w},cropData:function(a,b,c,f,d){var e=a.length,k=0,h=e,l;d=w(d,this.cropShoulder);for(l=0;l<e;l++)if(a[l]>=c){k=Math.max(0,l-d);break}for(c=l;c<e;c++)if(a[c]>f){h=c+d;break}return{xData:a.slice(k,h),yData:b.slice(k,h),start:k,end:h}},generatePoints:function(){var a=this.options,b=a.data,c=this.data,f,d=this.processedXData,g=this.processedYData,r=this.pointClass,t=d.length,n=this.cropStart||0,m=this.hasGroupedData;a=a.keys;var q=[], |
|
|
|
p;c||m||(c=[],c.length=b.length,c=this.data=c);a&&m&&(this.options.keys=!1);for(p=0;p<t;p++){var z=n+p;if(m){var w=(new r).init(this,[d[p]].concat(h(g[p])));w.dataGroup=this.groupMap[p];w.dataGroup.options&&(w.options=w.dataGroup.options,B(w,w.dataGroup.options),delete w.dataLabels)}else(w=c[z])||"undefined"===typeof b[z]||(c[z]=w=(new r).init(this,b[z],d[p]));w&&(w.index=z,q[p]=w)}this.options.keys=a;if(c&&(t!==(f=c.length)||m))for(p=0;p<f;p++)p!==n||m||(p+=t),c[p]&&(c[p].destroyElements(),c[p].plotX= |
|
|
|
void 0);this.data=c;this.points=q;l(this,"afterGeneratePoints")},getXExtremes:function(a){return{min:E(a),max:F(a)}},getExtremes:function(a){var e=this.xAxis,b=this.yAxis,c=this.processedXData||this.xData,f=[],d=0,h=0;var g=0;var r=this.requireSorting?this.cropShoulder:0,t=b?b.positiveValuesOnly:!1,n;a=a||this.stackedYData||this.processedYData||[];b=a.length;e&&(g=e.getExtremes(),h=g.min,g=g.max);for(n=0;n<b;n++){var m=c[n];var q=a[n];var w=(z(q)||p(q))&&(q.length||0<q||!t);m=this.getExtremesFromAll|| |
|
|
|
this.options.getExtremesFromAll||this.cropped||!e||(c[n+r]||m)>=h&&(c[n-r]||m)<=g;if(w&&m)if(w=q.length)for(;w--;)z(q[w])&&(f[d++]=q[w]);else f[d++]=q}this.dataMin=E(f);this.dataMax=F(f);l(this,"afterGetExtremes")},getFirstValidPoint:function(a){for(var e=null,b=a.length,c=0;null===e&&c<b;)e=a[c],c++;return e},translate:function(){this.processedXData||this.processData();this.generatePoints();var a=this.options,b=a.stacking,c=this.xAxis,f=c.categories,d=this.enabledDataSorting,h=this.yAxis,g=this.points, |
|
|
|
r=g.length,t=!!this.modifyValue,n,m=this.pointPlacementToXValue(),q=z(m),I=a.threshold,C=a.startFromThreshold?I:0,B,E=this.zoneAxis||"y",F=Number.MAX_VALUE;for(n=0;n<r;n++){var y=g[n],M=y.x;var R=y.y;var X=y.low,K=b&&h.stacks[(this.negStacks&&R<(C?0:I)?"-":"")+this.stackKey];h.positiveValuesOnly&&null!==R&&0>=R&&(y.isNull=!0);y.plotX=B=x(D(c.translate(M,0,0,0,1,m,"flags"===this.type),-1E5,1E5));if(b&&this.visible&&K&&K[M]){var aa=this.getStackIndicator(aa,M,this.index);if(!y.isNull){var W=K[M];var Y= |
|
|
|
W.points[aa.key]}}p(Y)&&(X=Y[0],R=Y[1],X===C&&aa.key===K[M].base&&(X=w(z(I)&&I,h.min)),h.positiveValuesOnly&&0>=X&&(X=null),y.total=y.stackTotal=W.total,y.percentage=W.total&&y.y/W.total*100,y.stackY=R,this.irregularWidths||W.setOffset(this.pointXOffset||0,this.barW||0));y.yBottom=v(X)?D(h.translate(X,0,1,0,1),-1E5,1E5):null;t&&(R=this.modifyValue(R,y));y.plotY=R="number"===typeof R&&Infinity!==R?D(h.translate(R,0,1,0,1),-1E5,1E5):void 0;y.isInside="undefined"!==typeof R&&0<=R&&R<=h.len&&0<=B&&B<= |
|
|
|
c.len;y.clientX=q?x(c.translate(M,0,0,0,1,m)):B;y.negative=y[E]<(a[E+"Threshold"]||I||0);y.category=f&&"undefined"!==typeof f[y.x]?f[y.x]:y.x;if(!y.isNull&&!1!==y.visible){"undefined"!==typeof S&&(F=Math.min(F,Math.abs(B-S)));var S=B}y.zone=this.zones.length&&y.getZone();!y.graphic&&this.group&&d&&(y.isNew=!0)}this.closestPointRangePx=F;l(this,"afterTranslate")},getValidPoints:function(a,b,c){var e=this.chart;return(a||this.points||[]).filter(function(a){return b&&!e.isInsidePlot(a.plotX,a.plotY, |
|
|
|
e.inverted)?!1:!1!==a.visible&&(c||!a.isNull)})},getClipBox:function(a,b){var e=this.options,c=this.chart,f=c.inverted,k=this.xAxis,d=k&&this.yAxis;a&&!1===e.clip&&d?a=f?{y:-c.chartWidth+d.len+d.pos,height:c.chartWidth,width:c.chartHeight,x:-c.chartHeight+k.len+k.pos}:{y:-d.pos,height:c.chartHeight,width:c.chartWidth,x:-k.pos}:(a=this.clipBox||c.clipBox,b&&(a.width=c.plotSizeX,a.x=0));return b?{width:a.width,x:a.x}:a},setClip:function(a){var e=this.chart,b=this.options,c=e.renderer,f=e.inverted,d= |
|
|
|
this.clipBox,h=this.getClipBox(a),l=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,h.height,b.xAxis,b.yAxis].join(),g=e[l],r=e[l+"m"];g||(a&&(h.width=0,f&&(h.x=e.plotSizeX+(!1!==b.clip?0:e.plotTop)),e[l+"m"]=r=c.clipRect(f?e.plotSizeX+99:-99,f?-e.plotLeft:-e.plotTop,99,f?e.chartWidth:e.chartHeight)),e[l]=g=c.clipRect(h),g.count={length:0});a&&!g.count[this.index]&&(g.count[this.index]=!0,g.count.length+=1);if(!1!==b.clip||a)this.group.clip(a||d?g:e.clipRect),this.markerGroup.clip(r), |
|
|
|
this.sharedClipKey=l;a||(g.count[this.index]&&(delete g.count[this.index],--g.count.length),0===g.count.length&&l&&e[l]&&(d||(e[l]=e[l].destroy()),e[l+"m"]&&(e[l+"m"]=e[l+"m"].destroy())))},animate:function(a){var e=this.chart,b=y(this.options.animation);if(a)this.setClip(b);else{var c=this.sharedClipKey;a=e[c];var f=this.getClipBox(b,!0);a&&a.animate(f,b);e[c+"m"]&&e[c+"m"].animate({width:f.width+99,x:f.x-(e.inverted?0:99)},b);this.animate=null}},afterAnimate:function(){this.setClip();l(this,"afterAnimate"); |
|
|
|
this.finishedAnimating=!0},drawPoints:function(){var a=this.points,b=this.chart,c,f,d=this.options.marker,h=this[this.specialGroup]||this.markerGroup,l=this.xAxis,g=w(d.enabled,!l||l.isRadial?!0:null,this.closestPointRangePx>=d.enabledThreshold*d.radius);if(!1!==d.enabled||this._hasPointMarkers)for(c=0;c<a.length;c++){var r=a[c];var t=(f=r.graphic)?"animate":"attr";var n=r.marker||{};var m=!!r.marker;if((g&&"undefined"===typeof n.enabled||n.enabled)&&!r.isNull&&!1!==r.visible){var q=w(n.symbol,this.symbol); |
|
|
|
var p=this.markerAttribs(r,r.selected&&"select");this.enabledDataSorting&&(r.startXPos=l.reversed?-p.width:l.width);var z=!1!==r.isInside;f?f[z?"show":"hide"](z).animate(p):z&&(0<p.width||r.hasImage)&&(r.graphic=f=b.renderer.symbol(q,p.x,p.y,p.width,p.height,m?n:d).add(h),this.enabledDataSorting&&b.hasRendered&&(f.attr({x:r.startXPos}),t="animate"));f&&"animate"===t&&f[z?"show":"hide"](z).animate(p);if(f&&!b.styledMode)f[t](this.pointAttribs(r,r.selected&&"select"));f&&f.addClass(r.getClassName(), |
|
|
|
!0)}else f&&(r.graphic=f.destroy())}},markerAttribs:function(a,b){var e=this.options.marker,c=a.marker||{},f=c.symbol||e.symbol,k=w(c.radius,e.radius);b&&(e=e.states[b],b=c.states&&c.states[b],k=w(b&&b.radius,e&&e.radius,k+(e&&e.radiusPlus||0)));a.hasImage=f&&0===f.indexOf("url");a.hasImage&&(k=0);a={x:Math.floor(a.plotX)-k,y:a.plotY-k};k&&(a.width=a.height=2*k);return a},pointAttribs:function(a,b){var e=this.options.marker,c=a&&a.options,f=c&&c.marker||{},k=this.color,d=c&&c.color,h=a&&a.color;c= |
|
|
|
w(f.lineWidth,e.lineWidth);var l=a&&a.zone&&a.zone.color;a=1;k=d||l||h||k;d=f.fillColor||e.fillColor||k;k=f.lineColor||e.lineColor||k;b=b||"normal";e=e.states[b];b=f.states&&f.states[b]||{};c=w(b.lineWidth,e.lineWidth,c+w(b.lineWidthPlus,e.lineWidthPlus,0));d=b.fillColor||e.fillColor||d;k=b.lineColor||e.lineColor||k;a=w(b.opacity,e.opacity,a);return{stroke:k,"stroke-width":c,fill:d,opacity:a}},destroy:function(a){var e=this,b=e.chart,c=/AppleWebKit\/533/.test(r.navigator.userAgent),f,h,g=e.data|| |
|
|
|
[],t,n;l(e,"destroy");this.removeEvents(a);(e.axisTypes||[]).forEach(function(a){(n=e[a])&&n.series&&(C(n.series,e),n.isDirty=n.forceRedraw=!0)});e.legendItem&&e.chart.legend.destroyItem(e);for(h=g.length;h--;)(t=g[h])&&t.destroy&&t.destroy();e.points=null;d.clearTimeout(e.animationTimeout);q(e,function(a,e){a instanceof I&&!a.survive&&(f=c&&"group"===e?"hide":"destroy",a[f]())});b.hoverSeries===e&&(b.hoverSeries=null);C(b.series,e);b.orderSeries();q(e,function(b,c){a&&"hcEvents"===c||delete e[c]})}, |
|
|
|
getGraphPath:function(a,b,c){var e=this,f=e.options,k=f.step,d,h=[],l=[],g;a=a||e.points;(d=a.reversed)&&a.reverse();(k={right:1,center:2}[k]||k&&3)&&d&&(k=4-k);a=this.getValidPoints(a,!1,!(f.connectNulls&&!b&&!c));a.forEach(function(d,u){var r=d.plotX,t=d.plotY,n=a[u-1];(d.leftCliff||n&&n.rightCliff)&&!c&&(g=!0);d.isNull&&!v(b)&&0<u?g=!f.connectNulls:d.isNull&&!b?g=!0:(0===u||g?u=["M",d.plotX,d.plotY]:e.getPointSpline?u=e.getPointSpline(a,d,u):k?(u=1===k?["L",n.plotX,t]:2===k?["L",(n.plotX+r)/2, |
|
|
|
n.plotY,"L",(n.plotX+r)/2,t]:["L",r,n.plotY],u.push("L",r,t)):u=["L",r,t],l.push(d.x),k&&(l.push(d.x),2===k&&l.push(d.x)),h.push.apply(h,u),g=!1)});h.xMap=l;return e.graphPath=h},drawGraph:function(){var a=this,b=this.options,c=(this.gappedPath||this.getGraphPath).call(this),f=this.chart.styledMode,d=[["graph","highcharts-graph"]];f||d[0].push(b.lineColor||this.color||"#cccccc",b.dashStyle);d=a.getZonesGraphs(d);d.forEach(function(e,k){var d=e[0],h=a[d],l=h?"animate":"attr";h?(h.endX=a.preventGraphAnimation? |
|
|
|
null:c.xMap,h.animate({d:c})):c.length&&(a[d]=h=a.chart.renderer.path(c).addClass(e[1]).attr({zIndex:1}).add(a.group));h&&!f&&(d={stroke:e[2],"stroke-width":b.lineWidth,fill:a.fillGraph&&a.color||"none"},e[3]?d.dashstyle=e[3]:"square"!==b.linecap&&(d["stroke-linecap"]=d["stroke-linejoin"]="round"),h[l](d).shadow(2>k&&b.shadow));h&&(h.startX=c.xMap,h.isArea=c.isArea)})},getZonesGraphs:function(a){this.zones.forEach(function(e,b){b=["zone-graph-"+b,"highcharts-graph highcharts-zone-graph-"+b+" "+(e.className|| |
|
|
|
"")];this.chart.styledMode||b.push(e.color||this.color,e.dashStyle||this.options.dashStyle);a.push(b)},this);return a},applyZones:function(){var a=this,b=this.chart,c=b.renderer,f=this.zones,d,h,l=this.clips||[],g,r=this.graph,t=this.area,n=Math.max(b.chartWidth,b.chartHeight),m=this[(this.zoneAxis||"y")+"Axis"],q=b.inverted,p,z,v,I=!1;if(f.length&&(r||t)&&m&&"undefined"!==typeof m.min){var x=m.reversed;var C=m.horiz;r&&!this.showLine&&r.hide();t&&t.hide();var B=m.getExtremes();f.forEach(function(e, |
|
|
|
f){d=x?C?b.plotWidth:0:C?0:m.toPixels(B.min)||0;d=D(w(h,d),0,n);h=D(Math.round(m.toPixels(w(e.value,B.max),!0)||0),0,n);I&&(d=h=m.toPixels(B.max));p=Math.abs(d-h);z=Math.min(d,h);v=Math.max(d,h);m.isXAxis?(g={x:q?v:z,y:0,width:p,height:n},C||(g.x=b.plotHeight-g.x)):(g={x:0,y:q?v:z,width:n,height:p},C&&(g.y=b.plotWidth-g.y));q&&c.isVML&&(g=m.isXAxis?{x:0,y:x?z:v,height:g.width,width:b.chartWidth}:{x:g.y-b.plotLeft-b.spacingBox.x,y:0,width:g.height,height:b.chartHeight});l[f]?l[f].animate(g):l[f]=c.clipRect(g); |
|
|
|
r&&a["zone-graph-"+f].clip(l[f]);t&&a["zone-area-"+f].clip(l[f]);I=e.value>B.max;a.resetZones&&0===h&&(h=void 0)});this.clips=l}else a.visible&&(r&&r.show(!0),t&&t.show(!0))},invertGroups:function(a){function e(){["group","markerGroup"].forEach(function(e){b[e]&&(f.renderer.isVML&&b[e].attr({width:b.yAxis.len,height:b.xAxis.len}),b[e].width=b.yAxis.len,b[e].height=b.xAxis.len,b[e].invert(b.isRadialSeries?!1:a))})}var b=this,f=b.chart;b.xAxis&&(b.eventsToUnbind.push(c(f,"resize",e)),e(),b.invertGroups= |
|
|
|
e)},plotGroup:function(a,b,c,f,d){var e=this[a],k=!e;k&&(this[a]=e=this.chart.renderer.g().attr({zIndex:f||.1}).add(d));e.addClass("highcharts-"+b+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(v(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(e.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0);e.attr({visibility:c})[k?"attr":"animate"](this.getPlotBox());return e},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis; |
|
|
|
a.inverted&&(b=c,c=this.xAxis);return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},removeEvents:function(a){a?this.eventsToUnbind.length&&(this.eventsToUnbind.forEach(function(a){a()}),this.eventsToUnbind.length=0):t(this)},render:function(){var a=this,b=a.chart,c=a.options,d=!!a.animate&&b.renderer.isSVG&&y(c.animation).duration,h=a.visible?"inherit":"hidden",g=c.zIndex,r=a.hasRendered,t=b.seriesGroup,n=b.inverted;l(this,"render");var m=a.plotGroup("group","series", |
|
|
|
h,g,t);a.markerGroup=a.plotGroup("markerGroup","markers",h,g,t);d&&a.animate(!0);m.inverted=a.isCartesian||a.invertable?n:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.visible&&a.drawPoints();a.drawDataLabels&&a.drawDataLabels();a.redrawPoints&&a.redrawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(n);!1===c.clip||a.sharedClipKey||r||m.clip(b.clipRect);d&&a.animate();r||(a.animationTimeout=f(function(){a.afterAnimate()},d||0));a.isDirty=!1;a.hasRendered= |
|
|
|
!0;l(a,"afterRender")},redraw:function(){var a=this.chart,b=this.isDirty||this.isDirtyData,c=this.group,f=this.xAxis,d=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:w(f&&f.left,a.plotLeft),translateY:w(d&&d.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree},kdAxisArray:["clientX","plotY"],searchPoint:function(a,b){var e=this.xAxis,c=this.yAxis,f=this.chart.inverted;return this.searchKDTree({clientX:f?e.len-a.chartY+e.pos:a.chartX- |
|
|
|
e.pos,plotY:f?c.len-a.chartX+c.pos:a.chartY-c.pos},b,a)},buildKDTree:function(a){function e(a,c,f){var k;if(k=a&&a.length){var d=b.kdAxisArray[c%f];a.sort(function(a,e){return a[d]-e[d]});k=Math.floor(k/2);return{point:a[k],left:e(a.slice(0,k),c+1,f),right:e(a.slice(k+1),c+1,f)}}}this.buildingKdTree=!0;var b=this,c=-1<b.options.findNearestPointBy.indexOf("y")?2:1;delete b.kdTree;f(function(){b.kdTree=e(b.getValidPoints(null,!b.directTouch),c,c);b.buildingKdTree=!1},b.options.kdNow||a&&"touchstart"=== |
|
|
|
a.type?0:1)},searchKDTree:function(a,b,c){function e(a,b,c,l){var g=b.point,r=f.kdAxisArray[c%l],u=g;var t=v(a[k])&&v(g[k])?Math.pow(a[k]-g[k],2):null;var n=v(a[d])&&v(g[d])?Math.pow(a[d]-g[d],2):null;n=(t||0)+(n||0);g.dist=v(n)?Math.sqrt(n):Number.MAX_VALUE;g.distX=v(t)?Math.sqrt(t):Number.MAX_VALUE;r=a[r]-g[r];n=0>r?"left":"right";t=0>r?"right":"left";b[n]&&(n=e(a,b[n],c+1,l),u=n[h]<u[h]?n:g);b[t]&&Math.sqrt(r*r)<u[h]&&(a=e(a,b[t],c+1,l),u=a[h]<u[h]?a:u);return u}var f=this,k=this.kdAxisArray[0], |
|
|
|
d=this.kdAxisArray[1],h=b?"distX":"dist";b=-1<f.options.findNearestPointBy.indexOf("y")?2:1;this.kdTree||this.buildingKdTree||this.buildKDTree(c);if(this.kdTree)return e(a,this.kdTree,b,b)},pointPlacementToXValue:function(){var a=this.xAxis,b=this.options.pointPlacement;"between"===b&&(b=a.reversed?-.5:.5);z(b)&&(b*=w(this.options.pointRange||a.pointRange));return b}});""});K(y,"parts/Stacking.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.correctFloat,F=g.defined,E=g.destroyObjectProperties, |
|
|
|
D=g.objectEach,x=g.pick;g=d.Axis;var v=d.Chart,C=d.format,B=d.Series;d.StackItem=function(d,g,m,q,w){var h=d.chart.inverted;this.axis=d;this.isNegative=m;this.options=g=g||{};this.x=q;this.total=null;this.points={};this.stack=w;this.rightCliff=this.leftCliff=0;this.alignOptions={align:g.align||(h?m?"left":"right":"center"),verticalAlign:g.verticalAlign||(h?"middle":m?"bottom":"top"),y:g.y,x:g.x};this.textAlign=g.textAlign||(h?m?"right":"left":"center")};d.StackItem.prototype={destroy:function(){E(this, |
|
|
|
this.axis)},render:function(d){var g=this.axis.chart,m=this.options,q=m.format;q=q?C(q,this,g):m.formatter.call(this);this.label?this.label.attr({text:q,visibility:"hidden"}):(this.label=g.renderer.label(q,null,null,m.shape,null,null,m.useHTML,!1,"stack-labels"),q={text:q,align:this.textAlign,rotation:m.rotation,padding:x(m.padding,0),visibility:"hidden"},this.label.attr(q),g.styledMode||this.label.css(m.style),this.label.added||this.label.add(d));this.label.labelrank=g.plotHeight},setOffset:function(d, |
|
|
|
g,m,q,w){var h=this.axis,f=h.chart;q=h.translate(h.usePercentage?100:q?q:this.total,0,0,0,1);m=h.translate(m?m:0);m=F(q)&&Math.abs(q-m);d=x(w,f.xAxis[0].translate(this.x))+d;h=F(q)&&this.getStackBox(f,this,d,q,g,m,h);g=this.label;d=this.isNegative;w="justify"===x(this.options.overflow,"justify");if(g&&h){m=g.getBBox();var c=f.inverted?d?m.width:0:m.width/2,b=f.inverted?m.height/2:d?-4:m.height+4;this.alignOptions.x=x(this.options.x,0);g.align(this.alignOptions,null,h);q=g.alignAttr;g.show();q.y-= |
|
|
|
b;w&&(q.x-=c,B.prototype.justifyDataLabel.call(this.axis,g,this.alignOptions,q,m,h),q.x+=c);q.x=g.alignAttr.x;g.attr({x:q.x,y:q.y});x(!w&&this.options.crop,!0)&&((f=f.isInsidePlot(g.x+(f.inverted?0:-m.width/2),g.y)&&f.isInsidePlot(g.x+(f.inverted?d?-m.width:m.width:m.width/2),g.y+m.height))||g.hide())}},getStackBox:function(d,g,m,q,w,h,f){var c=g.axis.reversed,b=d.inverted;d=f.height+f.pos-(b?d.plotLeft:d.plotTop);g=g.isNegative&&!c||!g.isNegative&&c;return{x:b?g?q:q-h:m,y:b?d-m-w:g?d-q-h:d-q,width:b? |
|
|
|
h:w,height:b?w:h}}};v.prototype.getStacks=function(){var d=this,g=d.inverted;d.yAxis.forEach(function(d){d.stacks&&d.hasVisibleSeries&&(d.oldStacks=d.stacks)});d.series.forEach(function(m){var q=m.xAxis&&m.xAxis.options||{};!m.options.stacking||!0!==m.visible&&!1!==d.options.chart.ignoreHiddenSeries||(m.stackKey=[m.type,x(m.options.stack,""),g?q.top:q.left,g?q.height:q.width].join())})};g.prototype.buildStacks=function(){var g=this.series,v=x(this.options.reversedStacks,!0),m=g.length,q;if(!this.isXAxis){this.usePercentage= |
|
|
|
!1;for(q=m;q--;){var w=g[v?q:m-q-1];w.setStackedPoints()}for(q=0;q<m;q++)g[q].modifyStacks();d.fireEvent(this,"afterBuildStacks")}};g.prototype.renderStackTotals=function(){var d=this.chart,g=d.renderer,m=this.stacks,q=this.stackTotalGroup;q||(this.stackTotalGroup=q=g.g("stack-labels").attr({visibility:"visible",zIndex:6}).add());q.translate(d.plotLeft,d.plotTop);D(m,function(d){D(d,function(d){d.render(q)})})};g.prototype.resetStacks=function(){var d=this,g=d.stacks;d.isXAxis||D(g,function(g){D(g, |
|
|
|
function(m,p){m.touched<d.stacksTouched?(m.destroy(),delete g[p]):(m.total=null,m.cumulative=null)})})};g.prototype.cleanStacks=function(){if(!this.isXAxis){if(this.oldStacks)var d=this.stacks=this.oldStacks;D(d,function(d){D(d,function(d){d.cumulative=d.total})})}};B.prototype.setStackedPoints=function(){if(this.options.stacking&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var g=this.processedXData,v=this.processedYData,m=[],q=v.length,w=this.options,h=w.threshold,f=x(w.startFromThreshold&& |
|
|
|
h,0),c=w.stack;w=w.stacking;var b=this.stackKey,a="-"+b,l=this.negStacks,n=this.yAxis,t=n.stacks,I=n.oldStacks,r,e;n.stacksTouched+=1;for(e=0;e<q;e++){var k=g[e];var u=v[e];var H=this.getStackIndicator(H,k,this.index);var G=H.key;var A=(r=l&&u<(f?0:h))?a:b;t[A]||(t[A]={});t[A][k]||(I[A]&&I[A][k]?(t[A][k]=I[A][k],t[A][k].total=null):t[A][k]=new d.StackItem(n,n.options.stackLabels,r,k,c));A=t[A][k];null!==u?(A.points[G]=A.points[this.index]=[x(A.cumulative,f)],F(A.cumulative)||(A.base=G),A.touched= |
|
|
|
n.stacksTouched,0<H.index&&!1===this.singleStacks&&(A.points[G][0]=A.points[this.index+","+k+",0"][0])):A.points[G]=A.points[this.index]=null;"percent"===w?(r=r?b:a,l&&t[r]&&t[r][k]?(r=t[r][k],A.total=r.total=Math.max(r.total,A.total)+Math.abs(u)||0):A.total=y(A.total+(Math.abs(u)||0))):A.total=y(A.total+(u||0));A.cumulative=x(A.cumulative,f)+(u||0);null!==u&&(A.points[G].push(A.cumulative),m[e]=A.cumulative)}"percent"===w&&(n.usePercentage=!0);this.stackedYData=m;n.oldStacks={}}};B.prototype.modifyStacks= |
|
|
|
function(){var d=this,g=d.stackKey,m=d.yAxis.stacks,q=d.processedXData,w,h=d.options.stacking;d[h+"Stacker"]&&[g,"-"+g].forEach(function(f){for(var c=q.length,b,a;c--;)if(b=q[c],w=d.getStackIndicator(w,b,d.index,f),a=(b=m[f]&&m[f][b])&&b.points[w.key])d[h+"Stacker"](a,b,c)})};B.prototype.percentStacker=function(d,g,m){g=g.total?100/g.total:0;d[0]=y(d[0]*g);d[1]=y(d[1]*g);this.stackedYData[m]=d[1]};B.prototype.getStackIndicator=function(d,g,m,q){!F(d)||d.x!==g||q&&d.key!==q?d={x:g,index:0,key:q}:d.index++; |
|
|
|
d.key=[m,g,d.index].join();return d}});K(y,"parts/Dynamics.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.defined,F=g.erase,E=g.extend,D=g.isArray,x=g.isNumber,v=g.isObject,C=g.isString,B=g.objectEach,p=g.pick,z=g.relativeLength,m=g.setAnimation,q=g.splat,w=d.addEvent,h=d.animate,f=d.Axis;g=d.Chart;var c=d.createElement,b=d.css,a=d.fireEvent,l=d.merge,n=d.Point,t=d.Series,I=d.seriesTypes;d.cleanRecursively=function(a,e){var b={};B(a,function(c,f){if(v(a[f],!0)&&!a.nodeType&& |
|
|
|
e[f])c=d.cleanRecursively(a[f],e[f]),Object.keys(c).length&&(b[f]=c);else if(v(a[f])||a[f]!==e[f])b[f]=a[f]});return b};E(g.prototype,{addSeries:function(b,e,c){var f,d=this;b&&(e=p(e,!0),a(d,"addSeries",{options:b},function(){f=d.initSeries(b);d.isDirtyLegend=!0;d.linkSeries();f.enabledDataSorting&&f.setData(b.data,!1);a(d,"afterAddSeries",{series:f});e&&d.redraw(c)}));return f},addAxis:function(a,e,b,c){return this.createAxis(e?"xAxis":"yAxis",{axis:a,redraw:b,animation:c})},addColorAxis:function(a, |
|
|
|
e,b){return this.createAxis("colorAxis",{axis:a,redraw:e,animation:b})},createAxis:function(a,e){var b=this.options,c="colorAxis"===a,h=e.redraw,g=e.animation;e=l(e.axis,{index:this[a].length,isX:"xAxis"===a});var r=c?new d.ColorAxis(this,e):new f(this,e);b[a]=q(b[a]||{});b[a].push(e);c&&(this.isDirtyLegend=!0,this.axes.forEach(function(a){a.series=[]}),this.series.forEach(function(a){a.bindAxes();a.isDirtyData=!0}));p(h,!0)&&this.redraw(g);return r},showLoading:function(a){var e=this,f=e.options, |
|
|
|
d=e.loadingDiv,g=f.loading,l=function(){d&&b(d,{left:e.plotLeft+"px",top:e.plotTop+"px",width:e.plotWidth+"px",height:e.plotHeight+"px"})};d||(e.loadingDiv=d=c("div",{className:"highcharts-loading highcharts-loading-hidden"},null,e.container),e.loadingSpan=c("span",{className:"highcharts-loading-inner"},null,d),w(e,"redraw",l));d.className="highcharts-loading";e.loadingSpan.innerHTML=p(a,f.lang.loading,"");e.styledMode||(b(d,E(g.style,{zIndex:10})),b(e.loadingSpan,g.labelStyle),e.loadingShown||(b(d, |
|
|
|
{opacity:0,display:""}),h(d,{opacity:g.style.opacity||.5},{duration:g.showDuration||0})));e.loadingShown=!0;l()},hideLoading:function(){var a=this.options,e=this.loadingDiv;e&&(e.className="highcharts-loading highcharts-loading-hidden",this.styledMode||h(e,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){b(e,{display:"none"})}}));this.loadingShown=!1},propsRequireDirtyBox:"backgroundColor borderColor borderWidth borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "), |
|
|
|
propsRequireReflow:"margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft".split(" "),propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" "),collectionsWithUpdate:["xAxis","yAxis","zAxis","series"],update:function(b,e,c,f){var k=this,h={credits:"addCredits",title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"},g,u,r,t=b.isResponsiveOptions,n=[];a(k,"update", |
|
|
|
{options:b});t||k.setResponsive(!1,!0);b=d.cleanRecursively(b,k.options);l(!0,k.userOptions,b);if(g=b.chart){l(!0,k.options.chart,g);"className"in g&&k.setClassName(g.className);"reflow"in g&&k.setReflow(g.reflow);if("inverted"in g||"polar"in g||"type"in g){k.propFromSeries();var m=!0}"alignTicks"in g&&(m=!0);B(g,function(a,e){-1!==k.propsRequireUpdateSeries.indexOf("chart."+e)&&(u=!0);-1!==k.propsRequireDirtyBox.indexOf(e)&&(k.isDirtyBox=!0);t||-1===k.propsRequireReflow.indexOf(e)||(r=!0)});!k.styledMode&& |
|
|
|
"style"in g&&k.renderer.setStyle(g.style)}!k.styledMode&&b.colors&&(this.options.colors=b.colors);b.plotOptions&&l(!0,this.options.plotOptions,b.plotOptions);b.time&&this.time===d.time&&(this.time=new d.Time(b.time));B(b,function(a,e){if(k[e]&&"function"===typeof k[e].update)k[e].update(a,!1);else if("function"===typeof k[h[e]])k[h[e]](a);"chart"!==e&&-1!==k.propsRequireUpdateSeries.indexOf(e)&&(u=!0)});this.collectionsWithUpdate.forEach(function(a){if(b[a]){if("series"===a){var e=[];k[a].forEach(function(a, |
|
|
|
b){a.options.isInternal||e.push(p(a.options.index,b))})}q(b[a]).forEach(function(b,f){(f=y(b.id)&&k.get(b.id)||k[a][e?e[f]:f])&&f.coll===a&&(f.update(b,!1),c&&(f.touched=!0));!f&&c&&k.collectionsWithInit[a]&&(k.collectionsWithInit[a][0].apply(k,[b].concat(k.collectionsWithInit[a][1]||[]).concat([!1])).touched=!0)});c&&k[a].forEach(function(a){a.touched||a.options.isInternal?delete a.touched:n.push(a)})}});n.forEach(function(a){a.remove&&a.remove(!1)});m&&k.axes.forEach(function(a){a.update({},!1)}); |
|
|
|
u&&k.getSeriesOrderByLinks().forEach(function(a){a.chart&&a.update({},!1)},this);b.loading&&l(!0,k.options.loading,b.loading);m=g&&g.width;g=g&&g.height;C(g)&&(g=z(g,m||k.chartWidth));r||x(m)&&m!==k.chartWidth||x(g)&&g!==k.chartHeight?k.setSize(m,g,f):p(e,!0)&&k.redraw(f);a(k,"afterUpdate",{options:b,redraw:e,animation:f})},setSubtitle:function(a,e){this.applyDescription("subtitle",a);this.layOutTitles(e)},setCaption:function(a,e){this.applyDescription("caption",a);this.layOutTitles(e)}});g.prototype.collectionsWithInit= |
|
|
|
{xAxis:[g.prototype.addAxis,[!0]],yAxis:[g.prototype.addAxis,[!1]],series:[g.prototype.addSeries]};E(n.prototype,{update:function(a,e,b,c){function f(){d.applyOptions(a);null===d.y&&g&&(d.graphic=g.destroy());v(a,!0)&&(g&&g.element&&a&&a.marker&&"undefined"!==typeof a.marker.symbol&&(d.graphic=g.destroy()),a&&a.dataLabels&&d.dataLabel&&(d.dataLabel=d.dataLabel.destroy()),d.connector&&(d.connector=d.connector.destroy()));h=d.index;k.updateParallelArrays(d,h);u.data[h]=v(u.data[h],!0)||v(a,!0)?d.options: |
|
|
|
p(a,u.data[h]);k.isDirty=k.isDirtyData=!0;!k.fixedBox&&k.hasCartesianSeries&&(l.isDirtyBox=!0);"point"===u.legendType&&(l.isDirtyLegend=!0);e&&l.redraw(b)}var d=this,k=d.series,g=d.graphic,h,l=k.chart,u=k.options;e=p(e,!0);!1===c?f():d.firePointEvent("update",{options:a},f)},remove:function(a,e){this.series.removePoint(this.series.data.indexOf(this),a,e)}});E(t.prototype,{addPoint:function(b,e,c,f,d){var k=this.options,g=this.data,h=this.chart,l=this.xAxis;l=l&&l.hasNames&&l.names;var u=k.data,r= |
|
|
|
this.xData,t;e=p(e,!0);var n={series:this};this.pointClass.prototype.applyOptions.apply(n,[b]);var m=n.x;var q=r.length;if(this.requireSorting&&m<r[q-1])for(t=!0;q&&r[q-1]>m;)q--;this.updateParallelArrays(n,"splice",q,0,0);this.updateParallelArrays(n,q);l&&n.name&&(l[m]=n.name);u.splice(q,0,b);t&&(this.data.splice(q,0,null),this.processData());"point"===k.legendType&&this.generatePoints();c&&(g[0]&&g[0].remove?g[0].remove(!1):(g.shift(),this.updateParallelArrays(n,"shift"),u.shift()));!1!==d&&a(this, |
|
|
|
"addPoint",{point:n});this.isDirtyData=this.isDirty=!0;e&&h.redraw(f)},removePoint:function(a,e,b){var c=this,f=c.data,d=f[a],k=c.points,g=c.chart,h=function(){k&&k.length===f.length&&k.splice(a,1);f.splice(a,1);c.options.data.splice(a,1);c.updateParallelArrays(d||{series:c},"splice",a,1);d&&d.destroy();c.isDirty=!0;c.isDirtyData=!0;e&&g.redraw()};m(b,g);e=p(e,!0);d?d.firePointEvent("remove",null,h):h()},remove:function(b,e,c,f){function d(){k.destroy(f);k.remove=null;g.isDirtyLegend=g.isDirtyBox= |
|
|
|
!0;g.linkSeries();p(b,!0)&&g.redraw(e)}var k=this,g=k.chart;!1!==c?a(k,"remove",null,d):d()},update:function(b,e){b=d.cleanRecursively(b,this.userOptions);a(this,"update",{options:b});var c=this,f=c.chart,g=c.userOptions,h=c.initialType||c.type,r=b.type||g.type||f.options.chart.type,t=!(this.hasDerivedData||b.dataGrouping||r&&r!==this.type||"undefined"!==typeof b.pointStart||b.pointInterval||b.pointIntervalUnit||b.keys),n=I[h].prototype,m,q=["group","markerGroup","dataLabelsGroup","transformGroup"], |
|
|
|
w=["eventOptions","navigatorSeries","baseSeries"],v=c.finishedAnimating&&{animation:!1},z={};t&&(w.push("data","isDirtyData","points","processedXData","processedYData","xIncrement","_hasPointMarkers","_hasPointLabels","mapMap","mapData","minY","maxY","minX","maxX"),!1!==b.visible&&w.push("area","graph"),c.parallelArrays.forEach(function(a){w.push(a+"Data")}),b.data&&(b.dataSorting&&E(c.options.dataSorting,b.dataSorting),this.setData(b.data,!1)));b=l(g,v,{index:"undefined"===typeof g.index?c.index: |
|
|
|
g.index,pointStart:p(g.pointStart,c.xData[0])},!t&&{data:c.options.data},b);t&&b.data&&(b.data=c.options.data);w=q.concat(w);w.forEach(function(a){w[a]=c[a];delete c[a]});c.remove(!1,null,!1,!0);for(m in n)c[m]=void 0;I[r||h]?E(c,I[r||h].prototype):d.error(17,!0,f,{missingModuleFor:r||h});w.forEach(function(a){c[a]=w[a]});c.init(f,b);if(t&&this.points){var x=c.options;!1===x.visible?(z.graphic=1,z.dataLabel=1):c._hasPointLabels||(r=x.marker,n=x.dataLabels,r&&(!1===r.enabled||"symbol"in r)&&(z.graphic= |
|
|
|
1),n&&!1===n.enabled&&(z.dataLabel=1));this.points.forEach(function(a){a&&a.series&&(a.resolveColor(),Object.keys(z).length&&a.destroyElements(z),!1===x.showInLegend&&a.legendItem&&f.legend.destroyItem(a))},this)}b.zIndex!==g.zIndex&&q.forEach(function(a){c[a]&&c[a].attr({zIndex:b.zIndex})});c.initialType=h;f.linkSeries();a(this,"afterUpdate");p(e,!0)&&f.redraw(t?void 0:!1)},setName:function(a){this.name=this.options.name=this.userOptions.name=a;this.chart.isDirtyLegend=!0}});E(f.prototype,{update:function(a, |
|
|
|
e){var b=this.chart,c=a&&a.events||{};a=l(this.userOptions,a);b.options[this.coll].indexOf&&(b.options[this.coll][b.options[this.coll].indexOf(this.userOptions)]=a);B(b.options[this.coll].events,function(a,e){"undefined"===typeof c[e]&&(c[e]=void 0)});this.destroy(!0);this.init(b,E(a,{events:c}));b.isDirtyBox=!0;p(e,!0)&&b.redraw()},remove:function(a){for(var e=this.chart,b=this.coll,c=this.series,f=c.length;f--;)c[f]&&c[f].remove(!1);F(e.axes,this);F(e[b],this);D(e.options[b])?e.options[b].splice(this.options.index, |
|
|
|
1):delete e.options[b];e[b].forEach(function(a,e){a.options.index=a.userOptions.index=e});this.destroy();e.isDirtyBox=!0;p(a,!0)&&e.redraw()},setTitle:function(a,e){this.update({title:a},e)},setCategories:function(a,e){this.update({categories:a},e)}})});K(y,"parts/AreaSeries.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.objectEach,F=g.pick,E=d.color,D=d.Series;g=d.seriesType;g("area","line",{softThreshold:!1,threshold:0},{singleStacks:!1,getStackPoints:function(d){var g= |
|
|
|
[],x=[],B=this.xAxis,p=this.yAxis,z=p.stacks[this.stackKey],m={},q=this.index,w=p.series,h=w.length,f=F(p.options.reversedStacks,!0)?1:-1,c;d=d||this.points;if(this.options.stacking){for(c=0;c<d.length;c++)d[c].leftNull=d[c].rightNull=void 0,m[d[c].x]=d[c];y(z,function(a,b){null!==a.total&&x.push(b)});x.sort(function(a,b){return a-b});var b=w.map(function(a){return a.visible});x.forEach(function(a,d){var l=0,t,w;if(m[a]&&!m[a].isNull)g.push(m[a]),[-1,1].forEach(function(g){var e=1===g?"rightNull": |
|
|
|
"leftNull",k=0,l=z[x[d+g]];if(l)for(c=q;0<=c&&c<h;)t=l.points[c],t||(c===q?m[a][e]=!0:b[c]&&(w=z[a].points[c])&&(k-=w[1]-w[0])),c+=f;m[a][1===g?"rightCliff":"leftCliff"]=k});else{for(c=q;0<=c&&c<h;){if(t=z[a].points[c]){l=t[1];break}c+=f}l=p.translate(l,0,1,0,1);g.push({isNull:!0,plotX:B.translate(a,0,0,0,1),x:a,plotY:l,yBottom:l})}})}return g},getGraphPath:function(d){var g=D.prototype.getGraphPath,x=this.options,B=x.stacking,p=this.yAxis,z,m=[],q=[],w=this.index,h=p.stacks[this.stackKey],f=x.threshold, |
|
|
|
c=Math.round(p.getThreshold(x.threshold));x=F(x.connectNulls,"percent"===B);var b=function(a,b,g){var e=d[a];a=B&&h[e.x].points[w];var k=e[g+"Null"]||0;g=e[g+"Cliff"]||0;e=!0;if(g||k){var u=(k?a[0]:a[1])+g;var t=a[0]+g;e=!!k}else!B&&d[b]&&d[b].isNull&&(u=t=f);"undefined"!==typeof u&&(q.push({plotX:l,plotY:null===u?c:p.getThreshold(u),isNull:e,isCliff:!0}),m.push({plotX:l,plotY:null===t?c:p.getThreshold(t),doCurve:!1}))};d=d||this.points;B&&(d=this.getStackPoints(d));for(z=0;z<d.length;z++){B||(d[z].leftCliff= |
|
|
|
d[z].rightCliff=d[z].leftNull=d[z].rightNull=void 0);var a=d[z].isNull;var l=F(d[z].rectPlotX,d[z].plotX);var n=F(d[z].yBottom,c);if(!a||x)x||b(z,z-1,"left"),a&&!B&&x||(q.push(d[z]),m.push({x:z,plotX:l,plotY:n})),x||b(z,z+1,"right")}z=g.call(this,q,!0,!0);m.reversed=!0;a=g.call(this,m,!0,!0);a.length&&(a[0]="L");a=z.concat(a);g=g.call(this,q,!1,x);a.xMap=z.xMap;this.areaPath=a;return g},drawGraph:function(){this.areaPath=[];D.prototype.drawGraph.apply(this);var d=this,g=this.areaPath,C=this.options, |
|
|
|
B=[["area","highcharts-area",this.color,C.fillColor]];this.zones.forEach(function(g,v){B.push(["zone-area-"+v,"highcharts-area highcharts-zone-area-"+v+" "+g.className,g.color||d.color,g.fillColor||C.fillColor])});B.forEach(function(p){var v=p[0],m=d[v],q=m?"animate":"attr",w={};m?(m.endX=d.preventGraphAnimation?null:g.xMap,m.animate({d:g})):(w.zIndex=0,m=d[v]=d.chart.renderer.path(g).addClass(p[1]).add(d.group),m.isArea=!0);d.chart.styledMode||(w.fill=F(p[3],E(p[2]).setOpacity(F(C.fillOpacity,.75)).get())); |
|
|
|
m[q](w);m.startX=g.xMap;m.shiftUnit=C.step?2:1})},drawLegendSymbol:d.LegendSymbolMixin.drawRectangle});""});K(y,"parts/SplineSeries.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.pick;d=d.seriesType;d("spline","line",{},{getPointSpline:function(d,g,D){var x=g.plotX,v=g.plotY,C=d[D-1];D=d[D+1];if(C&&!C.isNull&&!1!==C.doCurve&&!g.isCliff&&D&&!D.isNull&&!1!==D.doCurve&&!g.isCliff){d=C.plotY;var B=D.plotX;D=D.plotY;var p=0;var z=(1.5*x+C.plotX)/2.5;var m=(1.5*v+d)/2.5;B=(1.5* |
|
|
|
x+B)/2.5;var q=(1.5*v+D)/2.5;B!==z&&(p=(q-m)*(B-x)/(B-z)+v-q);m+=p;q+=p;m>d&&m>v?(m=Math.max(d,v),q=2*v-m):m<d&&m<v&&(m=Math.min(d,v),q=2*v-m);q>D&&q>v?(q=Math.max(D,v),m=2*v-q):q<D&&q<v&&(q=Math.min(D,v),m=2*v-q);g.rightContX=B;g.rightContY=q}g=["C",y(C.rightContX,C.plotX),y(C.rightContY,C.plotY),y(z,x),y(m,v),x,v];C.rightContX=C.rightContY=null;return g}});""});K(y,"parts/AreaSplineSeries.js",[y["parts/Globals.js"]],function(d){var g=d.seriesTypes.area.prototype,y=d.seriesType;y("areaspline","spline", |
|
|
|
d.defaultPlotOptions.area,{getStackPoints:g.getStackPoints,getGraphPath:g.getGraphPath,drawGraph:g.drawGraph,drawLegendSymbol:d.LegendSymbolMixin.drawRectangle});""});K(y,"parts/ColumnSeries.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.animObject,F=g.clamp,E=g.defined,D=g.extend,x=g.isNumber,v=g.pick,C=d.color,B=d.merge,p=d.Series;g=d.seriesType;var z=d.svg;g("column","line",{borderRadius:0,crisp:!0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50, |
|
|
|
pointRange:null,states:{hover:{halo:!1,brightness:.1},select:{color:"#cccccc",borderColor:"#000000"}},dataLabels:{align:null,verticalAlign:null,y:null},softThreshold:!1,startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0,borderColor:"#ffffff"},{cropShoulder:0,directTouch:!0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){p.prototype.init.apply(this,arguments);var d=this,g=d.chart;g.hasRendered&&g.series.forEach(function(g){g.type===d.type&&(g.isDirty=!0)})}, |
|
|
|
getColumnMetrics:function(){var d=this,g=d.options,w=d.xAxis,h=d.yAxis,f=w.options.reversedStacks;f=w.reversed&&!f||!w.reversed&&f;var c,b={},a=0;!1===g.grouping?a=1:d.chart.series.forEach(function(f){var g=f.yAxis,e=f.options;if(f.type===d.type&&(f.visible||!d.chart.options.chart.ignoreHiddenSeries)&&h.len===g.len&&h.pos===g.pos){if(e.stacking){c=f.stackKey;"undefined"===typeof b[c]&&(b[c]=a++);var k=b[c]}else!1!==e.grouping&&(k=a++);f.columnIndex=k}});var l=Math.min(Math.abs(w.transA)*(w.ordinalSlope|| |
|
|
|
g.pointRange||w.closestPointRange||w.tickInterval||1),w.len),n=l*g.groupPadding,t=(l-2*n)/(a||1);g=Math.min(g.maxPointWidth||w.len,v(g.pointWidth,t*(1-2*g.pointPadding)));d.columnMetrics={width:g,offset:(t-g)/2+(n+((d.columnIndex||0)+(f?1:0))*t-l/2)*(f?-1:1)};return d.columnMetrics},crispCol:function(d,g,w,h){var f=this.chart,c=this.borderWidth,b=-(c%2?.5:0);c=c%2?.5:1;f.inverted&&f.renderer.isVML&&(c+=1);this.options.crisp&&(w=Math.round(d+w)+b,d=Math.round(d)+b,w-=d);h=Math.round(g+h)+c;b=.5>=Math.abs(g)&& |
|
|
|
.5<h;g=Math.round(g)+c;h-=g;b&&h&&(--g,h+=1);return{x:d,y:g,width:w,height:h}},translate:function(){var d=this,g=d.chart,w=d.options,h=d.dense=2>d.closestPointRange*d.xAxis.transA;h=d.borderWidth=v(w.borderWidth,h?0:1);var f=d.yAxis,c=w.threshold,b=d.translatedThreshold=f.getThreshold(c),a=v(w.minPointLength,5),l=d.getColumnMetrics(),n=l.width,t=d.barW=Math.max(n,1+2*h),z=d.pointXOffset=l.offset,r=d.dataMin,e=d.dataMax;g.inverted&&(b-=.5);w.pointPadding&&(t=Math.ceil(t));p.prototype.translate.apply(d); |
|
|
|
d.points.forEach(function(k){var h=v(k.yBottom,b),l=999+Math.abs(h),m=n;l=F(k.plotY,-l,f.len+l);var A=k.plotX+z,q=t,w=Math.min(l,h),p=Math.max(l,h)-w;if(a&&Math.abs(p)<a){p=a;var I=!f.reversed&&!k.negative||f.reversed&&k.negative;k.y===c&&d.dataMax<=c&&f.min<c&&r!==e&&(I=!I);w=Math.abs(w-b)>a?h-a:b-(I?a:0)}E(k.options.pointWidth)&&(m=q=Math.ceil(k.options.pointWidth),A-=Math.round((m-n)/2));k.barX=A;k.pointWidth=m;k.tooltipPos=g.inverted?[f.len+f.pos-g.plotLeft-l,d.xAxis.len-A-q/2,p]:[A+q/2,l+f.pos- |
|
|
|
g.plotTop,p];k.shapeType=d.pointClass.prototype.shapeType||"rect";k.shapeArgs=d.crispCol.apply(d,k.isNull?[A,b,q,0]:[A,w,q,p])})},getSymbol:d.noop,drawLegendSymbol:d.LegendSymbolMixin.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(d,g){var m=this.options,h=this.pointAttrToOptions||{};var f=h.stroke||"borderColor";var c=h["stroke-width"]||"borderWidth",b=d&&d.color||this.color,a=d&&d[f]||m[f]||this.color||b,l=d&&d[c]|| |
|
|
|
m[c]||this[c]||0;h=d&&d.options.dashStyle||m.dashStyle;var n=v(d&&d.opacity,m.opacity,1);if(d&&this.zones.length){var t=d.getZone();b=d.options.color||t&&(t.color||d.nonZonedColor)||this.color;t&&(a=t.borderColor||a,h=t.dashStyle||h,l=t.borderWidth||l)}g&&d&&(d=B(m.states[g],d.options.states&&d.options.states[g]||{}),g=d.brightness,b=d.color||"undefined"!==typeof g&&C(b).brighten(d.brightness).get()||b,a=d[f]||a,l=d[c]||l,h=d.dashStyle||h,n=v(d.opacity,n));f={fill:b,stroke:a,"stroke-width":l,opacity:n}; |
|
|
|
h&&(f.dashstyle=h);return f},drawPoints:function(){var d=this,g=this.chart,p=d.options,h=g.renderer,f=p.animationLimit||250,c;d.points.forEach(function(b){var a=b.graphic,l=!!a,n=a&&g.pointCount<f?"animate":"attr";if(x(b.plotY)&&null!==b.y){c=b.shapeArgs;a&&b.hasNewShapeType()&&(a=a.destroy());d.enabledDataSorting&&(b.startXPos=d.xAxis.reversed?-(c?c.width:0):d.xAxis.width);a||(b.graphic=a=h[b.shapeType](c).add(b.group||d.group))&&d.enabledDataSorting&&g.hasRendered&&g.pointCount<f&&(a.attr({x:b.startXPos}), |
|
|
|
l=!0,n="animate");if(a&&l)a[n](B(c));if(p.borderRadius)a[n]({r:p.borderRadius});g.styledMode||a[n](d.pointAttribs(b,b.selected&&"select")).shadow(!1!==b.allowShadow&&p.shadow,null,p.stacking&&!p.borderRadius);a.addClass(b.getClassName(),!0)}else a&&(b.graphic=a.destroy())})},animate:function(d){var g=this,m=this.yAxis,h=g.options,f=this.chart.inverted,c={},b=f?"translateX":"translateY";if(z)if(d)c.scaleY=.001,d=F(m.toPixels(h.threshold),m.pos,m.pos+m.len),f?c.translateX=d-m.len:c.translateY=d,g.clipBox&& |
|
|
|
g.setClip(),g.group.attr(c);else{var a=g.group.attr(b);g.group.animate({scaleY:1},D(y(g.options.animation),{step:function(f,d){c[b]=a+d.pos*(m.pos-a);g.group.attr(c)}}));g.animate=null}},remove:function(){var d=this,g=d.chart;g.hasRendered&&g.series.forEach(function(g){g.type===d.type&&(g.isDirty=!0)});p.prototype.remove.apply(d,arguments)}});""});K(y,"parts/BarSeries.js",[y["parts/Globals.js"]],function(d){d=d.seriesType;d("bar","column",null,{inverted:!0});""});K(y,"parts/ScatterSeries.js",[y["parts/Globals.js"]], |
|
|
|
function(d){var g=d.Series,y=d.seriesType;y("scatter","line",{lineWidth:0,findNearestPointBy:"xy",jitter:{x:0,y:0},marker:{enabled:!0},tooltip:{headerFormat:'<span style="color:{point.color}">\u25cf</span> <span style="font-size: 10px"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"}},{sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,drawGraph:function(){this.options.lineWidth&& |
|
|
|
g.prototype.drawGraph.call(this)},applyJitter:function(){var d=this,g=this.options.jitter,y=this.points.length;g&&this.points.forEach(function(x,v){["x","y"].forEach(function(C,B){var p="plot"+C.toUpperCase();if(g[C]&&!x.isNull){var z=d[C+"Axis"];var m=g[C]*z.transA;if(z&&!z.isLog){var q=Math.max(0,x[p]-m);z=Math.min(z.len,x[p]+m);B=1E4*Math.sin(v+B*y);x[p]=q+(z-q)*(B-Math.floor(B));"x"===C&&(x.clientX=x.plotX)}}})})}});d.addEvent(g,"afterTranslate",function(){this.applyJitter&&this.applyJitter()}); |
|
|
|
""});K(y,"mixins/centered-series.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.isNumber,F=g.pick,E=g.relativeLength,D=d.deg2rad;d.CenteredSeriesMixin={getCenter:function(){var d=this.options,g=this.chart,C=2*(d.slicedOffset||0),B=g.plotWidth-2*C;g=g.plotHeight-2*C;var p=d.center;p=[F(p[0],"50%"),F(p[1],"50%"),d.size||"100%",d.innerSize||0];var z=Math.min(B,g),m;for(m=0;4>m;++m){var q=p[m];d=2>m||2===m&&/%$/.test(q);p[m]=E(q,[B,g,z,p[2]][m])+(d?C:0)}p[3]>p[2]&&(p[3]=p[2]); |
|
|
|
return p},getStartAndEndRadians:function(d,g){d=y(d)?d:0;g=y(g)&&g>d&&360>g-d?g:d+360;return{start:D*(d+-90),end:D*(g+-90)}}}});K(y,"parts/PieSeries.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.clamp,F=g.defined,E=g.isNumber,D=g.pick,x=g.relativeLength,v=g.setAnimation,C=d.addEvent;g=d.CenteredSeriesMixin;var B=g.getStartAndEndRadians,p=d.merge,z=d.noop,m=d.Point,q=d.Series,w=d.seriesType,h=d.fireEvent;w("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{allowOverlap:!0, |
|
|
|
connectorPadding:5,connectorShape:"fixedOffset",crookDistance:"70%",distance:30,enabled:!0,formatter:function(){return this.point.isNull?void 0:this.point.name},softConnector:!0,x:0},fillColor:void 0,ignoreHiddenPoint:!0,inactiveOtherPoints:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,lineWidth:void 0,states:{hover:{brightness:.1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0, |
|
|
|
trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:d.seriesTypes.column.prototype.pointAttribs,animate:function(f){var c=this,b=c.points,a=c.startAngleRad;f||(b.forEach(function(b){var f=b.graphic,d=b.shapeArgs;f&&d&&(f.attr({r:D(b.startR,c.center&&c.center[3]/2),start:a,end:a}),f.animate({r:d.r,start:d.start,end:d.end},c.options.animation))}),c.animate=null)},hasData:function(){return!!this.processedXData.length},updateTotals:function(){var f,c=0,b=this.points,a=b.length,d=this.options.ignoreHiddenPoint; |
|
|
|
for(f=0;f<a;f++){var g=b[f];c+=d&&!g.visible?0:g.isNull?0:g.y}this.total=c;for(f=0;f<a;f++)g=b[f],g.percentage=0<c&&(g.visible||!d)?g.y/c*100:0,g.total=c},generatePoints:function(){q.prototype.generatePoints.call(this);this.updateTotals()},getX:function(f,c,b){var a=this.center,d=this.radii?this.radii[b.index]:a[2]/2;f=Math.asin(y((f-a[1])/(d+b.labelDistance),-1,1));return a[0]+(c?-1:1)*Math.cos(f)*(d+b.labelDistance)+(0<b.labelDistance?(c?-1:1)*this.options.dataLabels.padding:0)},translate:function(f){this.generatePoints(); |
|
|
|
var c=0,b=this.options,a=b.slicedOffset,d=a+(b.borderWidth||0),g=B(b.startAngle,b.endAngle),t=this.startAngleRad=g.start;g=(this.endAngleRad=g.end)-t;var m=this.points,r=b.dataLabels.distance;b=b.ignoreHiddenPoint;var e,k=m.length;f||(this.center=f=this.getCenter());for(e=0;e<k;e++){var u=m[e];var q=t+c*g;if(!b||u.visible)c+=u.percentage/100;var p=t+c*g;u.shapeType="arc";u.shapeArgs={x:f[0],y:f[1],r:f[2]/2,innerR:f[3]/2,start:Math.round(1E3*q)/1E3,end:Math.round(1E3*p)/1E3};u.labelDistance=D(u.options.dataLabels&& |
|
|
|
u.options.dataLabels.distance,r);u.labelDistance=x(u.labelDistance,u.shapeArgs.r);this.maxLabelDistance=Math.max(this.maxLabelDistance||0,u.labelDistance);p=(p+q)/2;p>1.5*Math.PI?p-=2*Math.PI:p<-Math.PI/2&&(p+=2*Math.PI);u.slicedTranslation={translateX:Math.round(Math.cos(p)*a),translateY:Math.round(Math.sin(p)*a)};var A=Math.cos(p)*f[2]/2;var w=Math.sin(p)*f[2]/2;u.tooltipPos=[f[0]+.7*A,f[1]+.7*w];u.half=p<-Math.PI/2||p>Math.PI/2?1:0;u.angle=p;q=Math.min(d,u.labelDistance/5);u.labelPosition={natural:{x:f[0]+ |
|
|
|
A+Math.cos(p)*u.labelDistance,y:f[1]+w+Math.sin(p)*u.labelDistance},"final":{},alignment:0>u.labelDistance?"center":u.half?"right":"left",connectorPosition:{breakAt:{x:f[0]+A+Math.cos(p)*q,y:f[1]+w+Math.sin(p)*q},touchingSliceAt:{x:f[0]+A,y:f[1]+w}}}}h(this,"afterTranslate")},drawEmpty:function(){var f=this.options;if(0===this.total){var c=this.center[0];var b=this.center[1];this.graph||(this.graph=this.chart.renderer.circle(c,b,0).addClass("highcharts-graph").add(this.group));this.graph.animate({"stroke-width":f.borderWidth, |
|
|
|
cx:c,cy:b,r:this.center[2]/2,fill:f.fillColor||"none",stroke:f.color||"#cccccc"})}else this.graph&&(this.graph=this.graph.destroy())},redrawPoints:function(){var f=this,c=f.chart,b=c.renderer,a,d,g,h,m=f.options.shadow;this.drawEmpty();!m||f.shadowGroup||c.styledMode||(f.shadowGroup=b.g("shadow").attr({zIndex:-1}).add(f.group));f.points.forEach(function(l){var e={};d=l.graphic;if(!l.isNull&&d){h=l.shapeArgs;a=l.getTranslate();if(!c.styledMode){var k=l.shadowGroup;m&&!k&&(k=l.shadowGroup=b.g("shadow").add(f.shadowGroup)); |
|
|
|
k&&k.attr(a);g=f.pointAttribs(l,l.selected&&"select")}l.delayedRendering?(d.setRadialReference(f.center).attr(h).attr(a),c.styledMode||d.attr(g).attr({"stroke-linejoin":"round"}).shadow(m,k),l.delayedRendering=!1):(d.setRadialReference(f.center),c.styledMode||p(!0,e,g),p(!0,e,h,a),d.animate(e));d.attr({visibility:l.visible?"inherit":"hidden"});d.addClass(l.getClassName())}else d&&(l.graphic=d.destroy())})},drawPoints:function(){var f=this.chart.renderer;this.points.forEach(function(c){c.graphic|| |
|
|
|
(c.graphic=f[c.shapeType](c.shapeArgs).add(c.series.group),c.delayedRendering=!0)})},searchPoint:z,sortByAngle:function(f,c){f.sort(function(b,a){return"undefined"!==typeof b.angle&&(a.angle-b.angle)*c})},drawLegendSymbol:d.LegendSymbolMixin.drawRectangle,getCenter:g.getCenter,getSymbol:z,drawGraph:null},{init:function(){m.prototype.init.apply(this,arguments);var f=this;f.name=D(f.name,"Slice");var c=function(b){f.slice("select"===b.type)};C(f,"select",c);C(f,"unselect",c);return f},isValid:function(){return E(this.y)&& |
|
|
|
0<=this.y},setVisible:function(f,c){var b=this,a=b.series,d=a.chart,g=a.options.ignoreHiddenPoint;c=D(c,g);f!==b.visible&&(b.visible=b.options.visible=f="undefined"===typeof f?!b.visible:f,a.options.data[a.data.indexOf(b)]=b.options,["graphic","dataLabel","connector","shadowGroup"].forEach(function(a){if(b[a])b[a][f?"show":"hide"](!0)}),b.legendItem&&d.legend.colorizeItem(b,f),f||"hover"!==b.state||b.setState(""),g&&(a.isDirty=!0),c&&d.redraw())},slice:function(f,c,b){var a=this.series;v(b,a.chart); |
|
|
|
D(c,!0);this.sliced=this.options.sliced=F(f)?f:!this.sliced;a.options.data[a.data.indexOf(this)]=this.options;this.graphic.animate(this.getTranslate());this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},getTranslate:function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}},haloPath:function(f){var c=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(c.x,c.y,c.r+f,c.r+f,{innerR:c.r-1,start:c.start,end:c.end})},connectorShapes:{fixedOffset:function(f, |
|
|
|
c,b){var a=c.breakAt;c=c.touchingSliceAt;return["M",f.x,f.y].concat(b.softConnector?["C",f.x+("left"===f.alignment?-5:5),f.y,2*a.x-c.x,2*a.y-c.y,a.x,a.y]:["L",a.x,a.y]).concat(["L",c.x,c.y])},straight:function(f,c){c=c.touchingSliceAt;return["M",f.x,f.y,"L",c.x,c.y]},crookedLine:function(f,c,b){c=c.touchingSliceAt;var a=this.series,d=a.center[0],g=a.chart.plotWidth,h=a.chart.plotLeft;a=f.alignment;var m=this.shapeArgs.r;b=x(b.crookDistance,1);b="left"===a?d+m+(g+h-d-m)*(1-b):h+(d-m)*b;d=["L",b,f.y]; |
|
|
|
if("left"===a?b>f.x||b<c.x:b<f.x||b>c.x)d=[];return["M",f.x,f.y].concat(d).concat(["L",c.x,c.y])}},getConnectorPath:function(){var f=this.labelPosition,c=this.series.options.dataLabels,b=c.connectorShape,a=this.connectorShapes;a[b]&&(b=a[b]);return b.call(this,{x:f.final.x,y:f.final.y,alignment:f.alignment},f.connectorPosition,c)}});""});K(y,"parts/DataLabels.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.animObject,F=g.arrayMax,E=g.clamp,D=g.defined,x=g.extend,v=g.isArray, |
|
|
|
C=g.objectEach,B=g.pick,p=g.relativeLength,z=g.splat,m=d.format,q=d.merge;g=d.noop;var w=d.Series,h=d.seriesTypes,f=d.stableSort;d.distribute=function(c,b,a){function g(a,e){return a.target-e.target}var h,t=!0,m=c,r=[];var e=0;var k=m.reducedLen||b;for(h=c.length;h--;)e+=c[h].size;if(e>k){f(c,function(a,e){return(e.rank||0)-(a.rank||0)});for(e=h=0;e<=k;)e+=c[h].size,h++;r=c.splice(h-1,c.length)}f(c,g);for(c=c.map(function(a){return{size:a.size,targets:[a.target],align:B(a.align,.5)}});t;){for(h=c.length;h--;)t= |
|
|
|
c[h],e=(Math.min.apply(0,t.targets)+Math.max.apply(0,t.targets))/2,t.pos=E(e-t.size*t.align,0,b-t.size);h=c.length;for(t=!1;h--;)0<h&&c[h-1].pos+c[h-1].size>c[h].pos&&(c[h-1].size+=c[h].size,c[h-1].targets=c[h-1].targets.concat(c[h].targets),c[h-1].align=.5,c[h-1].pos+c[h-1].size>b&&(c[h-1].pos=b-c[h-1].size),c.splice(h,1),t=!0)}m.push.apply(m,r);h=0;c.some(function(e){var c=0;if(e.targets.some(function(){m[h].pos=e.pos+c;if(Math.abs(m[h].pos-m[h].target)>a)return m.slice(0,h+1).forEach(function(a){delete a.pos}), |
|
|
|
m.reducedLen=(m.reducedLen||b)-.1*b,m.reducedLen>.1*b&&d.distribute(m,b,a),!0;c+=m[h].size;h++}))return!0});f(m,g)};w.prototype.drawDataLabels=function(){function c(a,e){var b=e.filter;return b?(e=b.operator,a=a[b.property],b=b.value,">"===e&&a>b||"<"===e&&a<b||">="===e&&a>=b||"<="===e&&a<=b||"=="===e&&a==b||"==="===e&&a===b?!0:!1):!0}function b(a,e){var b=[],c;if(v(a)&&!v(e))b=a.map(function(a){return q(a,e)});else if(v(e)&&!v(a))b=e.map(function(e){return q(a,e)});else if(v(a)||v(e))for(c=Math.max(a.length, |
|
|
|
e.length);c--;)b[c]=q(a[c],e[c]);else b=q(a,e);return b}var a=this,f=a.chart,g=a.options,h=g.dataLabels,p=a.points,r,e=a.hasRendered||0,k=y(g.animation).duration,u=Math.min(k,200),H=!f.renderer.forExport&&B(h.defer,0<u),w=f.renderer;h=b(b(f.options.plotOptions&&f.options.plotOptions.series&&f.options.plotOptions.series.dataLabels,f.options.plotOptions&&f.options.plotOptions[a.type]&&f.options.plotOptions[a.type].dataLabels),h);d.fireEvent(this,"drawDataLabels");if(v(h)||h.enabled||a._hasPointLabels){var A= |
|
|
|
a.plotGroup("dataLabelsGroup","data-labels",H&&!e?"hidden":"inherit",h.zIndex||6);H&&(A.attr({opacity:+e}),e||setTimeout(function(){var e=a.dataLabelsGroup;e&&(a.visible&&A.show(!0),e[g.animation?"animate":"attr"]({opacity:1},{duration:u}))},k-u));p.forEach(function(e){r=z(b(h,e.dlOptions||e.options&&e.options.dataLabels));r.forEach(function(b,d){var k=b.enabled&&(!e.isNull||e.dataLabelOnNull)&&c(e,b),h=e.dataLabels?e.dataLabels[d]:e.dataLabel,l=e.connectors?e.connectors[d]:e.connector,u=B(b.distance, |
|
|
|
e.labelDistance),t=!h;if(k){var r=e.getLabelConfig();var n=B(b[e.formatPrefix+"Format"],b.format);r=D(n)?m(n,r,f):(b[e.formatPrefix+"Formatter"]||b.formatter).call(r,b);n=b.style;var q=b.rotation;f.styledMode||(n.color=B(b.color,n.color,a.color,"#000000"),"contrast"===n.color?(e.contrastColor=w.getContrast(e.color||a.color),n.color=!D(u)&&b.inside||0>u||g.stacking?e.contrastColor:"#000000"):delete e.contrastColor,g.cursor&&(n.cursor=g.cursor));var p={r:b.borderRadius||0,rotation:q,padding:b.padding, |
|
|
|
zIndex:1};f.styledMode||(p.fill=b.backgroundColor,p.stroke=b.borderColor,p["stroke-width"]=b.borderWidth);C(p,function(a,e){"undefined"===typeof a&&delete p[e]})}!h||k&&D(r)?k&&D(r)&&(h?p.text=r:(e.dataLabels=e.dataLabels||[],h=e.dataLabels[d]=q?w.text(r,0,-9999).addClass("highcharts-data-label"):w.label(r,0,-9999,b.shape,null,null,b.useHTML,null,"data-label"),d||(e.dataLabel=h),h.addClass(" highcharts-data-label-color-"+e.colorIndex+" "+(b.className||"")+(b.useHTML?" highcharts-tracker":""))),h.options= |
|
|
|
b,h.attr(p),f.styledMode||h.css(n).shadow(b.shadow),h.added||h.add(A),b.textPath&&!b.useHTML&&(h.setTextPath(e.getDataLabelPath&&e.getDataLabelPath(h)||e.graphic,b.textPath),e.dataLabelPath&&!b.textPath.enabled&&(e.dataLabelPath=e.dataLabelPath.destroy())),a.alignDataLabel(e,h,b,null,t)):(e.dataLabel=e.dataLabel&&e.dataLabel.destroy(),e.dataLabels&&(1===e.dataLabels.length?delete e.dataLabels:delete e.dataLabels[d]),d||delete e.dataLabel,l&&(e.connector=e.connector.destroy(),e.connectors&&(1===e.connectors.length? |
|
|
|
delete e.connectors:delete e.connectors[d])))})})}d.fireEvent(this,"afterDrawDataLabels")};w.prototype.alignDataLabel=function(c,b,a,f,d){var g=this,h=this.chart,l=this.isCartesian&&h.inverted,e=this.enabledDataSorting,k=B(c.dlBox&&c.dlBox.centerX,c.plotX,-9999),u=B(c.plotY,-9999),n=b.getBBox(),m=a.rotation,A=a.align,q=h.isInsidePlot(k,Math.round(u),l),p="justify"===B(a.overflow,e?"none":"justify"),w=this.visible&&(c.series.forceDL||e&&!p||q||f&&h.isInsidePlot(k,l?f.x+1:f.y+f.height-1,l));var v=function(a){e&& |
|
|
|
g.xAxis&&!p&&g.setDataLabelStartPos(c,b,d,q,a)};if(w){var z=h.renderer.fontMetrics(h.styledMode?void 0:a.style.fontSize,b).b;f=x({x:l?this.yAxis.len-u:k,y:Math.round(l?this.xAxis.len-k:u),width:0,height:0},f);x(a,{width:n.width,height:n.height});m?(p=!1,k=h.renderer.rotCorr(z,m),k={x:f.x+a.x+f.width/2+k.x,y:f.y+a.y+{top:0,middle:.5,bottom:1}[a.verticalAlign]*f.height},v(k),b[d?"attr":"animate"](k).attr({align:A}),v=(m+720)%360,v=180<v&&360>v,"left"===A?k.y-=v?n.height:0:"center"===A?(k.x-=n.width/ |
|
|
|
2,k.y-=n.height/2):"right"===A&&(k.x-=n.width,k.y-=v?0:n.height),b.placed=!0,b.alignAttr=k):(v(f),b.align(a,null,f),k=b.alignAttr);p&&0<=f.height?this.justifyDataLabel(b,a,k,n,f,d):B(a.crop,!0)&&(w=h.isInsidePlot(k.x,k.y)&&h.isInsidePlot(k.x+n.width,k.y+n.height));if(a.shape&&!m)b[d?"attr":"animate"]({anchorX:l?h.plotWidth-c.plotY:c.plotX,anchorY:l?h.plotHeight-c.plotX:c.plotY})}d&&e&&(b.placed=!1);w||e&&!p||(b.hide(!0),b.placed=!1)};w.prototype.setDataLabelStartPos=function(c,b,a,f,d){var g=this.chart, |
|
|
|
h=g.inverted,l=this.xAxis,e=l.reversed,k=h?b.height/2:b.width/2;c=(c=c.pointWidth)?c/2:0;l=h?d.x:e?-k-c:l.width-k+c;d=h?e?this.yAxis.height-k+c:-k-c:d.y;b.startXPos=l;b.startYPos=d;f?"hidden"===b.visibility&&(b.show(),b.attr({opacity:0}).animate({opacity:1})):b.attr({opacity:1}).animate({opacity:0},void 0,b.hide);g.hasRendered&&(a&&b.attr({x:b.startXPos,y:b.startYPos}),b.placed=!0)};w.prototype.justifyDataLabel=function(c,b,a,f,d,g){var h=this.chart,l=b.align,e=b.verticalAlign,k=c.box?0:c.padding|| |
|
|
|
0;var u=a.x+k;if(0>u){"right"===l?(b.align="left",b.inside=!0):b.x=-u;var t=!0}u=a.x+f.width-k;u>h.plotWidth&&("left"===l?(b.align="right",b.inside=!0):b.x=h.plotWidth-u,t=!0);u=a.y+k;0>u&&("bottom"===e?(b.verticalAlign="top",b.inside=!0):b.y=-u,t=!0);u=a.y+f.height-k;u>h.plotHeight&&("top"===e?(b.verticalAlign="bottom",b.inside=!0):b.y=h.plotHeight-u,t=!0);t&&(c.placed=!g,c.align(b,null,d));return t};h.pie&&(h.pie.prototype.dataLabelPositioners={radialDistributionY:function(c){return c.top+c.distributeBox.pos}, |
|
|
|
radialDistributionX:function(c,b,a,f){return c.getX(a<b.top+2||a>b.bottom-2?f:a,b.half,b)},justify:function(c,b,a){return a[0]+(c.half?-1:1)*(b+c.labelDistance)},alignToPlotEdges:function(c,b,a,f){c=c.getBBox().width;return b?c+f:a-c-f},alignToConnectors:function(c,b,a,f){var d=0,g;c.forEach(function(a){g=a.dataLabel.getBBox().width;g>d&&(d=g)});return b?d+f:a-d-f}},h.pie.prototype.drawDataLabels=function(){var c=this,b=c.data,a,f=c.chart,g=c.options.dataLabels,h=g.connectorPadding,m,r=f.plotWidth, |
|
|
|
e=f.plotHeight,k=f.plotLeft,u=Math.round(f.chartWidth/3),p,v=c.center,A=v[2]/2,z=v[1],x,C,y,E,P=[[],[]],O,N,M,K,T=[0,0,0,0],Z=c.dataLabelPositioners,da;c.visible&&(g.enabled||c._hasPointLabels)&&(b.forEach(function(a){a.dataLabel&&a.visible&&a.dataLabel.shortened&&(a.dataLabel.attr({width:"auto"}).css({width:"auto",textOverflow:"clip"}),a.dataLabel.shortened=!1)}),w.prototype.drawDataLabels.apply(c),b.forEach(function(a){a.dataLabel&&(a.visible?(P[a.half].push(a),a.dataLabel._pos=null,!D(g.style.width)&& |
|
|
|
!D(a.options.dataLabels&&a.options.dataLabels.style&&a.options.dataLabels.style.width)&&a.dataLabel.getBBox().width>u&&(a.dataLabel.css({width:.7*u}),a.dataLabel.shortened=!0)):(a.dataLabel=a.dataLabel.destroy(),a.dataLabels&&1===a.dataLabels.length&&delete a.dataLabels))}),P.forEach(function(b,l){var u=b.length,t=[],n;if(u){c.sortByAngle(b,l-.5);if(0<c.maxLabelDistance){var m=Math.max(0,z-A-c.maxLabelDistance);var q=Math.min(z+A+c.maxLabelDistance,f.plotHeight);b.forEach(function(a){0<a.labelDistance&& |
|
|
|
a.dataLabel&&(a.top=Math.max(0,z-A-a.labelDistance),a.bottom=Math.min(z+A+a.labelDistance,f.plotHeight),n=a.dataLabel.getBBox().height||21,a.distributeBox={target:a.labelPosition.natural.y-a.top+n/2,size:n,rank:a.y},t.push(a.distributeBox))});m=q+n-m;d.distribute(t,m,m/5)}for(K=0;K<u;K++){a=b[K];y=a.labelPosition;x=a.dataLabel;M=!1===a.visible?"hidden":"inherit";N=m=y.natural.y;t&&D(a.distributeBox)&&("undefined"===typeof a.distributeBox.pos?M="hidden":(E=a.distributeBox.size,N=Z.radialDistributionY(a))); |
|
|
|
delete a.positionIndex;if(g.justify)O=Z.justify(a,A,v);else switch(g.alignTo){case "connectors":O=Z.alignToConnectors(b,l,r,k);break;case "plotEdges":O=Z.alignToPlotEdges(x,l,r,k);break;default:O=Z.radialDistributionX(c,a,N,m)}x._attr={visibility:M,align:y.alignment};x._pos={x:O+g.x+({left:h,right:-h}[y.alignment]||0),y:N+g.y-10};y.final.x=O;y.final.y=N;B(g.crop,!0)&&(C=x.getBBox().width,m=null,O-C<h&&1===l?(m=Math.round(C-O+h),T[3]=Math.max(m,T[3])):O+C>r-h&&0===l&&(m=Math.round(O+C-r+h),T[1]=Math.max(m, |
|
|
|
T[1])),0>N-E/2?T[0]=Math.max(Math.round(-N+E/2),T[0]):N+E/2>e&&(T[2]=Math.max(Math.round(N+E/2-e),T[2])),x.sideOverflow=m)}}}),0===F(T)||this.verifyDataLabelOverflow(T))&&(this.placeDataLabels(),this.points.forEach(function(a){da=q(g,a.options.dataLabels);if(m=B(da.connectorWidth,1)){var e;p=a.connector;if((x=a.dataLabel)&&x._pos&&a.visible&&0<a.labelDistance){M=x._attr.visibility;if(e=!p)a.connector=p=f.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+a.colorIndex+(a.className? |
|
|
|
" "+a.className:"")).add(c.dataLabelsGroup),f.styledMode||p.attr({"stroke-width":m,stroke:da.connectorColor||a.color||"#666666"});p[e?"attr":"animate"]({d:a.getConnectorPath()});p.attr("visibility",M)}else p&&(a.connector=p.destroy())}}))},h.pie.prototype.placeDataLabels=function(){this.points.forEach(function(c){var b=c.dataLabel,a;b&&c.visible&&((a=b._pos)?(b.sideOverflow&&(b._attr.width=Math.max(b.getBBox().width-b.sideOverflow,0),b.css({width:b._attr.width+"px",textOverflow:(this.options.dataLabels.style|| |
|
|
|
{}).textOverflow||"ellipsis"}),b.shortened=!0),b.attr(b._attr),b[b.moved?"animate":"attr"](a),b.moved=!0):b&&b.attr({y:-9999}));delete c.distributeBox},this)},h.pie.prototype.alignDataLabel=g,h.pie.prototype.verifyDataLabelOverflow=function(c){var b=this.center,a=this.options,f=a.center,d=a.minSize||80,g=null!==a.size;if(!g){if(null!==f[0])var h=Math.max(b[2]-Math.max(c[1],c[3]),d);else h=Math.max(b[2]-c[1]-c[3],d),b[0]+=(c[3]-c[1])/2;null!==f[1]?h=E(h,d,b[2]-Math.max(c[0],c[2])):(h=E(h,d,b[2]-c[0]- |
|
|
|
c[2]),b[1]+=(c[0]-c[2])/2);h<b[2]?(b[2]=h,b[3]=Math.min(p(a.innerSize||0,h),h),this.translate(b),this.drawDataLabels&&this.drawDataLabels()):g=!0}return g});h.column&&(h.column.prototype.alignDataLabel=function(c,b,a,f,d){var g=this.chart.inverted,h=c.series,l=c.dlBox||c.shapeArgs,e=B(c.below,c.plotY>B(this.translatedThreshold,h.yAxis.len)),k=B(a.inside,!!this.options.stacking);l&&(f=q(l),0>f.y&&(f.height+=f.y,f.y=0),l=f.y+f.height-h.yAxis.len,0<l&&(f.height-=l),g&&(f={x:h.yAxis.len-f.y-f.height, |
|
|
|
y:h.xAxis.len-f.x-f.width,width:f.height,height:f.width}),k||(g?(f.x+=e?0:f.width,f.width=0):(f.y+=e?f.height:0,f.height=0)));a.align=B(a.align,!g||k?"center":e?"right":"left");a.verticalAlign=B(a.verticalAlign,g||k?"middle":e?"top":"bottom");w.prototype.alignDataLabel.call(this,c,b,a,f,d);f&&(0>=f.height&&f.y===this.chart.plotHeight||0>=f.width&&0===f.x)&&(b.hide(!0),b.placed=!1);a.inside&&c.contrastColor&&b.css({color:c.contrastColor})})});K(y,"modules/overlapping-datalabels.src.js",[y["parts/Globals.js"], |
|
|
|
y["parts/Utilities.js"]],function(d,g){var y=g.isArray,F=g.objectEach,E=g.pick;g=d.Chart;var D=d.addEvent,x=d.fireEvent;D(g,"render",function(){var d=[];(this.labelCollectors||[]).forEach(function(g){d=d.concat(g())});(this.yAxis||[]).forEach(function(g){g.options.stackLabels&&!g.options.stackLabels.allowOverlap&&F(g.stacks,function(g){F(g,function(g){d.push(g.label)})})});(this.series||[]).forEach(function(g){var v=g.options.dataLabels;g.visible&&(!1!==v.enabled||g._hasPointLabels)&&g.points.forEach(function(g){g.visible&& |
|
|
|
(y(g.dataLabels)?g.dataLabels:g.dataLabel?[g.dataLabel]:[]).forEach(function(p){var m=p.options;p.labelrank=E(m.labelrank,g.labelrank,g.shapeArgs&&g.shapeArgs.height);m.allowOverlap||d.push(p)})})});this.hideOverlappingLabels(d)});g.prototype.hideOverlappingLabels=function(d){var g=this,v=d.length,p=g.renderer,z,m,q,w=!1;var h=function(b){var a=b.box?0:b.padding||0;var c=0;if(b&&(!b.alignAttr||b.placed)){var f=b.alignAttr||{x:b.attr("x"),y:b.attr("y")};var d=b.parentGroup;b.width||(c=b.getBBox(), |
|
|
|
b.width=c.width,b.height=c.height,c=p.fontMetrics(null,b.element).h);return{x:f.x+(d.translateX||0)+a,y:f.y+(d.translateY||0)+a-c,width:b.width-2*a,height:b.height-2*a}}};for(m=0;m<v;m++)if(z=d[m])z.oldOpacity=z.opacity,z.newOpacity=1,z.absoluteBox=h(z);d.sort(function(b,a){return(a.labelrank||0)-(b.labelrank||0)});for(m=0;m<v;m++){var f=(h=d[m])&&h.absoluteBox;for(z=m+1;z<v;++z){var c=(q=d[z])&&q.absoluteBox;!f||!c||h===q||0===h.newOpacity||0===q.newOpacity||c.x>f.x+f.width||c.x+c.width<f.x||c.y> |
|
|
|
f.y+f.height||c.y+c.height<f.y||((h.labelrank<q.labelrank?h:q).newOpacity=0)}}d.forEach(function(b){var a;if(b){var c=b.newOpacity;b.oldOpacity!==c&&(b.alignAttr&&b.placed?(c?b.show(!0):a=function(){b.hide(!0);b.placed=!1},w=!0,b.alignAttr.opacity=c,b[b.isOld?"animate":"attr"](b.alignAttr,null,a),x(g,"afterHideOverlappingLabel")):b.attr({opacity:c}));b.isOld=!0}});w&&x(g,"afterHideAllOverlappingLabels")}});K(y,"parts/Interaction.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y= |
|
|
|
g.defined,F=g.extend,E=g.isArray,D=g.isObject,x=g.objectEach,v=g.pick,C=d.addEvent;g=d.Chart;var B=d.createElement,p=d.css,z=d.defaultOptions,m=d.defaultPlotOptions,q=d.fireEvent,w=d.hasTouch,h=d.Legend,f=d.merge,c=d.Point,b=d.Series,a=d.seriesTypes,l=d.svg;var n=d.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,e=function(a){var e=c.getPointFromEvent(a);"undefined"!==typeof e&&(c.isDirectTouch=!0,e.onMouseOver(a))},f;a.points.forEach(function(a){f=E(a.dataLabels)?a.dataLabels: |
|
|
|
a.dataLabel?[a.dataLabel]:[];a.graphic&&(a.graphic.element.point=a);f.forEach(function(e){e.div?e.div.point=a:e.element.point=a})});a._hasTracking||(a.trackerGroups.forEach(function(f){if(a[f]){a[f].addClass("highcharts-tracker").on("mouseover",e).on("mouseout",function(a){c.onTrackerMouseOut(a)});if(w)a[f].on("touchstart",e);!b.styledMode&&a.options.cursor&&a[f].css(p).css({cursor:a.options.cursor})}}),a._hasTracking=!0);q(this,"afterDrawTracker")},drawTrackerGraph:function(){var a=this,b=a.options, |
|
|
|
c=b.trackByArea,e=[].concat(c?a.areaPath:a.graphPath),f=e.length,d=a.chart,g=d.pointer,h=d.renderer,m=d.options.tooltip.snap,n=a.tracker,p,v=function(){if(d.hoverSeries!==a)a.onMouseOver()},z="rgba(192,192,192,"+(l?.0001:.002)+")";if(f&&!c)for(p=f+1;p--;)"M"===e[p]&&e.splice(p+1,0,e[p+1]-m,e[p+2],"L"),(p&&"M"===e[p]||p===f)&&e.splice(p,0,"L",e[p-2]+m,e[p-1]);n?n.attr({d:e}):a.graph&&(a.tracker=h.path(e).attr({visibility:a.visible?"visible":"hidden",zIndex:2}).addClass(c?"highcharts-tracker-area": |
|
|
|
"highcharts-tracker-line").add(a.group),d.styledMode||a.tracker.attr({"stroke-linejoin":"round",stroke:z,fill:c?z:"none","stroke-width":a.graph.strokeWidth()+(c?0:2*m)}),[a.tracker,a.markerGroup].forEach(function(a){a.addClass("highcharts-tracker").on("mouseover",v).on("mouseout",function(a){g.onTrackerMouseOut(a)});b.cursor&&!d.styledMode&&a.css({cursor:b.cursor});if(w)a.on("touchstart",v)}));q(this,"afterDrawTracker")}};a.column&&(a.column.prototype.drawTracker=n.drawTrackerPoint);a.pie&&(a.pie.prototype.drawTracker= |
|
|
|
n.drawTrackerPoint);a.scatter&&(a.scatter.prototype.drawTracker=n.drawTrackerPoint);F(h.prototype,{setItemEvents:function(a,b,d){var e=this,k=e.chart.renderer.boxWrapper,g=a instanceof c,h="highcharts-legend-"+(g?"point":"series")+"-active",l=e.chart.styledMode;(d?b:a.legendGroup).on("mouseover",function(){a.visible&&e.allItems.forEach(function(e){a!==e&&e.setState("inactive",!g)});a.setState("hover");a.visible&&k.addClass(h);l||b.css(e.options.itemHoverStyle)}).on("mouseout",function(){e.chart.styledMode|| |
|
|
|
b.css(f(a.visible?e.itemStyle:e.itemHiddenStyle));e.allItems.forEach(function(e){a!==e&&e.setState("",!g)});k.removeClass(h);a.setState()}).on("click",function(b){var c=function(){a.setVisible&&a.setVisible();e.allItems.forEach(function(e){a!==e&&e.setState(a.visible?"inactive":"",!g)})};k.removeClass(h);b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):q(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=B("input",{type:"checkbox",className:"highcharts-legend-checkbox", |
|
|
|
checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);C(a.checkbox,"click",function(b){q(a.series||a,"checkboxClick",{checked:b.target.checked,item:a},function(){a.select()})})}});F(g.prototype,{showResetZoom:function(){function a(){b.zoomOut()}var b=this,c=z.lang,e=b.options.chart.resetZoomButton,f=e.theme,d=f.states,g="chart"===e.relativeTo||"spaceBox"===e.relativeTo?null:"plotBox";q(this,"beforeShowResetZoom",null,function(){b.resetZoomButton=b.renderer.button(c.resetZoom, |
|
|
|
null,null,a,f,d&&d.hover).attr({align:e.position.align,title:c.resetZoomTitle}).addClass("highcharts-reset-zoom").add().align(e.position,!1,g)});q(this,"afterShowResetZoom")},zoomOut:function(){q(this,"selection",{resetSelection:!0},this.zoom)},zoom:function(a){var b=this,c,e=b.pointer,f=!1,d=b.inverted?e.mouseDownX:e.mouseDownY;!a||a.resetSelection?(b.axes.forEach(function(a){c=a.zoom()}),e.initiated=!1):a.xAxis.concat(a.yAxis).forEach(function(a){var k=a.axis,g=b.inverted?k.left:k.top,h=b.inverted? |
|
|
|
g+k.width:g+k.height,l=k.isXAxis,u=!1;if(!l&&d>=g&&d<=h||l||!y(d))u=!0;e[l?"zoomX":"zoomY"]&&u&&(c=k.zoom(a.min,a.max),k.displayBtn&&(f=!0))});var g=b.resetZoomButton;f&&!g?b.showResetZoom():!f&&D(g)&&(b.resetZoomButton=g.destroy());c&&b.redraw(v(b.options.chart.animation,a&&a.animation,100>b.pointCount))},pan:function(a,b){var c=this,e=c.hoverPoints,f=c.options.chart,d;b="object"===typeof b?b:{enabled:b,type:"x"};f&&f.panning&&(f.panning=b);var g=b.type;q(this,"pan",{originalEvent:a},function(){e&& |
|
|
|
e.forEach(function(a){a.setState()});var b=[1];"xy"===g?b=[1,0]:"y"===g&&(b=[0]);b.forEach(function(e){var b=c[e?"xAxis":"yAxis"][0],f=b.options,g=b.horiz,k=a[g?"chartX":"chartY"];g=g?"mouseDownX":"mouseDownY";var h=c[g],l=(b.pointRange||0)/2,u=b.reversed&&!c.inverted||!b.reversed&&c.inverted?-1:1,r=b.getExtremes(),m=b.toValue(h-k,!0)+l*u;u=b.toValue(h+b.len-k,!0)-l*u;var t=u<m;h=t?u:m;m=t?m:u;u=Math.min(r.dataMin,l?r.min:b.toValue(b.toPixels(r.min)-b.minPixelPadding));l=Math.max(r.dataMax,l?r.max: |
|
|
|
b.toValue(b.toPixels(r.max)+b.minPixelPadding));if(!f.ordinal){e&&(f=u-h,0<f&&(m+=f,h=u),f=m-l,0<f&&(m=l,h-=f));if(b.series.length&&h!==r.min&&m!==r.max&&e||b.panningState&&h>=b.panningState.startMin&&m<=b.panningState.startMax)b.setExtremes(h,m,!1,!1,{trigger:"pan"}),d=!0;c[g]=k}});d&&c.redraw(!1);p(c.container,{cursor:"move"})})}});F(c.prototype,{select:function(a,b){var c=this,e=c.series,f=e.chart;this.selectedStaging=a=v(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected= |
|
|
|
c.options.selected=a;e.options.data[e.data.indexOf(c)]=c.options;c.setState(a&&"select");b||f.getSelectedPoints().forEach(function(a){var e=a.series;a.selected&&a!==c&&(a.selected=a.options.selected=!1,e.options.data[e.data.indexOf(a)]=a.options,a.setState(f.hoverPoints&&e.options.inactiveOtherPoints?"inactive":""),a.firePointEvent("unselect"))})});delete this.selectedStaging},onMouseOver:function(a){var b=this.series.chart,c=b.pointer;a=a?c.normalize(a):c.getChartCoordinatesFromPoint(this,b.inverted); |
|
|
|
c.runPointActions(a,this)},onMouseOut:function(){var a=this.series.chart;this.firePointEvent("mouseOut");this.series.options.inactiveOtherPoints||(a.hoverPoints||[]).forEach(function(a){a.setState()});a.hoverPoints=a.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var a=this,b=f(a.series.options.point,a.options).events;a.events=b;x(b,function(b,e){d.isFunction(b)&&C(a,e,b)});this.hasImportedEvents=!0}},setState:function(a,b){var c=this.series,e=this.state,f=c.options.states[a|| |
|
|
|
"normal"]||{},d=m[c.type].marker&&c.options.marker,g=d&&!1===d.enabled,h=d&&d.states&&d.states[a||"normal"]||{},l=!1===h.enabled,n=c.stateMarkerGraphic,t=this.marker||{},p=c.chart,w=c.halo,z,x=d&&c.markerAttribs;a=a||"";if(!(a===this.state&&!b||this.selected&&"select"!==a||!1===f.enabled||a&&(l||g&&!1===h.enabled)||a&&t.states&&t.states[a]&&!1===t.states[a].enabled)){this.state=a;x&&(z=c.markerAttribs(this,a));if(this.graphic){e&&this.graphic.removeClass("highcharts-point-"+e);a&&this.graphic.addClass("highcharts-point-"+ |
|
|
|
a);if(!p.styledMode){var B=c.pointAttribs(this,a);var y=v(p.options.chart.animation,f.animation);c.options.inactiveOtherPoints&&((this.dataLabels||[]).forEach(function(a){a&&a.animate({opacity:B.opacity},y)}),this.connector&&this.connector.animate({opacity:B.opacity},y));this.graphic.animate(B,y)}z&&this.graphic.animate(z,v(p.options.chart.animation,h.animation,d.animation));n&&n.hide()}else{if(a&&h){e=t.symbol||c.symbol;n&&n.currentSymbol!==e&&(n=n.destroy());if(z)if(n)n[b?"animate":"attr"]({x:z.x, |
|
|
|
y:z.y});else e&&(c.stateMarkerGraphic=n=p.renderer.symbol(e,z.x,z.y,z.width,z.height).add(c.markerGroup),n.currentSymbol=e);!p.styledMode&&n&&n.attr(c.pointAttribs(this,a))}n&&(n[a&&this.isInside?"show":"hide"](),n.element.point=this)}a=f.halo;f=(n=this.graphic||n)&&n.visibility||"inherit";a&&a.size&&n&&"hidden"!==f&&!this.isCluster?(w||(c.halo=w=p.renderer.path().add(n.parentGroup)),w.show()[b?"animate":"attr"]({d:this.haloPath(a.size)}),w.attr({"class":"highcharts-halo highcharts-color-"+v(this.colorIndex, |
|
|
|
c.colorIndex)+(this.className?" "+this.className:""),visibility:f,zIndex:-1}),w.point=this,p.styledMode||w.attr(F({fill:this.color||c.color,"fill-opacity":a.opacity},a.attributes))):w&&w.point&&w.point.haloPath&&w.animate({d:w.point.haloPath(0)},null,w.hide);q(this,"afterSetState")}},haloPath:function(a){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-a,this.plotY-a,2*a,2*a)}});F(b.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut(); |
|
|
|
this.options.events.mouseOver&&q(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,e=b.hoverPoint;b.hoverSeries=null;if(e)e.onMouseOut();this&&a.events.mouseOut&&q(this,"mouseOut");!c||this.stickyTracking||c.shared&&!this.noSharedTooltip||c.hide();b.series.forEach(function(a){a.setState("",!0)})},setState:function(a,b){var c=this,e=c.options,f=c.graph,d=e.inactiveOtherPoints,g=e.states,h=e.lineWidth,l=e.opacity,m=v(g[a|| |
|
|
|
"normal"]&&g[a||"normal"].animation,c.chart.options.chart.animation);e=0;a=a||"";if(c.state!==a&&([c.group,c.markerGroup,c.dataLabelsGroup].forEach(function(e){e&&(c.state&&e.removeClass("highcharts-series-"+c.state),a&&e.addClass("highcharts-series-"+a))}),c.state=a,!c.chart.styledMode)){if(g[a]&&!1===g[a].enabled)return;a&&(h=g[a].lineWidth||h+(g[a].lineWidthPlus||0),l=v(g[a].opacity,l));if(f&&!f.dashstyle)for(g={"stroke-width":h},f.animate(g,m);c["zone-graph-"+e];)c["zone-graph-"+e].attr(g),e+= |
|
|
|
1;d||[c.group,c.markerGroup,c.dataLabelsGroup,c.labelBySeries].forEach(function(a){a&&a.animate({opacity:l},m)})}b&&d&&c.points&&c.setAllPointsToState(a)},setAllPointsToState:function(a){this.points.forEach(function(b){b.setState&&b.setState(a)})},setVisible:function(a,b){var c=this,e=c.chart,f=c.legendItem,d=e.options.chart.ignoreHiddenSeries,g=c.visible;var h=(c.visible=a=c.options.visible=c.userOptions.visible="undefined"===typeof a?!g:a)?"show":"hide";["group","dataLabelsGroup","markerGroup", |
|
|
|
"tracker","tt"].forEach(function(a){if(c[a])c[a][h]()});if(e.hoverSeries===c||(e.hoverPoint&&e.hoverPoint.series)===c)c.onMouseOut();f&&e.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&e.series.forEach(function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)});c.linkedSeries.forEach(function(e){e.setVisible(a,!1)});d&&(e.isDirtyBox=!0);q(c,h);!1!==b&&e.redraw()},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=this.options.selected= |
|
|
|
"undefined"===typeof a?!this.selected:a;this.checkbox&&(this.checkbox.checked=a);q(this,a?"select":"unselect")},drawTracker:n.drawTrackerGraph})});K(y,"parts/Responsive.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.isArray,F=g.isObject,E=g.objectEach,D=g.pick,x=g.splat;g=d.Chart;g.prototype.setResponsive=function(g,x){var v=this.options.responsive,p=[],z=this.currentResponsive;!x&&v&&v.rules&&v.rules.forEach(function(g){"undefined"===typeof g._id&&(g._id=d.uniqueKey()); |
|
|
|
this.matchResponsiveRule(g,p)},this);x=d.merge.apply(0,p.map(function(g){return d.find(v.rules,function(d){return d._id===g}).chartOptions}));x.isResponsiveOptions=!0;p=p.toString()||void 0;p!==(z&&z.ruleIds)&&(z&&this.update(z.undoOptions,g,!0),p?(z=this.currentOptions(x),z.isResponsiveOptions=!0,this.currentResponsive={ruleIds:p,mergedOptions:x,undoOptions:z},this.update(x,g,!0)):this.currentResponsive=void 0)};g.prototype.matchResponsiveRule=function(d,g){var v=d.condition;(v.callback||function(){return this.chartWidth<= |
|
|
|
D(v.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=D(v.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=D(v.minWidth,0)&&this.chartHeight>=D(v.minHeight,0)}).call(this)&&g.push(d._id)};g.prototype.currentOptions=function(d){function g(d,m,p,w){var h;E(d,function(f,c){if(!w&&-1<v.collectionsWithUpdate.indexOf(c))for(f=x(f),p[c]=[],h=0;h<f.length;h++)m[c][h]&&(p[c][h]={},g(f[h],m[c][h],p[c][h],w+1));else F(f)?(p[c]=y(f)?[]:{},g(f,m[c]||{},p[c],w+1)):p[c]="undefined"===typeof m[c]?null:m[c]})}var v=this, |
|
|
|
p={};g(d,this.options,p,0);return p}});K(y,"masters/highcharts.src.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.extend;y(d,{animObject:g.animObject,arrayMax:g.arrayMax,arrayMin:g.arrayMin,attr:g.attr,correctFloat:g.correctFloat,defined:g.defined,destroyObjectProperties:g.destroyObjectProperties,discardElement:g.discardElement,erase:g.erase,extend:g.extend,extendClass:g.extendClass,isArray:g.isArray,isClass:g.isClass,isDOMElement:g.isDOMElement,isNumber:g.isNumber,isObject:g.isObject, |
|
|
|
isString:g.isString,numberFormat:g.numberFormat,objectEach:g.objectEach,offset:g.offset,pad:g.pad,pick:g.pick,pInt:g.pInt,relativeLength:g.relativeLength,setAnimation:g.setAnimation,splat:g.splat,syncTimeout:g.syncTimeout,wrap:g.wrap});return d});K(y,"parts/Scrollbar.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){function y(d,f,c){this.init(d,f,c)}var F=g.correctFloat,E=g.defined,D=g.destroyObjectProperties,x=g.pick,v=d.addEvent;g=d.Axis;var C=d.defaultOptions,B=d.fireEvent,p=d.hasTouch, |
|
|
|
z=d.merge,m=d.removeEvent,q,w={height:d.isTouchDevice?20:14,barBorderRadius:0,buttonBorderRadius:0,liveRedraw:void 0,margin:10,minWidth:6,step:.2,zIndex:3,barBackgroundColor:"#cccccc",barBorderWidth:1,barBorderColor:"#cccccc",buttonArrowColor:"#333333",buttonBackgroundColor:"#e6e6e6",buttonBorderColor:"#cccccc",buttonBorderWidth:1,rifleColor:"#333333",trackBackgroundColor:"#f2f2f2",trackBorderColor:"#f2f2f2",trackBorderWidth:1};C.scrollbar=z(!0,w,C.scrollbar);d.swapXY=q=function(d,f){var c=d.length; |
|
|
|
if(f)for(f=0;f<c;f+=3){var b=d[f+1];d[f+1]=d[f+2];d[f+2]=b}return d};y.prototype={init:function(d,f,c){this.scrollbarButtons=[];this.renderer=d;this.userOptions=f;this.options=z(w,f);this.chart=c;this.size=x(this.options.size,this.options.height);f.enabled&&(this.render(),this.initEvents(),this.addEvents())},render:function(){var d=this.renderer,f=this.options,c=this.size,b=this.chart.styledMode,a;this.group=a=d.g("scrollbar").attr({zIndex:f.zIndex,translateY:-99999}).add();this.track=d.rect().addClass("highcharts-scrollbar-track").attr({x:0, |
|
|
|
r:f.trackBorderRadius||0,height:c,width:c}).add(a);b||this.track.attr({fill:f.trackBackgroundColor,stroke:f.trackBorderColor,"stroke-width":f.trackBorderWidth});this.trackBorderWidth=this.track.strokeWidth();this.track.attr({y:-this.trackBorderWidth%2/2});this.scrollbarGroup=d.g().add(a);this.scrollbar=d.rect().addClass("highcharts-scrollbar-thumb").attr({height:c,width:c,r:f.barBorderRadius||0}).add(this.scrollbarGroup);this.scrollbarRifles=d.path(q(["M",-3,c/4,"L",-3,2*c/3,"M",0,c/4,"L",0,2*c/3, |
|
|
|
"M",3,c/4,"L",3,2*c/3],f.vertical)).addClass("highcharts-scrollbar-rifles").add(this.scrollbarGroup);b||(this.scrollbar.attr({fill:f.barBackgroundColor,stroke:f.barBorderColor,"stroke-width":f.barBorderWidth}),this.scrollbarRifles.attr({stroke:f.rifleColor,"stroke-width":1}));this.scrollbarStrokeWidth=this.scrollbar.strokeWidth();this.scrollbarGroup.translate(-this.scrollbarStrokeWidth%2/2,-this.scrollbarStrokeWidth%2/2);this.drawScrollbarButton(0);this.drawScrollbarButton(1)},position:function(d, |
|
|
|
f,c,b){var a=this.options.vertical,g=0,h=this.rendered?"animate":"attr";this.x=d;this.y=f+this.trackBorderWidth;this.width=c;this.xOffset=this.height=b;this.yOffset=g;a?(this.width=this.yOffset=c=g=this.size,this.xOffset=f=0,this.barWidth=b-2*c,this.x=d+=this.options.margin):(this.height=this.xOffset=b=f=this.size,this.barWidth=c-2*b,this.y+=this.options.margin);this.group[h]({translateX:d,translateY:this.y});this.track[h]({width:c,height:b});this.scrollbarButtons[1][h]({translateX:a?0:c-f,translateY:a? |
|
|
|
b-g:0})},drawScrollbarButton:function(d){var f=this.renderer,c=this.scrollbarButtons,b=this.options,a=this.size;var g=f.g().add(this.group);c.push(g);g=f.rect().addClass("highcharts-scrollbar-button").add(g);this.chart.styledMode||g.attr({stroke:b.buttonBorderColor,"stroke-width":b.buttonBorderWidth,fill:b.buttonBackgroundColor});g.attr(g.crisp({x:-.5,y:-.5,width:a+1,height:a+1,r:b.buttonBorderRadius},g.strokeWidth()));g=f.path(q(["M",a/2+(d?-1:1),a/2-3,"L",a/2+(d?-1:1),a/2+3,"L",a/2+(d?2:-2),a/2], |
|
|
|
b.vertical)).addClass("highcharts-scrollbar-arrow").add(c[d]);this.chart.styledMode||g.attr({fill:b.buttonArrowColor})},setRange:function(d,f){var c=this.options,b=c.vertical,a=c.minWidth,g=this.barWidth,h,m=!this.rendered||this.hasDragged||this.chart.navigator&&this.chart.navigator.hasDragged?"attr":"animate";if(E(g)){d=Math.max(d,0);var p=Math.ceil(g*d);this.calculatedWidth=h=F(g*Math.min(f,1)-p);h<a&&(p=(g-a+h)*d,h=a);a=Math.floor(p+this.xOffset+this.yOffset);g=h/2-.5;this.from=d;this.to=f;b?(this.scrollbarGroup[m]({translateY:a}), |
|
|
|
this.scrollbar[m]({height:h}),this.scrollbarRifles[m]({translateY:g}),this.scrollbarTop=a,this.scrollbarLeft=0):(this.scrollbarGroup[m]({translateX:a}),this.scrollbar[m]({width:h}),this.scrollbarRifles[m]({translateX:g}),this.scrollbarLeft=a,this.scrollbarTop=0);12>=h?this.scrollbarRifles.hide():this.scrollbarRifles.show(!0);!1===c.showFull&&(0>=d&&1<=f?this.group.hide():this.group.show());this.rendered=!0}},initEvents:function(){var d=this;d.mouseMoveHandler=function(f){var c=d.chart.pointer.normalize(f), |
|
|
|
b=d.options.vertical?"chartY":"chartX",a=d.initPositions;!d.grabbedCenter||f.touches&&0===f.touches[0][b]||(c=d.cursorToScrollbarPosition(c)[b],b=d[b],b=c-b,d.hasDragged=!0,d.updatePosition(a[0]+b,a[1]+b),d.hasDragged&&B(d,"changed",{from:d.from,to:d.to,trigger:"scrollbar",DOMType:f.type,DOMEvent:f}))};d.mouseUpHandler=function(f){d.hasDragged&&B(d,"changed",{from:d.from,to:d.to,trigger:"scrollbar",DOMType:f.type,DOMEvent:f});d.grabbedCenter=d.hasDragged=d.chartX=d.chartY=null};d.mouseDownHandler= |
|
|
|
function(f){f=d.chart.pointer.normalize(f);f=d.cursorToScrollbarPosition(f);d.chartX=f.chartX;d.chartY=f.chartY;d.initPositions=[d.from,d.to];d.grabbedCenter=!0};d.buttonToMinClick=function(f){var c=F(d.to-d.from)*d.options.step;d.updatePosition(F(d.from-c),F(d.to-c));B(d,"changed",{from:d.from,to:d.to,trigger:"scrollbar",DOMEvent:f})};d.buttonToMaxClick=function(f){var c=(d.to-d.from)*d.options.step;d.updatePosition(d.from+c,d.to+c);B(d,"changed",{from:d.from,to:d.to,trigger:"scrollbar",DOMEvent:f})}; |
|
|
|
d.trackClick=function(f){var c=d.chart.pointer.normalize(f),b=d.to-d.from,a=d.y+d.scrollbarTop,g=d.x+d.scrollbarLeft;d.options.vertical&&c.chartY>a||!d.options.vertical&&c.chartX>g?d.updatePosition(d.from+b,d.to+b):d.updatePosition(d.from-b,d.to-b);B(d,"changed",{from:d.from,to:d.to,trigger:"scrollbar",DOMEvent:f})}},cursorToScrollbarPosition:function(d){var f=this.options;f=f.minWidth>this.calculatedWidth?f.minWidth:0;return{chartX:(d.chartX-this.x-this.xOffset)/(this.barWidth-f),chartY:(d.chartY- |
|
|
|
this.y-this.yOffset)/(this.barWidth-f)}},updatePosition:function(d,f){1<f&&(d=F(1-F(f-d)),f=1);0>d&&(f=F(f-d),d=0);this.from=d;this.to=f},update:function(d){this.destroy();this.init(this.chart.renderer,z(!0,this.options,d),this.chart)},addEvents:function(){var d=this.options.inverted?[1,0]:[0,1],f=this.scrollbarButtons,c=this.scrollbarGroup.element,b=this.mouseDownHandler,a=this.mouseMoveHandler,g=this.mouseUpHandler;d=[[f[d[0]].element,"click",this.buttonToMinClick],[f[d[1]].element,"click",this.buttonToMaxClick], |
|
|
|
[this.track.element,"click",this.trackClick],[c,"mousedown",b],[c.ownerDocument,"mousemove",a],[c.ownerDocument,"mouseup",g]];p&&d.push([c,"touchstart",b],[c.ownerDocument,"touchmove",a],[c.ownerDocument,"touchend",g]);d.forEach(function(a){v.apply(null,a)});this._events=d},removeEvents:function(){this._events.forEach(function(d){m.apply(null,d)});this._events.length=0},destroy:function(){var d=this.chart.scroller;this.removeEvents();["track","scrollbarRifles","scrollbar","scrollbarGroup","group"].forEach(function(d){this[d]&& |
|
|
|
this[d].destroy&&(this[d]=this[d].destroy())},this);d&&this===d.scrollbar&&(d.scrollbar=null,D(d.scrollbarButtons))}};d.Scrollbar||(v(g,"afterInit",function(){var g=this;g.options&&g.options.scrollbar&&g.options.scrollbar.enabled&&(g.options.scrollbar.vertical=!g.horiz,g.options.startOnTick=g.options.endOnTick=!1,g.scrollbar=new y(g.chart.renderer,g.options.scrollbar,g.chart),v(g.scrollbar,"changed",function(f){var c=Math.min(x(g.options.min,g.min),g.min,g.dataMin),b=Math.max(x(g.options.max,g.max), |
|
|
|
g.max,g.dataMax)-c;if(g.horiz&&!g.reversed||!g.horiz&&g.reversed){var a=c+b*this.to;c+=b*this.from}else a=c+b*(1-this.from),c+=b*(1-this.to);x(this.options.liveRedraw,d.svg&&!d.isTouchDevice&&!this.chart.isBoosting)||"mouseup"===f.DOMType||!E(f.DOMType)?g.setExtremes(c,a,!0,"mousemove"!==f.DOMType,f):this.setRange(this.from,this.to)}))}),v(g,"afterRender",function(){var d=Math.min(x(this.options.min,this.min),this.min,x(this.dataMin,this.min)),f=Math.max(x(this.options.max,this.max),this.max,x(this.dataMax, |
|
|
|
this.max)),c=this.scrollbar,b=this.axisTitleMargin+(this.titleOffset||0),a=this.chart.scrollbarsOffsets,g=this.options.margin||0;c&&(this.horiz?(this.opposite||(a[1]+=b),c.position(this.left,this.top+this.height+2+a[1]-(this.opposite?g:0),this.width,this.height),this.opposite||(a[1]+=g),b=1):(this.opposite&&(a[0]+=b),c.position(this.left+this.width+2+a[0]-(this.opposite?0:g),this.top,this.width,this.height),this.opposite&&(a[0]+=g),b=0),a[b]+=c.size+c.options.margin,isNaN(d)||isNaN(f)||!E(this.min)|| |
|
|
|
!E(this.max)||this.min===this.max?c.setRange(0,1):(a=(this.min-d)/(f-d),d=(this.max-d)/(f-d),this.horiz&&!this.reversed||!this.horiz&&this.reversed?c.setRange(a,d):c.setRange(1-d,1-a)))}),v(g,"afterGetOffset",function(){var d=this.horiz?2:1,f=this.scrollbar;f&&(this.chart.scrollbarsOffsets=[0,0],this.chart.axisOffset[d]+=f.size+f.options.margin)}),d.Scrollbar=y)});K(y,"parts/Navigator.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){function y(a){this.init(a)}var F=g.clamp,E=g.correctFloat, |
|
|
|
D=g.defined,x=g.destroyObjectProperties,v=g.erase,C=g.extend,B=g.isArray,p=g.isNumber,z=g.pick,m=g.splat,q=d.addEvent,w=d.Axis;g=d.Chart;var h=d.color,f=d.defaultOptions,c=d.hasTouch,b=d.isTouchDevice,a=d.merge,l=d.removeEvent,n=d.Scrollbar,t=d.Series,I=function(a){for(var e=[],b=1;b<arguments.length;b++)e[b-1]=arguments[b];e=[].filter.call(e,p);if(e.length)return Math[a].apply(0,e)};var r="undefined"===typeof d.seriesTypes.areaspline?"line":"areaspline";C(f,{navigator:{height:40,margin:25,maskInside:!0, |
|
|
|
handles:{width:7,height:15,symbols:["navigator-handle","navigator-handle"],enabled:!0,lineWidth:1,backgroundColor:"#f2f2f2",borderColor:"#999999"},maskFill:h("#6685c2").setOpacity(.3).get(),outlineColor:"#cccccc",outlineWidth:1,series:{type:r,fillOpacity:.05,lineWidth:1,compare:null,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:[["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,3,4]],["week",[1,2,3]],["month",[1,3,6]],["year",null]]},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",className:"highcharts-navigator-series",lineColor:null,marker:{enabled:!1},threshold:null},xAxis:{overscroll:0,className:"highcharts-navigator-xaxis",tickLength:0,lineWidth:0,gridLineColor:"#e6e6e6",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#999999"},x:3,y:-4},crosshair:!1},yAxis:{className:"highcharts-navigator-yaxis",gridLineWidth:0,startOnTick:!1, |
|
|
|
endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickLength:0,tickWidth:0}}});d.Renderer.prototype.symbols["navigator-handle"]=function(a,b,c,d,f){a=f.width/2;b=Math.round(a/3)+.5;f=f.height;return["M",-a-1,.5,"L",a,.5,"L",a,f+.5,"L",-a-1,f+.5,"L",-a-1,.5,"M",-b,4,"L",-b,f-3,"M",b-1,4,"L",b-1,f-3]};w.prototype.toFixedRange=function(a,b,c,d){var e=this.chart&&this.chart.fixedRange,f=(this.pointRange||0)/2;a=z(c,this.translate(a,!0,!this.horiz));b=z(d,this.translate(b, |
|
|
|
!0,!this.horiz));var g=e&&(b-a)/e;D(c)||(a=E(a+f));D(d)||(b=E(b-f));.7<g&&1.3>g&&(d?a=b-e:b=a+e);p(a)&&p(b)||(a=b=void 0);return{min:a,max:b}};y.prototype={drawHandle:function(a,b,c,d){var e=this.navigatorOptions.handles.height;this.handles[b][d](c?{translateX:Math.round(this.left+this.height/2),translateY:Math.round(this.top+parseInt(a,10)+.5-e)}:{translateX:Math.round(this.left+parseInt(a,10)),translateY:Math.round(this.top+this.height/2-e/2-1)})},drawOutline:function(a,b,c,d){var e=this.navigatorOptions.maskInside, |
|
|
|
f=this.outline.strokeWidth(),g=f/2;f=f%2/2;var k=this.outlineHeight,h=this.scrollbarHeight,l=this.size,u=this.left-h,m=this.top;c?(u-=g,c=m+b+f,b=m+a+f,a=["M",u+k,m-h-f,"L",u+k,c,"L",u,c,"L",u,b,"L",u+k,b,"L",u+k,m+l+h].concat(e?["M",u+k,c-g,"L",u+k,b+g]:[])):(a+=u+h-f,b+=u+h-f,m+=g,a=["M",u,m,"L",a,m,"L",a,m+k,"L",b,m+k,"L",b,m,"L",u+l+2*h,m].concat(e?["M",a-g,m,"L",b+g,m]:[]));this.outline[d]({d:a})},drawMasks:function(a,b,c,d){var e=this.left,f=this.top,g=this.height;if(c){var k=[e,e,e];var h= |
|
|
|
[f,f+a,f+b];var l=[g,g,g];var u=[a,b-a,this.size-b]}else k=[e,e+a,e+b],h=[f,f,f],l=[a,b-a,this.size-b],u=[g,g,g];this.shades.forEach(function(a,b){a[d]({x:k[b],y:h[b],width:l[b],height:u[b]})})},renderElements:function(){var a=this,b=a.navigatorOptions,c=b.maskInside,d=a.chart,f=d.renderer,g,h={cursor:d.inverted?"ns-resize":"ew-resize"};a.navigatorGroup=g=f.g("navigator").attr({zIndex:8,visibility:"hidden"}).add();[!c,c,!c].forEach(function(e,c){a.shades[c]=f.rect().addClass("highcharts-navigator-mask"+ |
|
|
|
(1===c?"-inside":"-outside")).add(g);d.styledMode||a.shades[c].attr({fill:e?b.maskFill:"rgba(0,0,0,0)"}).css(1===c&&h)});a.outline=f.path().addClass("highcharts-navigator-outline").add(g);d.styledMode||a.outline.attr({"stroke-width":b.outlineWidth,stroke:b.outlineColor});b.handles.enabled&&[0,1].forEach(function(e){b.handles.inverted=d.inverted;a.handles[e]=f.symbol(b.handles.symbols[e],-b.handles.width/2-1,0,b.handles.width,b.handles.height,b.handles);a.handles[e].attr({zIndex:7-e}).addClass("highcharts-navigator-handle highcharts-navigator-handle-"+ |
|
|
|
["left","right"][e]).add(g);if(!d.styledMode){var c=b.handles;a.handles[e].attr({fill:c.backgroundColor,stroke:c.borderColor,"stroke-width":c.lineWidth}).css(h)}})},update:function(b){(this.series||[]).forEach(function(a){a.baseSeries&&delete a.baseSeries.navigatorSeries});this.destroy();a(!0,this.chart.options.navigator,this.options,b);this.init(this.chart)},render:function(a,b,c,d){var e=this.chart,f=this.scrollbarHeight,g,k=this.xAxis,h=k.pointRange||0;var l=k.fake?e.xAxis[0]:k;var u=this.navigatorEnabled, |
|
|
|
m,n=this.rendered;var r=e.inverted;var t=e.xAxis[0].minRange,q=e.xAxis[0].options.maxRange;if(!this.hasDragged||D(c)){a=E(a-h/2);b=E(b+h/2);if(!p(a)||!p(b))if(n)c=0,d=z(k.width,l.width);else return;this.left=z(k.left,e.plotLeft+f+(r?e.plotWidth:0));this.size=m=g=z(k.len,(r?e.plotHeight:e.plotWidth)-2*f);e=r?f:g+2*f;c=z(c,k.toPixels(a,!0));d=z(d,k.toPixels(b,!0));p(c)&&Infinity!==Math.abs(c)||(c=0,d=e);a=k.toValue(c,!0);b=k.toValue(d,!0);var w=Math.abs(E(b-a));w<t?this.grabbedLeft?c=k.toPixels(b-t- |
|
|
|
h,!0):this.grabbedRight&&(d=k.toPixels(a+t+h,!0)):D(q)&&E(w-h)>q&&(this.grabbedLeft?c=k.toPixels(b-q-h,!0):this.grabbedRight&&(d=k.toPixels(a+q+h,!0)));this.zoomedMax=F(Math.max(c,d),0,m);this.zoomedMin=F(this.fixedWidth?this.zoomedMax-this.fixedWidth:Math.min(c,d),0,m);this.range=this.zoomedMax-this.zoomedMin;m=Math.round(this.zoomedMax);c=Math.round(this.zoomedMin);u&&(this.navigatorGroup.attr({visibility:"visible"}),n=n&&!this.hasDragged?"animate":"attr",this.drawMasks(c,m,r,n),this.drawOutline(c, |
|
|
|
m,r,n),this.navigatorOptions.handles.enabled&&(this.drawHandle(c,0,r,n),this.drawHandle(m,1,r,n)));this.scrollbar&&(r?(r=this.top-f,l=this.left-f+(u||!l.opposite?0:(l.titleOffset||0)+l.axisTitleMargin),f=g+2*f):(r=this.top+(u?this.height:-f),l=this.left-f),this.scrollbar.position(l,r,e,f),this.scrollbar.setRange(this.zoomedMin/(g||1),this.zoomedMax/(g||1)));this.rendered=!0}},addMouseEvents:function(){var a=this,b=a.chart,d=b.container,f=[],g,h;a.mouseMoveHandler=g=function(b){a.onMouseMove(b)};a.mouseUpHandler= |
|
|
|
h=function(b){a.onMouseUp(b)};f=a.getPartsEvents("mousedown");f.push(q(b.renderTo,"mousemove",g),q(d.ownerDocument,"mouseup",h));c&&(f.push(q(b.renderTo,"touchmove",g),q(d.ownerDocument,"touchend",h)),f.concat(a.getPartsEvents("touchstart")));a.eventsToUnbind=f;a.series&&a.series[0]&&f.push(q(a.series[0].xAxis,"foundExtremes",function(){b.navigator.modifyNavigatorAxisExtremes()}))},getPartsEvents:function(a){var b=this,e=[];["shades","handles"].forEach(function(c){b[c].forEach(function(d,f){e.push(q(d.element, |
|
|
|
a,function(a){b[c+"Mousedown"](a,f)}))})});return e},shadesMousedown:function(a,b){a=this.chart.pointer.normalize(a);var e=this.chart,c=this.xAxis,d=this.zoomedMin,f=this.left,g=this.size,k=this.range,h=a.chartX;e.inverted&&(h=a.chartY,f=this.top);if(1===b)this.grabbedCenter=h,this.fixedWidth=k,this.dragOffset=h-d;else{a=h-f-k/2;if(0===b)a=Math.max(0,a);else if(2===b&&a+k>=g)if(a=g-k,this.reversedExtremes){a-=k;var l=this.getUnionExtremes().dataMin}else var m=this.getUnionExtremes().dataMax;a!==d&& |
|
|
|
(this.fixedWidth=k,b=c.toFixedRange(a,a+k,l,m),D(b.min)&&e.xAxis[0].setExtremes(Math.min(b.min,b.max),Math.max(b.min,b.max),!0,null,{trigger:"navigator"}))}},handlesMousedown:function(a,b){this.chart.pointer.normalize(a);a=this.chart;var e=a.xAxis[0],c=this.reversedExtremes;0===b?(this.grabbedLeft=!0,this.otherHandlePos=this.zoomedMax,this.fixedExtreme=c?e.min:e.max):(this.grabbedRight=!0,this.otherHandlePos=this.zoomedMin,this.fixedExtreme=c?e.max:e.min);a.fixedRange=null},onMouseMove:function(a){var e= |
|
|
|
this,c=e.chart,f=e.left,g=e.navigatorSize,h=e.range,l=e.dragOffset,m=c.inverted;a.touches&&0===a.touches[0].pageX||(a=c.pointer.normalize(a),c=a.chartX,m&&(f=e.top,c=a.chartY),e.grabbedLeft?(e.hasDragged=!0,e.render(0,0,c-f,e.otherHandlePos)):e.grabbedRight?(e.hasDragged=!0,e.render(0,0,e.otherHandlePos,c-f)):e.grabbedCenter&&(e.hasDragged=!0,c<l?c=l:c>g+l-h&&(c=g+l-h),e.render(0,0,c-l,c-l+h)),e.hasDragged&&e.scrollbar&&z(e.scrollbar.options.liveRedraw,d.svg&&!b&&!this.chart.isBoosting)&&(a.DOMType= |
|
|
|
a.type,setTimeout(function(){e.onMouseUp(a)},0)))},onMouseUp:function(a){var b=this.chart,e=this.xAxis,c=this.scrollbar,d=a.DOMEvent||a;if(this.hasDragged&&(!c||!c.hasDragged)||"scrollbar"===a.trigger){c=this.getUnionExtremes();if(this.zoomedMin===this.otherHandlePos)var f=this.fixedExtreme;else if(this.zoomedMax===this.otherHandlePos)var g=this.fixedExtreme;this.zoomedMax===this.size&&(g=this.reversedExtremes?c.dataMin:c.dataMax);0===this.zoomedMin&&(f=this.reversedExtremes?c.dataMax:c.dataMin); |
|
|
|
e=e.toFixedRange(this.zoomedMin,this.zoomedMax,f,g);D(e.min)&&b.xAxis[0].setExtremes(Math.min(e.min,e.max),Math.max(e.min,e.max),!0,this.hasDragged?!1:null,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:d})}"mousemove"!==a.DOMType&&"touchmove"!==a.DOMType&&(this.grabbedLeft=this.grabbedRight=this.grabbedCenter=this.fixedWidth=this.fixedExtreme=this.otherHandlePos=this.hasDragged=this.dragOffset=null)},removeEvents:function(){this.eventsToUnbind&&(this.eventsToUnbind.forEach(function(a){a()}), |
|
|
|
this.eventsToUnbind=void 0);this.removeBaseSeriesEvents()},removeBaseSeriesEvents:function(){var a=this.baseSeries||[];this.navigatorEnabled&&a[0]&&(!1!==this.navigatorOptions.adaptToUpdatedData&&a.forEach(function(a){l(a,"updatedData",this.updatedDataHandler)},this),a[0].xAxis&&l(a[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes))},init:function(b){var e=b.options,c=e.navigator,d=c.enabled,f=e.scrollbar,g=f.enabled;e=d?c.height:0;var h=g?f.height:0;this.handles=[];this.shades=[];this.chart= |
|
|
|
b;this.setBaseSeries();this.height=e;this.scrollbarHeight=h;this.scrollbarEnabled=g;this.navigatorEnabled=d;this.navigatorOptions=c;this.scrollbarOptions=f;this.outlineHeight=e+h;this.opposite=z(c.opposite,!(d||!b.inverted));var l=this;d=l.baseSeries;f=b.xAxis.length;g=b.yAxis.length;var m=d&&d[0]&&d[0].xAxis||b.xAxis[0]||{options:{}};b.isDirtyBox=!0;l.navigatorEnabled?(l.xAxis=new w(b,a({breaks:m.options.breaks,ordinal:m.options.ordinal},c.xAxis,{id:"navigator-x-axis",yAxis:"navigator-y-axis",isX:!0, |
|
|
|
type:"datetime",index:f,isInternal:!0,offset:0,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1},b.inverted?{offsets:[h,0,-h,0],width:e}:{offsets:[0,-h,0,h],height:e})),l.yAxis=new w(b,a(c.yAxis,{id:"navigator-y-axis",alignTicks:!1,offset:0,index:g,isInternal:!0,zoomEnabled:!1},b.inverted?{width:e}:{height:e})),d||c.series.data?l.updateNavigatorSeries(!1):0===b.series.length&&(l.unbindRedraw=q(b,"beforeRedraw",function(){0<b.series.length&&!l.series&&(l.setBaseSeries(), |
|
|
|
l.unbindRedraw())})),l.reversedExtremes=b.inverted&&!l.xAxis.reversed||!b.inverted&&l.xAxis.reversed,l.renderElements(),l.addMouseEvents()):l.xAxis={translate:function(a,e){var c=b.xAxis[0],d=c.getExtremes(),f=c.len-2*h,g=I("min",c.options.min,d.dataMin);c=I("max",c.options.max,d.dataMax)-g;return e?a*c/f+g:f*(a-g)/c},toPixels:function(a){return this.translate(a)},toValue:function(a){return this.translate(a,!0)},toFixedRange:w.prototype.toFixedRange,fake:!0};b.options.scrollbar.enabled&&(b.scrollbar= |
|
|
|
l.scrollbar=new n(b.renderer,a(b.options.scrollbar,{margin:l.navigatorEnabled?0:10,vertical:b.inverted}),b),q(l.scrollbar,"changed",function(a){var e=l.size,c=e*this.to;e*=this.from;l.hasDragged=l.scrollbar.hasDragged;l.render(0,0,e,c);(b.options.scrollbar.liveRedraw||"mousemove"!==a.DOMType&&"touchmove"!==a.DOMType)&&setTimeout(function(){l.onMouseUp(a)})}));l.addBaseSeriesEvents();l.addChartEvents()},getUnionExtremes:function(a){var b=this.chart.xAxis[0],e=this.xAxis,c=e.options,d=b.options,f;a&& |
|
|
|
null===b.dataMin||(f={dataMin:z(c&&c.min,I("min",d.min,b.dataMin,e.dataMin,e.min)),dataMax:z(c&&c.max,I("max",d.max,b.dataMax,e.dataMax,e.max))});return f},setBaseSeries:function(a,b){var e=this.chart,c=this.baseSeries=[];a=a||e.options&&e.options.navigator.baseSeries||(e.series.length?d.find(e.series,function(a){return!a.options.isInternal}).index:0);(e.series||[]).forEach(function(b,e){b.options.isInternal||!b.options.showInNavigator&&(e!==a&&b.options.id!==a||!1===b.options.showInNavigator)||c.push(b)}); |
|
|
|
this.xAxis&&!this.xAxis.fake&&this.updateNavigatorSeries(!0,b)},updateNavigatorSeries:function(b,c){var e=this,d=e.chart,g=e.baseSeries,k,h,n=e.navigatorOptions.series,r,t={enableMouseTracking:!1,index:null,linkedTo:null,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",showInLegend:!1,stacking:!1,isInternal:!0,states:{inactive:{opacity:1}}},p=e.series=(e.series||[]).filter(function(a){var b=a.baseSeries;return 0>g.indexOf(b)?(b&&(l(b,"updatedData",e.updatedDataHandler),delete b.navigatorSeries), |
|
|
|
a.chart&&a.destroy(),!1):!0});g&&g.length&&g.forEach(function(b){var l=b.navigatorSeries,m=C({color:b.color,visible:b.visible},B(n)?f.navigator.series:n);l&&!1===e.navigatorOptions.adaptToUpdatedData||(t.name="Navigator "+g.length,k=b.options||{},r=k.navigatorOptions||{},h=a(k,t,m,r),h.pointRange=z(m.pointRange,r.pointRange,f.plotOptions[h.type||"line"].pointRange),m=r.data||m.data,e.hasNavigatorData=e.hasNavigatorData||!!m,h.data=m||k.data&&k.data.slice(0),l&&l.options?l.update(h,c):(b.navigatorSeries= |
|
|
|
d.initSeries(h),b.navigatorSeries.baseSeries=b,p.push(b.navigatorSeries)))});if(n.data&&(!g||!g.length)||B(n))e.hasNavigatorData=!1,n=m(n),n.forEach(function(b,c){t.name="Navigator "+(p.length+1);h=a(f.navigator.series,{color:d.series[c]&&!d.series[c].options.isInternal&&d.series[c].color||d.options.colors[c]||d.options.colors[0]},t,b);h.data=b.data;h.data&&(e.hasNavigatorData=!0,p.push(d.initSeries(h)))});b&&this.addBaseSeriesEvents()},addBaseSeriesEvents:function(){var a=this,b=a.baseSeries||[]; |
|
|
|
b[0]&&b[0].xAxis&&q(b[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes);b.forEach(function(b){q(b,"show",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!0,!1)});q(b,"hide",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!1,!1)});!1!==this.navigatorOptions.adaptToUpdatedData&&b.xAxis&&q(b,"updatedData",this.updatedDataHandler);q(b,"remove",function(){this.navigatorSeries&&(v(a.series,this.navigatorSeries),D(this.navigatorSeries.options)&&this.navigatorSeries.remove(!1), |
|
|
|
delete this.navigatorSeries)})},this)},getBaseSeriesMin:function(a){return this.baseSeries.reduce(function(a,b){return Math.min(a,b.xData?b.xData[0]:a)},a)},modifyNavigatorAxisExtremes:function(){var a=this.xAxis,b;"undefined"!==typeof a.getExtremes&&(!(b=this.getUnionExtremes(!0))||b.dataMin===a.min&&b.dataMax===a.max||(a.min=b.dataMin,a.max=b.dataMax))},modifyBaseAxisExtremes:function(){var a=this.chart.navigator,b=this.getExtremes(),c=b.dataMin,d=b.dataMax;b=b.max-b.min;var f=a.stickToMin,g=a.stickToMax, |
|
|
|
h=z(this.options.overscroll,0),l=a.series&&a.series[0],m=!!this.setExtremes;if(!this.eventArgs||"rangeSelectorButton"!==this.eventArgs.trigger){if(f){var n=c;var r=n+b}g&&(r=d+h,f||(n=Math.max(r-b,a.getBaseSeriesMin(l&&l.xData?l.xData[0]:-Number.MAX_VALUE))));m&&(f||g)&&p(n)&&(this.min=this.userMin=n,this.max=this.userMax=r)}a.stickToMin=a.stickToMax=null},updatedDataHandler:function(){var a=this.chart.navigator,b=this.navigatorSeries,c=a.getBaseSeriesMin(this.xData[0]);a.stickToMax=a.reversedExtremes? |
|
|
|
0===Math.round(a.zoomedMin):Math.round(a.zoomedMax)>=Math.round(a.size);a.stickToMin=p(this.xAxis.min)&&this.xAxis.min<=c&&(!this.chart.fixedRange||!a.stickToMax);b&&!a.hasNavigatorData&&(b.options.pointStart=this.xData[0],b.setData(this.options.data,!1,null,!1))},addChartEvents:function(){this.eventsToUnbind||(this.eventsToUnbind=[]);this.eventsToUnbind.push(q(this.chart,"redraw",function(){var a=this.navigator,b=a&&(a.baseSeries&&a.baseSeries[0]&&a.baseSeries[0].xAxis||a.scrollbar&&this.xAxis[0]); |
|
|
|
b&&a.render(b.min,b.max)}),q(this.chart,"getMargins",function(){var a=this.navigator,b=a.opposite?"plotTop":"marginBottom";this.inverted&&(b=a.opposite?"marginRight":"plotLeft");this[b]=(this[b]||0)+(a.navigatorEnabled||!this.inverted?a.outlineHeight:0)+a.navigatorOptions.margin}))},destroy:function(){this.removeEvents();this.xAxis&&(v(this.chart.xAxis,this.xAxis),v(this.chart.axes,this.xAxis));this.yAxis&&(v(this.chart.yAxis,this.yAxis),v(this.chart.axes,this.yAxis));(this.series||[]).forEach(function(a){a.destroy&& |
|
|
|
a.destroy()});"series xAxis yAxis shades outline scrollbarTrack scrollbarRifles scrollbarGroup scrollbar navigatorGroup rendered".split(" ").forEach(function(a){this[a]&&this[a].destroy&&this[a].destroy();this[a]=null},this);[this.handles].forEach(function(a){x(a)},this)}};d.Navigator||(d.Navigator=y,q(w,"zoom",function(a){var e=this.chart.options,c=e.chart.zoomType,d=e.chart.pinchType,f=e.navigator;e=e.rangeSelector;this.isXAxis&&(f&&f.enabled||e&&e.enabled)&&("y"===c?a.zoomed=!1:(!b&&"xy"===c|| |
|
|
|
b&&"xy"===d)&&this.options.range&&(c=this.previousZoom,D(a.newMin)?this.previousZoom=[this.min,this.max]:c&&(a.newMin=c[0],a.newMax=c[1],delete this.previousZoom)));"undefined"!==typeof a.zoomed&&a.preventDefault()}),q(g,"beforeShowResetZoom",function(){var a=this.options,c=a.navigator,d=a.rangeSelector;if((c&&c.enabled||d&&d.enabled)&&(!b&&"x"===a.chart.zoomType||b&&"x"===a.chart.pinchType))return!1}),q(g,"beforeRender",function(){var a=this.options;if(a.navigator.enabled||a.scrollbar.enabled)this.scroller= |
|
|
|
this.navigator=new y(this)}),q(g,"afterSetChartSize",function(){var a=this.legend,b=this.navigator;if(b){var c=a&&a.options;var d=b.xAxis;var f=b.yAxis;var g=b.scrollbarHeight;this.inverted?(b.left=b.opposite?this.chartWidth-g-b.height:this.spacing[3]+g,b.top=this.plotTop+g):(b.left=this.plotLeft+g,b.top=b.navigatorOptions.top||this.chartHeight-b.height-g-this.spacing[2]-(this.rangeSelector&&this.extraBottomMargin?this.rangeSelector.getHeight():0)-(c&&"bottom"===c.verticalAlign&&c.enabled&&!c.floating? |
|
|
|
a.legendHeight+z(c.margin,10):0)-(this.titleOffset?this.titleOffset[2]:0));d&&f&&(this.inverted?d.options.left=f.options.left=b.left:d.options.top=f.options.top=b.top,d.setAxisSize(),f.setAxisSize())}}),q(g,"update",function(b){var e=b.options.navigator||{},c=b.options.scrollbar||{};this.navigator||this.scroller||!e.enabled&&!c.enabled||(a(!0,this.options.navigator,e),a(!0,this.options.scrollbar,c),delete b.options.navigator,delete b.options.scrollbar)}),q(g,"afterUpdate",function(a){this.navigator|| |
|
|
|
this.scroller||!this.options.navigator.enabled&&!this.options.scrollbar.enabled||(this.scroller=this.navigator=new y(this),z(a.redraw,!0)&&this.redraw(a.animation))}),q(g,"afterAddSeries",function(){this.navigator&&this.navigator.setBaseSeries(null,!1)}),q(t,"afterUpdate",function(){this.chart.navigator&&!this.options.isInternal&&this.chart.navigator.setBaseSeries(null,!1)}),g.prototype.callbacks.push(function(a){var b=a.navigator;b&&a.xAxis[0]&&(a=a.xAxis[0].getExtremes(),b.render(a.min,a.max))}))}); |
|
|
|
K(y,"parts/OrdinalAxis.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.defined,F=g.extend,E=g.pick;g=d.addEvent;var D=d.Axis,x=d.Chart,v=d.css,C=d.noop,B=d.timeUnits;g(d.Series,"updatedData",function(){var d=this.xAxis;d&&d.options.ordinal&&delete d.ordinalIndex});D.prototype.getTimeTicks=function(d,g,m,q,w,h,f){var c=0,b,a,l={},n=[],t=-Number.MAX_VALUE,p=this.options.tickPixelInterval,r=this.chart.time,e=[];if(!this.options.ordinal&&!this.options.breaks||!w||3>w.length|| |
|
|
|
"undefined"===typeof g)return r.getTimeTicks.apply(r,arguments);var k=w.length;for(b=0;b<k;b++){var u=b&&w[b-1]>m;w[b]<g&&(c=b);if(b===k-1||w[b+1]-w[b]>5*h||u){if(w[b]>t){for(a=r.getTimeTicks(d,w[c],w[b],q);a.length&&a[0]<=t;)a.shift();a.length&&(t=a[a.length-1]);e.push(n.length);n=n.concat(a)}c=b+1}if(u)break}a=a.info;if(f&&a.unitRange<=B.hour){b=n.length-1;for(c=1;c<b;c++)if(r.dateFormat("%d",n[c])!==r.dateFormat("%d",n[c-1])){l[n[c]]="day";var v=!0}v&&(l[n[0]]="day");a.higherRanks=l}a.segmentStarts= |
|
|
|
e;n.info=a;if(f&&y(p)){c=e=n.length;v=[];var z;for(r=[];c--;)b=this.translate(n[c]),z&&(r[c]=z-b),v[c]=z=b;r.sort();r=r[Math.floor(r.length/2)];r<.6*p&&(r=null);c=n[e-1]>m?e-1:e;for(z=void 0;c--;)b=v[c],e=Math.abs(z-b),z&&e<.8*p&&(null===r||e<.8*r)?(l[n[c]]&&!l[n[c+1]]?(e=c+1,z=b):e=c,n.splice(e,1)):z=b}return n};F(D.prototype,{beforeSetTickPositions:function(){var d=[],g,m=!1,q=this.getExtremes(),w=q.min,h=q.max,f,c=this.isXAxis&&!!this.options.breaks;q=this.options.ordinal;var b=Number.MAX_VALUE, |
|
|
|
a=this.chart.options.chart.ignoreHiddenSeries,l;if(q||c){this.series.forEach(function(f,h){g=[];if(!(a&&!1===f.visible||!1===f.takeOrdinalPosition&&!c)&&(d=d.concat(f.processedXData),n=d.length,d.sort(function(a,b){return a-b}),b=Math.min(b,E(f.closestPointRange,b)),n)){for(h=0;h<n-1;)d[h]!==d[h+1]&&g.push(d[h+1]),h++;g[0]!==d[0]&&g.unshift(d[0]);d=g}f.isSeriesBoosting&&(l=!0)});l&&(d.length=0);var n=d.length;if(2<n){var t=d[1]-d[0];for(f=n-1;f--&&!m;)d[f+1]-d[f]!==t&&(m=!0);!this.options.keepOrdinalPadding&& |
|
|
|
(d[0]-w>t||h-d[d.length-1]>t)&&(m=!0)}else this.options.overscroll&&(2===n?b=d[1]-d[0]:1===n?(b=this.options.overscroll,d=[d[0],d[0]+b]):b=this.overscrollPointsRange);m?(this.options.overscroll&&(this.overscrollPointsRange=b,d=d.concat(this.getOverscrollPositions())),this.ordinalPositions=d,t=this.ordinal2lin(Math.max(w,d[0]),!0),f=Math.max(this.ordinal2lin(Math.min(h,d[d.length-1]),!0),1),this.ordinalSlope=h=(h-w)/(f-t),this.ordinalOffset=w-t*h):(this.overscrollPointsRange=E(this.closestPointRange, |
|
|
|
this.overscrollPointsRange),this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=void 0)}this.isOrdinal=q&&m;this.groupIntervalFactor=null},val2lin:function(d,g){var m=this.ordinalPositions;if(m){var q=m.length,p;for(p=q;p--;)if(m[p]===d){var h=p;break}for(p=q-1;p--;)if(d>m[p]||0===p){d=(d-m[p])/(m[p+1]-m[p]);h=p+d;break}g=g?h:this.ordinalSlope*(h||0)+this.ordinalOffset}else g=d;return g},lin2val:function(d,g){var m=this.ordinalPositions;if(m){var q=this.ordinalSlope,p=this.ordinalOffset,h= |
|
|
|
m.length-1;if(g)if(0>d)d=m[0];else if(d>h)d=m[h];else{h=Math.floor(d);var f=d-h}else for(;h--;)if(g=q*h+p,d>=g){q=q*(h+1)+p;f=(d-g)/(q-g);break}return"undefined"!==typeof f&&"undefined"!==typeof m[h]?m[h]+(f?f*(m[h+1]-m[h]):0):d}return d},getExtendedPositions:function(){var d=this,g=d.chart,m=d.series[0].currentDataGrouping,q=d.ordinalIndex,w=m?m.count+m.unitName:"raw",h=d.options.overscroll,f=d.getExtremes(),c;q||(q=d.ordinalIndex={});if(!q[w]){var b={series:[],chart:g,getExtremes:function(){return{min:f.dataMin, |
|
|
|
max:f.dataMax+h}},options:{ordinal:!0},val2lin:D.prototype.val2lin,ordinal2lin:D.prototype.ordinal2lin};d.series.forEach(function(a){c={xAxis:b,xData:a.xData.slice(),chart:g,destroyGroupedData:C};c.xData=c.xData.concat(d.getOverscrollPositions());c.options={dataGrouping:m?{enabled:!0,forced:!0,approximation:"open",units:[[m.unitName,[m.count]]]}:{enabled:!1}};a.processData.apply(c);b.series.push(c)});d.beforeSetTickPositions.apply(b);q[w]=b.ordinalPositions}return q[w]},getOverscrollPositions:function(){var d= |
|
|
|
this.options.overscroll,g=this.overscrollPointsRange,m=[],q=this.dataMax;if(y(g))for(m.push(q);q<=this.dataMax+d;)q+=g,m.push(q);return m},getGroupIntervalFactor:function(d,g,m){m=m.processedXData;var q=m.length,p=[];var h=this.groupIntervalFactor;if(!h){for(h=0;h<q-1;h++)p[h]=m[h+1]-m[h];p.sort(function(d,c){return d-c});p=p[Math.floor(q/2)];d=Math.max(d,m[0]);g=Math.min(g,m[q-1]);this.groupIntervalFactor=h=q*p/(g-d)}return h},postProcessTickInterval:function(d){var g=this.ordinalSlope;return g? |
|
|
|
this.options.breaks?this.closestPointRange||d:d/(g/this.closestPointRange):d}});D.prototype.ordinal2lin=D.prototype.val2lin;g(x,"pan",function(d){var g=this.xAxis[0],m=g.options.overscroll,q=d.originalEvent.chartX,p=this.options.chart&&this.options.chart.panning,h=!1;if(p&&"y"!==p.type&&g.options.ordinal&&g.series.length){var f=this.mouseDownX,c=g.getExtremes(),b=c.dataMax,a=c.min,l=c.max,n=this.hoverPoints,t=g.closestPointRange||g.overscrollPointsRange;f=(f-q)/(g.translationSlope*(g.ordinalSlope|| |
|
|
|
t));var x={ordinalPositions:g.getExtendedPositions()};t=g.lin2val;var r=g.val2lin;if(!x.ordinalPositions)h=!0;else if(1<Math.abs(f)){n&&n.forEach(function(a){a.setState()});if(0>f){n=x;var e=g.ordinalPositions?g:x}else n=g.ordinalPositions?g:x,e=x;x=e.ordinalPositions;b>x[x.length-1]&&x.push(b);this.fixedRange=l-a;f=g.toFixedRange(null,null,t.apply(n,[r.apply(n,[a,!0])+f,!0]),t.apply(e,[r.apply(e,[l,!0])+f,!0]));f.min>=Math.min(c.dataMin,a)&&f.max<=Math.max(b,l)+m&&g.setExtremes(f.min,f.max,!0,!1, |
|
|
|
{trigger:"pan"});this.mouseDownX=q;v(this.container,{cursor:"move"})}}else h=!0;h||p&&/y/.test(p.type)?m&&(g.max=g.dataMax+m):d.preventDefault()});g(D,"foundExtremes",function(){this.isXAxis&&y(this.options.overscroll)&&this.max===this.dataMax&&(!this.chart.mouseIsDown||this.isInternal)&&(!this.eventArgs||this.eventArgs&&"navigator"!==this.eventArgs.trigger)&&(this.max+=this.options.overscroll,!this.isInternal&&y(this.userMin)&&(this.min+=this.options.overscroll))});g(D,"afterSetScale",function(){this.horiz&& |
|
|
|
!this.isDirty&&(this.isDirty=this.isOrdinal&&this.chart.navigator&&!this.chart.navigator.adaptToUpdatedData)})});K(y,"modules/broken-axis.src.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.extend,F=g.isArray,E=g.pick;g=d.addEvent;var D=d.find,x=d.fireEvent,v=d.Axis,C=d.Series,B=function(d,g){return D(g,function(g){return g.from<d&&d<g.to})};y(v.prototype,{isInBreak:function(d,g){var m=d.repeat||Infinity,q=d.from,p=d.to-d.from;g=g>=q?(g-q)%m:m-(q-g)%m;return d.inclusive? |
|
|
|
g<=p:g<p&&0!==g},isInAnyBreak:function(d,g){var m=this.options.breaks,q=m&&m.length,p;if(q){for(;q--;)if(this.isInBreak(m[q],d)){var h=!0;p||(p=E(m[q].showPoints,!this.isXAxis))}var f=h&&g?h&&!p:h}return f}});g(v,"afterInit",function(){"function"===typeof this.setBreaks&&this.setBreaks(this.options.breaks,!1)});g(v,"afterSetTickPositions",function(){if(this.isBroken){var d=this.tickPositions,g=this.tickPositions.info,m=[],q;for(q=0;q<d.length;q++)this.isInAnyBreak(d[q])||m.push(d[q]);this.tickPositions= |
|
|
|
m;this.tickPositions.info=g}});g(v,"afterSetOptions",function(){this.isBroken&&(this.options.ordinal=!1)});v.prototype.setBreaks=function(d,g){function m(d){var c=d,b;for(b=0;b<p.breakArray.length;b++){var a=p.breakArray[b];if(a.to<=d)c-=a.len;else if(a.from>=d)break;else if(p.isInBreak(a,d)){c-=d-a.from;break}}return c}function q(d){var c;for(c=0;c<p.breakArray.length;c++){var b=p.breakArray[c];if(b.from>=d)break;else b.to<d?d+=b.len:p.isInBreak(b,d)&&(d+=b.len)}return d}var p=this,h=F(d)&&!!d.length; |
|
|
|
p.isDirty=p.isBroken!==h;p.isBroken=h;p.options.breaks=p.userOptions.breaks=d;p.forceRedraw=!0;p.series.forEach(function(d){d.isDirty=!0});h||p.val2lin!==m||(delete p.val2lin,delete p.lin2val);h&&(p.userOptions.ordinal=!1,p.val2lin=m,p.lin2val=q,p.setExtremes=function(d,c,b,a,g){if(this.isBroken){for(var f,h=this.options.breaks;f=B(d,h);)d=f.to;for(;f=B(c,h);)c=f.from;c<d&&(c=d)}v.prototype.setExtremes.call(this,d,c,b,a,g)},p.setAxisTranslation=function(d){v.prototype.setAxisTranslation.call(this, |
|
|
|
d);this.unitLength=null;if(this.isBroken){d=p.options.breaks;var c=[],b=[],a=0,f,g=p.userMin||p.min,h=p.userMax||p.max,m=E(p.pointRangePadding,0),r;d.forEach(function(a){f=a.repeat||Infinity;p.isInBreak(a,g)&&(g+=a.to%f-g%f);p.isInBreak(a,h)&&(h-=h%f-a.from%f)});d.forEach(function(a){k=a.from;for(f=a.repeat||Infinity;k-f>g;)k-=f;for(;k<g;)k+=f;for(r=k;r<h;r+=f)c.push({value:r,move:"in"}),c.push({value:r+(a.to-a.from),move:"out",size:a.breakSize})});c.sort(function(a,b){return a.value===b.value?("in"=== |
|
|
|
a.move?0:1)-("in"===b.move?0:1):a.value-b.value});var e=0;var k=g;c.forEach(function(c){e+="in"===c.move?1:-1;1===e&&"in"===c.move&&(k=c.value);0===e&&(b.push({from:k,to:c.value,len:c.value-k-(c.size||0)}),a+=c.value-k-(c.size||0))});p.breakArray=b;p.unitLength=h-g-a+m;x(p,"afterBreaks");p.staticScale?p.transA=p.staticScale:p.unitLength&&(p.transA*=(h-p.min+m)/p.unitLength);m&&(p.minPixelPadding=p.transA*p.minPointOffset);p.min=g;p.max=h}});E(g,!0)&&this.chart.redraw()};g(C,"afterGeneratePoints", |
|
|
|
function(){var d=this.options.connectNulls,g=this.points,m=this.xAxis,q=this.yAxis;if(this.isDirty)for(var v=g.length;v--;){var h=g[v],f=!(null===h.y&&!1===d)&&(m&&m.isInAnyBreak(h.x,!0)||q&&q.isInAnyBreak(h.y,!0));h.visible=f?!1:!1!==h.options.visible}});g(C,"afterRender",function(){this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,E(this.pointArrayMap,["y"]))});d.Series.prototype.drawBreaks=function(d,g){var m=this,p=m.points,v,h,f,c;d&&g.forEach(function(b){v=d.breakArray||[];h=d.isXAxis? |
|
|
|
d.min:E(m.options.threshold,d.min);p.forEach(function(a){c=E(a["stack"+b.toUpperCase()],a[b]);v.forEach(function(b){f=!1;if(h<b.from&&c>b.to||h>b.from&&c<b.from)f="pointBreak";else if(h<b.from&&c>b.from&&c<b.to||h>b.from&&c>b.to&&c<b.from)f="pointInBreak";f&&x(d,f,{point:a,brk:b})})})})};d.Series.prototype.gappedPath=function(){var g=this.currentDataGrouping,v=g&&g.gapSize;g=this.options.gapSize;var m=this.points.slice(),q=m.length-1,w=this.yAxis,h;if(g&&0<q)for("value"!==this.options.gapUnit&&(g*= |
|
|
|
this.basePointRange),v&&v>g&&v>=this.basePointRange&&(g=v),h=void 0;q--;)h&&!1!==h.visible||(h=m[q+1]),v=m[q],!1!==h.visible&&!1!==v.visible&&(h.x-v.x>g&&(h=(v.x+h.x)/2,m.splice(q+1,0,{isNull:!0,x:h}),this.options.stacking&&(h=w.stacks[this.stackKey][h]=new d.StackItem(w,w.options.stackLabels,!1,h,this.stack),h.total=0)),h=v);return this.getGraphPath(m)}});K(y,"masters/modules/broken-axis.src.js",[],function(){});K(y,"parts/DataGrouping.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d, |
|
|
|
g){var y=g.arrayMax,F=g.arrayMin,E=g.correctFloat,D=g.defined,x=g.extend,v=g.isNumber,C=g.pick;g=d.addEvent;var B=d.Axis,p=d.defaultPlotOptions,z=d.format,m=d.merge,q=d.Point,w=d.Series,h=d.Tooltip,f=d.approximations={sum:function(a){var b=a.length;if(!b&&a.hasNulls)var e=null;else if(b)for(e=0;b--;)e+=a[b];return e},average:function(a){var b=a.length;a=f.sum(a);v(a)&&b&&(a=E(a/b));return a},averages:function(){var a=[];[].forEach.call(arguments,function(b){a.push(f.average(b))});return"undefined"=== |
|
|
|
typeof a[0]?void 0:a},open:function(a){return a.length?a[0]:a.hasNulls?null:void 0},high:function(a){return a.length?y(a):a.hasNulls?null:void 0},low:function(a){return a.length?F(a):a.hasNulls?null:void 0},close:function(a){return a.length?a[a.length-1]:a.hasNulls?null:void 0},ohlc:function(a,b,c,d){a=f.open(a);b=f.high(b);c=f.low(c);d=f.close(d);if(v(a)||v(b)||v(c)||v(d))return[a,b,c,d]},range:function(a,b){a=f.low(a);b=f.high(b);if(v(a)||v(b))return[a,b];if(null===a&&null===b)return null}},c=function(a, |
|
|
|
b,c,d){var e=this,g=e.data,h=e.options&&e.options.data,k=[],l=[],n=[],r=a.length,u=!!b,t=[],p=e.pointArrayMap,q=p&&p.length,w=["x"].concat(p||["y"]),x=0,z=0,y;d="function"===typeof d?d:f[d]?f[d]:f[e.getDGApproximation&&e.getDGApproximation()||"average"];q?p.forEach(function(){t.push([])}):t.push([]);var H=q||1;for(y=0;y<=r&&!(a[y]>=c[0]);y++);for(y;y<=r;y++){for(;"undefined"!==typeof c[x+1]&&a[y]>=c[x+1]||y===r;){var B=c[x];e.dataGroupInfo={start:e.cropStart+z,length:t[0].length};var C=d.apply(e, |
|
|
|
t);e.pointClass&&!D(e.dataGroupInfo.options)&&(e.dataGroupInfo.options=m(e.pointClass.prototype.optionsToObject.call({series:e},e.options.data[e.cropStart+z])),w.forEach(function(a){delete e.dataGroupInfo.options[a]}));"undefined"!==typeof C&&(k.push(B),l.push(C),n.push(e.dataGroupInfo));z=y;for(B=0;B<H;B++)t[B].length=0,t[B].hasNulls=!1;x+=1;if(y===r)break}if(y===r)break;if(p)for(B=e.cropStart+y,C=g&&g[B]||e.pointClass.prototype.applyOptions.apply({series:e},[h[B]]),B=0;B<q;B++){var E=C[p[B]];v(E)? |
|
|
|
t[B].push(E):null===E&&(t[B].hasNulls=!0)}else B=u?b[y]:null,v(B)?t[0].push(B):null===B&&(t[0].hasNulls=!0)}return{groupedXData:k,groupedYData:l,groupMap:n}},b={approximations:f,groupData:c},a=w.prototype,l=a.processData,n=a.generatePoints,t={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"]}},I={line:{},spline:{},area:{},areaspline:{},arearange:{},column:{groupPixelWidth:10},columnrange:{groupPixelWidth:10},candlestick:{groupPixelWidth:10},ohlc:{groupPixelWidth:5}},r=d.defaultDataGroupingUnits=[["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]];a.getDGApproximation=function(){return d.seriesTypes.arearange&&this instanceof d.seriesTypes.arearange?"range":d.seriesTypes.ohlc&&this instanceof d.seriesTypes.ohlc?"ohlc":d.seriesTypes.column&&this instanceof d.seriesTypes.column?"sum":"average"};a.groupData=c;a.processData=function(){var b=this.chart,c=this.options.dataGrouping,d=!1!==this.allowDG&&c&&C(c.enabled,b.options.isStock),f=this.visible||!b.options.chart.ignoreHiddenSeries, |
|
|
|
g,h=this.currentDataGrouping,m=!1;this.forceCrop=d;this.groupPixelWidth=null;this.hasProcessed=!0;d&&!this.requireSorting&&(this.requireSorting=m=!0);d=!1===l.apply(this,arguments)||!d;m&&(this.requireSorting=!1);if(!d){this.destroyGroupedData();d=c.groupAll?this.xData:this.processedXData;var n=c.groupAll?this.yData:this.processedYData,t=b.plotSizeX;b=this.xAxis;var p=b.options.ordinal,q=this.groupPixelWidth=b.getGroupPixelWidth&&b.getGroupPixelWidth();if(q){this.isDirty=g=!0;this.points=null;m=b.getExtremes(); |
|
|
|
var v=m.min;m=m.max;p=p&&b.getGroupIntervalFactor(v,m,this)||1;q=q*(m-v)/t*p;t=b.getTimeTicks(b.normalizeTimeTickInterval(q,c.units||r),Math.min(v,d[0]),Math.max(m,d[d.length-1]),b.options.startOfWeek,d,this.closestPointRange);n=a.groupData.apply(this,[d,n,t,c.approximation]);d=n.groupedXData;p=n.groupedYData;var w=0;if(c.smoothed&&d.length){var x=d.length-1;for(d[x]=Math.min(d[x],m);x--&&0<x;)d[x]+=q/2;d[0]=Math.max(d[0],v)}for(x=1;x<t.length;x++)t.info.segmentStarts&&-1!==t.info.segmentStarts.indexOf(x)|| |
|
|
|
(w=Math.max(t[x]-t[x-1],w));v=t.info;v.gapSize=w;this.closestPointRange=t.info.totalRange;this.groupMap=n.groupMap;if(D(d[0])&&d[0]<b.min&&f){if(!D(b.options.min)&&b.min<=b.dataMin||b.min===b.dataMin)b.min=Math.min(d[0],b.min);b.dataMin=Math.min(d[0],b.dataMin)}c.groupAll&&(c=this.cropData(d,p,b.min,b.max,1),d=c.xData,p=c.yData);this.processedXData=d;this.processedYData=p}else this.groupMap=null;this.hasGroupedData=g;this.currentDataGrouping=v;this.preventGraphAnimation=(h&&h.totalRange)!==(v&&v.totalRange)}}; |
|
|
|
a.destroyGroupedData=function(){this.groupedData&&(this.groupedData.forEach(function(a,b){a&&(this.groupedData[b]=a.destroy?a.destroy():null)},this),this.groupedData.length=0)};a.generatePoints=function(){n.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};g(q,"update",function(){if(this.dataGroup)return d.error(24,!1,this.series.chart),!1});g(h,"headerFormatter",function(a){var b=this.chart,c=b.time,e=a.labelConfig,d=e.series,f=d.tooltipOptions,g=d.options.dataGrouping, |
|
|
|
h=f.xDateFormat,l=d.xAxis,m=f[(a.isFooter?"footer":"header")+"Format"];if(l&&"datetime"===l.options.type&&g&&v(e.key)){var n=d.currentDataGrouping;g=g.dateTimeLabelFormats||t.dateTimeLabelFormats;if(n)if(f=g[n.unitName],1===n.count)h=f[0];else{h=f[1];var r=f[2]}else!h&&g&&(h=this.getXDateFormat(e,f,l));h=c.dateFormat(h,e.key);r&&(h+=c.dateFormat(r,e.key+n.totalRange-1));d.chart.styledMode&&(m=this.styledModeFormat(m));a.text=z(m,{point:x(e.point,{key:h}),series:d},b);a.preventDefault()}});g(w,"destroy", |
|
|
|
a.destroyGroupedData);g(w,"afterSetOptions",function(a){a=a.options;var b=this.type,c=this.chart.options.plotOptions,e=p[b].dataGrouping,d=this.useCommonDataGrouping&&t;if(I[b]||d)e||(e=m(t,I[b])),a.dataGrouping=m(d,e,c.series&&c.series.dataGrouping,c[b].dataGrouping,this.userOptions.dataGrouping)});g(B,"afterSetScale",function(){this.series.forEach(function(a){a.hasProcessed=!1})});B.prototype.getGroupPixelWidth=function(){var a=this.series,b=a.length,c,d=0,f=!1,g;for(c=b;c--;)(g=a[c].options.dataGrouping)&& |
|
|
|
(d=Math.max(d,C(g.groupPixelWidth,t.groupPixelWidth)));for(c=b;c--;)(g=a[c].options.dataGrouping)&&a[c].hasProcessed&&(b=(a[c].processedXData||a[c].data).length,a[c].groupPixelWidth||b>this.chart.plotSizeX/d||b&&g.forced)&&(f=!0);return f?d:0};B.prototype.setDataGrouping=function(a,b){var c;b=C(b,!0);a||(a={forced:!1,units:null});if(this instanceof B)for(c=this.series.length;c--;)this.series[c].update({dataGrouping:a},!1);else this.chart.options.series.forEach(function(b){b.dataGrouping=a},!1);this.ordinalSlope= |
|
|
|
null;b&&this.chart.redraw()};d.dataGrouping=b;"";return b});K(y,"parts/OHLCSeries.js",[y["parts/Globals.js"]],function(d){var g=d.Point,y=d.seriesType,F=d.seriesTypes;y("ohlc","column",{lineWidth:1,tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</span> <b> {series.name}</b><br/>Open: {point.open}<br/>High: {point.high}<br/>Low: {point.low}<br/>Close: {point.close}<br/>'},threshold:null,states:{hover:{lineWidth:3}},stickyTracking:!0},{directTouch:!1,pointArrayMap:["open","high","low", |
|
|
|
"close"],toYData:function(d){return[d.open,d.high,d.low,d.close]},pointValKey:"close",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"},init:function(){F.column.prototype.init.apply(this,arguments);this.options.stacking=!1},pointAttribs:function(d,g){g=F.column.prototype.pointAttribs.call(this,d,g);var x=this.options;delete g.fill;!d.options.color&&x.upColor&&d.open<d.close&&(g.stroke=x.upColor);return g},translate:function(){var d=this,g=d.yAxis,x=!!d.modifyValue,v=["plotOpen","plotHigh", |
|
|
|
"plotLow","plotClose","yBottom"];F.column.prototype.translate.apply(d);d.points.forEach(function(y){[y.open,y.high,y.low,y.close,y.low].forEach(function(B,p){null!==B&&(x&&(B=d.modifyValue(B)),y[v[p]]=g.toPixels(B,!0))});y.tooltipPos[1]=y.plotHigh+g.pos-d.chart.plotTop})},drawPoints:function(){var d=this,g=d.chart;d.points.forEach(function(x){var v=x.graphic,y=!v;if("undefined"!==typeof x.plotY){v||(x.graphic=v=g.renderer.path().add(d.group));g.styledMode||v.attr(d.pointAttribs(x,x.selected&&"select")); |
|
|
|
var B=v.strokeWidth()%2/2;var p=Math.round(x.plotX)-B;var z=Math.round(x.shapeArgs.width/2);var m=["M",p,Math.round(x.yBottom),"L",p,Math.round(x.plotHigh)];if(null!==x.open){var q=Math.round(x.plotOpen)+B;m.push("M",p,q,"L",p-z,q)}null!==x.close&&(q=Math.round(x.plotClose)+B,m.push("M",p,q,"L",p+z,q));v[y?"attr":"animate"]({d:m}).addClass(x.getClassName(),!0)}})},animate:null},{getClassName:function(){return g.prototype.getClassName.call(this)+(this.open<this.close?" highcharts-point-up":" highcharts-point-down")}}); |
|
|
|
""});K(y,"parts/CandlestickSeries.js",[y["parts/Globals.js"]],function(d){var g=d.defaultPlotOptions,y=d.merge,F=d.seriesType,E=d.seriesTypes;F("candlestick","ohlc",y(g.column,{states:{hover:{lineWidth:2}},tooltip:g.ohlc.tooltip,threshold:null,lineColor:"#000000",lineWidth:1,upColor:"#ffffff",stickyTracking:!0}),{pointAttribs:function(d,g){var v=E.column.prototype.pointAttribs.call(this,d,g),x=this.options,y=d.open<d.close,p=x.lineColor||this.color;v["stroke-width"]=x.lineWidth;v.fill=d.options.color|| |
|
|
|
(y?x.upColor||this.color:this.color);v.stroke=d.options.lineColor||(y?x.upLineColor||p:p);g&&(d=x.states[g],v.fill=d.color||v.fill,v.stroke=d.lineColor||v.stroke,v["stroke-width"]=d.lineWidth||v["stroke-width"]);return v},drawPoints:function(){var d=this,g=d.chart,v=d.yAxis.reversed;d.points.forEach(function(x){var y=x.graphic,p=!y;if("undefined"!==typeof x.plotY){y||(x.graphic=y=g.renderer.path().add(d.group));d.chart.styledMode||y.attr(d.pointAttribs(x,x.selected&&"select")).shadow(d.options.shadow); |
|
|
|
var z=y.strokeWidth()%2/2;var m=Math.round(x.plotX)-z;var q=x.plotOpen;var w=x.plotClose;var h=Math.min(q,w);q=Math.max(q,w);var f=Math.round(x.shapeArgs.width/2);w=v?q!==x.yBottom:Math.round(h)!==Math.round(x.plotHigh);var c=v?Math.round(h)!==Math.round(x.plotHigh):q!==x.yBottom;h=Math.round(h)+z;q=Math.round(q)+z;z=[];z.push("M",m-f,q,"L",m-f,h,"L",m+f,h,"L",m+f,q,"Z","M",m,h,"L",m,w?Math.round(v?x.yBottom:x.plotHigh):h,"M",m,q,"L",m,c?Math.round(v?x.plotHigh:x.yBottom):q);y[p?"attr":"animate"]({d:z}).addClass(x.getClassName(), |
|
|
|
!0)}})}});""});K(y,"mixins/on-series.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.defined,F=d.seriesTypes,E=d.stableSort;return{getPlotBox:function(){return d.Series.prototype.getPlotBox.call(this.options.onSeries&&this.chart.get(this.options.onSeries)||this)},translate:function(){F.column.prototype.translate.apply(this);var d=this,g=d.options,v=d.chart,C=d.points,B=C.length-1,p,z=g.onSeries;z=z&&v.get(z);g=g.onKey||"y";var m=z&&z.options.step,q=z&&z.points,w=q&&q.length, |
|
|
|
h=v.inverted,f=d.xAxis,c=d.yAxis,b=0,a;if(z&&z.visible&&w){b=(z.pointXOffset||0)+(z.barW||0)/2;v=z.currentDataGrouping;var l=q[w-1].x+(v?v.totalRange:0);E(C,function(a,b){return a.x-b.x});for(g="plot"+g[0].toUpperCase()+g.substr(1);w--&&C[B];){var n=q[w];v=C[B];v.y=n.y;if(n.x<=v.x&&"undefined"!==typeof n[g]){if(v.x<=l&&(v.plotY=n[g],n.x<v.x&&!m&&(a=q[w+1])&&"undefined"!==typeof a[g])){var t=(v.x-n.x)/(a.x-n.x);v.plotY+=t*(a[g]-n[g]);v.y+=t*(a.y-n.y)}B--;w++;if(0>B)break}}}C.forEach(function(a,g){a.plotX+= |
|
|
|
b;if("undefined"===typeof a.plotY||h)0<=a.plotX&&a.plotX<=f.len?h?(a.plotY=f.translate(a.x,0,1,0,1),a.plotX=y(a.y)?c.translate(a.y,0,0,0,1):0):a.plotY=(f.opposite?0:d.yAxis.len)+f.offset:a.shapeArgs={};if((p=C[g-1])&&p.plotX===a.plotX){"undefined"===typeof p.stackIndex&&(p.stackIndex=0);var e=p.stackIndex+1}a.stackIndex=e});this.onSeries=z}}});K(y,"parts/FlagsSeries.js",[y["parts/Globals.js"],y["parts/Utilities.js"],y["mixins/on-series.js"]],function(d,g,y){function F(d){h[d+"pin"]=function(c,b,a, |
|
|
|
f,g){var l=g&&g.anchorX;g=g&&g.anchorY;"circle"===d&&f>a&&(c-=Math.round((f-a)/2),a=f);var m=h[d](c,b,a,f);l&&g&&(m.push("M","circle"===d?c+a/2:m[1]+m[4]/2,b>g?b:b+f,"L",l,g),m=m.concat(h.circle(l-1,g-1,2,2)));return m}}var E=g.defined,D=g.isNumber,x=g.objectEach,v=g.wrap,C=d.addEvent,B=d.merge;g=d.noop;var p=d.Renderer,z=d.Series,m=d.seriesType,q=d.TrackerMixin,w=d.VMLRenderer,h=d.SVGRenderer.prototype.symbols;m("flags","column",{pointRange:0,allowOverlapX:!1,shape:"flag",stackDistance:12,textAlign:"center", |
|
|
|
tooltip:{pointFormat:"{point.text}<br/>"},threshold:null,y:-30,fillColor:"#ffffff",lineWidth:1,states:{hover:{lineColor:"#000000",fillColor:"#ccd6eb"}},style:{fontSize:"11px",fontWeight:"bold"}},{sorted:!1,noSharedTooltip:!0,allowDG:!1,takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:z.prototype.init,pointAttribs:function(d,c){var b=this.options,a=d&&d.color||this.color,f=b.lineColor,g=d&&d.lineWidth;d=d&&d.fillColor||b.fillColor;c&&(d=b.states[c].fillColor,f=b.states[c].lineColor, |
|
|
|
g=b.states[c].lineWidth);return{fill:d||a,stroke:f||a,"stroke-width":g||b.lineWidth||0}},translate:y.translate,getPlotBox:y.getPlotBox,drawPoints:function(){var f=this.points,c=this.chart,b=c.renderer,a=c.inverted,g=this.options,h=g.y,m,p=this.yAxis,r={},e=[];for(m=f.length;m--;){var k=f[m];var u=(a?k.plotY:k.plotX)>this.xAxis.len;var q=k.plotX;var w=k.stackIndex;var A=k.options.shape||g.shape;var z=k.plotY;"undefined"!==typeof z&&(z=k.plotY+h-("undefined"!==typeof w&&w*g.stackDistance));k.anchorX= |
|
|
|
w?void 0:k.plotX;var y=w?void 0:k.plotY;var C="flag"!==A;w=k.graphic;"undefined"!==typeof z&&0<=q&&!u?(w||(w=k.graphic=b.label("",null,null,A,null,null,g.useHTML),c.styledMode||w.attr(this.pointAttribs(k)).css(B(g.style,k.style)),w.attr({align:C?"center":"left",width:g.width,height:g.height,"text-align":g.textAlign}).addClass("highcharts-point").add(this.markerGroup),k.graphic.div&&(k.graphic.div.point=k),c.styledMode||w.shadow(g.shadow),w.isNew=!0),0<q&&(q-=w.strokeWidth()%2),A={y:z,anchorY:y},g.allowOverlapX&& |
|
|
|
(A.x=q,A.anchorX=k.anchorX),w.attr({text:k.options.title||g.title||"A"})[w.isNew?"attr":"animate"](A),g.allowOverlapX||(r[k.plotX]?r[k.plotX].size=Math.max(r[k.plotX].size,w.width):r[k.plotX]={align:C?.5:0,size:w.width,target:q,anchorX:q}),k.tooltipPos=[q,z+p.pos-c.plotTop]):w&&(k.graphic=w.destroy())}g.allowOverlapX||(x(r,function(a){a.plotX=a.anchorX;e.push(a)}),d.distribute(e,a?p.len:this.xAxis.len,100),f.forEach(function(a){var b=a.graphic&&r[a.plotX];b&&(a.graphic[a.graphic.isNew?"attr":"animate"]({x:b.pos+ |
|
|
|
b.align*b.size,anchorX:a.anchorX}),E(b.pos)?a.graphic.isNew=!1:(a.graphic.attr({x:-9999,anchorX:-9999}),a.graphic.isNew=!0))}));g.useHTML&&v(this.markerGroup,"on",function(a){return d.SVGElement.prototype.on.apply(a.apply(this,[].slice.call(arguments,1)),[].slice.call(arguments,1))})},drawTracker:function(){var d=this.points;q.drawTrackerPoint.apply(this);d.forEach(function(c){var b=c.graphic;b&&C(b.element,"mouseover",function(){0<c.stackIndex&&!c.raised&&(c._y=b.y,b.attr({y:c._y-8}),c.raised=!0); |
|
|
|
d.forEach(function(a){a!==c&&a.raised&&a.graphic&&(a.graphic.attr({y:a._y}),a.raised=!1)})})})},animate:function(d){d?this.setClip():this.animate=null},setClip:function(){z.prototype.setClip.apply(this,arguments);!1!==this.options.clip&&this.sharedClipKey&&this.markerGroup.clip(this.chart[this.sharedClipKey])},buildKDTree:g,invertGroups:g},{isValid:function(){return D(this.y)||"undefined"===typeof this.y}});h.flag=function(d,c,b,a,g){var f=g&&g.anchorX||d;g=g&&g.anchorY||c;return h.circle(f-1,g-1, |
|
|
|
2,2).concat(["M",f,g,"L",d,c+a,d,c,d+b,c,d+b,c+a,d,c+a,"Z"])};F("circle");F("square");p===w&&["circlepin","flag","squarepin"].forEach(function(d){w.prototype.symbols[d]=h[d]});""});K(y,"parts/RangeSelector.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){function y(a){this.init(a)}var F=g.defined,E=g.destroyObjectProperties,D=g.discardElement,x=g.extend,v=g.isNumber,C=g.objectEach,B=g.pick,p=g.pInt,z=g.splat,m=d.addEvent,q=d.Axis;g=d.Chart;var w=d.css,h=d.createElement,f=d.defaultOptions, |
|
|
|
c=d.fireEvent,b=d.merge;x(f,{rangeSelector:{verticalAlign:"top",buttonTheme:{width:28,height:18,padding:2,zIndex:7},floating:!1,x:0,y:0,height:void 0,inputPosition:{align:"right",x:0,y:0},buttonPosition:{align:"left",x:0,y:0},labelStyle:{color:"#666666"}}});f.lang=b(f.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"});y.prototype={clickButton:function(a,b){var c=this.chart,d=this.buttonOptions[a],f=c.xAxis[0],g=c.scroller&&c.scroller.getUnionExtremes()||f||{},e=g.dataMin, |
|
|
|
h=g.dataMax,l=f&&Math.round(Math.min(f.max,B(h,f.max))),p=d.type;g=d._range;var w,A=d.dataGrouping;if(null!==e&&null!==h){c.fixedRange=g;A&&(this.forcedDataGrouping=!0,q.prototype.setDataGrouping.call(f||{chart:this.chart},A,!1),this.frozenStates=d.preserveDataGrouping);if("month"===p||"year"===p)if(f){p={range:d,max:l,chart:c,dataMin:e,dataMax:h};var x=f.minFromRange.call(p);v(p.newMax)&&(l=p.newMax)}else g=d;else if(g)x=Math.max(l-g,e),l=Math.min(x+g,h);else if("ytd"===p)if(f)"undefined"===typeof h&& |
|
|
|
(e=Number.MAX_VALUE,h=Number.MIN_VALUE,c.series.forEach(function(a){a=a.xData;e=Math.min(a[0],e);h=Math.max(a[a.length-1],h)}),b=!1),l=this.getYTDExtremes(h,e,c.time.useUTC),x=w=l.min,l=l.max;else{this.deferredYTDClick=a;return}else"all"===p&&f&&(x=e,l=h);x+=d._offsetMin;l+=d._offsetMax;this.setSelected(a);if(f)f.setExtremes(x,l,B(b,1),null,{trigger:"rangeSelectorButton",rangeSelectorButton:d});else{var y=z(c.options.xAxis)[0];var C=y.range;y.range=g;var D=y.min;y.min=w;m(c,"load",function(){y.range= |
|
|
|
C;y.min=D})}}},setSelected:function(a){this.selected=this.options.selected=a},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(a){var b=this,d=a.options.rangeSelector,f=d.buttons||[].concat(b.defaultButtons),g=d.selected,h=function(){var a=b.minInput,d=b.maxInput;a&&a.blur&&c(a,"blur");d&&d.blur&&c(d,"blur")};b.chart=a;b.options=d;b.buttons= |
|
|
|
[];b.buttonOptions=f;this.unMouseDown=m(a.container,"mousedown",h);this.unResize=m(a,"resize",h);f.forEach(b.computeButtonRange);"undefined"!==typeof g&&f[g]&&this.clickButton(g,!1);m(a,"load",function(){a.xAxis&&a.xAxis[0]&&m(a.xAxis[0],"setExtremes",function(c){this.max-this.min!==a.fixedRange&&"rangeSelectorButton"!==c.trigger&&"updatedData"!==c.trigger&&b.forcedDataGrouping&&!b.frozenStates&&this.setDataGrouping(!1,!1)})})},updateButtonStates:function(){var a=this,b=this.chart,c=b.xAxis[0],d= |
|
|
|
Math.round(c.max-c.min),f=!c.hasVisibleSeries,g=b.scroller&&b.scroller.getUnionExtremes()||c,e=g.dataMin,h=g.dataMax;b=a.getYTDExtremes(h,e,b.time.useUTC);var m=b.min,p=b.max,q=a.selected,w=v(q),x=a.options.allButtonsEnabled,z=a.buttons;a.buttonOptions.forEach(function(b,g){var k=b._range,l=b.type,n=b.count||1,r=z[g],t=0,u=b._offsetMax-b._offsetMin;b=g===q;var v=k>h-e,A=k<c.minRange,y=!1,B=!1;k=k===d;("month"===l||"year"===l)&&d+36E5>=864E5*{month:28,year:365}[l]*n-u&&d-36E5<=864E5*{month:31,year:366}[l]* |
|
|
|
n+u?k=!0:"ytd"===l?(k=p-m+u===d,y=!b):"all"===l&&(k=c.max-c.min>=h-e,B=!b&&w&&k);l=!x&&(v||A||B||f);n=b&&k||k&&!w&&!y||b&&a.frozenStates;l?t=3:n&&(w=!0,t=2);r.state!==t&&(r.setState(t),0===t&&q===g&&a.setSelected(null))})},computeButtonRange:function(a){var b=a.type,c=a.count||1,d={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5};if(d[b])a._range=d[b]*c;else if("month"===b||"year"===b)a._range=864E5*{month:30,year:365}[b]*c;a._offsetMin=B(a.offsetMin,0);a._offsetMax=B(a.offsetMax, |
|
|
|
0);a._range+=a._offsetMax-a._offsetMin},setInputValue:function(a,b){var c=this.chart.options.rangeSelector,d=this.chart.time,f=this[a+"Input"];F(b)&&(f.previousValue=f.HCTime,f.HCTime=b);f.value=d.dateFormat(c.inputEditDateFormat||"%Y-%m-%d",f.HCTime);this[a+"DateBox"].attr({text:d.dateFormat(c.inputDateFormat||"%b %e, %Y",f.HCTime)})},showInput:function(a){var b=this.inputGroup,c=this[a+"DateBox"];w(this[a+"Input"],{left:b.translateX+c.x+"px",top:b.translateY+"px",width:c.width-2+"px",height:c.height- |
|
|
|
2+"px",border:"2px solid silver"})},hideInput:function(a){w(this[a+"Input"],{border:0,width:"1px",height:"1px"});this.setInputValue(a)},drawInput:function(a){function c(){var a=y.value,b=(e.inputDateParser||Date.parse)(a),c=m.xAxis[0],d=m.scroller&&m.scroller.xAxis?m.scroller.xAxis:c,f=d.dataMin;d=d.dataMax;b!==y.previousValue&&(y.previousValue=b,v(b)||(b=a.split("-"),b=Date.UTC(p(b[0]),p(b[1])-1,p(b[2]))),v(b)&&(m.time.useUTC||(b+=6E4*(new Date).getTimezoneOffset()),u?b>g.maxInput.HCTime?b=void 0: |
|
|
|
b<f&&(b=f):b<g.minInput.HCTime?b=void 0:b>d&&(b=d),"undefined"!==typeof b&&c.setExtremes(u?b:c.min,u?c.max:b,void 0,void 0,{trigger:"rangeSelectorInput"})))}var g=this,m=g.chart,q=m.renderer.style||{},r=m.renderer,e=m.options.rangeSelector,k=g.div,u="min"===a,y,z,A=this.inputGroup;this[a+"Label"]=z=r.label(f.lang[u?"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).addClass("highcharts-range-label").attr({padding:2}).add(A);A.offset+=z.width+5;this[a+"DateBox"]=r=r.label("",A.offset).addClass("highcharts-range-input").attr({padding:2, |
|
|
|
width:e.inputBoxWidth||90,height:e.inputBoxHeight||17,"text-align":"center"}).on("click",function(){g.showInput(a);g[a+"Input"].focus()});m.styledMode||r.attr({stroke:e.inputBoxBorderColor||"#cccccc","stroke-width":1});r.add(A);A.offset+=r.width+(u?10:0);this[a+"Input"]=y=h("input",{name:a,className:"highcharts-range-selector",type:"text"},{top:m.plotTop+"px"},k);m.styledMode||(z.css(b(q,e.labelStyle)),r.css(b({color:"#333333"},q,e.inputStyle)),w(y,x({position:"absolute",border:0,width:"1px",height:"1px", |
|
|
|
padding:0,textAlign:"center",fontSize:q.fontSize,fontFamily:q.fontFamily,top:"-9999em"},e.inputStyle)));y.onfocus=function(){g.showInput(a)};y.onblur=function(){y===d.doc.activeElement&&c();g.hideInput(a);y.blur()};y.onchange=c;y.onkeypress=function(a){13===a.keyCode&&c()}},getPosition:function(){var a=this.chart,b=a.options.rangeSelector;a="top"===b.verticalAlign?a.plotTop-a.axisOffset[0]:0;return{buttonTop:a+b.buttonPosition.y,inputTop:a+b.inputPosition.y-10}},getYTDExtremes:function(a,b,c){var d= |
|
|
|
this.chart.time,f=new d.Date(a),g=d.get("FullYear",f);c=c?d.Date.UTC(g,0,1):+new d.Date(g,0,1);b=Math.max(b||0,c);f=f.getTime();return{max:Math.min(a||f,f),min:b}},render:function(a,b){var c=this,d=c.chart,g=d.renderer,l=d.container,e=d.options,k=e.exporting&&!1!==e.exporting.enabled&&e.navigation&&e.navigation.buttonOptions,m=f.lang,p=c.div,q=e.rangeSelector,v=B(e.chart.style&&e.chart.style.zIndex,0)+1;e=q.floating;var w=c.buttons;p=c.inputGroup;var x=q.buttonTheme,y=q.buttonPosition,z=q.inputPosition, |
|
|
|
C=q.inputEnabled,D=x&&x.states,E=d.plotLeft,F=c.buttonGroup;var K=c.rendered;var M=c.options.verticalAlign,T=d.legend,Z=T&&T.options,S=y.y,R=z.y,X=K||!1,fa=X?"animate":"attr",aa=0,W=0,Y;if(!1!==q.enabled){K||(c.group=K=g.g("range-selector-group").attr({zIndex:7}).add(),c.buttonGroup=F=g.g("range-selector-buttons").add(K),c.zoomText=g.text(m.rangeSelectorZoom,0,15).add(F),d.styledMode||(c.zoomText.css(q.labelStyle),x["stroke-width"]=B(x["stroke-width"],0)),c.buttonOptions.forEach(function(a,b){w[b]= |
|
|
|
g.button(a.text,0,0,function(d){var e=a.events&&a.events.click,f;e&&(f=e.call(a,d));!1!==f&&c.clickButton(b);c.isActive=!0},x,D&&D.hover,D&&D.select,D&&D.disabled).attr({"text-align":"center"}).add(F)}),!1!==C&&(c.div=p=h("div",null,{position:"relative",height:0,zIndex:v}),l.parentNode.insertBefore(p,l),c.inputGroup=p=g.g("input-group").add(K),p.offset=0,c.drawInput("min"),c.drawInput("max")));c.zoomText[fa]({x:B(E+y.x,E)});var ea=B(E+y.x,E)+c.zoomText.getBBox().width+5;c.buttonOptions.forEach(function(a, |
|
|
|
b){w[b][fa]({x:ea});ea+=w[b].width+B(q.buttonSpacing,5)});E=d.plotLeft-d.spacing[3];c.updateButtonStates();k&&this.titleCollision(d)&&"top"===M&&"right"===y.align&&y.y+F.getBBox().height-12<(k.y||0)+k.height&&(aa=-40);"left"===y.align?Y=y.x-d.spacing[3]:"right"===y.align&&(Y=y.x+aa-d.spacing[1]);F.align({y:y.y,width:F.getBBox().width,align:y.align,x:Y},!0,d.spacingBox);c.group.placed=X;c.buttonGroup.placed=X;!1!==C&&(aa=k&&this.titleCollision(d)&&"top"===M&&"right"===z.align&&z.y-p.getBBox().height- |
|
|
|
12<(k.y||0)+k.height+d.spacing[0]?-40:0,"left"===z.align?Y=E:"right"===z.align&&(Y=-Math.max(d.axisOffset[1],-aa)),p.align({y:z.y,width:p.getBBox().width,align:z.align,x:z.x+Y-2},!0,d.spacingBox),l=p.alignAttr.translateX+p.alignOptions.x-aa+p.getBBox().x+2,k=p.alignOptions.width,m=F.alignAttr.translateX+F.getBBox().x,Y=F.getBBox().width+20,(z.align===y.align||m+Y>l&&l+k>m&&S<R+p.getBBox().height)&&p.attr({translateX:p.alignAttr.translateX+(d.axisOffset[1]>=-aa?0:-aa),translateY:p.alignAttr.translateY+ |
|
|
|
F.getBBox().height+10}),c.setInputValue("min",a),c.setInputValue("max",b),c.inputGroup.placed=X);c.group.align({verticalAlign:M},!0,d.spacingBox);a=c.group.getBBox().height+20;b=c.group.alignAttr.translateY;"bottom"===M&&(T=Z&&"bottom"===Z.verticalAlign&&Z.enabled&&!Z.floating?T.legendHeight+B(Z.margin,10):0,a=a+T-20,W=b-a-(e?0:q.y)-(d.titleOffset?d.titleOffset[2]:0)-10);if("top"===M)e&&(W=0),d.titleOffset&&d.titleOffset[0]&&(W=d.titleOffset[0]),W+=d.margin[0]-d.spacing[0]||0;else if("middle"===M)if(R=== |
|
|
|
S)W=0>R?b+void 0:b;else if(R||S)W=0>R||0>S?W-Math.min(R,S):b-a+NaN;c.group.translate(q.x,q.y+Math.floor(W));!1!==C&&(c.minInput.style.marginTop=c.group.translateY+"px",c.maxInput.style.marginTop=c.group.translateY+"px");c.rendered=!0}},getHeight:function(){var a=this.options,b=this.group,c=a.y,d=a.buttonPosition.y,f=a.inputPosition.y;if(a.height)return a.height;a=b?b.getBBox(!0).height+13+c:0;b=Math.min(f,d);if(0>f&&0>d||0<f&&0<d)a+=Math.abs(b);return a},titleCollision:function(a){return!(a.options.title.text|| |
|
|
|
a.options.subtitle.text)},update:function(a){var c=this.chart;b(!0,c.options.rangeSelector,a);this.destroy();this.init(c);c.rangeSelector.render()},destroy:function(){var a=this,b=a.minInput,c=a.maxInput;a.unMouseDown();a.unResize();E(a.buttons);b&&(b.onfocus=b.onblur=b.onchange=null);c&&(c.onfocus=c.onblur=c.onchange=null);C(a,function(b,c){b&&"chart"!==c&&(b.destroy?b.destroy():b.nodeType&&D(this[c]));b!==y.prototype[c]&&(a[c]=null)},this)}};q.prototype.minFromRange=function(){var a=this.range, |
|
|
|
b={month:"Month",year:"FullYear"}[a.type],c=this.max,d=this.chart.time,f=function(a,c){var e=new d.Date(a),f=d.get(b,e);d.set(b,e,f+c);f===d.get(b,e)&&d.set("Date",e,0);return e.getTime()-a};if(v(a)){var g=c-a;var e=a}else g=c+f(c,-a.count),this.chart&&(this.chart.fixedRange=c-g);var h=B(this.dataMin,Number.MIN_VALUE);v(g)||(g=h);g<=h&&(g=h,"undefined"===typeof e&&(e=f(g,a.count)),this.newMax=Math.min(g+e,this.dataMax));v(c)||(g=void 0);return g};d.RangeSelector||(m(g,"afterGetContainer",function(){this.options.rangeSelector.enabled&& |
|
|
|
(this.rangeSelector=new y(this))}),m(g,"beforeRender",function(){var a=this.axes,b=this.rangeSelector;b&&(v(b.deferredYTDClick)&&(b.clickButton(b.deferredYTDClick),delete b.deferredYTDClick),a.forEach(function(a){a.updateNames();a.setScale()}),this.getAxisMargins(),b.render(),a=b.options.verticalAlign,b.options.floating||("bottom"===a?this.extraBottomMargin=!0:"middle"!==a&&(this.extraTopMargin=!0)))}),m(g,"update",function(a){var b=a.options.rangeSelector;a=this.rangeSelector;var c=this.extraBottomMargin, |
|
|
|
d=this.extraTopMargin;b&&b.enabled&&!F(a)&&(this.options.rangeSelector.enabled=!0,this.rangeSelector=new y(this));this.extraTopMargin=this.extraBottomMargin=!1;a&&(a.render(),b=b&&b.verticalAlign||a.options&&a.options.verticalAlign,a.options.floating||("bottom"===b?this.extraBottomMargin=!0:"middle"!==b&&(this.extraTopMargin=!0)),this.extraBottomMargin!==c||this.extraTopMargin!==d)&&(this.isDirtyBox=!0)}),m(g,"render",function(){var a=this.rangeSelector;a&&!a.options.floating&&(a.render(),a=a.options.verticalAlign, |
|
|
|
"bottom"===a?this.extraBottomMargin=!0:"middle"!==a&&(this.extraTopMargin=!0))}),m(g,"getMargins",function(){var a=this.rangeSelector;a&&(a=a.getHeight(),this.extraTopMargin&&(this.plotTop+=a),this.extraBottomMargin&&(this.marginBottom+=a))}),g.prototype.callbacks.push(function(a){function b(){c=a.xAxis[0].getExtremes();v(c.min)&&d.render(c.min,c.max)}var c,d=a.rangeSelector;if(d){var f=m(a.xAxis[0],"afterSetExtremes",function(a){d.render(a.min,a.max)});var g=m(a,"redraw",b);b()}m(a,"destroy",function(){d&& |
|
|
|
(g(),f())})}),d.RangeSelector=y)});K(y,"parts/StockChart.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(d,g){var y=g.arrayMax,F=g.arrayMin,E=g.clamp,D=g.defined,x=g.extend,v=g.isNumber,C=g.isString,B=g.pick,p=g.splat;g=d.addEvent;var z=d.Axis,m=d.Chart,q=d.format,w=d.merge,h=d.Point,f=d.Renderer,c=d.Series,b=d.SVGRenderer,a=d.VMLRenderer,l=c.prototype,n=l.init,t=l.processData,I=h.prototype.tooltipFormatter;d.StockChart=d.stockChart=function(a,b,c){var e=C(a)||a.nodeName,f=arguments[e? |
|
|
|
1:0],g=f,h=f.series,k=d.getOptions(),l,r=f.chart&&f.chart.panning,n=B(f.navigator&&f.navigator.enabled,k.navigator.enabled,!0),q=r&&/y/.test(r.type),t={startOnTick:!1,endOnTick:!1};f.xAxis=p(f.xAxis||{}).map(function(a,b){return w({minPadding:0,maxPadding:0,overscroll:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0},k.xAxis,k.xAxis&&k.xAxis[b],a,{type:"datetime",categories:null},n?t:null)});f.yAxis=p(f.yAxis||{}).map(function(a,b){l=B(a.opposite,!0);return w({labels:{y:-2}, |
|
|
|
opposite:l,showLastLabel:!(!a.categories&&"category"!==a.type),title:{text:null}},k.yAxis,k.yAxis&&k.yAxis[b],a,q?t:null)});f.series=null;f=w({chart:{panning:{enabled:!0,type:"x"},pinchType:"x"},navigator:{enabled:n},scrollbar:{enabled:B(k.scrollbar.enabled,!0)},rangeSelector:{enabled:B(k.rangeSelector.enabled,!0)},title:{text:null},tooltip:{split:B(k.tooltip.split,!0),crosshairs:!0},legend:{enabled:!1}},f,{isStock:!0});f.series=g.series=h;return e?new m(a,f,c):new m(f,b)};g(c,"setOptions",function(a){function b(a){return d.seriesTypes[a]&& |
|
|
|
c instanceof d.seriesTypes[a]}var c=this,f;this.chart.options.isStock&&(b("column")||b("columnrange")?f={borderWidth:0,shadow:!1}:!b("line")||b("scatter")||b("sma")||(f={marker:{enabled:!1,radius:2}}),f&&(a.plotOptions[this.type]=w(a.plotOptions[this.type],f)))});g(z,"autoLabelAlign",function(a){var b=this.chart,c=this.options;b=b._labelPanes=b._labelPanes||{};var d=this.options.labels;this.chart.options.isStock&&"yAxis"===this.coll&&(c=c.top+","+c.height,!b[c]&&d.enabled&&(15===d.x&&(d.x=0),"undefined"=== |
|
|
|
typeof d.align&&(d.align="right"),b[c]=this,a.align="right",a.preventDefault()))});g(z,"destroy",function(){var a=this.chart,b=this.options&&this.options.top+","+this.options.height;b&&a._labelPanes&&a._labelPanes[b]===this&&delete a._labelPanes[b]});g(z,"getPlotLinePath",function(a){function b(a){var b="xAxis"===a?"yAxis":"xAxis";a=c.options[b];return v(a)?[g[b][a]]:C(a)?[g.get(a)]:f.map(function(a){return a[b]})}var c=this,f=this.isLinked&&!this.series?this.linkedParent.series:this.series,g=c.chart, |
|
|
|
h=g.renderer,l=c.left,m=c.top,r,n,p,q,t=[],w=[],x=a.translatedValue,y=a.value,z=a.force;if(g.options.isStock&&!1!==a.acrossPanes&&"xAxis"===c.coll||"yAxis"===c.coll){a.preventDefault();w=b(c.coll);var F=c.isXAxis?g.yAxis:g.xAxis;F.forEach(function(a){if(D(a.options.id)?-1===a.options.id.indexOf("navigator"):1){var b=a.isXAxis?"yAxis":"xAxis";b=D(a.options[b])?g[b][a.options[b]]:g[b][0];c===b&&w.push(a)}});var I=w.length?[]:[c.isXAxis?g.yAxis[0]:g.xAxis[0]];w.forEach(function(a){-1!==I.indexOf(a)|| |
|
|
|
d.find(I,function(b){return b.pos===a.pos&&b.len===a.len})||I.push(a)});var K=B(x,c.translate(y,null,null,a.old));v(K)&&(c.horiz?I.forEach(function(a){var b;n=a.pos;q=n+a.len;r=p=Math.round(K+c.transB);"pass"!==z&&(r<l||r>l+c.width)&&(z?r=p=E(r,l,l+c.width):b=!0);b||t.push("M",r,n,"L",p,q)}):I.forEach(function(a){var b;r=a.pos;p=r+a.len;n=q=Math.round(m+c.height-K);"pass"!==z&&(n<m||n>m+c.height)&&(z?n=q=E(n,m,m+c.height):b=!0);b||t.push("M",r,n,"L",p,q)}));a.path=0<t.length?h.crispPolyLine(t,a.lineWidth|| |
|
|
|
1):null}});b.prototype.crispPolyLine=function(a,b){var c;for(c=0;c<a.length;c+=6)a[c+1]===a[c+4]&&(a[c+1]=a[c+4]=Math.round(a[c+1])-b%2/2),a[c+2]===a[c+5]&&(a[c+2]=a[c+5]=Math.round(a[c+2])+b%2/2);return a};f===a&&(a.prototype.crispPolyLine=b.prototype.crispPolyLine);g(z,"afterHideCrosshair",function(){this.crossLabel&&(this.crossLabel=this.crossLabel.hide())});g(z,"afterDrawCrosshair",function(a){var b,c;if(D(this.crosshair.label)&&this.crosshair.label.enabled&&this.cross){var d=this.chart,f=this.options.crosshair.label, |
|
|
|
g=this.horiz,h=this.opposite,l=this.left,m=this.top,r=this.crossLabel,n=f.format,p="",t="inside"===this.options.tickPosition,v=!1!==this.crosshair.snap,w=0,y=a.e||this.cross&&this.cross.e,z=a.point;var C=this.lin2log;if(this.isLog){a=C(this.min);var E=C(this.max)}else a=this.min,E=this.max;C=g?"center":h?"right"===this.labelAlign?"right":"left":"left"===this.labelAlign?"left":"center";r||(r=this.crossLabel=d.renderer.label(null,null,null,f.shape||"callout").addClass("highcharts-crosshair-label"+(this.series[0]&& |
|
|
|
" highcharts-color-"+this.series[0].colorIndex)).attr({align:f.align||C,padding:B(f.padding,8),r:B(f.borderRadius,3),zIndex:2}).add(this.labelGroup),d.styledMode||r.attr({fill:f.backgroundColor||this.series[0]&&this.series[0].color||"#666666",stroke:f.borderColor||"","stroke-width":f.borderWidth||0}).css(x({color:"#ffffff",fontWeight:"normal",fontSize:"11px",textAlign:"center"},f.style)));g?(C=v?z.plotX+l:y.chartX,m+=h?0:this.height):(C=h?this.width+l:0,m=v?z.plotY+m:y.chartY);n||f.formatter||(this.isDatetimeAxis&& |
|
|
|
(p="%b %d, %Y"),n="{value"+(p?":"+p:"")+"}");p=v?z[this.isXAxis?"x":"y"]:this.toValue(g?y.chartX:y.chartY);r.attr({text:n?q(n,{value:p},d):f.formatter.call(this,p),x:C,y:m,visibility:p<a||p>E?"hidden":"visible"});f=r.getBBox();if(g){if(t&&!h||!t&&h)m=r.y-f.height}else m=r.y-f.height/2;g?(b=l-f.x,c=l+this.width-f.x):(b="left"===this.labelAlign?l:0,c="right"===this.labelAlign?l+this.width:d.chartWidth);r.translateX<b&&(w=b-r.translateX);r.translateX+f.width>=c&&(w=-(r.translateX+f.width-c));r.attr({x:C+ |
|
|
|
w,y:m,anchorX:g?C:this.opposite?0:d.chartWidth,anchorY:g?this.opposite?d.chartHeight:0:m+f.height/2})}});l.init=function(){n.apply(this,arguments);this.setCompare(this.options.compare)};l.setCompare=function(a){this.modifyValue="value"===a||"percent"===a?function(b,c){var d=this.compareValue;return"undefined"!==typeof b&&"undefined"!==typeof d?(b="value"===a?b-d:b/d*100-(100===this.options.compareBase?0:100),c&&(c.change=b),b):0}:null;this.userOptions.compare=a;this.chart.hasRendered&&(this.isDirty= |
|
|
|
!0)};l.processData=function(a){var b,c=-1,d=!0===this.options.compareStart?0:1;t.apply(this,arguments);if(this.xAxis&&this.processedYData){var f=this.processedXData;var g=this.processedYData;var h=g.length;this.pointArrayMap&&(c=this.pointArrayMap.indexOf(this.options.pointValKey||this.pointValKey||"y"));for(b=0;b<h-d;b++){var l=g[b]&&-1<c?g[b][c]:g[b];if(v(l)&&f[b+d]>=this.xAxis.min&&0!==l){this.compareValue=l;break}}}};g(c,"afterGetExtremes",function(){if(this.modifyValue){var a=[this.modifyValue(this.dataMin), |
|
|
|
this.modifyValue(this.dataMax)];this.dataMin=F(a);this.dataMax=y(a)}});z.prototype.setCompare=function(a,b){this.isXAxis||(this.series.forEach(function(b){b.setCompare(a)}),B(b,!0)&&this.chart.redraw())};h.prototype.tooltipFormatter=function(a){var b=this.series.chart.numberFormatter;a=a.replace("{point.change}",(0<this.change?"+":"")+b(this.change,B(this.series.tooltipOptions.changeDecimals,2)));return I.apply(this,[a])};g(c,"render",function(){var a=this.chart;if(!(a.is3d&&a.is3d()||a.polar)&&this.xAxis&& |
|
|
|
!this.xAxis.isRadial){var b=this.yAxis.len;if(this.xAxis.axisLine){var c=a.plotTop+a.plotHeight-this.yAxis.pos-this.yAxis.len,d=Math.floor(this.xAxis.axisLine.strokeWidth()/2);0<=c&&(b-=Math.max(d-c,0))}!this.clipBox&&this.animate?(this.clipBox=w(a.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=b):a[this.sharedClipKey]&&(a[this.sharedClipKey].animate({width:this.xAxis.len,height:b}),a[this.sharedClipKey+"m"]&&a[this.sharedClipKey+"m"].animate({width:this.xAxis.len}))}});g(m,"update", |
|
|
|
function(a){a=a.options;"scrollbar"in a&&this.navigator&&(w(!0,this.options.scrollbar,a.scrollbar),this.navigator.update({},!1),delete a.scrollbar)});g(z,"afterSetScale",function(){var a=this,b=a.chart.options.chart&&a.chart.options.chart.panning;if(b&&("y"===b.type||"xy"===b.type)&&!a.isXAxis&&!D(a.panningState)){var c=Number.MAX_VALUE,f=Number.MIN_VALUE;a.series.forEach(function(b){c=Math.min(d.arrayMin(b.yData),c)-(a.min&&a.dataMin?a.dataMin-a.min:0);f=Math.max(d.arrayMax(b.yData),f)+(a.max&&a.dataMax? |
|
|
|
a.max-a.dataMax:0)});a.panningState={startMin:c,startMax:f}}})});K(y,"masters/modules/stock.src.js",[],function(){});K(y,"masters/highstock.src.js",[y["masters/highcharts.src.js"]],function(d){d.product="Highstock";return d});y["masters/highstock.src.js"]._modules=y;return y["masters/highstock.src.js"]}); |