Ajout graphe + correctio logo precampagne
This commit is contained in:
parent
77bf9f3147
commit
6f3a98d17e
7 changed files with 383 additions and 26 deletions
21
roulette.py
21
roulette.py
|
@ -367,7 +367,26 @@ def home():
|
|||
|
||||
bans_hist.append(entry)
|
||||
|
||||
return render_template('home.html', bans_hist=bans_hist)
|
||||
con = connect_sqlite()
|
||||
cur = con.cursor()
|
||||
|
||||
cur.execute("""select firstname,name,ban_end from players""", [time()])
|
||||
|
||||
rows = cur.fetchall()
|
||||
con.close()
|
||||
tranchés = 0
|
||||
n_tranchés = 0
|
||||
with open(IMMUNITY_FILE, 'r') as f:
|
||||
immunity = f.read()
|
||||
for row in rows:
|
||||
if row[0]+' '+row[1] not in immunity:
|
||||
if row[2] > time():
|
||||
tranchés += 1
|
||||
else:
|
||||
n_tranchés += 1
|
||||
|
||||
stats = (tranchés,n_tranchés)
|
||||
return render_template('home.html', bans_hist=bans_hist, stats=stats)
|
||||
else:
|
||||
return render_template('precampagne.html', user=player)
|
||||
|
||||
|
|
290
static/highcharts-custom.js
Normal file
290
static/highcharts-custom.js
Normal file
|
@ -0,0 +1,290 @@
|
|||
/*
|
||||
Highcharts JS v5.0.7 custom build (2017-01-29)
|
||||
|
||||
(c) 2009-2016 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(Q,a){"object"===typeof module&&module.exports?module.exports=Q.document?a(Q):a:Q.Highcharts=a(Q)})("undefined"!==typeof window?window:this,function(Q){Q=function(){var a=window,y=a.document,I=a.navigator&&a.navigator.userAgent||"",E=y&&y.createElementNS&&!!y.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,K=/(edge|msie|trident)/i.test(I)&&!window.opera,c=!E,d=/Firefox/.test(I),p=d&&4>parseInt(I.split("Firefox/")[1],10);return a.Highcharts?a.Highcharts.error(16,!0):{product:"Highcharts",
|
||||
version:"5.0.7 custom build",deg2rad:2*Math.PI/360,doc:y,hasBidiBug:p,hasTouch:y&&void 0!==y.documentElement.ontouchstart,isMS:K,isWebKit:/AppleWebKit/.test(I),isFirefox:d,isTouchDevice:/(Mobile|Android|Windows Phone)/.test(I),SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:E,vml:c,win:a,charts:[],marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){}}}();(function(a){var y=[],I=a.charts,E=a.doc,K=a.win;a.error=function(c,d){c=a.isNumber(c)?
|
||||
"Highcharts error #"+c+": www.highcharts.com/errors/"+c:c;if(d)throw Error(c);K.console&&console.log(c)};a.Fx=function(a,d,p){this.options=d;this.elem=a;this.prop=p};a.Fx.prototype={dSetter:function(){var a=this.paths[0],d=this.paths[1],p=[],r=this.now,n=a.length,t;if(1===r)p=this.toD;else if(n===d.length&&1>r)for(;n--;)t=parseFloat(a[n]),p[n]=isNaN(t)?a[n]:r*parseFloat(d[n]-t)+t;else p=d;this.elem.attr("d",p,null,!0)},update:function(){var a=this.elem,d=this.prop,p=this.now,r=this.options.step;if(this[d+
|
||||
"Setter"])this[d+"Setter"]();else a.attr?a.element&&a.attr(d,p,null,!0):a.style[d]=p+this.unit;r&&r.call(a,p,this)},run:function(a,d,p){var c=this,n=function(a){return n.stopped?!1:c.step(a)},t;this.startTime=+new Date;this.start=a;this.end=d;this.unit=p;this.now=this.start;this.pos=0;n.elem=this.elem;n.prop=this.prop;n()&&1===y.push(n)&&(n.timerId=setInterval(function(){for(t=0;t<y.length;t++)y[t]()||y.splice(t--,1);y.length||clearInterval(n.timerId)},13))},step:function(a){var c=+new Date,p,r=this.options;
|
||||
p=this.elem;var n=r.complete,t=r.duration,m=r.curAnim,b;if(p.attr&&!p.element)p=!1;else if(a||c>=t+this.startTime){this.now=this.end;this.pos=1;this.update();a=m[this.prop]=!0;for(b in m)!0!==m[b]&&(a=!1);a&&n&&n.call(p);p=!1}else this.pos=r.easing((c-this.startTime)/t),this.now=this.start+(this.end-this.start)*this.pos,this.update(),p=!0;return p},initPath:function(c,d,p){function r(a){var e,b;for(u=a.length;u--;)e="M"===a[u]||"L"===a[u],b=/[a-zA-Z]/.test(a[u+3]),e&&b&&a.splice(u+1,0,a[u+1],a[u+
|
||||
2],a[u+1],a[u+2])}function n(a,e){for(;a.length<h;){a[0]=e[h-a.length];var b=a.slice(0,F);[].splice.apply(a,[0,0].concat(b));w&&(b=a.slice(a.length-F),[].splice.apply(a,[a.length,0].concat(b)),u--)}a[0]="M"}function t(a,b){for(var c=(h-a.length)/F;0<c&&c--;)e=a.slice().splice(a.length/H-F,F*H),e[0]=b[h-F-c*F],x&&(e[F-6]=e[F-2],e[F-5]=e[F-1]),[].splice.apply(a,[a.length/H,0].concat(e)),w&&c--}d=d||"";var m,b=c.startX,k=c.endX,x=-1<d.indexOf("C"),F=x?7:3,h,e,u;d=d.split(" ");p=p.slice();var w=c.isArea,
|
||||
H=w?2:1,M;x&&(r(d),r(p));if(b&&k){for(u=0;u<b.length;u++)if(b[u]===k[0]){m=u;break}else if(b[0]===k[k.length-b.length+u]){m=u;M=!0;break}void 0===m&&(d=[])}d.length&&a.isNumber(m)&&(h=p.length+m*H*F,M?(n(d,p),t(p,d)):(n(p,d),t(d,p)));return[d,p]}};a.extend=function(a,d){var c;a||(a={});for(c in d)a[c]=d[c];return a};a.merge=function(){var c,d=arguments,p,r={},n=function(c,d){var b,k;"object"!==typeof c&&(c={});for(k in d)d.hasOwnProperty(k)&&(b=d[k],a.isObject(b,!0)&&"renderTo"!==k&&"number"!==typeof b.nodeType?
|
||||
c[k]=n(c[k]||{},b):c[k]=d[k]);return c};!0===d[0]&&(r=d[1],d=Array.prototype.slice.call(d,2));p=d.length;for(c=0;c<p;c++)r=n(r,d[c]);return r};a.pInt=function(a,d){return parseInt(a,d||10)};a.isString=function(a){return"string"===typeof a};a.isArray=function(a){a=Object.prototype.toString.call(a);return"[object Array]"===a||"[object Array Iterator]"===a};a.isObject=function(c,d){return c&&"object"===typeof c&&(!d||!a.isArray(c))};a.isNumber=function(a){return"number"===typeof a&&!isNaN(a)};a.erase=
|
||||
function(a,d){for(var c=a.length;c--;)if(a[c]===d){a.splice(c,1);break}};a.defined=function(a){return void 0!==a&&null!==a};a.attr=function(c,d,p){var r,n;if(a.isString(d))a.defined(p)?c.setAttribute(d,p):c&&c.getAttribute&&(n=c.getAttribute(d));else if(a.defined(d)&&a.isObject(d))for(r in d)c.setAttribute(r,d[r]);return n};a.splat=function(c){return a.isArray(c)?c:[c]};a.syncTimeout=function(a,d,p){if(d)return setTimeout(a,d,p);a.call(0,p)};a.pick=function(){var a=arguments,d,p,r=a.length;for(d=
|
||||
0;d<r;d++)if(p=a[d],void 0!==p&&null!==p)return p};a.css=function(c,d){a.isMS&&!a.svg&&d&&void 0!==d.opacity&&(d.filter="alpha(opacity\x3d"+100*d.opacity+")");a.extend(c.style,d)};a.createElement=function(c,d,p,r,n){c=E.createElement(c);var t=a.css;d&&a.extend(c,d);n&&t(c,{padding:0,border:"none",margin:0});p&&t(c,p);r&&r.appendChild(c);return c};a.extendClass=function(c,d){var p=function(){};p.prototype=new c;a.extend(p.prototype,d);return p};a.pad=function(a,d,p){return Array((d||2)+1-String(a).length).join(p||
|
||||
0)+a};a.relativeLength=function(a,d){return/%$/.test(a)?d*parseFloat(a)/100:parseFloat(a)};a.wrap=function(a,d,p){var c=a[d];a[d]=function(){var a=Array.prototype.slice.call(arguments),d=arguments,m=this;m.proceed=function(){c.apply(m,arguments.length?arguments:d)};a.unshift(c);a=p.apply(this,a);m.proceed=null;return a}};a.getTZOffset=function(c){var d=a.Date;return 6E4*(d.hcGetTimezoneOffset&&d.hcGetTimezoneOffset(c)||d.hcTimezoneOffset||0)};a.dateFormat=function(c,d,p){if(!a.defined(d)||isNaN(d))return a.defaultOptions.lang.invalidDate||
|
||||
"";c=a.pick(c,"%Y-%m-%d %H:%M:%S");var r=a.Date,n=new r(d-a.getTZOffset(d)),t,m=n[r.hcGetHours](),b=n[r.hcGetDay](),k=n[r.hcGetDate](),x=n[r.hcGetMonth](),F=n[r.hcGetFullYear](),h=a.defaultOptions.lang,e=h.weekdays,u=h.shortWeekdays,w=a.pad,r=a.extend({a:u?u[b]:e[b].substr(0,3),A:e[b],d:w(k),e:w(k,2," "),w:b,b:h.shortMonths[x],B:h.months[x],m:w(x+1),y:F.toString().substr(2,2),Y:F,H:w(m),k:m,I:w(m%12||12),l:m%12||12,M:w(n[r.hcGetMinutes]()),p:12>m?"AM":"PM",P:12>m?"am":"pm",S:w(n.getSeconds()),L:w(Math.round(d%
|
||||
1E3),3)},a.dateFormats);for(t in r)for(;-1!==c.indexOf("%"+t);)c=c.replace("%"+t,"function"===typeof r[t]?r[t](d):r[t]);return p?c.substr(0,1).toUpperCase()+c.substr(1):c};a.formatSingle=function(c,d){var p=/\.([0-9])/,r=a.defaultOptions.lang;/f$/.test(c)?(p=(p=c.match(p))?p[1]:-1,null!==d&&(d=a.numberFormat(d,p,r.decimalPoint,-1<c.indexOf(",")?r.thousandsSep:""))):d=a.dateFormat(c,d);return d};a.format=function(c,d){for(var p="{",r=!1,n,t,m,b,k=[],x;c;){p=c.indexOf(p);if(-1===p)break;n=c.slice(0,
|
||||
p);if(r){n=n.split(":");t=n.shift().split(".");b=t.length;x=d;for(m=0;m<b;m++)x=x[t[m]];n.length&&(x=a.formatSingle(n.join(":"),x));k.push(x)}else k.push(n);c=c.slice(p+1);p=(r=!r)?"}":"{"}k.push(c);return k.join("")};a.getMagnitude=function(a){return Math.pow(10,Math.floor(Math.log(a)/Math.LN10))};a.normalizeTickInterval=function(c,d,p,r,n){var t,m=c;p=a.pick(p,1);t=c/p;d||(d=n?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],!1===r&&(1===p?d=a.grep(d,function(a){return 0===a%1}):.1>=p&&(d=[1/p])));
|
||||
for(r=0;r<d.length&&!(m=d[r],n&&m*p>=c||!n&&t<=(d[r]+(d[r+1]||d[r]))/2);r++);return m=a.correctFloat(m*p,-Math.round(Math.log(.001)/Math.LN10))};a.stableSort=function(a,d){var c=a.length,r,n;for(n=0;n<c;n++)a[n].safeI=n;a.sort(function(a,c){r=d(a,c);return 0===r?a.safeI-c.safeI:r});for(n=0;n<c;n++)delete a[n].safeI};a.arrayMin=function(a){for(var d=a.length,c=a[0];d--;)a[d]<c&&(c=a[d]);return c};a.arrayMax=function(a){for(var d=a.length,c=a[0];d--;)a[d]>c&&(c=a[d]);return c};a.destroyObjectProperties=
|
||||
function(a,d){for(var c in a)a[c]&&a[c]!==d&&a[c].destroy&&a[c].destroy(),delete a[c]};a.discardElement=function(c){var d=a.garbageBin;d||(d=a.createElement("div"));c&&d.appendChild(c);d.innerHTML=""};a.correctFloat=function(a,d){return parseFloat(a.toPrecision(d||14))};a.setAnimation=function(c,d){d.renderer.globalAnimation=a.pick(c,d.options.chart.animation,!0)};a.animObject=function(c){return a.isObject(c)?a.merge(c):{duration:c?500:0}};a.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,
|
||||
day:864E5,week:6048E5,month:24192E5,year:314496E5};a.numberFormat=function(c,d,p,r){c=+c||0;d=+d;var n=a.defaultOptions.lang,t=(c.toString().split(".")[1]||"").length,m,b;-1===d?d=Math.min(t,20):a.isNumber(d)||(d=2);b=(Math.abs(c)+Math.pow(10,-Math.max(d,t)-1)).toFixed(d);t=String(a.pInt(b));m=3<t.length?t.length%3:0;p=a.pick(p,n.decimalPoint);r=a.pick(r,n.thousandsSep);c=(0>c?"-":"")+(m?t.substr(0,m)+r:"");c+=t.substr(m).replace(/(\d{3})(?=\d)/g,"$1"+r);d&&(c+=p+b.slice(-d));return c};Math.easeInOutSine=
|
||||
function(a){return-.5*(Math.cos(Math.PI*a)-1)};a.getStyle=function(c,d){return"width"===d?Math.min(c.offsetWidth,c.scrollWidth)-a.getStyle(c,"padding-left")-a.getStyle(c,"padding-right"):"height"===d?Math.min(c.offsetHeight,c.scrollHeight)-a.getStyle(c,"padding-top")-a.getStyle(c,"padding-bottom"):(c=K.getComputedStyle(c,void 0))&&a.pInt(c.getPropertyValue(d))};a.inArray=function(a,d){return d.indexOf?d.indexOf(a):[].indexOf.call(d,a)};a.grep=function(a,d){return[].filter.call(a,d)};a.find=function(a,
|
||||
d){return[].find.call(a,d)};a.map=function(a,d){for(var c=[],r=0,n=a.length;r<n;r++)c[r]=d.call(a[r],a[r],r,a);return c};a.offset=function(a){var d=E.documentElement;a=a.getBoundingClientRect();return{top:a.top+(K.pageYOffset||d.scrollTop)-(d.clientTop||0),left:a.left+(K.pageXOffset||d.scrollLeft)-(d.clientLeft||0)}};a.stop=function(a,d){for(var c=y.length;c--;)y[c].elem!==a||d&&d!==y[c].prop||(y[c].stopped=!0)};a.each=function(a,d,p){return Array.prototype.forEach.call(a,d,p)};a.addEvent=function(c,
|
||||
d,p){function r(a){a.target=a.srcElement||K;p.call(c,a)}var n=c.hcEvents=c.hcEvents||{};c.addEventListener?c.addEventListener(d,p,!1):c.attachEvent&&(c.hcEventsIE||(c.hcEventsIE={}),c.hcEventsIE[p.toString()]=r,c.attachEvent("on"+d,r));n[d]||(n[d]=[]);n[d].push(p);return function(){a.removeEvent(c,d,p)}};a.removeEvent=function(c,d,p){function r(a,b){c.removeEventListener?c.removeEventListener(a,b,!1):c.attachEvent&&(b=c.hcEventsIE[b.toString()],c.detachEvent("on"+a,b))}function n(){var a,b;if(c.nodeName)for(b in d?
|
||||
(a={},a[d]=!0):a=m,a)if(m[b])for(a=m[b].length;a--;)r(b,m[b][a])}var t,m=c.hcEvents,b;m&&(d?(t=m[d]||[],p?(b=a.inArray(p,t),-1<b&&(t.splice(b,1),m[d]=t),r(d,p)):(n(),m[d]=[])):(n(),c.hcEvents={}))};a.fireEvent=function(c,d,p,r){var n;n=c.hcEvents;var t,m;p=p||{};if(E.createEvent&&(c.dispatchEvent||c.fireEvent))n=E.createEvent("Events"),n.initEvent(d,!0,!0),a.extend(n,p),c.dispatchEvent?c.dispatchEvent(n):c.fireEvent(d,n);else if(n)for(n=n[d]||[],t=n.length,p.target||a.extend(p,{preventDefault:function(){p.defaultPrevented=
|
||||
!0},target:c,type:d}),d=0;d<t;d++)(m=n[d])&&!1===m.call(c,p)&&p.preventDefault();r&&!p.defaultPrevented&&r(p)};a.animate=function(c,d,p){var r,n="",t,m,b;a.isObject(p)||(r=arguments,p={duration:r[2],easing:r[3],complete:r[4]});a.isNumber(p.duration)||(p.duration=400);p.easing="function"===typeof p.easing?p.easing:Math[p.easing]||Math.easeInOutSine;p.curAnim=a.merge(d);for(b in d)a.stop(c,b),m=new a.Fx(c,p,b),t=null,"d"===b?(m.paths=m.initPath(c,c.d,d.d),m.toD=d.d,r=0,t=1):c.attr?r=c.attr(b):(r=parseFloat(a.getStyle(c,
|
||||
b))||0,"opacity"!==b&&(n="px")),t||(t=d[b]),t.match&&t.match("px")&&(t=t.replace(/px/g,"")),m.run(r,t,n)};a.seriesType=function(c,d,p,r,n){var t=a.getOptions(),m=a.seriesTypes;t.plotOptions[c]=a.merge(t.plotOptions[d],p);m[c]=a.extendClass(m[d]||function(){},r);m[c].prototype.type=c;n&&(m[c].prototype.pointClass=a.extendClass(a.Point,n));return m[c]};a.uniqueKey=function(){var a=Math.random().toString(36).substring(2,9),d=0;return function(){return"highcharts-"+a+"-"+d++}}();K.jQuery&&(K.jQuery.fn.highcharts=
|
||||
function(){var c=[].slice.call(arguments);if(this[0])return c[0]?(new (a[a.isString(c[0])?c.shift():"Chart"])(this[0],c[0],c[1]),this):I[a.attr(this[0],"data-highcharts-chart")]});E&&!E.defaultView&&(a.getStyle=function(c,d){var p={width:"clientWidth",height:"clientHeight"}[d];if(c.style[d])return a.pInt(c.style[d]);"opacity"===d&&(d="filter");if(p)return c.style.zoom=1,Math.max(c[p]-2*a.getStyle(c,"padding"),0);c=c.currentStyle[d.replace(/\-(\w)/g,function(a,d){return d.toUpperCase()})];"filter"===
|
||||
d&&(c=c.replace(/alpha\(opacity=([0-9]+)\)/,function(a,d){return d/100}));return""===c?1:a.pInt(c)});Array.prototype.forEach||(a.each=function(a,d,p){for(var c=0,n=a.length;c<n;c++)if(!1===d.call(p,a[c],c,a))return c});Array.prototype.indexOf||(a.inArray=function(a,d){var c,r=0;if(d)for(c=d.length;r<c;r++)if(d[r]===a)return r;return-1});Array.prototype.filter||(a.grep=function(a,d){for(var c=[],r=0,n=a.length;r<n;r++)d(a[r],r)&&c.push(a[r]);return c});Array.prototype.find||(a.find=function(a,d){var c,
|
||||
r=a.length;for(c=0;c<r;c++)if(d(a[c],c))return a[c]})})(Q);(function(a){var y=a.each,I=a.isNumber,E=a.map,K=a.merge,c=a.pInt;a.Color=function(d){if(!(this instanceof a.Color))return new a.Color(d);this.init(d)};a.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(a){return[c(a[1]),c(a[2]),c(a[3]),parseFloat(a[4],10)]}},{regex:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(a){return[c(a[1],
|
||||
16),c(a[2],16),c(a[3],16),1]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(a){return[c(a[1]),c(a[2]),c(a[3]),1]}}],names:{white:"#ffffff",black:"#000000"},init:function(d){var c,r,n,t;if((this.input=d=this.names[d]||d)&&d.stops)this.stops=E(d.stops,function(d){return new a.Color(d[1])});else for(n=this.parsers.length;n--&&!r;)t=this.parsers[n],(c=t.regex.exec(d))&&(r=t.parse(c));this.rgba=r||[]},get:function(a){var c=this.input,d=this.rgba,n;this.stops?
|
||||
(n=K(c),n.stops=[].concat(n.stops),y(this.stops,function(d,c){n.stops[c]=[n.stops[c][0],d.get(a)]})):n=d&&I(d[0])?"rgb"===a||!a&&1===d[3]?"rgb("+d[0]+","+d[1]+","+d[2]+")":"a"===a?d[3]:"rgba("+d.join(",")+")":c;return n},brighten:function(a){var d,r=this.rgba;if(this.stops)y(this.stops,function(d){d.brighten(a)});else if(I(a)&&0!==a)for(d=0;3>d;d++)r[d]+=c(255*a),0>r[d]&&(r[d]=0),255<r[d]&&(r[d]=255);return this},setOpacity:function(a){this.rgba[3]=a;return this}};a.color=function(d){return new a.Color(d)}})(Q);
|
||||
(function(a){function y(){var d=a.defaultOptions.global,c=r.moment;if(d.timezone){if(c)return function(a){return-c.tz(a,d.timezone).utcOffset()};a.error(25)}return d.useUTC&&d.getTimezoneOffset}function I(){var d=a.defaultOptions.global,t,m=d.useUTC,b=m?"getUTC":"get",k=m?"setUTC":"set";a.Date=t=d.Date||r.Date;t.hcTimezoneOffset=m&&d.timezoneOffset;t.hcGetTimezoneOffset=y();t.hcMakeTime=function(a,b,h,e,d,k){var u;m?(u=t.UTC.apply(0,arguments),u+=c(u)):u=(new t(a,b,p(h,1),p(e,0),p(d,0),p(k,0))).getTime();
|
||||
return u};K("Minutes Hours Day Date Month FullYear".split(" "),function(a){t["hcGet"+a]=b+a});K("Milliseconds Seconds Minutes Hours Date Month FullYear".split(" "),function(a){t["hcSet"+a]=k+a})}var E=a.color,K=a.each,c=a.getTZOffset,d=a.merge,p=a.pick,r=a.win;a.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:{useUTC:!0,VMLRadialGradientURL:"http://code.highcharts.com/5.0.7 custom build/gfx/vml-radial-gradient.png"},chart:{borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:20},
|
||||
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},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},
|
||||
itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},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:a.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:a.isTouchDevice?25:10,backgroundColor:E("#f7f7f7").setOpacity(.85).get(),borderWidth:1,headerFormat:'\x3cspan style\x3d"font-size: 10px"\x3e{point.key}\x3c/span\x3e\x3cbr/\x3e',pointFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e',
|
||||
shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px",pointerEvents:"none",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};a.setOptions=function(c){a.defaultOptions=d(!0,a.defaultOptions,c);I();return a.defaultOptions};a.getOptions=function(){return a.defaultOptions};a.defaultPlotOptions=a.defaultOptions.plotOptions;I()})(Q);
|
||||
(function(a){var y,I,E=a.addEvent,K=a.animate,c=a.attr,d=a.charts,p=a.color,r=a.css,n=a.createElement,t=a.defined,m=a.deg2rad,b=a.destroyObjectProperties,k=a.doc,x=a.each,F=a.extend,h=a.erase,e=a.grep,u=a.hasTouch,w=a.inArray,H=a.isArray,M=a.isFirefox,G=a.isMS,N=a.isObject,C=a.isString,q=a.isWebKit,z=a.merge,A=a.noop,B=a.pick,D=a.pInt,f=a.removeEvent,l=a.stop,L=a.svg,O=a.SVG_NS,P=a.symbolSizes,R=a.win;y=a.SVGElement=function(){return this};y.prototype={opacity:1,SVG_NS:O,textProps:"direction fontSize fontWeight fontFamily fontStyle color lineHeight width textDecoration textOverflow textOutline".split(" "),
|
||||
init:function(g,a){this.element="span"===a?n(a):k.createElementNS(this.SVG_NS,a);this.renderer=g},animate:function(g,v,f){v=a.animObject(B(v,this.renderer.globalAnimation,!0));0!==v.duration?(f&&(v.complete=f),K(this,g,v)):this.attr(g,null,f);return this},colorGradient:function(g,f,l){var v=this.renderer,b,e,J,h,q,d,u,c,L,k,O,w=[],m;g.linearGradient?e="linearGradient":g.radialGradient&&(e="radialGradient");if(e){J=g[e];q=v.gradients;u=g.stops;k=l.radialReference;H(J)&&(g[e]=J={x1:J[0],y1:J[1],x2:J[2],
|
||||
y2:J[3],gradientUnits:"userSpaceOnUse"});"radialGradient"===e&&k&&!t(J.gradientUnits)&&(h=J,J=z(J,v.getRadialAttr(k,h),{gradientUnits:"userSpaceOnUse"}));for(O in J)"id"!==O&&w.push(O,J[O]);for(O in u)w.push(u[O]);w=w.join(",");q[w]?k=q[w].attr("id"):(J.id=k=a.uniqueKey(),q[w]=d=v.createElement(e).attr(J).add(v.defs),d.radAttr=h,d.stops=[],x(u,function(g){0===g[1].indexOf("rgba")?(b=a.color(g[1]),c=b.get("rgb"),L=b.get("a")):(c=g[1],L=1);g=v.createElement("stop").attr({offset:g[0],"stop-color":c,
|
||||
"stop-opacity":L}).add(d);d.stops.push(g)}));m="url("+v.url+"#"+k+")";l.setAttribute(f,m);l.gradient=w;g.toString=function(){return m}}},applyTextOutline:function(g){var a=this.element,f,l,e,b;-1!==g.indexOf("contrast")&&(g=g.replace(/contrast/g,this.renderer.getContrast(a.style.fill)));this.fakeTS=!0;this.ySetter=this.xSetter;f=[].slice.call(a.getElementsByTagName("tspan"));g=g.split(" ");l=g[g.length-1];(e=g[0])&&"none"!==e&&(e=e.replace(/(^[\d\.]+)(.*?)$/g,function(g,a,f){return 2*a+f}),x(f,function(g){"highcharts-text-outline"===
|
||||
g.getAttribute("class")&&h(f,a.removeChild(g))}),b=a.firstChild,x(f,function(g,f){0===f&&(g.setAttribute("x",a.getAttribute("x")),f=a.getAttribute("y"),g.setAttribute("y",f||0),null===f&&a.setAttribute("y",0));g=g.cloneNode(1);c(g,{"class":"highcharts-text-outline",fill:l,stroke:l,"stroke-width":e,"stroke-linejoin":"round"});a.insertBefore(g,b)}))},attr:function(g,a,f,e){var v,b=this.element,J,h=this,q;"string"===typeof g&&void 0!==a&&(v=g,g={},g[v]=a);if("string"===typeof g)h=(this[g+"Getter"]||
|
||||
this._defaultGetter).call(this,g,b);else{for(v in g)a=g[v],q=!1,e||l(this,v),this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(v)&&(J||(this.symbolAttr(g),J=!0),q=!0),!this.rotation||"x"!==v&&"y"!==v||(this.doTransform=!0),q||(q=this[v+"Setter"]||this._defaultSetter,q.call(this,a,v,b),this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(v)&&this.updateShadows(v,a,q));this.doTransform&&(this.updateTransform(),this.doTransform=!1)}f&&f();return h},updateShadows:function(g,
|
||||
a,f){for(var v=this.shadows,l=v.length;l--;)f.call(v[l],"height"===g?Math.max(a-(v[l].cutHeight||0),0):"d"===g?this.d:a,g,v[l])},addClass:function(g,a){var f=this.attr("class")||"";-1===f.indexOf(g)&&(a||(g=(f+(f?" ":"")+g).replace(" "," ")),this.attr("class",g));return this},hasClass:function(g){return-1!==c(this.element,"class").indexOf(g)},removeClass:function(g){c(this.element,"class",(c(this.element,"class")||"").replace(g,""));return this},symbolAttr:function(g){var a=this;x("x y r start end width height innerR anchorX anchorY".split(" "),
|
||||
function(f){a[f]=B(g[f],a[f])});a.attr({d:a.renderer.symbols[a.symbolName](a.x,a.y,a.width,a.height,a)})},clip:function(g){return this.attr("clip-path",g?"url("+this.renderer.url+"#"+g.id+")":"none")},crisp:function(g,a){var f,v={},l;a=a||g.strokeWidth||0;l=Math.round(a)%2/2;g.x=Math.floor(g.x||this.x||0)+l;g.y=Math.floor(g.y||this.y||0)+l;g.width=Math.floor((g.width||this.width||0)-2*l);g.height=Math.floor((g.height||this.height||0)-2*l);t(g.strokeWidth)&&(g.strokeWidth=a);for(f in g)this[f]!==g[f]&&
|
||||
(this[f]=v[f]=g[f]);return v},css:function(g){var a=this.styles,f={},l=this.element,e,b,q="";e=!a;var h=["textOverflow","width"];g&&g.color&&(g.fill=g.color);if(a)for(b in g)g[b]!==a[b]&&(f[b]=g[b],e=!0);if(e){e=this.textWidth=g&&g.width&&"text"===l.nodeName.toLowerCase()&&D(g.width)||this.textWidth;a&&(g=F(a,f));this.styles=g;e&&!L&&this.renderer.forExport&&delete g.width;if(G&&!L)r(this.element,g);else{a=function(g,a){return"-"+a.toLowerCase()};for(b in g)-1===w(b,h)&&(q+=b.replace(/([A-Z])/g,a)+
|
||||
":"+g[b]+";");q&&c(l,"style",q)}this.added&&(e&&this.renderer.buildText(this),g&&g.textOutline&&this.applyTextOutline(g.textOutline))}return this},strokeWidth:function(){return this["stroke-width"]||0},on:function(g,a){var f=this,l=f.element;u&&"click"===g?(l.ontouchstart=function(g){f.touchEventFired=Date.now();g.preventDefault();a.call(l,g)},l.onclick=function(g){(-1===R.navigator.userAgent.indexOf("Android")||1100<Date.now()-(f.touchEventFired||0))&&a.call(l,g)}):l["on"+g]=a;return this},setRadialReference:function(g){var a=
|
||||
this.renderer.gradients[this.element.gradient];this.element.radialReference=g;a&&a.radAttr&&a.animate(this.renderer.getRadialAttr(g,a.radAttr));return this},translate:function(g,a){return this.attr({translateX:g,translateY:a})},invert:function(g){this.inverted=g;this.updateTransform();return this},updateTransform:function(){var g=this.translateX||0,a=this.translateY||0,f=this.scaleX,l=this.scaleY,b=this.inverted,e=this.rotation,q=this.element;b&&(g+=this.width,a+=this.height);g=["translate("+g+","+
|
||||
a+")"];b?g.push("rotate(90) scale(-1,1)"):e&&g.push("rotate("+e+" "+(q.getAttribute("x")||0)+" "+(q.getAttribute("y")||0)+")");(t(f)||t(l))&&g.push("scale("+B(f,1)+" "+B(l,1)+")");g.length&&q.setAttribute("transform",g.join(" "))},toFront:function(){var g=this.element;g.parentNode.appendChild(g);return this},align:function(g,a,f){var l,v,b,e,J={};v=this.renderer;b=v.alignedObjects;var q,d;if(g){if(this.alignOptions=g,this.alignByTranslate=a,!f||C(f))this.alignTo=l=f||"renderer",h(b,this),b.push(this),
|
||||
f=null}else g=this.alignOptions,a=this.alignByTranslate,l=this.alignTo;f=B(f,v[l],v);l=g.align;v=g.verticalAlign;b=(f.x||0)+(g.x||0);e=(f.y||0)+(g.y||0);"right"===l?q=1:"center"===l&&(q=2);q&&(b+=(f.width-(g.width||0))/q);J[a?"translateX":"x"]=Math.round(b);"bottom"===v?d=1:"middle"===v&&(d=2);d&&(e+=(f.height-(g.height||0))/d);J[a?"translateY":"y"]=Math.round(e);this[this.placed?"animate":"attr"](J);this.placed=!0;this.alignAttr=J;return this},getBBox:function(g,a){var f,l=this.renderer,v,b=this.element,
|
||||
e=this.styles,q,h=this.textStr,d,u=l.cache,c=l.cacheKeys,k;a=B(a,this.rotation);v=a*m;q=e&&e.fontSize;void 0!==h&&(k=h.toString(),-1===k.indexOf("\x3c")&&(k=k.replace(/[0-9]/g,"0")),k+=["",a||0,q,e&&e.width,e&&e.textOverflow].join());k&&!g&&(f=u[k]);if(!f){if(b.namespaceURI===this.SVG_NS||l.forExport){try{(d=this.fakeTS&&function(g){x(b.querySelectorAll(".highcharts-text-outline"),function(a){a.style.display=g})})&&d("none"),f=b.getBBox?F({},b.getBBox()):{width:b.offsetWidth,height:b.offsetHeight},
|
||||
d&&d("")}catch(U){}if(!f||0>f.width)f={width:0,height:0}}else f=this.htmlGetBBox();l.isSVG&&(g=f.width,l=f.height,e&&"11px"===e.fontSize&&17===Math.round(l)&&(f.height=l=14),a&&(f.width=Math.abs(l*Math.sin(v))+Math.abs(g*Math.cos(v)),f.height=Math.abs(l*Math.cos(v))+Math.abs(g*Math.sin(v))));if(k&&0<f.height){for(;250<c.length;)delete u[c.shift()];u[k]||c.push(k);u[k]=f}}return f},show:function(g){return this.attr({visibility:g?"inherit":"visible"})},hide:function(){return this.attr({visibility:"hidden"})},
|
||||
fadeOut:function(g){var a=this;a.animate({opacity:0},{duration:g||150,complete:function(){a.attr({y:-9999})}})},add:function(g){var a=this.renderer,f=this.element,l;g&&(this.parentGroup=g);this.parentInverted=g&&g.inverted;void 0!==this.textStr&&a.buildText(this);this.added=!0;if(!g||g.handleZ||this.zIndex)l=this.zIndexSetter();l||(g?g.element:a.box).appendChild(f);if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(g){var a=g.parentNode;a&&a.removeChild(g)},destroy:function(){var g=
|
||||
this.element||{},a=this.renderer.isSVG&&"SPAN"===g.nodeName&&this.parentGroup,f,b;g.onclick=g.onmouseout=g.onmouseover=g.onmousemove=g.point=null;l(this);this.clipPath&&(this.clipPath=this.clipPath.destroy());if(this.stops){for(b=0;b<this.stops.length;b++)this.stops[b]=this.stops[b].destroy();this.stops=null}this.safeRemoveChild(g);for(this.destroyShadows();a&&a.div&&0===a.div.childNodes.length;)g=a.parentGroup,this.safeRemoveChild(a.div),delete a.div,a=g;this.alignTo&&h(this.renderer.alignedObjects,
|
||||
this);for(f in this)delete this[f];return null},shadow:function(g,a,f){var l=[],v,b,e=this.element,q,h,d,J;if(!g)this.destroyShadows();else if(!this.shadows){h=B(g.width,3);d=(g.opacity||.15)/h;J=this.parentInverted?"(-1,-1)":"("+B(g.offsetX,1)+", "+B(g.offsetY,1)+")";for(v=1;v<=h;v++)b=e.cloneNode(0),q=2*h+1-2*v,c(b,{isShadow:"true",stroke:g.color||"#000000","stroke-opacity":d*v,"stroke-width":q,transform:"translate"+J,fill:"none"}),f&&(c(b,"height",Math.max(c(b,"height")-q,0)),b.cutHeight=q),a?
|
||||
a.element.appendChild(b):e.parentNode.insertBefore(b,e),l.push(b);this.shadows=l}return this},destroyShadows:function(){x(this.shadows||[],function(g){this.safeRemoveChild(g)},this);this.shadows=void 0},xGetter:function(g){"circle"===this.element.nodeName&&("x"===g?g="cx":"y"===g&&(g="cy"));return this._defaultGetter(g)},_defaultGetter:function(g){g=B(this[g],this.element?this.element.getAttribute(g):null,0);/^[\-0-9\.]+$/.test(g)&&(g=parseFloat(g));return g},dSetter:function(g,a,f){g&&g.join&&(g=
|
||||
g.join(" "));/(NaN| {2}|^$)/.test(g)&&(g="M 0 0");f.setAttribute(a,g);this[a]=g},dashstyleSetter:function(g){var a,f=this["stroke-width"];"inherit"===f&&(f=1);if(g=g&&g.toLowerCase()){g=g.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(a=g.length;a--;)g[a]=D(g[a])*f;g=g.join(",").replace(/NaN/g,"none");this.element.setAttribute("stroke-dasharray",
|
||||
g)}},alignSetter:function(g){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[g])},opacitySetter:function(g,a,f){this[a]=g;f.setAttribute(a,g)},titleSetter:function(g){var a=this.element.getElementsByTagName("title")[0];a||(a=k.createElementNS(this.SVG_NS,"title"),this.element.appendChild(a));a.firstChild&&a.removeChild(a.firstChild);a.appendChild(k.createTextNode(String(B(g),"").replace(/<[^>]*>/g,"")))},textSetter:function(g){g!==this.textStr&&(delete this.bBox,
|
||||
this.textStr=g,this.added&&this.renderer.buildText(this))},fillSetter:function(g,a,f){"string"===typeof g?f.setAttribute(a,g):g&&this.colorGradient(g,a,f)},visibilitySetter:function(g,a,f){"inherit"===g?f.removeAttribute(a):f.setAttribute(a,g)},zIndexSetter:function(g,a){var f=this.renderer,l=this.parentGroup,b=(l||f).element||f.box,v,e=this.element,q;v=this.added;var h;t(g)&&(e.zIndex=g,g=+g,this[a]===g&&(v=!1),this[a]=g);if(v){(g=this.zIndex)&&l&&(l.handleZ=!0);a=b.childNodes;for(h=0;h<a.length&&
|
||||
!q;h++)l=a[h],v=l.zIndex,l!==e&&(D(v)>g||!t(g)&&t(v)||0>g&&!t(v)&&b!==f.box)&&(b.insertBefore(e,l),q=!0);q||b.appendChild(e)}return q},_defaultSetter:function(g,a,f){f.setAttribute(a,g)}};y.prototype.yGetter=y.prototype.xGetter;y.prototype.translateXSetter=y.prototype.translateYSetter=y.prototype.rotationSetter=y.prototype.verticalAlignSetter=y.prototype.scaleXSetter=y.prototype.scaleYSetter=function(a,f){this[f]=a;this.doTransform=!0};y.prototype["stroke-widthSetter"]=y.prototype.strokeSetter=function(a,
|
||||
f,l){this[f]=a;this.stroke&&this["stroke-width"]?(y.prototype.fillSetter.call(this,this.stroke,"stroke",l),l.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===f&&0===a&&this.hasStroke&&(l.removeAttribute("stroke"),this.hasStroke=!1)};I=a.SVGRenderer=function(){this.init.apply(this,arguments)};I.prototype={Element:y,SVG_NS:O,init:function(a,f,l,b,e,h){var g;b=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"}).css(this.getStyle(b));g=b.element;
|
||||
a.appendChild(g);-1===a.innerHTML.indexOf("xmlns")&&c(g,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=g;this.boxWrapper=b;this.alignedObjects=[];this.url=(M||q)&&k.getElementsByTagName("base").length?R.location.href.replace(/#.*?$/,"").replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(k.createTextNode("Created with Highcharts 5.0.7 custom build"));this.defs=this.createElement("defs").add();this.allowHTML=h;this.forExport=
|
||||
e;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(f,l,!1);var v;M&&a.getBoundingClientRect&&(f=function(){r(a,{left:0,top:0});v=a.getBoundingClientRect();r(a,{left:Math.ceil(v.left)-v.left+"px",top:Math.ceil(v.top)-v.top+"px"})},f(),this.unSubPixelFix=E(R,"resize",f))},getStyle:function(a){return this.style=F({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();b(this.gradients||{});this.gradients=null;a&&(this.defs=a.destroy());this.unSubPixelFix&&this.unSubPixelFix();return this.alignedObjects=null},createElement:function(a){var g=new this.Element;g.init(this,a);return g},draw:A,getRadialAttr:function(a,f){return{cx:a[0]-a[2]/2+f.cx*a[2],cy:a[1]-a[2]/2+f.cy*a[2],r:f.r*a[2]}},buildText:function(a){var g=
|
||||
a.element,f=this,l=f.forExport,b=B(a.textStr,"").toString(),q=-1!==b.indexOf("\x3c"),h=g.childNodes,d,u,w,m,z=c(g,"x"),A=a.styles,n=a.textWidth,t=A&&A.lineHeight,P=A&&A.textOutline,F=A&&"ellipsis"===A.textOverflow,R=A&&"nowrap"===A.whiteSpace,p=A&&A.fontSize,H,G=h.length,A=n&&!a.added&&this.box,C=function(a){var l;l=/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:p||f.style.fontSize||12;return t?D(t):f.fontMetrics(l,a.getAttribute("style")?a:g).h};H=[b,F,R,t,P,p,n].join();if(H!==a.textCache){for(a.textCache=
|
||||
H;G--;)g.removeChild(h[G]);q||P||F||n||-1!==b.indexOf(" ")?(d=/<.*class="([^"]+)".*>/,u=/<.*style="([^"]+)".*>/,w=/<.*href="(http[^"]+)".*>/,A&&A.appendChild(g),b=q?b.replace(/<(b|strong)>/g,'\x3cspan style\x3d"font-weight:bold"\x3e').replace(/<(i|em)>/g,'\x3cspan style\x3d"font-style:italic"\x3e').replace(/<a/g,"\x3cspan").replace(/<\/(b|strong|i|em|a)>/g,"\x3c/span\x3e").split(/<br.*?>/g):[b],b=e(b,function(a){return""!==a}),x(b,function(b,e){var v,q=0;b=b.replace(/^\s+|\s+$/g,"").replace(/<span/g,
|
||||
"|||\x3cspan").replace(/<\/span>/g,"\x3c/span\x3e|||");v=b.split("|||");x(v,function(b){if(""!==b||1===v.length){var h={},J=k.createElementNS(f.SVG_NS,"tspan"),A,S;d.test(b)&&(A=b.match(d)[1],c(J,"class",A));u.test(b)&&(S=b.match(u)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),c(J,"style",S));w.test(b)&&!l&&(c(J,"onclick",'location.href\x3d"'+b.match(w)[1]+'"'),r(J,{cursor:"pointer"}));b=(b.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"\x3c").replace(/>/g,"\x3e");if(" "!==b){J.appendChild(k.createTextNode(b));
|
||||
q?h.dx=0:e&&null!==z&&(h.x=z);c(J,h);g.appendChild(J);!q&&e&&(!L&&l&&r(J,{display:"block"}),c(J,"dy",C(J)));if(n){h=b.replace(/([^\^])-/g,"$1- ").split(" ");A=1<v.length||e||1<h.length&&!R;for(var x,B,D=[],t=C(J),P=a.rotation,T=b,p=T.length;(A||F)&&(h.length||D.length);)a.rotation=0,x=a.getBBox(!0),B=x.width,!L&&f.forExport&&(B=f.measureSpanWidth(J.firstChild.data,a.styles)),x=B>n,void 0===m&&(m=x),F&&m?(p/=2,""===T||!x&&.5>p?h=[]:(T=b.substring(0,T.length+(x?-1:1)*Math.ceil(p)),h=[T+(3<n?"\u2026":
|
||||
"")],J.removeChild(J.firstChild))):x&&1!==h.length?(J.removeChild(J.firstChild),D.unshift(h.pop())):(h=D,D=[],h.length&&!R&&(J=k.createElementNS(O,"tspan"),c(J,{dy:t,x:z}),S&&c(J,"style",S),g.appendChild(J)),B>n&&(n=B)),h.length&&J.appendChild(k.createTextNode(h.join(" ").replace(/- /g,"-")));a.rotation=P}q++}}})}),m&&a.attr("title",a.textStr),A&&A.removeChild(g),P&&a.applyTextOutline&&a.applyTextOutline(P)):g.appendChild(k.createTextNode(b.replace(/</g,"\x3c").replace(/>/g,"\x3e")))}},getContrast:function(a){a=
|
||||
p(a).rgba;return 510<a[0]+a[1]+a[2]?"#000000":"#FFFFFF"},button:function(a,f,l,b,e,h,q,d,u){var g=this.label(a,f,l,u,null,null,null,null,"button"),v=0;g.attr(z({padding:8,r:2},e));var k,J,c,L;e=z({fill:"#f7f7f7",stroke:"#cccccc","stroke-width":1,style:{color:"#333333",cursor:"pointer",fontWeight:"normal"}},e);k=e.style;delete e.style;h=z(e,{fill:"#e6e6e6"},h);J=h.style;delete h.style;q=z(e,{fill:"#e6ebf5",style:{color:"#000000",fontWeight:"bold"}},q);c=q.style;delete q.style;d=z(e,{style:{color:"#cccccc"}},
|
||||
d);L=d.style;delete d.style;E(g.element,G?"mouseover":"mouseenter",function(){3!==v&&g.setState(1)});E(g.element,G?"mouseout":"mouseleave",function(){3!==v&&g.setState(v)});g.setState=function(a){1!==a&&(g.state=v=a);g.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+["normal","hover","pressed","disabled"][a||0]);g.attr([e,h,q,d][a||0]).css([k,J,c,L][a||0])};g.attr(e).css(F({cursor:"default"},k));return g.on("click",function(a){3!==v&&b.call(g,a)})},crispLine:function(a,
|
||||
f){a[1]===a[4]&&(a[1]=a[4]=Math.round(a[1])-f%2/2);a[2]===a[5]&&(a[2]=a[5]=Math.round(a[2])+f%2/2);return a},path:function(a){var g={fill:"none"};H(a)?g.d=a:N(a)&&F(g,a);return this.createElement("path").attr(g)},circle:function(a,f,l){a=N(a)?a:{x:a,y:f,r:l};f=this.createElement("circle");f.xSetter=f.ySetter=function(a,g,f){f.setAttribute("c"+g,a)};return f.attr(a)},arc:function(a,f,l,b,e,h){N(a)&&(f=a.y,l=a.r,b=a.innerR,e=a.start,h=a.end,a=a.x);a=this.symbol("arc",a||0,f||0,l||0,l||0,{innerR:b||
|
||||
0,start:e||0,end:h||0});a.r=l;return a},rect:function(a,f,l,b,e,h){e=N(a)?a.r:e;var g=this.createElement("rect");a=N(a)?a:void 0===a?{}:{x:a,y:f,width:Math.max(l,0),height:Math.max(b,0)};void 0!==h&&(a.strokeWidth=h,a=g.crisp(a));a.fill="none";e&&(a.r=e);g.rSetter=function(a,g,f){c(f,{rx:a,ry:a})};return g.attr(a)},setSize:function(a,f,l){var g=this.alignedObjects,b=g.length;this.width=a;this.height=f;for(this.boxWrapper.animate({width:a,height:f},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+
|
||||
" "+this.attr("height")})},duration:B(l,!0)?void 0:0});b--;)g[b].align()},g:function(a){var g=this.createElement("g");return a?g.attr({"class":"highcharts-"+a}):g},image:function(a,f,l,b,e){var g={preserveAspectRatio:"none"};1<arguments.length&&F(g,{x:f,y:l,width:b,height:e});g=this.createElement("image").attr(g);g.element.setAttributeNS?g.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):g.element.setAttribute("hc-svg-href",a);return g},symbol:function(a,f,l,b,e,h){var g=this,v,q=this.symbols[a],
|
||||
u=t(f)&&q&&this.symbols[a](Math.round(f),Math.round(l),b,e,h),c=/^url\((.*?)\)$/,L,J;q?(v=this.path(u),v.attr("fill","none"),F(v,{symbolName:a,x:f,y:l,width:b,height:e}),h&&F(v,h)):c.test(a)&&(L=a.match(c)[1],v=this.image(L),v.imgwidth=B(P[L]&&P[L].width,h&&h.width),v.imgheight=B(P[L]&&P[L].height,h&&h.height),J=function(){v.attr({width:v.width,height:v.height})},x(["width","height"],function(a){v[a+"Setter"]=function(a,g){var f={},l=this["img"+g],b="width"===g?"translateX":"translateY";this[g]=a;
|
||||
t(l)&&(this.element&&this.element.setAttribute(g,l),this.alignByTranslate||(f[b]=((this[g]||0)-l)/2,this.attr(f)))}}),t(f)&&v.attr({x:f,y:l}),v.isImg=!0,t(v.imgwidth)&&t(v.imgheight)?J():(v.attr({width:0,height:0}),n("img",{onload:function(){var a=d[g.chartIndex];0===this.width&&(r(this,{position:"absolute",top:"-999em"}),k.body.appendChild(this));P[L]={width:this.width,height:this.height};v.imgwidth=this.width;v.imgheight=this.height;v.element&&J();this.parentNode&&this.parentNode.removeChild(this);
|
||||
g.imgCount--;if(!g.imgCount&&a&&a.onload)a.onload()},src:L}),this.imgCount++));return v},symbols:{circle:function(a,f,l,b){return this.arc(a+l/2,f+b/2,l/2,b/2,{start:0,end:2*Math.PI,open:!1})},square:function(a,f,l,b){return["M",a,f,"L",a+l,f,a+l,f+b,a,f+b,"Z"]},triangle:function(a,f,l,b){return["M",a+l/2,f,"L",a+l,f+b,a,f+b,"Z"]},"triangle-down":function(a,f,l,b){return["M",a,f,"L",a+l,f,a+l/2,f+b,"Z"]},diamond:function(a,f,l,b){return["M",a+l/2,f,"L",a+l,f+b/2,a+l/2,f+b,a,f+b/2,"Z"]},arc:function(a,
|
||||
f,l,b,e){var g=e.start,h=e.r||l,v=e.r||b||l,q=e.end-.001;l=e.innerR;b=e.open;var d=Math.cos(g),u=Math.sin(g),k=Math.cos(q),q=Math.sin(q);e=e.end-g<Math.PI?0:1;h=["M",a+h*d,f+v*u,"A",h,v,0,e,1,a+h*k,f+v*q];t(l)&&h.push(b?"M":"L",a+l*k,f+l*q,"A",l,l,0,e,0,a+l*d,f+l*u);h.push(b?"":"Z");return h},callout:function(a,f,l,b,e){var g=Math.min(e&&e.r||0,l,b),h=g+6,q=e&&e.anchorX;e=e&&e.anchorY;var d;d=["M",a+g,f,"L",a+l-g,f,"C",a+l,f,a+l,f,a+l,f+g,"L",a+l,f+b-g,"C",a+l,f+b,a+l,f+b,a+l-g,f+b,"L",a+g,f+b,"C",
|
||||
a,f+b,a,f+b,a,f+b-g,"L",a,f+g,"C",a,f,a,f,a+g,f];q&&q>l?e>f+h&&e<f+b-h?d.splice(13,3,"L",a+l,e-6,a+l+6,e,a+l,e+6,a+l,f+b-g):d.splice(13,3,"L",a+l,b/2,q,e,a+l,b/2,a+l,f+b-g):q&&0>q?e>f+h&&e<f+b-h?d.splice(33,3,"L",a,e+6,a-6,e,a,e-6,a,f+g):d.splice(33,3,"L",a,b/2,q,e,a,b/2,a,f+g):e&&e>b&&q>a+h&&q<a+l-h?d.splice(23,3,"L",q+6,f+b,q,f+b+6,q-6,f+b,a+g,f+b):e&&0>e&&q>a+h&&q<a+l-h&&d.splice(3,3,"L",q-6,f,q,f-6,q+6,f,l-g,f);return d}},clipRect:function(g,f,l,b){var e=a.uniqueKey(),h=this.createElement("clipPath").attr({id:e}).add(this.defs);
|
||||
g=this.rect(g,f,l,b,0).add(h);g.id=e;g.clipPath=h;g.count=0;return g},text:function(a,f,l,b){var g=!L&&this.forExport,e={};if(b&&(this.allowHTML||!this.forExport))return this.html(a,f,l);e.x=Math.round(f||0);l&&(e.y=Math.round(l));if(a||0===a)e.text=a;a=this.createElement("text").attr(e);g&&a.css({position:"absolute"});b||(a.xSetter=function(a,f,g){var l=g.getElementsByTagName("tspan"),b,e=g.getAttribute(f),h;for(h=0;h<l.length;h++)b=l[h],b.getAttribute(f)===e&&b.setAttribute(f,a);g.setAttribute(f,
|
||||
a)});return a},fontMetrics:function(a,f){a=a||f&&f.style&&f.style.fontSize||this.style&&this.style.fontSize;a=/px/.test(a)?D(a):/em/.test(a)?parseFloat(a)*(f?this.fontMetrics(null,f.parentNode).f:16):12;f=24>a?a+3:Math.round(1.2*a);return{h:f,b:Math.round(.8*f),f:a}},rotCorr:function(a,f,l){var g=a;f&&l&&(g=Math.max(g*Math.cos(f*m),4));return{x:-a/3*Math.sin(f*m),y:g}},label:function(a,l,b,e,h,q,d,u,k){var g=this,v=g.g("button"!==k&&"label"),c=v.text=g.text("",0,0,d).attr({zIndex:1}),L,O,w=0,A=3,
|
||||
m=0,n,J,B,D,P,S={},r,R,p=/^url\((.*?)\)$/.test(e),H=p,G,C,M,N;k&&v.addClass("highcharts-"+k);H=p;G=function(){return(r||0)%2/2};C=function(){var a=c.element.style,f={};O=(void 0===n||void 0===J||P)&&t(c.textStr)&&c.getBBox();v.width=(n||O.width||0)+2*A+m;v.height=(J||O.height||0)+2*A;R=A+g.fontMetrics(a&&a.fontSize,c).b;H&&(L||(v.box=L=g.symbols[e]||p?g.symbol(e):g.rect(),L.addClass(("button"===k?"":"highcharts-label-box")+(k?" highcharts-"+k+"-box":"")),L.add(v),a=G(),f.x=a,f.y=(u?-R:0)+a),f.width=
|
||||
Math.round(v.width),f.height=Math.round(v.height),L.attr(F(f,S)),S={})};M=function(){var a=m+A,f;f=u?0:R;t(n)&&O&&("center"===P||"right"===P)&&(a+={center:.5,right:1}[P]*(n-O.width));if(a!==c.x||f!==c.y)c.attr("x",a),void 0!==f&&c.attr("y",f);c.x=a;c.y=f};N=function(a,f){L?L.attr(a,f):S[a]=f};v.onAdd=function(){c.add(v);v.attr({text:a||0===a?a:"",x:l,y:b});L&&t(h)&&v.attr({anchorX:h,anchorY:q})};v.widthSetter=function(a){n=a};v.heightSetter=function(a){J=a};v["text-alignSetter"]=function(a){P=a};
|
||||
v.paddingSetter=function(a){t(a)&&a!==A&&(A=v.padding=a,M())};v.paddingLeftSetter=function(a){t(a)&&a!==m&&(m=a,M())};v.alignSetter=function(a){a={left:0,center:.5,right:1}[a];a!==w&&(w=a,O&&v.attr({x:B}))};v.textSetter=function(a){void 0!==a&&c.textSetter(a);C();M()};v["stroke-widthSetter"]=function(a,f){a&&(H=!0);r=this["stroke-width"]=a;N(f,a)};v.strokeSetter=v.fillSetter=v.rSetter=function(a,f){"fill"===f&&a&&(H=!0);N(f,a)};v.anchorXSetter=function(a,f){h=a;N(f,Math.round(a)-G()-B)};v.anchorYSetter=
|
||||
function(a,f){q=a;N(f,a-D)};v.xSetter=function(a){v.x=a;w&&(a-=w*((n||O.width)+2*A));B=Math.round(a);v.attr("translateX",B)};v.ySetter=function(a){D=v.y=Math.round(a);v.attr("translateY",D)};var T=v.css;return F(v,{css:function(a){if(a){var f={};a=z(a);x(v.textProps,function(g){void 0!==a[g]&&(f[g]=a[g],delete a[g])});c.css(f)}return T.call(v,a)},getBBox:function(){return{width:O.width+2*A,height:O.height+2*A,x:O.x-A,y:O.y-A}},shadow:function(a){a&&(C(),L&&L.shadow(a));return v},destroy:function(){f(v.element,
|
||||
"mouseenter");f(v.element,"mouseleave");c&&(c=c.destroy());L&&(L=L.destroy());y.prototype.destroy.call(v);v=g=C=M=N=null}})}};a.Renderer=I})(Q);(function(a){var y=a.attr,I=a.createElement,E=a.css,K=a.defined,c=a.each,d=a.extend,p=a.isFirefox,r=a.isMS,n=a.isWebKit,t=a.pInt,m=a.SVGRenderer,b=a.win,k=a.wrap;d(a.SVGElement.prototype,{htmlCss:function(a){var b=this.element;if(b=a&&"SPAN"===b.tagName&&a.width)delete a.width,this.textWidth=b,this.updateTransform();a&&"ellipsis"===a.textOverflow&&(a.whiteSpace=
|
||||
"nowrap",a.overflow="hidden");this.styles=d(this.styles,a);E(this.element,a);return this},htmlGetBBox:function(){var a=this.element;"text"===a.nodeName&&(a.style.position="absolute");return{x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,b=this.element,h=this.translateX||0,e=this.translateY||0,d=this.x||0,k=this.y||0,m=this.textAlign||"left",r={left:0,center:.5,right:1}[m],p=this.styles;E(b,{marginLeft:h,marginTop:e});
|
||||
this.shadows&&c(this.shadows,function(a){E(a,{marginLeft:h+1,marginTop:e+1})});this.inverted&&c(b.childNodes,function(e){a.invertChild(e,b)});if("SPAN"===b.tagName){var N=this.rotation,C=t(this.textWidth),q=p&&p.whiteSpace,z=[N,m,b.innerHTML,this.textWidth,this.textAlign].join();z!==this.cTT&&(p=a.fontMetrics(b.style.fontSize).b,K(N)&&this.setSpanRotation(N,r,p),E(b,{width:"",whiteSpace:q||"nowrap"}),b.offsetWidth>C&&/[ \-]/.test(b.textContent||b.innerText)&&E(b,{width:C+"px",display:"block",whiteSpace:q||
|
||||
"normal"}),this.getSpanCorrection(b.offsetWidth,p,r,N,m));E(b,{left:d+(this.xCorr||0)+"px",top:k+(this.yCorr||0)+"px"});n&&(p=b.offsetHeight);this.cTT=z}}else this.alignOnAdd=!0},setSpanRotation:function(a,d,h){var e={},c=r?"-ms-transform":n?"-webkit-transform":p?"MozTransform":b.opera?"-o-transform":"";e[c]=e.transform="rotate("+a+"deg)";e[c+(p?"Origin":"-origin")]=e.transformOrigin=100*d+"% "+h+"px";E(this.element,e)},getSpanCorrection:function(a,b,h){this.xCorr=-a*h;this.yCorr=-b}});d(m.prototype,
|
||||
{html:function(a,b,h){var e=this.createElement("span"),u=e.element,w=e.renderer,m=w.isSVG,n=function(a,b){c(["opacity","visibility"],function(e){k(a,e+"Setter",function(a,e,h,d){a.call(this,e,h,d);b[h]=e})})};e.textSetter=function(a){a!==u.innerHTML&&delete this.bBox;u.innerHTML=this.textStr=a;e.htmlUpdateTransform()};m&&n(e,e.element.style);e.xSetter=e.ySetter=e.alignSetter=e.rotationSetter=function(a,b){"align"===b&&(b="textAlign");e[b]=a;e.htmlUpdateTransform()};e.attr({text:a,x:Math.round(b),
|
||||
y:Math.round(h)}).css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize,position:"absolute"});u.style.whiteSpace="nowrap";e.css=e.htmlCss;m&&(e.add=function(a){var b,h=w.box.parentNode,q=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)q.push(a),a=a.parentGroup;c(q.reverse(),function(a){var c,k=y(a.element,"class");k&&(k={className:k});b=a.div=a.div||I("div",k,{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px",display:a.display,opacity:a.opacity,pointerEvents:a.styles&&
|
||||
a.styles.pointerEvents},b||h);c=b.style;d(a,{on:function(){e.on.apply({element:q[0].div},arguments);return a},translateXSetter:function(b,f){c.left=b+"px";a[f]=b;a.doTransform=!0},translateYSetter:function(b,f){c.top=b+"px";a[f]=b;a.doTransform=!0}});n(a,c)})}}else b=h;b.appendChild(u);e.added=!0;e.alignOnAdd&&e.htmlUpdateTransform();return e});return e}})})(Q);(function(a){var y=a.correctFloat,I=a.defined,E=a.destroyObjectProperties,K=a.isNumber,c=a.merge,d=a.pick,p=a.deg2rad;a.Tick=function(a,d,
|
||||
c,m){this.axis=a;this.pos=d;this.type=c||"";this.isNew=!0;c||m||this.addLabel()};a.Tick.prototype={addLabel:function(){var a=this.axis,n=a.options,t=a.chart,m=a.categories,b=a.names,k=this.pos,x=n.labels,p=a.tickPositions,h=k===p[0],e=k===p[p.length-1],b=m?d(m[k],b[k],k):k,m=this.label,p=p.info,u;a.isDatetimeAxis&&p&&(u=n.dateTimeLabelFormats[p.higherRanks[k]||p.unitName]);this.isFirst=h;this.isLast=e;n=a.labelFormatter.call({axis:a,chart:t,isFirst:h,isLast:e,dateTimeLabelFormat:u,value:a.isLog?y(a.lin2log(b)):
|
||||
b});I(m)?m&&m.attr({text:n}):(this.labelLength=(this.label=m=I(n)&&x.enabled?t.renderer.text(n,0,0,x.useHTML).css(c(x.style)).add(a.labelGroup):null)&&m.getBBox().width,this.rotation=0)},getLabelSize:function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},handleOverflow:function(a){var c=this.axis,t=a.x,m=c.chart.chartWidth,b=c.chart.spacing,k=d(c.labelLeft,Math.min(c.pos,b[3])),b=d(c.labelRight,Math.max(c.pos+c.len,m-b[1])),x=this.label,r=this.rotation,h={left:0,center:.5,
|
||||
right:1}[c.labelAlign],e=x.getBBox().width,u=c.getSlotWidth(),w=u,H=1,M,G={};if(r)0>r&&t-h*e<k?M=Math.round(t/Math.cos(r*p)-k):0<r&&t+h*e>b&&(M=Math.round((m-t)/Math.cos(r*p)));else if(m=t+(1-h)*e,t-h*e<k?w=a.x+w*(1-h)-k:m>b&&(w=b-a.x+w*h,H=-1),w=Math.min(u,w),w<u&&"center"===c.labelAlign&&(a.x+=H*(u-w-h*(u-Math.min(e,w)))),e>w||c.autoRotation&&(x.styles||{}).width)M=w;M&&(G.width=M,(c.options.labels.style||{}).textOverflow||(G.textOverflow="ellipsis"),x.css(G))},getPosition:function(a,d,c,m){var b=
|
||||
this.axis,k=b.chart,n=m&&k.oldChartHeight||k.chartHeight;return{x:a?b.translate(d+c,null,null,m)+b.transB:b.left+b.offset+(b.opposite?(m&&k.oldChartWidth||k.chartWidth)-b.right-b.left:0),y:a?n-b.bottom+b.offset-(b.opposite?b.height:0):n-b.translate(d+c,null,null,m)-b.transB}},getLabelPosition:function(a,d,c,m,b,k,x,F){var h=this.axis,e=h.transA,u=h.reversed,w=h.staggerLines,n=h.tickRotCorr||{x:0,y:0},t=b.y;I(t)||(t=0===h.side?c.rotation?-8:-c.getBBox().height:2===h.side?n.y+8:Math.cos(c.rotation*
|
||||
p)*(n.y-c.getBBox(!1,0).height/2));a=a+b.x+n.x-(k&&m?k*e*(u?-1:1):0);d=d+t-(k&&!m?k*e*(u?1:-1):0);w&&(c=x/(F||1)%w,h.opposite&&(c=w-c-1),d+=h.labelOffset/w*c);return{x:a,y:Math.round(d)}},getMarkPath:function(a,d,c,m,b,k){return k.crispLine(["M",a,d,"L",a+(b?0:-c),d+(b?c:0)],m)},render:function(a,c,p){var m=this.axis,b=m.options,k=m.chart.renderer,n=m.horiz,t=this.type,h=this.label,e=this.pos,u=b.labels,w=this.gridLine,H=t?t+"Tick":"tick",r=m.tickSize(H),G=this.mark,N=!G,C=u.step,q={},z=!0,A=m.tickmarkOffset,
|
||||
B=this.getPosition(n,e,A,c),D=B.x,B=B.y,f=n&&D===m.pos+m.len||!n&&B===m.pos?-1:1,l=t?t+"Grid":"grid",L=b[l+"LineWidth"],O=b[l+"LineColor"],P=b[l+"LineDashStyle"],l=d(b[H+"Width"],!t&&m.isXAxis?1:0),H=b[H+"Color"];p=d(p,1);this.isActive=!0;w||(q.stroke=O,q["stroke-width"]=L,P&&(q.dashstyle=P),t||(q.zIndex=1),c&&(q.opacity=0),this.gridLine=w=k.path().attr(q).addClass("highcharts-"+(t?t+"-":"")+"grid-line").add(m.gridGroup));if(!c&&w&&(e=m.getPlotLinePath(e+A,w.strokeWidth()*f,c,!0)))w[this.isNew?"attr":
|
||||
"animate"]({d:e,opacity:p});r&&(m.opposite&&(r[0]=-r[0]),N&&(this.mark=G=k.path().addClass("highcharts-"+(t?t+"-":"")+"tick").add(m.axisGroup),G.attr({stroke:H,"stroke-width":l})),G[N?"attr":"animate"]({d:this.getMarkPath(D,B,r[0],G.strokeWidth()*f,n,k),opacity:p}));h&&K(D)&&(h.xy=B=this.getLabelPosition(D,B,h,n,u,A,a,C),this.isFirst&&!this.isLast&&!d(b.showFirstLabel,1)||this.isLast&&!this.isFirst&&!d(b.showLastLabel,1)?z=!1:!n||m.isRadial||u.step||u.rotation||c||0===p||this.handleOverflow(B),C&&
|
||||
a%C&&(z=!1),z&&K(B.y)?(B.opacity=p,h[this.isNew?"attr":"animate"](B)):h.attr("y",-9999),this.isNew=!1)},destroy:function(){E(this,this.axis)}}})(Q);(function(a){var y=a.arrayMax,I=a.arrayMin,E=a.defined,K=a.destroyObjectProperties,c=a.each,d=a.erase,p=a.merge,r=a.pick;a.PlotLineOrBand=function(a,c){this.axis=a;c&&(this.options=c,this.id=c.id)};a.PlotLineOrBand.prototype={render:function(){var a=this,c=a.axis,d=c.horiz,b=a.options,k=b.label,x=a.label,F=b.to,h=b.from,e=b.value,u=E(h)&&E(F),w=E(e),H=
|
||||
a.svgElem,M=!H,G=[],N,C=b.color,q=r(b.zIndex,0),z=b.events,G={"class":"highcharts-plot-"+(u?"band ":"line ")+(b.className||"")},A={},B=c.chart.renderer,D=u?"bands":"lines",f=c.log2lin;c.isLog&&(h=f(h),F=f(F),e=f(e));w?(G={stroke:C,"stroke-width":b.width},b.dashStyle&&(G.dashstyle=b.dashStyle)):u&&(C&&(G.fill=C),b.borderWidth&&(G.stroke=b.borderColor,G["stroke-width"]=b.borderWidth));A.zIndex=q;D+="-"+q;(C=c[D])||(c[D]=C=B.g("plot-"+D).attr(A).add());M&&(a.svgElem=H=B.path().attr(G).add(C));if(w)G=
|
||||
c.getPlotLinePath(e,H.strokeWidth());else if(u)G=c.getPlotBandPath(h,F,b);else return;if(M&&G&&G.length){if(H.attr({d:G}),z)for(N in b=function(f){H.on(f,function(l){z[f].apply(a,[l])})},z)b(N)}else H&&(G?(H.show(),H.animate({d:G})):(H.hide(),x&&(a.label=x=x.destroy())));k&&E(k.text)&&G&&G.length&&0<c.width&&0<c.height&&!G.flat?(k=p({align:d&&u&&"center",x:d?!u&&4:10,verticalAlign:!d&&u&&"middle",y:d?u?16:10:u?6:-4,rotation:d&&!u&&90},k),this.renderLabel(k,G,u,q)):x&&x.hide();return a},renderLabel:function(a,
|
||||
c,d,b){var k=this.label,m=this.axis.chart.renderer;k||(k={align:a.textAlign||a.align,rotation:a.rotation,"class":"highcharts-plot-"+(d?"band":"line")+"-label "+(a.className||"")},k.zIndex=b,this.label=k=m.text(a.text,0,0,a.useHTML).attr(k).add(),k.css(a.style));b=[c[1],c[4],d?c[6]:c[1]];c=[c[2],c[5],d?c[7]:c[2]];d=I(b);m=I(c);k.align(a,!1,{x:d,y:m,width:y(b)-d,height:y(c)-m});k.show()},destroy:function(){d(this.axis.plotLinesAndBands,this);delete this.axis;K(this)}};a.AxisPlotLineOrBandExtension=
|
||||
{getPlotBandPath:function(a,c){c=this.getPlotLinePath(c,null,null,!0);(a=this.getPlotLinePath(a,null,null,!0))&&c?(a.flat=a.toString()===c.toString(),a.push(c[4],c[5],c[1],c[2],"z")):a=null;return a},addPlotBand:function(a){return this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){return this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(c,d){var m=(new a.PlotLineOrBand(this,c)).render(),b=this.userOptions;m&&(d&&(b[d]=b[d]||[],b[d].push(c)),this.plotLinesAndBands.push(m));
|
||||
return m},removePlotBandOrLine:function(a){for(var n=this.plotLinesAndBands,m=this.options,b=this.userOptions,k=n.length;k--;)n[k].id===a&&n[k].destroy();c([m.plotLines||[],b.plotLines||[],m.plotBands||[],b.plotBands||[]],function(b){for(k=b.length;k--;)b[k].id===a&&d(b,b[k])})}}})(Q);(function(a){var y=a.addEvent,I=a.animObject,E=a.arrayMax,K=a.arrayMin,c=a.AxisPlotLineOrBandExtension,d=a.color,p=a.correctFloat,r=a.defaultOptions,n=a.defined,t=a.deg2rad,m=a.destroyObjectProperties,b=a.each,k=a.extend,
|
||||
x=a.fireEvent,F=a.format,h=a.getMagnitude,e=a.grep,u=a.inArray,w=a.isArray,H=a.isNumber,M=a.isString,G=a.merge,N=a.normalizeTickInterval,C=a.pick,q=a.PlotLineOrBand,z=a.removeEvent,A=a.splat,B=a.syncTimeout,D=a.Tick;a.Axis=function(){this.init.apply(this,arguments)};a.Axis.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,labels:{enabled:!0,style:{color:"#666666",
|
||||
cursor:"default",fontSize:"11px"},x:0},minPadding:.01,maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",title:{align:"middle",style:{color:"#666666"}},type:"linear",minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",tickColor:"#ccd6eb"},defaultYAxisOptions:{endOnTick:!0,tickPixelInterval:72,showLastLabel:!0,
|
||||
labels:{x:-8},maxPadding:.05,minPadding:.05,startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return a.numberFormat(this.total,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"#000000",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},defaultLeftAxisOptions:{labels:{x:-15},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],
|
||||
x:0},title:{rotation:0}},init:function(a,l){var f=l.isX;this.chart=a;this.horiz=a.inverted?!f:f;this.isXAxis=f;this.coll=this.coll||(f?"xAxis":"yAxis");this.opposite=l.opposite;this.side=l.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(l);var b=this.options,e=b.type;this.labelFormatter=b.labels.formatter||this.defaultLabelFormatter;this.userOptions=l;this.minPixelPadding=0;this.reversed=b.reversed;this.visible=!1!==b.visible;this.zoomEnabled=!1!==b.zoomEnabled;this.hasNames=
|
||||
"category"===e||!0===b.categories;this.categories=b.categories||this.hasNames;this.names=this.names||[];this.isLog="logarithmic"===e;this.isDatetimeAxis="datetime"===e;this.isLinked=n(b.linkedTo);this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=b.minRange||b.maxZoom;this.range=b.range;this.offset=b.offset||0;this.stacks={};this.oldStacks={};this.stacksTouched=0;this.min=this.max=null;this.crosshair=C(b.crosshair,
|
||||
A(a.options.tooltip.crosshairs)[f?0:1],!1);var h;l=this.options.events;-1===u(this,a.axes)&&(f?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];a.inverted&&f&&void 0===this.reversed&&(this.reversed=!0);this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(h in l)y(this,h,l[h]);this.isLog&&(this.val2lin=this.log2lin,this.lin2val=this.lin2log)},setOptions:function(a){this.options=G(this.defaultOptions,"yAxis"===this.coll&&this.defaultYAxisOptions,
|
||||
[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],G(r[this.coll],a))},defaultLabelFormatter:function(){var f=this.axis,l=this.value,b=f.categories,e=this.dateTimeLabelFormat,h=r.lang,c=h.numericSymbols,h=h.numericSymbolMagnitude||1E3,g=c&&c.length,d,q=f.options.labels.format,f=f.isLog?l:f.tickInterval;if(q)d=F(q,this);else if(b)d=l;else if(e)d=a.dateFormat(e,l);else if(g&&1E3<=f)for(;g--&&void 0===d;)b=Math.pow(h,g+1),f>=
|
||||
b&&0===10*l%b&&null!==c[g]&&0!==l&&(d=a.numberFormat(l/b,-1)+c[g]);void 0===d&&(d=1E4<=Math.abs(l)?a.numberFormat(l,-1):a.numberFormat(l,-1,void 0,""));return d},getSeriesExtremes:function(){var a=this,l=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.buildStacks&&a.buildStacks();b(a.series,function(f){if(f.visible||!l.options.chart.ignoreHiddenSeries){var b=f.options,h=b.threshold,c;a.hasVisibleSeries=!0;a.isLog&&0>=h&&(h=null);if(a.isXAxis)b=f.xData,
|
||||
b.length&&(f=K(b),H(f)||f instanceof Date||(b=e(b,function(a){return H(a)}),f=K(b)),a.dataMin=Math.min(C(a.dataMin,b[0]),f),a.dataMax=Math.max(C(a.dataMax,b[0]),E(b)));else if(f.getExtremes(),c=f.dataMax,f=f.dataMin,n(f)&&n(c)&&(a.dataMin=Math.min(C(a.dataMin,f),f),a.dataMax=Math.max(C(a.dataMax,c),c)),n(h)&&(a.threshold=h),!b.softThreshold||a.isLog)a.softThreshold=!1}})},translate:function(a,b,e,h,c,d){var f=this.linkedParent||this,l=1,q=0,k=h?f.oldTransA:f.transA;h=h?f.oldMin:f.min;var u=f.minPixelPadding;
|
||||
c=(f.isOrdinal||f.isBroken||f.isLog&&c)&&f.lin2val;k||(k=f.transA);e&&(l*=-1,q=f.len);f.reversed&&(l*=-1,q-=l*(f.sector||f.len));b?(a=(a*l+q-u)/k+h,c&&(a=f.lin2val(a))):(c&&(a=f.val2lin(a)),a=l*(a-h)*k+q+l*u+(H(d)?k*d:0));return a},toPixels:function(a,l){return this.translate(a,!1,!this.horiz,null,!0)+(l?0:this.pos)},toValue:function(a,l){return this.translate(a-(l?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,l,b,e,h){var f=this.chart,g=this.left,c=this.top,d,q,k=b&&f.oldChartHeight||
|
||||
f.chartHeight,u=b&&f.oldChartWidth||f.chartWidth,L;d=this.transB;var w=function(a,f,g){if(a<f||a>g)e?a=Math.min(Math.max(f,a),g):L=!0;return a};h=C(h,this.translate(a,null,null,b));a=b=Math.round(h+d);d=q=Math.round(k-h-d);H(h)?this.horiz?(d=c,q=k-this.bottom,a=b=w(a,g,g+this.width)):(a=g,b=u-this.right,d=q=w(d,c,c+this.height)):L=!0;return L&&!e?null:f.renderer.crispLine(["M",a,d,"L",b,q],l||1)},getLinearTickPositions:function(a,b,e){var f,l=p(Math.floor(b/a)*a),h=p(Math.ceil(e/a)*a),g=[];if(b===
|
||||
e&&H(b))return[b];for(b=l;b<=h;){g.push(b);b=p(b+a);if(b===f)break;f=b}return g},getMinorTickPositions:function(){var a=this.options,b=this.tickPositions,e=this.minorTickInterval,h=[],c,d=this.pointRangePadding||0;c=this.min-d;var d=this.max+d,g=d-c;if(g&&g/e<this.len/3)if(this.isLog)for(d=b.length,c=1;c<d;c++)h=h.concat(this.getLogTickPositions(e,b[c-1],b[c],!0));else if(this.isDatetimeAxis&&"auto"===a.minorTickInterval)h=h.concat(this.getTimeTicks(this.normalizeTimeTickInterval(e),c,d,a.startOfWeek));
|
||||
else for(b=c+(b[0]-c)%e;b<=d&&b!==h[0];b+=e)h.push(b);0!==h.length&&this.trimTicks(h,a.startOnTick,a.endOnTick);return h},adjustForMinRange:function(){var a=this.options,l=this.min,e=this.max,h,c=this.dataMax-this.dataMin>=this.minRange,d,g,q,k,u,w;this.isXAxis&&void 0===this.minRange&&!this.isLog&&(n(a.min)||n(a.max)?this.minRange=null:(b(this.series,function(a){k=a.xData;for(g=u=a.xIncrement?1:k.length-1;0<g;g--)if(q=k[g]-k[g-1],void 0===d||q<d)d=q}),this.minRange=Math.min(5*d,this.dataMax-this.dataMin)));
|
||||
e-l<this.minRange&&(w=this.minRange,h=(w-e+l)/2,h=[l-h,C(a.min,l-h)],c&&(h[2]=this.isLog?this.log2lin(this.dataMin):this.dataMin),l=E(h),e=[l+w,C(a.max,l+w)],c&&(e[2]=this.isLog?this.log2lin(this.dataMax):this.dataMax),e=K(e),e-l<w&&(h[0]=e-w,h[1]=C(a.min,e-w),l=E(h)));this.min=l;this.max=e},getClosest:function(){var a;this.categories?a=1:b(this.series,function(f){var b=f.closestPointRange,l=f.visible||!f.chart.options.chart.ignoreHiddenSeries;!f.noSharedTooltip&&n(b)&&l&&(a=n(a)?Math.min(a,b):b)});
|
||||
return a},nameToX:function(a){var f=w(this.categories),b=f?this.categories:this.names,e=a.options.x,h;a.series.requireSorting=!1;n(e)||(e=!1===this.options.uniqueNames?a.series.autoIncrement():u(a.name,b));-1===e?f||(h=b.length):h=e;this.names[h]=a.name;return h},updateNames:function(){var a=this;0<this.names.length&&(this.names.length=0,this.minRange=void 0,b(this.series||[],function(f){f.xIncrement=null;if(!f.points||f.isDirtyData)f.processData(),f.generatePoints();b(f.points,function(b,l){var e;
|
||||
b.options&&(e=a.nameToX(b),e!==b.x&&(b.x=e,f.xData[l]=e))})}))},setAxisTranslation:function(a){var f=this,e=f.max-f.min,h=f.axisPointRange||0,c,d=0,g=0,q=f.linkedParent,k=!!f.categories,u=f.transA,w=f.isXAxis;if(w||k||h)c=f.getClosest(),q?(d=q.minPointOffset,g=q.pointRangePadding):b(f.series,function(a){var b=k?1:w?C(a.options.pointRange,c,0):f.axisPointRange||0;a=a.options.pointPlacement;h=Math.max(h,b);f.single||(d=Math.max(d,M(a)?0:b/2),g=Math.max(g,"on"===a?0:b))}),q=f.ordinalSlope&&c?f.ordinalSlope/
|
||||
c:1,f.minPointOffset=d*=q,f.pointRangePadding=g*=q,f.pointRange=Math.min(h,e),w&&(f.closestPointRange=c);a&&(f.oldTransA=u);f.translationSlope=f.transA=u=f.len/(e+g||1);f.transB=f.horiz?f.left:f.bottom;f.minPixelPadding=u*d},minFromRange:function(){return this.max-this.range},setTickInterval:function(f){var l=this,e=l.chart,c=l.options,d=l.isLog,q=l.log2lin,g=l.isDatetimeAxis,k=l.isXAxis,u=l.isLinked,w=c.maxPadding,A=c.minPadding,m=c.tickInterval,z=c.tickPixelInterval,B=l.categories,D=l.threshold,
|
||||
r=l.softThreshold,t,F,G,M;g||B||u||this.getTickAmount();G=C(l.userMin,c.min);M=C(l.userMax,c.max);u?(l.linkedParent=e[l.coll][c.linkedTo],e=l.linkedParent.getExtremes(),l.min=C(e.min,e.dataMin),l.max=C(e.max,e.dataMax),c.type!==l.linkedParent.options.type&&a.error(11,1)):(!r&&n(D)&&(l.dataMin>=D?(t=D,A=0):l.dataMax<=D&&(F=D,w=0)),l.min=C(G,t,l.dataMin),l.max=C(M,F,l.dataMax));d&&(!f&&0>=Math.min(l.min,C(l.dataMin,l.min))&&a.error(10,1),l.min=p(q(l.min),15),l.max=p(q(l.max),15));l.range&&n(l.max)&&
|
||||
(l.userMin=l.min=G=Math.max(l.min,l.minFromRange()),l.userMax=M=l.max,l.range=null);x(l,"foundExtremes");l.beforePadding&&l.beforePadding();l.adjustForMinRange();!(B||l.axisPointRange||l.usePercentage||u)&&n(l.min)&&n(l.max)&&(q=l.max-l.min)&&(!n(G)&&A&&(l.min-=q*A),!n(M)&&w&&(l.max+=q*w));H(c.floor)?l.min=Math.max(l.min,c.floor):H(c.softMin)&&(l.min=Math.min(l.min,c.softMin));H(c.ceiling)?l.max=Math.min(l.max,c.ceiling):H(c.softMax)&&(l.max=Math.max(l.max,c.softMax));r&&n(l.dataMin)&&(D=D||0,!n(G)&&
|
||||
l.min<D&&l.dataMin>=D?l.min=D:!n(M)&&l.max>D&&l.dataMax<=D&&(l.max=D));l.tickInterval=l.min===l.max||void 0===l.min||void 0===l.max?1:u&&!m&&z===l.linkedParent.options.tickPixelInterval?m=l.linkedParent.tickInterval:C(m,this.tickAmount?(l.max-l.min)/Math.max(this.tickAmount-1,1):void 0,B?1:(l.max-l.min)*z/Math.max(l.len,z));k&&!f&&b(l.series,function(a){a.processData(l.min!==l.oldMin||l.max!==l.oldMax)});l.setAxisTranslation(!0);l.beforeSetTickPositions&&l.beforeSetTickPositions();l.postProcessTickInterval&&
|
||||
(l.tickInterval=l.postProcessTickInterval(l.tickInterval));l.pointRange&&!m&&(l.tickInterval=Math.max(l.pointRange,l.tickInterval));f=C(c.minTickInterval,l.isDatetimeAxis&&l.closestPointRange);!m&&l.tickInterval<f&&(l.tickInterval=f);g||d||m||(l.tickInterval=N(l.tickInterval,null,h(l.tickInterval),C(c.allowDecimals,!(.5<l.tickInterval&&5>l.tickInterval&&1E3<l.max&&9999>l.max)),!!this.tickAmount));this.tickAmount||(l.tickInterval=l.unsquish());this.setTickPositions()},setTickPositions:function(){var a=
|
||||
this.options,b,e=a.tickPositions,h=a.tickPositioner,c=a.startOnTick,d=a.endOnTick,g;this.tickmarkOffset=this.categories&&"between"===a.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval="auto"===a.minorTickInterval&&this.tickInterval?this.tickInterval/5:a.minorTickInterval;this.tickPositions=b=e&&e.slice();!b&&(b=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,a.units),this.min,this.max,a.startOfWeek,this.ordinalPositions,this.closestPointRange,
|
||||
!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max),b.length>this.len&&(b=[b[0],b.pop()]),this.tickPositions=b,h&&(h=h.apply(this,[this.min,this.max])))&&(this.tickPositions=b=h);this.trimTicks(b,c,d);this.isLinked||(this.min===this.max&&n(this.min)&&!this.tickAmount&&(g=!0,this.min-=.5,this.max+=.5),this.single=g,e||h||this.adjustTickAmount())},trimTicks:function(a,b,e){var f=a[0],l=a[a.length-1],h=this.minPointOffset||
|
||||
0;if(!this.isLinked){if(b)this.min=f;else for(;this.min-h>a[0];)a.shift();if(e)this.max=l;else for(;this.max+h<a[a.length-1];)a.pop();0===a.length&&n(f)&&a.push((l+f)/2)}},alignToOthers:function(){var a={},e,h=this.options;!1===this.chart.options.chart.alignTicks||!1===h.alignTicks||this.isLog||b(this.chart[this.coll],function(f){var b=f.options,b=[f.horiz?b.left:b.top,b.width,b.height,b.pane].join();f.series.length&&(a[b]?e=!0:a[b]=1)});return e},getTickAmount:function(){var a=this.options,b=a.tickAmount,
|
||||
e=a.tickPixelInterval;!n(a.tickInterval)&&this.len<e&&!this.isRadial&&!this.isLog&&a.startOnTick&&a.endOnTick&&(b=2);!b&&this.alignToOthers()&&(b=Math.ceil(this.len/e)+1);4>b&&(this.finalTickAmt=b,b=5);this.tickAmount=b},adjustTickAmount:function(){var a=this.tickInterval,b=this.tickPositions,e=this.tickAmount,h=this.finalTickAmt,c=b&&b.length;if(c<e){for(;b.length<e;)b.push(p(b[b.length-1]+a));this.transA*=(c-1)/(e-1);this.max=b[b.length-1]}else c>e&&(this.tickInterval*=2,this.setTickPositions());
|
||||
if(n(h)){for(a=e=b.length;a--;)(3===h&&1===a%2||2>=h&&0<a&&a<e-1)&&b.splice(a,1);this.finalTickAmt=void 0}},setScale:function(){var a,e;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();e=this.len!==this.oldAxisLength;b(this.series,function(f){if(f.isDirtyData||f.isDirty||f.xAxis.isDirty)a=!0});e||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()},setExtremes:function(a,e,h,c,d){var f=this,g=f.chart;h=C(h,!0);b(f.series,function(a){delete a.kdTree});d=k(d,{min:a,max:e});x(f,"setExtremes",d,function(){f.userMin=a;f.userMax=e;f.eventArgs=d;h&&g.redraw(c)})},zoom:function(a,b){var f=this.dataMin,e=this.dataMax,l=this.options,
|
||||
h=Math.min(f,C(l.min,f)),l=Math.max(e,C(l.max,e));if(a!==this.min||b!==this.max)this.allowZoomOutside||(n(f)&&(a<h&&(a=h),a>l&&(a=l)),n(e)&&(b<h&&(b=h),b>l&&(b=l))),this.displayBtn=void 0!==a||void 0!==b,this.setExtremes(a,b,!1,void 0,{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,e=b.offsets||[0,0,0,0],h=this.horiz,c=C(b.width,a.plotWidth-e[3]+e[1]),d=C(b.height,a.plotHeight-e[0]+e[2]),g=C(b.top,a.plotTop+e[0]),b=C(b.left,a.plotLeft+e[3]),e=/%$/;e.test(d)&&(d=
|
||||
Math.round(parseFloat(d)/100*a.plotHeight));e.test(g)&&(g=Math.round(parseFloat(g)/100*a.plotHeight+a.plotTop));this.left=b;this.top=g;this.width=c;this.height=d;this.bottom=a.chartHeight-d-g;this.right=a.chartWidth-c-b;this.len=Math.max(h?c:d,0);this.pos=h?b:g},getExtremes:function(){var a=this.isLog,b=this.lin2log;return{min:a?p(b(this.min)):this.min,max:a?p(b(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=
|
||||
this.isLog,f=this.lin2log,e=b?f(this.min):this.min,b=b?f(this.max):this.max;null===a?a=e:e>a?a=e:b<a&&(a=b);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=(C(a,0)-90*this.side+720)%360;return 15<a&&165>a?"right":195<a&&345>a?"left":"center"},tickSize:function(a){var b=this.options,f=b[a+"Length"],e=C(b[a+"Width"],"tick"===a&&this.isXAxis?1:0);if(e&&f)return"inside"===b[a+"Position"]&&(f=-f),[f,e]},labelMetrics:function(){return this.chart.renderer.fontMetrics(this.options.labels.style&&
|
||||
this.options.labels.style.fontSize,this.ticks[0]&&this.ticks[0].label)},unsquish:function(){var a=this.options.labels,e=this.horiz,h=this.tickInterval,c=h,d=this.len/(((this.categories?1:0)+this.max-this.min)/h),q,g=a.rotation,k=this.labelMetrics(),u,w=Number.MAX_VALUE,A,m=function(a){a/=d||1;a=1<a?Math.ceil(a):1;return a*h};e?(A=!a.staggerLines&&!a.step&&(n(g)?[g]:d<C(a.autoRotationLimit,80)&&a.autoRotation))&&b(A,function(a){var b;if(a===g||a&&-90<=a&&90>=a)u=m(Math.abs(k.h/Math.sin(t*a))),b=u+
|
||||
Math.abs(a/360),b<w&&(w=b,q=a,c=u)}):a.step||(c=m(k.h));this.autoRotation=A;this.labelRotation=C(q,g);return c},getSlotWidth:function(){var a=this.chart,b=this.horiz,e=this.options.labels,h=Math.max(this.tickPositions.length-(this.categories?0:1),1),c=a.margin[3];return b&&2>(e.step||0)&&!e.rotation&&(this.staggerLines||1)*this.len/h||!b&&(c&&c-a.spacing[3]||.33*a.chartWidth)},renderUnsquish:function(){var a=this.chart,e=a.renderer,h=this.tickPositions,c=this.ticks,d=this.options.labels,q=this.horiz,
|
||||
g=this.getSlotWidth(),k=Math.max(1,Math.round(g-2*(d.padding||5))),u={},w=this.labelMetrics(),A=d.style&&d.style.textOverflow,m,z=0,D,B;M(d.rotation)||(u.rotation=d.rotation||0);b(h,function(a){(a=c[a])&&a.labelLength>z&&(z=a.labelLength)});this.maxLabelLength=z;if(this.autoRotation)z>k&&z>w.h?u.rotation=this.labelRotation:this.labelRotation=0;else if(g&&(m={width:k+"px"},!A))for(m.textOverflow="clip",D=h.length;!q&&D--;)if(B=h[D],k=c[B].label)k.styles&&"ellipsis"===k.styles.textOverflow?k.css({textOverflow:"clip"}):
|
||||
c[B].labelLength>g&&k.css({width:g+"px"}),k.getBBox().height>this.len/h.length-(w.h-w.f)&&(k.specCss={textOverflow:"ellipsis"});u.rotation&&(m={width:(z>.5*a.chartHeight?.33*a.chartHeight:a.chartHeight)+"px"},A||(m.textOverflow="ellipsis"));if(this.labelAlign=d.align||this.autoLabelAlign(this.labelRotation))u.align=this.labelAlign;b(h,function(a){var b=(a=c[a])&&a.label;b&&(b.attr(u),m&&b.css(G(m,b.specCss)),delete b.specCss,a.rotation=u.rotation)});this.tickRotCorr=e.rotCorr(w.b,this.labelRotation||
|
||||
0,0!==this.side)},hasData:function(){return this.hasVisibleSeries||n(this.min)&&n(this.max)&&!!this.tickPositions},addTitle:function(a){var b=this.chart.renderer,f=this.horiz,e=this.opposite,h=this.options.title,c;this.axisTitle||((c=h.textAlign)||(c=(f?{low:"left",middle:"center",high:"right"}:{low:e?"right":"left",middle:"center",high:e?"left":"right"})[h.align]),this.axisTitle=b.text(h.text,0,0,h.useHTML).attr({zIndex:7,rotation:h.rotation||0,align:c}).addClass("highcharts-axis-title").css(h.style).add(this.axisGroup),
|
||||
this.axisTitle.isNew=!0);this.axisTitle[a?"show":"hide"](!0)},generateTick:function(a){var b=this.ticks;b[a]?b[a].addLabel():b[a]=new D(this,a)},getOffset:function(){var a=this,e=a.chart,h=e.renderer,c=a.options,d=a.tickPositions,q=a.ticks,g=a.horiz,k=a.side,u=e.inverted?[1,0,3,2][k]:k,w,m,A=0,z,D=0,B=c.title,p=c.labels,x=0,r=e.axisOffset,e=e.clipOffset,H=[-1,1,1,-1][k],t,G=c.className,F=a.axisParent,M=this.tickSize("tick");w=a.hasData();a.showAxis=m=w||C(c.showEmpty,!0);a.staggerLines=a.horiz&&p.staggerLines;
|
||||
a.axisGroup||(a.gridGroup=h.g("grid").attr({zIndex:c.gridZIndex||1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+(G||"")).add(F),a.axisGroup=h.g("axis").attr({zIndex:c.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(G||"")).add(F),a.labelGroup=h.g("axis-labels").attr({zIndex:p.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels "+(G||"")).add(F));if(w||a.isLinked)b(d,function(b,g){a.generateTick(b,g)}),a.renderUnsquish(),!1===p.reserveSpace||0!==k&&2!==k&&
|
||||
{1:"left",3:"right"}[k]!==a.labelAlign&&"center"!==a.labelAlign||b(d,function(a){x=Math.max(q[a].getLabelSize(),x)}),a.staggerLines&&(x*=a.staggerLines,a.labelOffset=x*(a.opposite?-1:1));else for(t in q)q[t].destroy(),delete q[t];B&&B.text&&!1!==B.enabled&&(a.addTitle(m),m&&(A=a.axisTitle.getBBox()[g?"height":"width"],z=B.offset,D=n(z)?0:C(B.margin,g?5:10)));a.renderLine();a.offset=H*C(c.offset,r[k]);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};h=0===k?-a.labelMetrics().h:2===k?a.tickRotCorr.y:0;D=Math.abs(x)+
|
||||
D;x&&(D=D-h+H*(g?C(p.y,a.tickRotCorr.y+8*H):p.x));a.axisTitleMargin=C(z,D);r[k]=Math.max(r[k],a.axisTitleMargin+A+H*a.offset,D,w&&d.length&&M?M[0]:0);c=c.offset?0:2*Math.floor(a.axisLine.strokeWidth()/2);e[u]=Math.max(e[u],c)},getLinePath:function(a){var b=this.chart,f=this.opposite,e=this.offset,h=this.horiz,c=this.left+(f?this.width:0)+e,e=b.chartHeight-this.bottom-(f?this.height:0)+e;f&&(a*=-1);return b.renderer.crispLine(["M",h?this.left:c,h?e:this.top,"L",h?b.chartWidth-this.right:c,h?e:b.chartHeight-
|
||||
this.bottom],a)},renderLine:function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))},getTitlePosition:function(){var a=this.horiz,b=this.left,e=this.top,h=this.len,c=this.options.title,d=a?b:e,g=this.opposite,q=this.offset,k=c.x||0,u=c.y||0,w=this.chart.renderer.fontMetrics(c.style&&c.style.fontSize,this.axisTitle).f,h={low:d+(a?0:h),
|
||||
middle:d+h/2,high:d+(a?h:0)}[c.align],b=(a?e+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(2===this.side?w:0);return{x:a?h+k:b+(g?this.width:0)+q+k,y:a?b+u-(g?this.height:0)+q:h+u}},renderMinorTick:function(a){var b=this.chart.hasRendered&&H(this.oldMin),f=this.minorTicks;f[a]||(f[a]=new D(this,a,"minor"));b&&f[a].isNew&&f[a].render(null,!0);f[a].render(null,!1,1)},renderTick:function(a,b){var f=this.isLinked,e=this.ticks,h=this.chart.hasRendered&&H(this.oldMin);if(!f||a>=this.min&&a<=this.max)e[a]||
|
||||
(e[a]=new D(this,a)),h&&e[a].isNew&&e[a].render(b,!0,.1),e[a].render(b)},render:function(){var a=this,e=a.chart,h=a.options,c=a.isLog,d=a.lin2log,k=a.isLinked,g=a.tickPositions,u=a.axisTitle,w=a.ticks,m=a.minorTicks,A=a.alternateBands,z=h.stackLabels,p=h.alternateGridColor,n=a.tickmarkOffset,x=a.axisLine,r=a.showAxis,H=I(e.renderer.globalAnimation),t,G;a.labelEdge.length=0;a.overlap=!1;b([w,m,A],function(a){for(var b in a)a[b].isActive=!1});if(a.hasData()||k)a.minorTickInterval&&!a.categories&&b(a.getMinorTickPositions(),
|
||||
function(b){a.renderMinorTick(b)}),g.length&&(b(g,function(b,g){a.renderTick(b,g)}),n&&(0===a.min||a.single)&&(w[-1]||(w[-1]=new D(a,-1,null,!0)),w[-1].render(-1))),p&&b(g,function(b,f){G=void 0!==g[f+1]?g[f+1]+n:a.max-n;0===f%2&&b<a.max&&G<=a.max+(e.polar?-n:n)&&(A[b]||(A[b]=new q(a)),t=b+n,A[b].options={from:c?d(t):t,to:c?d(G):G,color:p},A[b].render(),A[b].isActive=!0)}),a._addedPlotLB||(b((h.plotLines||[]).concat(h.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0);b([w,m,A],
|
||||
function(a){var b,g,f=[],h=H.duration;for(b in a)a[b].isActive||(a[b].render(b,!1,0),a[b].isActive=!1,f.push(b));B(function(){for(g=f.length;g--;)a[f[g]]&&!a[f[g]].isActive&&(a[f[g]].destroy(),delete a[f[g]])},a!==A&&e.hasRendered&&h?h:0)});x&&(x[x.isPlaced?"animate":"attr"]({d:this.getLinePath(x.strokeWidth())}),x.isPlaced=!0,x[r?"show":"hide"](!0));u&&r&&(u[u.isNew?"attr":"animate"](a.getTitlePosition()),u.isNew=!1);z&&z.enabled&&a.renderStackTotals();a.isDirty=!1},redraw:function(){this.visible&&
|
||||
(this.render(),b(this.plotLinesAndBands,function(a){a.render()}));b(this.series,function(a){a.isDirty=!0})},keepProps:"extKey hcEvents names series userMax userMin".split(" "),destroy:function(a){var e=this,f=e.stacks,h,c=e.plotLinesAndBands,d;a||z(e);for(h in f)m(f[h]),f[h]=null;b([e.ticks,e.minorTicks,e.alternateBands],function(a){m(a)});if(c)for(a=c.length;a--;)c[a].destroy();b("stackTotalGroup axisLine axisTitle axisGroup gridGroup labelGroup cross".split(" "),function(a){e[a]&&(e[a]=e[a].destroy())});
|
||||
for(d in e)e.hasOwnProperty(d)&&-1===u(d,e.keepProps)&&delete e[d]},drawCrosshair:function(a,b){var e,f=this.crosshair,h=C(f.snap,!0),c,g=this.cross;a||(a=this.cross&&this.cross.e);this.crosshair&&!1!==(n(b)||!h)?(h?n(b)&&(c=this.isXAxis?b.plotX:this.len-b.plotY):c=a&&(this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos),n(c)&&(e=this.getPlotLinePath(b&&(this.isXAxis?b.x:C(b.stackY,b.y)),null,null,null,c)||null),n(e)?(b=this.categories&&!this.isRadial,g||(this.cross=g=this.chart.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+
|
||||
(b?"category ":"thin ")+f.className).attr({zIndex:C(f.zIndex,2)}).add(),g.attr({stroke:f.color||(b?d("#ccd6eb").setOpacity(.25).get():"#cccccc"),"stroke-width":C(f.width,1)}),f.dashStyle&&g.attr({dashstyle:f.dashStyle})),g.show().attr({d:e}),b&&!f.width&&g.attr({"stroke-width":this.transA}),this.cross.e=a):this.hideCrosshair()):this.hideCrosshair()},hideCrosshair:function(){this.cross&&this.cross.hide()}};k(a.Axis.prototype,c)})(Q);(function(a){var y,I=a.addEvent,E=a.css,K=a.discardElement,c=a.defined,
|
||||
d=a.each,p=a.extend,r=a.isFirefox,n=a.marginNames,t=a.merge,m=a.pick,b=a.setAnimation,k=a.stableSort,x=a.win,F=a.wrap;y=a.Legend=function(a,b){this.init(a,b)};y.prototype={init:function(a,b){this.chart=a;this.setOptions(b);b.enabled&&(this.render(),I(this.chart,"endResize",function(){this.legend.positionCheckboxes()}))},setOptions:function(a){var b=m(a.padding,8);this.options=a;this.itemStyle=a.itemStyle;this.itemHiddenStyle=t(this.itemStyle,a.itemHiddenStyle);this.itemMarginTop=a.itemMarginTop||
|
||||
0;this.initialItemX=this.padding=b;this.initialItemY=b-5;this.itemHeight=this.maxItemWidth=0;this.symbolWidth=m(a.symbolWidth,16);this.pages=[]},update:function(a,b){var e=this.chart;this.setOptions(t(!0,this.options,a));this.destroy();e.isDirtyLegend=e.isDirtyBox=!0;m(b,!0)&&e.redraw()},colorizeItem:function(a,b){a.legendGroup[b?"removeClass":"addClass"]("highcharts-legend-item-hidden");var e=this.options,c=a.legendItem,h=a.legendLine,d=a.legendSymbol,k=this.itemHiddenStyle.color,e=b?e.itemStyle.color:
|
||||
k,m=b?a.color||k:k,n=a.options&&a.options.marker,q={fill:m},z;c&&c.css({fill:e,color:e});h&&h.attr({stroke:m});if(d){if(n&&d.isMarker&&(q=a.pointAttribs(),!b))for(z in q)q[z]=k;d.attr(q)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,h=a._legendItemPos,d=h[0],h=h[1],k=a.checkbox;(a=a.legendGroup)&&a.element&&a.translate(b?d:this.legendWidth-d-2*c-4,h);k&&(k.x=d,k.y=h)},destroyItem:function(a){var b=a.checkbox;d(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&
|
||||
(a[b]=a[b].destroy())});b&&K(a.checkbox)},destroy:function(){function a(a){this[a]&&(this[a]=this[a].destroy())}d(this.getAllItems(),function(b){d(["legendItem","legendGroup"],a,b)});d(["box","title","group"],a,this);this.display=null},positionCheckboxes:function(a){var b=this.group&&this.group.alignAttr,c,h=this.clipHeight||this.legendHeight,k=this.titleHeight;b&&(c=b.translateY,d(this.allItems,function(e){var d=e.checkbox,u;d&&(u=c+k+d.y+(a||0)+3,E(d,{left:b.translateX+e.checkboxOffset+d.x-20+"px",
|
||||
top:u+"px",display:u>c-6&&u<c+h-6?"":"none"}))}))},renderTitle:function(){var a=this.padding,b=this.options.title,c=0;b.text&&(this.title||(this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(b.style).add(this.group)),a=this.title.getBBox(),c=a.height,this.offsetWidth=a.width,this.contentGroup.attr({translateY:c}));this.titleHeight=c},setText:function(b){var e=this.options;b.legendItem.attr({text:e.labelFormat?a.format(e.labelFormat,b):
|
||||
e.labelFormatter.call(b)})},renderItem:function(a){var b=this.chart,c=b.renderer,h=this.options,d="horizontal"===h.layout,k=this.symbolWidth,n=h.symbolPadding,p=this.itemStyle,x=this.itemHiddenStyle,q=this.padding,z=d?m(h.itemDistance,20):0,A=!h.rtl,B=h.width,D=h.itemMarginBottom||0,f=this.itemMarginTop,l=this.initialItemX,r=a.legendItem,F=!a.series,P=!F&&a.series.drawLegendSymbol?a.series:a,R=P.options,R=this.createCheckboxForItem&&R&&R.showCheckbox,g=h.useHTML;r||(a.legendGroup=c.g("legend-item").addClass("highcharts-"+
|
||||
P.type+"-series highcharts-color-"+a.colorIndex+(a.options.className?" "+a.options.className:"")+(F?" highcharts-series-"+a.index:"")).attr({zIndex:1}).add(this.scrollGroup),a.legendItem=r=c.text("",A?k+n:-n,this.baseline||0,g).css(t(a.visible?p:x)).attr({align:A?"left":"right",zIndex:2}).add(a.legendGroup),this.baseline||(p=p.fontSize,this.fontMetrics=c.fontMetrics(p,r),this.baseline=this.fontMetrics.f+3+f,r.attr("y",this.baseline)),this.symbolHeight=h.symbolHeight||this.fontMetrics.f,P.drawLegendSymbol(this,
|
||||
a),this.setItemEvents&&this.setItemEvents(a,r,g),R&&this.createCheckboxForItem(a));this.colorizeItem(a,a.visible);this.setText(a);c=r.getBBox();k=a.checkboxOffset=h.itemWidth||a.legendItemWidth||k+n+c.width+z+(R?20:0);this.itemHeight=n=Math.round(a.legendItemHeight||c.height);d&&this.itemX-l+k>(B||b.chartWidth-2*q-l-h.x)&&(this.itemX=l,this.itemY+=f+this.lastLineHeight+D,this.lastLineHeight=0);this.maxItemWidth=Math.max(this.maxItemWidth,k);this.lastItemY=f+this.itemY+D;this.lastLineHeight=Math.max(n,
|
||||
this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];d?this.itemX+=k:(this.itemY+=f+n+D,this.lastLineHeight=n);this.offsetWidth=B||Math.max((d?this.itemX-l-z:k)+q,this.offsetWidth)},getAllItems:function(){var a=[];d(this.chart.series,function(b){var e=b&&b.options;b&&m(e.showInLegend,c(e.linkedTo)?!1:void 0,!0)&&(a=a.concat(b.legendItems||("point"===e.legendType?b.data:b)))});return a},adjustMargins:function(a,b){var e=this.chart,h=this.options,k=h.align.charAt(0)+h.verticalAlign.charAt(0)+
|
||||
h.layout.charAt(0);h.floating||d([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(d,u){d.test(k)&&!c(a[u])&&(e[n[u]]=Math.max(e[n[u]],e.legend[(u+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][u]*h[u%2?"x":"y"]+m(h.margin,12)+b[u]))})},render:function(){var a=this,b=a.chart,c=b.renderer,m=a.group,n,x,r,t,F=a.box,q=a.options,z=a.padding;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;m||(a.group=m=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=
|
||||
c.g().attr({zIndex:1}).add(m),a.scrollGroup=c.g().add(a.contentGroup));a.renderTitle();n=a.getAllItems();k(n,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});q.reversed&&n.reverse();a.allItems=n;a.display=x=!!n.length;a.lastLineHeight=0;d(n,function(b){a.renderItem(b)});r=(q.width||a.offsetWidth)+z;t=a.lastItemY+a.lastLineHeight+a.titleHeight;t=a.handleOverflow(t);t+=z;F||(a.box=F=c.rect().addClass("highcharts-legend-box").attr({r:q.borderRadius}).add(m),
|
||||
F.isNew=!0);F.attr({stroke:q.borderColor,"stroke-width":q.borderWidth||0,fill:q.backgroundColor||"none"}).shadow(q.shadow);0<r&&0<t&&(F[F.isNew?"attr":"animate"](F.crisp({x:0,y:0,width:r,height:t},F.strokeWidth())),F.isNew=!1);F[x?"show":"hide"]();a.legendWidth=r;a.legendHeight=t;d(n,function(b){a.positionItem(b)});x&&m.align(p({width:r,height:t},q),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,c=this.chart,h=c.renderer,k=this.options,n=k.y,c=c.spacingBox.height+
|
||||
("top"===k.verticalAlign?-n:n)-this.padding,n=k.maxHeight,p,x=this.clipRect,r=k.navigation,q=m(r.animation,!0),z=r.arrowSize||12,A=this.nav,B=this.pages,D=this.padding,f,l=this.allItems,t=function(a){a?x.attr({height:a}):x&&(b.clipRect=x.destroy(),b.contentGroup.clip());b.contentGroup.div&&(b.contentGroup.div.style.clip=a?"rect("+D+"px,9999px,"+(D+a)+"px,0)":"auto")};"horizontal"!==k.layout||"middle"===k.verticalAlign||k.floating||(c/=2);n&&(c=Math.min(c,n));B.length=0;a>c&&!1!==r.enabled?(this.clipHeight=
|
||||
p=Math.max(c-20-this.titleHeight-D,0),this.currentPage=m(this.currentPage,1),this.fullHeight=a,d(l,function(a,b){var e=a._legendItemPos[1];a=Math.round(a.legendItem.getBBox().height);var g=B.length;if(!g||e-B[g-1]>p&&(f||e)!==B[g-1])B.push(f||e),g++;b===l.length-1&&e+a-B[g-1]>p&&B.push(e);e!==f&&(f=e)}),x||(x=b.clipRect=h.clipRect(0,D,9999,0),b.contentGroup.clip(x)),t(p),A||(this.nav=A=h.g().attr({zIndex:1}).add(this.group),this.up=h.symbol("triangle",0,0,z,z).on("click",function(){b.scroll(-1,q)}).add(A),
|
||||
this.pager=h.text("",15,10).addClass("highcharts-legend-navigation").css(r.style).add(A),this.down=h.symbol("triangle-down",0,0,z,z).on("click",function(){b.scroll(1,q)}).add(A)),b.scroll(0),a=c):A&&(t(),A.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return a},scroll:function(a,e){var c=this.pages,d=c.length;a=this.currentPage+a;var h=this.clipHeight,k=this.options.navigation,m=this.pager,n=this.padding;a>d&&(a=d);0<a&&(void 0!==e&&b(e,this.chart),this.nav.attr({translateX:n,translateY:h+
|
||||
this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({"class":1===a?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}),m.attr({text:a+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,"class":a===d?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}),this.up.attr({fill:1===a?k.inactiveColor:k.activeColor}).css({cursor:1===a?"default":"pointer"}),this.down.attr({fill:a===d?k.inactiveColor:k.activeColor}).css({cursor:a===d?"default":"pointer"}),e=-c[a-
|
||||
1]+this.initialItemY,this.scrollGroup.animate({translateY:e}),this.currentPage=a,this.positionCheckboxes(e))}};a.LegendSymbolMixin={drawRectangle:function(a,b){var e=a.symbolHeight,c=a.options.squareSymbol;b.legendSymbol=this.chart.renderer.rect(c?(a.symbolWidth-e)/2:0,a.baseline-e+1,c?e:a.symbolWidth,e,m(a.options.symbolRadius,e/2)).addClass("highcharts-point").attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var b=this.options,c=b.marker,d=a.symbolWidth,h=a.symbolHeight,k=h/2,n=this.chart.renderer,
|
||||
p=this.legendGroup;a=a.baseline-Math.round(.3*a.fontMetrics.b);var x;x={"stroke-width":b.lineWidth||0};b.dashStyle&&(x.dashstyle=b.dashStyle);this.legendLine=n.path(["M",0,a,"L",d,a]).addClass("highcharts-graph").attr(x).add(p);c&&!1!==c.enabled&&(b=Math.min(m(c.radius,k),k),0===this.symbol.indexOf("url")&&(c=t(c,{width:h,height:h}),b=0),this.legendSymbol=c=n.symbol(this.symbol,d/2-b,a-b,2*b,2*b,c).addClass("highcharts-point").add(p),c.isMarker=!0)}};(/Trident\/7\.0/.test(x.navigator.userAgent)||
|
||||
r)&&F(y.prototype,"positionItem",function(a,b){var e=this,c=function(){b._legendItemPos&&a.call(e,b)};c();setTimeout(c)})})(Q);(function(a){var y=a.dateFormat,I=a.each,E=a.extend,K=a.format,c=a.isNumber,d=a.map,p=a.merge,r=a.pick,n=a.splat,t=a.syncTimeout,m=a.timeUnits;a.Tooltip=function(){this.init.apply(this,arguments)};a.Tooltip.prototype={init:function(a,c){this.chart=a;this.options=c;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.split=c.split&&!a.inverted;this.shared=c.shared||
|
||||
this.split},cleanSplit:function(a){I(this.chart.series,function(b){var c=b&&b.tt;c&&(!c.isActive||a?b.tt=c.destroy():c.isActive=!1)})},getLabel:function(){var a=this.chart.renderer,c=this.options;this.label||(this.split?this.label=a.g("tooltip"):(this.label=a.label("",0,0,c.shape||"callout",null,null,c.useHTML,null,"tooltip").attr({padding:c.padding,r:c.borderRadius}),this.label.attr({fill:c.backgroundColor,"stroke-width":c.borderWidth}).css(c.style).shadow(c.shadow)),this.label.attr({zIndex:8}).add());
|
||||
return this.label},update:function(a){this.destroy();this.init(this.chart,p(!0,this.options,a))},destroy:function(){this.label&&(this.label=this.label.destroy());this.split&&this.tt&&(this.cleanSplit(this.chart,!0),this.tt=this.tt.destroy());clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,c,d,m){var b=this,e=b.now,k=!1!==b.options.animation&&!b.isHidden&&(1<Math.abs(a-e.x)||1<Math.abs(c-e.y)),w=b.followPointer||1<b.len;E(e,{x:k?(2*e.x+a)/3:a,y:k?(e.y+c)/2:c,anchorX:w?
|
||||
void 0:k?(2*e.anchorX+d)/3:d,anchorY:w?void 0:k?(e.anchorY+m)/2:m});b.getLabel().attr(e);k&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){b&&b.move(a,c,d,m)},32))},hide:function(a){var b=this;clearTimeout(this.hideTimer);a=r(a,this.options.hideDelay,500);this.isHidden||(this.hideTimer=t(function(){b.getLabel()[a?"fadeOut":"hide"]();b.isHidden=!0},a))},getAnchor:function(a,c){var b,k=this.chart,h=k.inverted,e=k.plotTop,m=k.plotLeft,w=0,p=0,r,t;a=n(a);b=a[0].tooltipPos;
|
||||
this.followPointer&&c&&(void 0===c.chartX&&(c=k.pointer.normalize(c)),b=[c.chartX-k.plotLeft,c.chartY-e]);b||(I(a,function(a){r=a.series.yAxis;t=a.series.xAxis;w+=a.plotX+(!h&&t?t.left-m:0);p+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!h&&r?r.top-e:0)}),w/=a.length,p/=a.length,b=[h?k.plotWidth-p:w,this.shared&&!h&&1<a.length&&c?c.chartY-e:h?k.plotHeight-w:p]);return d(b,Math.round)},getPosition:function(a,c,d){var b=this.chart,h=this.distance,e={},k=d.h||0,m,n=["y",b.chartHeight,c,d.plotY+b.plotTop,
|
||||
b.plotTop,b.plotTop+b.plotHeight],p=["x",b.chartWidth,a,d.plotX+b.plotLeft,b.plotLeft,b.plotLeft+b.plotWidth],x=!this.followPointer&&r(d.ttBelow,!b.inverted===!!d.negative),t=function(a,b,c,f,d,q){var l=c<f-h,m=f+h+c<b,u=f-h-c;f+=h;if(x&&m)e[a]=f;else if(!x&&l)e[a]=u;else if(l)e[a]=Math.min(q-c,0>u-k?u:u-k);else if(m)e[a]=Math.max(d,f+k+c>b?f:f+k);else return!1},C=function(a,b,c,f){var d;f<h||f>b-h?d=!1:e[a]=f<c/2?1:f>b-c/2?b-c-2:f-c/2;return d},q=function(a){var b=n;n=p;p=b;m=a},z=function(){!1!==
|
||||
t.apply(0,n)?!1!==C.apply(0,p)||m||(q(!0),z()):m?e.x=e.y=0:(q(!0),z())};(b.inverted||1<this.len)&&q();z();return e},defaultFormatter:function(a){var b=this.points||n(this),c;c=[a.tooltipFooterHeaderFormatter(b[0])];c=c.concat(a.bodyFormatter(b));c.push(a.tooltipFooterHeaderFormatter(b[0],!0));return c},refresh:function(a,c){var b=this.chart,d,h=this.options,e,k,m={},p=[];d=h.formatter||this.defaultFormatter;var m=b.hoverPoints,t=this.shared;clearTimeout(this.hideTimer);this.followPointer=n(a)[0].series.tooltipOptions.followPointer;
|
||||
k=this.getAnchor(a,c);c=k[0];e=k[1];!t||a.series&&a.series.noSharedTooltip?m=a.getLabelConfig():(b.hoverPoints=a,m&&I(m,function(a){a.setState()}),I(a,function(a){a.setState("hover");p.push(a.getLabelConfig())}),m={x:a[0].category,y:a[0].y},m.points=p,a=a[0]);this.len=p.length;m=d.call(m,this);t=a.series;this.distance=r(t.tooltipOptions.distance,16);!1===m?this.hide():(d=this.getLabel(),this.isHidden&&d.attr({opacity:1}).show(),this.split?this.renderSplit(m,b.hoverPoints):(d.attr({text:m&&m.join?
|
||||
m.join(""):m}),d.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+r(a.colorIndex,t.colorIndex)),d.attr({stroke:h.borderColor||a.color||t.color||"#666666"}),this.updatePosition({plotX:c,plotY:e,negative:a.negative,ttBelow:a.ttBelow,h:k[2]||0})),this.isHidden=!1)},renderSplit:function(b,c){var d=this,k=[],h=this.chart,e=h.renderer,m=!0,n=this.options,p,t=this.getLabel();I(b.slice(0,c.length+1),function(a,b){b=c[b-1]||{isHeader:!0,plotX:c[0].plotX};var u=b.series||d,q=u.tt,z=b.series||
|
||||
{},A="highcharts-color-"+r(b.colorIndex,z.colorIndex,"none");q||(u.tt=q=e.label(null,null,null,"callout").addClass("highcharts-tooltip-box "+A).attr({padding:n.padding,r:n.borderRadius,fill:n.backgroundColor,stroke:b.color||z.color||"#333333","stroke-width":n.borderWidth}).add(t));q.isActive=!0;q.attr({text:a});q.css(n.style);a=q.getBBox();z=a.width+q.strokeWidth();b.isHeader?(p=a.height,z=Math.max(0,Math.min(b.plotX+h.plotLeft-z/2,h.chartWidth-z))):z=b.plotX+h.plotLeft-r(n.distance,16)-z;0>z&&(m=
|
||||
!1);a=(b.series&&b.series.yAxis&&b.series.yAxis.pos)+(b.plotY||0);a-=h.plotTop;k.push({target:b.isHeader?h.plotHeight+p:a,rank:b.isHeader?1:0,size:u.tt.getBBox().height+1,point:b,x:z,tt:q})});this.cleanSplit();a.distribute(k,h.plotHeight+p);I(k,function(a){var b=a.point,c=b.series;a.tt.attr({visibility:void 0===a.pos?"hidden":"inherit",x:m||b.isHeader?a.x:b.plotX+h.plotLeft+r(n.distance,16),y:a.pos+h.plotTop,anchorX:b.isHeader?b.plotX+h.plotLeft:b.plotX+c.xAxis.pos,anchorY:b.isHeader?a.pos+h.plotTop-
|
||||
15:b.plotY+c.yAxis.pos})})},updatePosition:function(a){var b=this.chart,c=this.getLabel(),c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(Math.round(c.x),Math.round(c.y||0),a.plotX+b.plotLeft,a.plotY+b.plotTop)},getDateFormat:function(a,c,d,n){var b=y("%m-%d %H:%M:%S.%L",c),e,k,p={millisecond:15,second:12,minute:9,hour:6,day:3},r="millisecond";for(k in m){if(a===m.week&&+y("%w",c)===d&&"00:00:00.000"===b.substr(6)){k="week";break}if(m[k]>a){k=r;break}if(p[k]&&
|
||||
b.substr(p[k])!=="01-01 00:00:00.000".substr(p[k]))break;"week"!==k&&(r=k)}k&&(e=n[k]);return e},getXDateFormat:function(a,c,d){c=c.dateTimeLabelFormats;var b=d&&d.closestPointRange;return(b?this.getDateFormat(b,a.x,d.options.startOfWeek,c):c.day)||c.year},tooltipFooterHeaderFormatter:function(a,d){var b=d?"footer":"header";d=a.series;var k=d.tooltipOptions,h=k.xDateFormat,e=d.xAxis,m=e&&"datetime"===e.options.type&&c(a.key),b=k[b+"Format"];m&&!h&&(h=this.getXDateFormat(a,k,e));m&&h&&(b=b.replace("{point.key}",
|
||||
"{point.key:"+h+"}"));return K(b,{point:a,series:d})},bodyFormatter:function(a){return d(a,function(a){var b=a.series.tooltipOptions;return(b.pointFormatter||a.point.tooltipFormatter).call(a.point,b.pointFormat)})}}})(Q);(function(a){var y=a.addEvent,I=a.attr,E=a.charts,K=a.color,c=a.css,d=a.defined,p=a.doc,r=a.each,n=a.extend,t=a.fireEvent,m=a.offset,b=a.pick,k=a.removeEvent,x=a.splat,F=a.Tooltip,h=a.win;a.Pointer=function(a,b){this.init(a,b)};a.Pointer.prototype={init:function(a,c){this.options=
|
||||
c;this.chart=a;this.runChartClick=c.chart.events&&!!c.chart.events.click;this.pinchDown=[];this.lastValidTouch={};F&&c.tooltip.enabled&&(a.tooltip=new F(a,c.tooltip),this.followTouchMove=b(c.tooltip.followTouchMove,!0));this.setDOMEvents()},zoomOption:function(a){var c=this.chart,e=c.options.chart,d=e.zoomType||"",c=c.inverted;/touch/.test(a.type)&&(d=b(e.pinchType,d));this.zoomX=a=/x/.test(d);this.zoomY=d=/y/.test(d);this.zoomHor=a&&!c||d&&c;this.zoomVert=d&&!c||a&&c;this.hasZoom=a||d},normalize:function(a,
|
||||
b){var c,e;a=a||h.event;a.target||(a.target=a.srcElement);e=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;b||(this.chartPosition=b=m(this.chart.container));void 0===e.pageX?(c=Math.max(a.x,a.clientX-b.left),b=a.y):(c=e.pageX-b.left,b=e.pageY-b.top);return n(a,{chartX:Math.round(c),chartY:Math.round(b)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};r(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});
|
||||
return b},runPointActions:function(c){var e=this.chart,d=e.series,h=e.tooltip,k=h?h.shared:!1,m=!0,n=e.hoverPoint,t=e.hoverSeries,q,z,A,B=[],D;if(!k&&!t)for(q=0;q<d.length;q++)if(d[q].directTouch||!d[q].options.stickyTracking)d=[];t&&(k?t.noSharedTooltip:t.directTouch)&&n?B=[n]:(k||!t||t.options.stickyTracking||(d=[t]),r(d,function(a){z=a.noSharedTooltip&&k;A=!k&&a.directTouch;a.visible&&!z&&!A&&b(a.options.enableMouseTracking,!0)&&(D=a.searchPoint(c,!z&&1===a.kdDimensions))&&D.series&&B.push(D)}),
|
||||
B.sort(function(a,b){var c=a.distX-b.distX,e=a.dist-b.dist,f=(b.series.group&&b.series.group.zIndex)-(a.series.group&&a.series.group.zIndex);return 0!==c&&k?c:0!==e?e:0!==f?f:a.series.index>b.series.index?-1:1}));if(k)for(q=B.length;q--;)(B[q].x!==B[0].x||B[q].series.noSharedTooltip)&&B.splice(q,1);if(B[0]&&(B[0]!==this.prevKDPoint||h&&h.isHidden)){if(k&&!B[0].series.noSharedTooltip){for(q=0;q<B.length;q++)B[q].onMouseOver(c,B[q]!==(t&&t.directTouch&&n||B[0]));B.length&&h&&h.refresh(B.sort(function(a,
|
||||
b){return a.series.index-b.series.index}),c)}else if(h&&h.refresh(B[0],c),!t||!t.directTouch)B[0].onMouseOver(c);this.prevKDPoint=B[0];m=!1}m&&(d=t&&t.tooltipOptions.followPointer,h&&d&&!h.isHidden&&(d=h.getAnchor([{}],c),h.updatePosition({plotX:d[0],plotY:d[1]})));this.unDocMouseMove||(this.unDocMouseMove=y(p,"mousemove",function(b){if(E[a.hoverChartIndex])E[a.hoverChartIndex].pointer.onDocumentMouseMove(b)}));r(k?B:[b(n,B[0])],function(a){r(e.axes,function(b){(!a||a.series&&a.series[b.coll]===b)&&
|
||||
b.drawCrosshair(c,a)})})},reset:function(a,b){var c=this.chart,e=c.hoverSeries,d=c.hoverPoint,h=c.hoverPoints,k=c.tooltip,m=k&&k.shared?h:d;a&&m&&r(x(m),function(b){b.series.isCartesian&&void 0===b.plotX&&(a=!1)});if(a)k&&m&&(k.refresh(m),d&&(d.setState(d.state,!0),r(c.axes,function(a){a.crosshair&&a.drawCrosshair(null,d)})));else{if(d)d.onMouseOut();h&&r(h,function(a){a.setState()});if(e)e.onMouseOut();k&&k.hide(b);this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove());r(c.axes,function(a){a.hideCrosshair()});
|
||||
this.hoverX=this.prevKDPoint=c.hoverPoints=c.hoverPoint=null}},scaleGroups:function(a,b){var c=this.chart,e;r(c.series,function(d){e=a||d.getPlotBox();d.xAxis&&d.xAxis.zoomEnabled&&d.group&&(d.group.attr(e),d.markerGroup&&(d.markerGroup.attr(e),d.markerGroup.clip(b?c.clipRect:null)),d.dataLabelsGroup&&d.dataLabelsGroup.attr(e))});c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=a.chartX;b.mouseDownY=this.mouseDownY=
|
||||
a.chartY},drag:function(a){var b=this.chart,c=b.options.chart,e=a.chartX,d=a.chartY,h=this.zoomHor,k=this.zoomVert,m=b.plotLeft,q=b.plotTop,n=b.plotWidth,A=b.plotHeight,p,D=this.selectionMarker,f=this.mouseDownX,l=this.mouseDownY,r=c.panKey&&a[c.panKey+"Key"];D&&D.touch||(e<m?e=m:e>m+n&&(e=m+n),d<q?d=q:d>q+A&&(d=q+A),this.hasDragged=Math.sqrt(Math.pow(f-e,2)+Math.pow(l-d,2)),10<this.hasDragged&&(p=b.isInsidePlot(f-m,l-q),b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&p&&!r&&!D&&(this.selectionMarker=
|
||||
D=b.renderer.rect(m,q,h?1:n,k?1:A,0).attr({fill:c.selectionMarkerFill||K("#335cad").setOpacity(.25).get(),"class":"highcharts-selection-marker",zIndex:7}).add()),D&&h&&(e-=f,D.attr({width:Math.abs(e),x:(0<e?0:e)+f})),D&&k&&(e=d-l,D.attr({height:Math.abs(e),y:(0<e?0:e)+l})),p&&!D&&c.panning&&b.pan(a,c.panning)))},drop:function(a){var b=this,e=this.chart,h=this.hasPinched;if(this.selectionMarker){var k={originalEvent:a,xAxis:[],yAxis:[]},m=this.selectionMarker,p=m.attr?m.attr("x"):m.x,x=m.attr?m.attr("y"):
|
||||
m.y,q=m.attr?m.attr("width"):m.width,z=m.attr?m.attr("height"):m.height,A;if(this.hasDragged||h)r(e.axes,function(c){if(c.zoomEnabled&&d(c.min)&&(h||b[{xAxis:"zoomX",yAxis:"zoomY"}[c.coll]])){var e=c.horiz,f="touchend"===a.type?c.minPixelPadding:0,l=c.toValue((e?p:x)+f),e=c.toValue((e?p+q:x+z)-f);k[c.coll].push({axis:c,min:Math.min(l,e),max:Math.max(l,e)});A=!0}}),A&&t(e,"selection",k,function(a){e.zoom(n(a,h?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();h&&this.scaleGroups()}e&&
|
||||
(c(e.container,{cursor:e._cursor}),e.cancelClick=10<this.hasDragged,e.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(a){a=this.normalize(a);this.zoomOption(a);a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(b){E[a.hoverChartIndex]&&E[a.hoverChartIndex].pointer.drop(b)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition;a=this.normalize(a,c);!c||this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-
|
||||
b.plotLeft,a.chartY-b.plotTop)||this.reset()},onContainerMouseLeave:function(b){var c=E[a.hoverChartIndex];c&&(b.relatedTarget||b.toElement)&&(c.pointer.reset(),c.pointer.chartPosition=null)},onContainerMouseMove:function(b){var c=this.chart;d(a.hoverChartIndex)&&E[a.hoverChartIndex]&&E[a.hoverChartIndex].mouseIsDown||(a.hoverChartIndex=c.index);b=this.normalize(b);b.returnValue=!1;"mousedown"===c.mouseIsDown&&this.drag(b);!this.inClass(b.target,"highcharts-tracker")&&!c.isInsidePlot(b.chartX-c.plotLeft,
|
||||
b.chartY-c.plotTop)||c.openMenu||this.runPointActions(b)},inClass:function(a,b){for(var c;a;){if(c=I(a,"class")){if(-1!==c.indexOf(b))return!0;if(-1!==c.indexOf("highcharts-container"))return!1}a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries;a=a.relatedTarget||a.toElement;if(!(!b||!a||b.options.stickyTracking||this.inClass(a,"highcharts-tooltip")||this.inClass(a,"highcharts-series-"+b.index)&&this.inClass(a,"highcharts-tracker")))b.onMouseOut()},onContainerClick:function(a){var b=
|
||||
this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop;a=this.normalize(a);b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(t(c.series,"click",n(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(n(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&t(b,"click",a)))},setDOMEvents:function(){var b=this,c=b.chart.container;c.onmousedown=function(a){b.onContainerMouseDown(a)};c.onmousemove=function(a){b.onContainerMouseMove(a)};c.onclick=function(a){b.onContainerClick(a)};
|
||||
y(c,"mouseleave",b.onContainerMouseLeave);1===a.chartCount&&y(p,"mouseup",b.onDocumentMouseUp);a.hasTouch&&(c.ontouchstart=function(a){b.onContainerTouchStart(a)},c.ontouchmove=function(a){b.onContainerTouchMove(a)},1===a.chartCount&&y(p,"touchend",b.onDocumentTouchEnd))},destroy:function(){var b;k(this.chart.container,"mouseleave",this.onContainerMouseLeave);a.chartCount||(k(p,"mouseup",this.onDocumentMouseUp),k(p,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(b in this)this[b]=
|
||||
null}}})(Q);(function(a){var y=a.addEvent,I=a.animate,E=a.animObject,K=a.attr,c=a.doc,d=a.Axis,p=a.createElement,r=a.defaultOptions,n=a.discardElement,t=a.charts,m=a.css,b=a.defined,k=a.each,x=a.extend,F=a.find,h=a.fireEvent,e=a.getStyle,u=a.grep,w=a.isNumber,H=a.isObject,M=a.isString,G=a.Legend,N=a.marginNames,C=a.merge,q=a.Pointer,z=a.pick,A=a.pInt,B=a.removeEvent,D=a.seriesTypes,f=a.splat,l=a.svg,L=a.syncTimeout,O=a.win,P=a.Renderer,R=a.Chart=function(){this.getArgs.apply(this,arguments)};a.chart=
|
||||
function(a,b,c){return new R(a,b,c)};R.prototype={callbacks:[],getArgs:function(){var a=[].slice.call(arguments);if(M(a[0])||a[0].nodeName)this.renderTo=a.shift();this.init(a[0],a[1])},init:function(b,c){var g,d=b.series;b.series=null;g=C(r,b);g.series=b.series=d;this.userOptions=b;this.respRules=[];b=g.chart;d=b.events;this.margin=[];this.spacing=[];this.bounds={h:{},v:{}};this.callback=c;this.isResizing=0;this.options=g;this.axes=[];this.series=[];this.hasCartesianSeries=b.showAxes;var f;this.index=
|
||||
t.length;t.push(this);a.chartCount++;if(d)for(f in d)y(this,f,d[f]);this.xAxis=[];this.yAxis=[];this.pointCount=this.colorCounter=this.symbolCounter=0;this.firstRender()},initSeries:function(b){var c=this.options.chart;(c=D[b.type||c.type||c.defaultSeriesType])||a.error(17,!0);c=new c;c.init(this,b);return c},orderSeries:function(a){var b=this.series;for(a=a||0;a<b.length;a++)b[a]&&(b[a].index=a,b[a].name=b[a].name||"Series "+(b[a].index+1))},isInsidePlot:function(a,b,c){var g=c?b:a;a=c?a:b;return 0<=
|
||||
g&&g<=this.plotWidth&&0<=a&&a<=this.plotHeight},redraw:function(b){var c=this.axes,g=this.series,d=this.pointer,f=this.legend,e=this.isDirtyLegend,q,l,m=this.hasCartesianSeries,A=this.isDirtyBox,n=g.length,z=n,p=this.renderer,D=p.isHidden(),B=[];this.setResponsive&&this.setResponsive(!1);a.setAnimation(b,this);D&&this.cloneRenderTo();for(this.layOutTitles();z--;)if(b=g[z],b.options.stacking&&(q=!0,b.isDirty)){l=!0;break}if(l)for(z=n;z--;)b=g[z],b.options.stacking&&(b.isDirty=!0);k(g,function(a){a.isDirty&&
|
||||
"point"===a.options.legendType&&(a.updateTotals&&a.updateTotals(),e=!0);a.isDirtyData&&h(a,"updatedData")});e&&f.options.enabled&&(f.render(),this.isDirtyLegend=!1);q&&this.getStacks();m&&k(c,function(a){a.updateNames();a.setScale()});this.getMargins();m&&(k(c,function(a){a.isDirty&&(A=!0)}),k(c,function(a){var b=a.min+","+a.max;a.extKey!==b&&(a.extKey=b,B.push(function(){h(a,"afterSetExtremes",x(a.eventArgs,a.getExtremes()));delete a.eventArgs}));(A||q)&&a.redraw()}));A&&this.drawChartBox();h(this,
|
||||
"predraw");k(g,function(a){(A||a.isDirty)&&a.visible&&a.redraw();a.isDirtyData=!1});d&&d.reset(!0);p.draw();h(this,"redraw");h(this,"render");D&&this.cloneRenderTo(!0);k(B,function(a){a.call()})},get:function(a){function b(b){return b.id===a||b.options&&b.options.id===a}var c,g=this.series,d;c=F(this.axes,b)||F(this.series,b);for(d=0;!c&&d<g.length;d++)c=F(g[d].points||[],b);return c},getAxes:function(){var a=this,b=this.options,c=b.xAxis=f(b.xAxis||{}),b=b.yAxis=f(b.yAxis||{});k(c,function(a,b){a.index=
|
||||
b;a.isX=!0});k(b,function(a,b){a.index=b});c=c.concat(b);k(c,function(b){new d(a,b)})},getSelectedPoints:function(){var a=[];k(this.series,function(b){a=a.concat(u(b.points||[],function(a){return a.selected}))});return a},getSelectedSeries:function(){return u(this.series,function(a){return a.selected})},setTitle:function(a,b,c){var g=this,d=g.options,f;f=d.title=C({style:{color:"#333333",fontSize:d.isStock?"16px":"18px"}},d.title,a);d=d.subtitle=C({style:{color:"#666666"}},d.subtitle,b);k([["title",
|
||||
a,f],["subtitle",b,d]],function(a,b){var c=a[0],d=g[c],f=a[1];a=a[2];d&&f&&(g[c]=d=d.destroy());a&&a.text&&!d&&(g[c]=g.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+c,zIndex:a.zIndex||4}).add(),g[c].update=function(a){g.setTitle(!b&&a,b&&a)},g[c].css(a.style))});g.layOutTitles(c)},layOutTitles:function(a){var b=0,c,g=this.renderer,d=this.spacingBox;k(["title","subtitle"],function(a){var c=this[a],f=this.options[a],e;c&&(e=f.style.fontSize,e=g.fontMetrics(e,c).b,c.css({width:(f.width||
|
||||
d.width+f.widthAdjust)+"px"}).align(x({y:b+e+("title"===a?-3:2)},f),!1,"spacingBox"),f.floating||f.verticalAlign||(b=Math.ceil(b+c.getBBox().height)))},this);c=this.titleOffset!==b;this.titleOffset=b;!this.isDirtyBox&&c&&(this.isDirtyBox=c,this.hasRendered&&z(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a=this.options.chart,c=a.width,a=a.height,d=this.renderToClone||this.renderTo;b(c)||(this.containerWidth=e(d,"width"));b(a)||(this.containerHeight=e(d,"height"));this.chartWidth=
|
||||
Math.max(0,c||this.containerWidth||600);this.chartHeight=Math.max(0,a||this.containerHeight||400)},cloneRenderTo:function(a){var b=this.renderToClone,g=this.container;if(a){if(b){for(;b.childNodes.length;)this.renderTo.appendChild(b.firstChild);n(b);delete this.renderToClone}}else g&&g.parentNode===this.renderTo&&this.renderTo.removeChild(g),this.renderToClone=b=this.renderTo.cloneNode(0),m(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block",
|
||||
"important"),c.body.appendChild(b),g&&b.appendChild(g)},setClassName:function(a){this.container.className="highcharts-container "+(a||"")},getContainer:function(){var b,d=this.options,f=d.chart,e,h;b=this.renderTo;var q=a.uniqueKey(),l;b||(this.renderTo=b=f.renderTo);M(b)&&(this.renderTo=b=c.getElementById(b));b||a.error(13,!0);e=A(K(b,"data-highcharts-chart"));w(e)&&t[e]&&t[e].hasRendered&&t[e].destroy();K(b,"data-highcharts-chart",this.index);b.innerHTML="";f.skipClone||b.offsetWidth||this.cloneRenderTo();
|
||||
this.getChartSize();e=this.chartWidth;h=this.chartHeight;l=x({position:"relative",overflow:"hidden",width:e+"px",height:h+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},f.style);this.container=b=p("div",{id:q},l,this.renderToClone||b);this._cursor=b.style.cursor;this.renderer=new (a[f.renderer]||P)(b,e,h,null,f.forExport,d.exporting&&d.exporting.allowHTML);this.setClassName(f.className);this.renderer.setStyle(f.style);this.renderer.chartIndex=this.index},
|
||||
getMargins:function(a){var c=this.spacing,g=this.margin,d=this.titleOffset;this.resetMargins();d&&!b(g[0])&&(this.plotTop=Math.max(this.plotTop,d+this.options.title.margin+c[0]));this.legend.display&&this.legend.adjustMargins(g,c);this.extraMargin&&(this[this.extraMargin.type]=(this[this.extraMargin.type]||0)+this.extraMargin.value);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);a||this.getAxisMargins()},getAxisMargins:function(){var a=this,c=a.axisOffset=[0,0,0,0],d=a.margin;a.hasCartesianSeries&&
|
||||
k(a.axes,function(a){a.visible&&a.getOffset()});k(N,function(g,f){b(d[f])||(a[g]+=c[f])});a.setChartSize()},reflow:function(a){var d=this,g=d.options.chart,f=d.renderTo,h=b(g.width),q=g.width||e(f,"width"),g=g.height||e(f,"height"),f=a?a.target:O;if(!h&&!d.isPrinting&&q&&g&&(f===O||f===c)){if(q!==d.containerWidth||g!==d.containerHeight)clearTimeout(d.reflowTimeout),d.reflowTimeout=L(function(){d.container&&d.setSize(void 0,void 0,!1)},a?100:0);d.containerWidth=q;d.containerHeight=g}},initReflow:function(){var a=
|
||||
this,b;b=y(O,"resize",function(b){a.reflow(b)});y(a,"destroy",b)},setSize:function(b,c,d){var g=this,f=g.renderer;g.isResizing+=1;a.setAnimation(d,g);g.oldChartHeight=g.chartHeight;g.oldChartWidth=g.chartWidth;void 0!==b&&(g.options.chart.width=b);void 0!==c&&(g.options.chart.height=c);g.getChartSize();b=f.globalAnimation;(b?I:m)(g.container,{width:g.chartWidth+"px",height:g.chartHeight+"px"},b);g.setChartSize(!0);f.setSize(g.chartWidth,g.chartHeight,d);k(g.axes,function(a){a.isDirty=!0;a.setScale()});
|
||||
g.isDirtyLegend=!0;g.isDirtyBox=!0;g.layOutTitles();g.getMargins();g.redraw(d);g.oldChartHeight=null;h(g,"resize");L(function(){g&&h(g,"endResize",null,function(){--g.isResizing})},E(b).duration)},setChartSize:function(a){var b=this.inverted,c=this.renderer,g=this.chartWidth,d=this.chartHeight,f=this.options.chart,e=this.spacing,h=this.clipOffset,q,l,m,A;this.plotLeft=q=Math.round(this.plotLeft);this.plotTop=l=Math.round(this.plotTop);this.plotWidth=m=Math.max(0,Math.round(g-q-this.marginRight));
|
||||
this.plotHeight=A=Math.max(0,Math.round(d-l-this.marginBottom));this.plotSizeX=b?A:m;this.plotSizeY=b?m:A;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:e[3],y:e[0],width:g-e[3]-e[1],height:d-e[0]-e[2]};this.plotBox=c.plotBox={x:q,y:l,width:m,height:A};g=2*Math.floor(this.plotBorderWidth/2);b=Math.ceil(Math.max(g,h[3])/2);c=Math.ceil(Math.max(g,h[0])/2);this.clipBox={x:b,y:c,width:Math.floor(this.plotSizeX-Math.max(g,h[1])/2-b),height:Math.max(0,Math.floor(this.plotSizeY-
|
||||
Math.max(g,h[2])/2-c))};a||k(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()})},resetMargins:function(){var a=this,b=a.options.chart;k(["margin","spacing"],function(c){var g=b[c],d=H(g)?g:[g,g,g,g];k(["Top","Right","Bottom","Left"],function(g,f){a[c][f]=z(b[c+g],d[f])})});k(N,function(b,c){a[b]=z(a.margin[c],a.spacing[c])});a.axisOffset=[0,0,0,0];a.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,f=this.chartBackground,
|
||||
e=this.plotBackground,h=this.plotBorder,q,l=this.plotBGImage,k=a.backgroundColor,m=a.plotBackgroundColor,A=a.plotBackgroundImage,n,z=this.plotLeft,p=this.plotTop,D=this.plotWidth,B=this.plotHeight,r=this.plotBox,t=this.clipRect,u=this.clipBox,x="animate";f||(this.chartBackground=f=b.rect().addClass("highcharts-background").add(),x="attr");q=a.borderWidth||0;n=q+(a.shadow?8:0);k={fill:k||"none"};if(q||f["stroke-width"])k.stroke=a.borderColor,k["stroke-width"]=q;f.attr(k).shadow(a.shadow);f[x]({x:n/
|
||||
2,y:n/2,width:c-n-q%2,height:d-n-q%2,r:a.borderRadius});x="animate";e||(x="attr",this.plotBackground=e=b.rect().addClass("highcharts-plot-background").add());e[x](r);e.attr({fill:m||"none"}).shadow(a.plotShadow);A&&(l?l.animate(r):this.plotBGImage=b.image(A,z,p,D,B).add());t?t.animate({width:u.width,height:u.height}):this.clipRect=b.clipRect(u);x="animate";h||(x="attr",this.plotBorder=h=b.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add());h.attr({stroke:a.plotBorderColor,"stroke-width":a.plotBorderWidth||
|
||||
0,fill:"none"});h[x](h.crisp({x:z,y:p,width:D,height:B},-h.strokeWidth()));this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart,c,d=a.options.series,f,e;k(["inverted","angular","polar"],function(g){c=D[b.type||b.defaultSeriesType];e=b[g]||c&&c.prototype[g];for(f=d&&d.length;!e&&f--;)(c=D[d[f].type])&&c.prototype[g]&&(e=!0);a[g]=e})},linkSeries:function(){var a=this,b=a.series;k(b,function(a){a.linkedSeries.length=0});k(b,function(b){var c=b.options.linkedTo;M(c)&&(c=":previous"===
|
||||
c?a.series[b.index-1]:a.get(c))&&c.linkedParent!==b&&(c.linkedSeries.push(b),b.linkedParent=c,b.visible=z(b.options.visible,c.options.visible,b.visible))})},renderSeries:function(){k(this.series,function(a){a.translate();a.render()})},renderLabels:function(){var a=this,b=a.options.labels;b.items&&k(b.items,function(c){var d=x(b.style,c.style),f=A(d.left)+a.plotLeft,g=A(d.top)+a.plotTop+12;delete d.left;delete d.top;a.renderer.text(c.html,f,g).attr({zIndex:2}).css(d).add()})},render:function(){var a=
|
||||
this.axes,b=this.renderer,c=this.options,d,f,e;this.setTitle();this.legend=new G(this,c.legend);this.getStacks&&this.getStacks();this.getMargins(!0);this.setChartSize();c=this.plotWidth;d=this.plotHeight-=21;k(a,function(a){a.setScale()});this.getAxisMargins();f=1.1<c/this.plotWidth;e=1.05<d/this.plotHeight;if(f||e)k(a,function(a){(a.horiz&&f||!a.horiz&&e)&&a.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries&&k(a,function(a){a.visible&&a.render()});this.seriesGroup||
|
||||
(this.seriesGroup=b.g("series-group").attr({zIndex:3}).add());this.renderSeries();this.renderLabels();this.addCredits();this.setResponsive&&this.setResponsive();this.hasRendered=!0},addCredits:function(a){var b=this;a=C(!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&&(O.location.href=a.href)}).attr({align:a.position.align,zIndex:8}).css(a.style).add().align(a.position),
|
||||
this.credits.update=function(a){b.credits=b.credits.destroy();b.addCredits(a)})},destroy:function(){var b=this,c=b.axes,d=b.series,f=b.container,e,q=f&&f.parentNode;h(b,"destroy");t[b.index]=void 0;a.chartCount--;b.renderTo.removeAttribute("data-highcharts-chart");B(b);for(e=c.length;e--;)c[e]=c[e].destroy();this.scroller&&this.scroller.destroy&&this.scroller.destroy();for(e=d.length;e--;)d[e]=d[e].destroy();k("title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" "),
|
||||
function(a){var c=b[a];c&&c.destroy&&(b[a]=c.destroy())});f&&(f.innerHTML="",B(f),q&&n(f));for(e in b)delete b[e]},isReadyToRender:function(){var a=this;return l||O!=O.top||"complete"===c.readyState?!0:(c.attachEvent("onreadystatechange",function(){c.detachEvent("onreadystatechange",a.firstRender);"complete"===c.readyState&&a.firstRender()}),!1)},firstRender:function(){var a=this,b=a.options;if(a.isReadyToRender()){a.getContainer();h(a,"init");a.resetMargins();a.setChartSize();a.propFromSeries();
|
||||
a.getAxes();k(b.series||[],function(b){a.initSeries(b)});a.linkSeries();h(a,"beforeRender");q&&(a.pointer=new q(a,b));a.render();if(!a.renderer.imgCount&&a.onload)a.onload();a.cloneRenderTo(!0)}},onload:function(){k([this.callback].concat(this.callbacks),function(a){a&&void 0!==this.index&&a.apply(this,[this])},this);h(this,"load");h(this,"render");b(this.index)&&!1!==this.options.chart.reflow&&this.initReflow();this.onload=null}}})(Q);(function(a){var y=a.pick,I=a.relativeLength;a.CenteredSeriesMixin=
|
||||
{getCenter:function(){var a=this.options,K=this.chart,c=2*(a.slicedOffset||0),d=K.plotWidth-2*c,K=K.plotHeight-2*c,p=a.center,p=[y(p[0],"50%"),y(p[1],"50%"),a.size||"100%",a.innerSize||0],r=Math.min(d,K),n,t;for(n=0;4>n;++n)t=p[n],a=2>n||2===n&&/%$/.test(t),p[n]=I(t,[d,K,r,p[2]][n])+(a?c:0);p[3]>p[2]&&(p[3]=p[2]);return p}}})(Q);(function(a){var y,I=a.each,E=a.extend,K=a.erase,c=a.fireEvent,d=a.format,p=a.isArray,r=a.isNumber,n=a.pick,t=a.removeEvent;y=a.Point=function(){};y.prototype={init:function(a,
|
||||
b,c){this.series=a;this.color=a.color;this.applyOptions(b,c);a.options.colorByPoint?(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter],b=b.length,c=a.colorCounter,a.colorCounter++,a.colorCounter===b&&(a.colorCounter=0)):c=a.colorIndex;this.colorIndex=n(this.colorIndex,c);a.chart.pointCount++;return this},applyOptions:function(a,b){var c=this.series,d=c.options.pointValKey||c.pointValKey;a=y.prototype.optionsToObject.call(this,a);E(this,a);this.options=this.options?
|
||||
E(this.options,a):a;a.group&&delete this.group;d&&(this.y=this[d]);this.isNull=n(this.isValid&&!this.isValid(),null===this.x||!r(this.y,!0));this.selected&&(this.state="select");"name"in this&&void 0===b&&c.xAxis&&c.xAxis.hasNames&&(this.x=c.xAxis.nameToX(this));void 0===this.x&&c&&(this.x=void 0===b?c.autoIncrement(this):b);return this},optionsToObject:function(a){var b={},c=this.series,d=c.options.keys,m=d||c.pointArrayMap||["y"],h=m.length,e=0,n=0;if(r(a)||null===a)b[m[0]]=a;else if(p(a))for(!d&&
|
||||
a.length>h&&(c=typeof a[0],"string"===c?b.name=a[0]:"number"===c&&(b.x=a[0]),e++);n<h;)d&&void 0===a[e]||(b[m[n]]=a[e]),e++,n++;else"object"===typeof a&&(b=a,a.dataLabels&&(c._hasPointLabels=!0),a.marker&&(c._hasPointMarkers=!0));return b},getClassName:function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+(void 0!==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 a=this.series,b=a.zones,a=a.zoneAxis||"y",c=0,d;for(d=b[c];this[a]>=d.value;)d=b[++c];d&&d.color&&!this.options.color&&(this.color=d.color);return d},destroy:function(){var a=this.series.chart,b=a.hoverPoints,c;a.pointCount--;b&&(this.setState(),K(b,this),b.length||(a.hoverPoints=null));if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)t(this),
|
||||
this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(c in this)this[c]=null},destroyElements:function(){for(var a=["graphic","dataLabel","dataLabelUpper","connector","shadowGroup"],b,c=6;c--;)b=a[c],this[b]&&(this[b]=this[b].destroy())},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(a){var b=
|
||||
this.series,c=b.tooltipOptions,m=n(c.valueDecimals,""),p=c.valuePrefix||"",h=c.valueSuffix||"";I(b.pointArrayMap||["y"],function(b){b="{point."+b;if(p||h)a=a.replace(b+"}",p+b+"}"+h);a=a.replace(b+"}",b+":,."+m+"f}")});return d(a,{point:this,series:this.series})},firePointEvent:function(a,b,d){var k=this,m=this.series.options;(m.point.events[a]||k.options&&k.options.events&&k.options.events[a])&&this.importEvents();"click"===a&&m.allowPointSelect&&(d=function(a){k.select&&k.select(null,a.ctrlKey||
|
||||
a.metaKey||a.shiftKey)});c(this,a,b,d)},visible:!0}})(Q);(function(a){var y=a.addEvent,I=a.animObject,E=a.arrayMax,K=a.arrayMin,c=a.correctFloat,d=a.Date,p=a.defaultOptions,r=a.defaultPlotOptions,n=a.defined,t=a.each,m=a.erase,b=a.extend,k=a.fireEvent,x=a.grep,F=a.isArray,h=a.isNumber,e=a.isString,u=a.merge,w=a.pick,H=a.removeEvent,M=a.splat,G=a.SVGElement,N=a.syncTimeout,C=a.win;a.Series=a.seriesType("line",null,{lineWidth:2,allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},
|
||||
marker:{lineWidth:0,lineColor:"#ffffff",radius:4,states:{hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){return null===this.y?"":a.numberFormat(this.y,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0,padding:5},cropThreshold:300,pointRange:0,softThreshold:!0,states:{hover:{lineWidthPlus:1,
|
||||
marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3},{isCartesian:!0,pointClass:a.Point,sorted:!0,requireSorting:!0,directTouch:!1,axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],coll:"series",init:function(a,c){var d=this,e,h,f=a.series,q;d.chart=a;d.options=c=d.setOptions(c);d.linkedSeries=[];d.bindAxes();b(d,{name:c.name,state:"",visible:!1!==c.visible,selected:!0===c.selected});h=c.events;for(e in h)y(d,e,h[e]);if(h&&h.click||c.point&&
|
||||
c.point.events&&c.point.events.click||c.allowPointSelect)a.runTrackerClick=!0;d.getColor();d.getSymbol();t(d.parallelArrays,function(a){d[a+"Data"]=[]});d.setData(c.data,!1);d.isCartesian&&(a.hasCartesianSeries=!0);f.length&&(q=f[f.length-1]);d._i=w(q&&q._i,-1)+1;a.orderSeries(this.insert(f))},insert:function(a){var b=this.options.index,c;if(h(b)){for(c=a.length;c--;)if(b>=w(a[c].options.index,a[c]._i)){a.splice(c+1,0,this);break}-1===c&&a.unshift(this);c+=1}else a.push(this);return w(c,a.length-
|
||||
1)},bindAxes:function(){var b=this,c=b.options,d=b.chart,e;t(b.axisTypes||[],function(h){t(d[h],function(a){e=a.options;if(c[h]===e.index||void 0!==c[h]&&c[h]===e.id||void 0===c[h]&&0===e.index)b.insert(a.series),b[h]=a,a.isDirty=!0});b[h]||b.optionalAxis===h||a.error(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,d=arguments,e=h(b)?function(d){var f="y"===d&&c.toYData?c.toYData(a):a[d];c[d+"Data"][b]=f}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(d,2))};
|
||||
t(c.parallelArrays,e)},autoIncrement:function(){var a=this.options,b=this.xIncrement,c,e=a.pointIntervalUnit,b=w(b,a.pointStart,0);this.pointInterval=c=w(this.pointInterval,a.pointInterval,1);e&&(a=new d(b),"day"===e?a=+a[d.hcSetDate](a[d.hcGetDate]()+c):"month"===e?a=+a[d.hcSetMonth](a[d.hcGetMonth]()+c):"year"===e&&(a=+a[d.hcSetFullYear](a[d.hcGetFullYear]()+c)),c=a-b);this.xIncrement=b+c;return b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},d=b.plotOptions||
|
||||
{},e=c[this.type];this.userOptions=a;c=u(e,c.series,a);this.tooltipOptions=u(p.tooltip,p.plotOptions[this.type].tooltip,b.tooltip,d.series&&d.series.tooltip,d[this.type]&&d[this.type].tooltip,a.tooltip);null===e.marker&&delete c.marker;this.zoneAxis=c.zoneAxis;a=this.zones=(c.zones||[]).slice();!c.negativeColor&&!c.negativeFillColor||c.zones||a.push({value:c[this.zoneAxis+"Threshold"]||c.threshold||0,className:"highcharts-negative",color:c.negativeColor,fillColor:c.negativeFillColor});a.length&&n(a[a.length-
|
||||
1].value)&&a.push({color:this.color,fillColor:this.fillColor});return c},getCyclic:function(a,b,c){var d,e=this.chart,f=this.userOptions,h=a+"Index",q=a+"Counter",k=c?c.length:w(e.options.chart[a+"Count"],e[a+"Count"]);b||(d=w(f[h],f["_"+h]),n(d)||(e.series.length||(e[q]=0),f["_"+h]=d=e[q]%k,e[q]+=1),c&&(b=c[d]));void 0!==d&&(this[h]=d);this[a]=b},getColor:function(){this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||r[this.type].color,this.chart.options.colors)},
|
||||
getSymbol:function(){this.getCyclic("symbol",this.options.marker.symbol,this.chart.options.symbols)},drawLegendSymbol:a.LegendSymbolMixin.drawLineMarker,setData:function(b,c,d,k){var q=this,f=q.points,l=f&&f.length||0,m,n=q.options,p=q.chart,z=null,g=q.xAxis,r=n.turboThreshold,A=this.xData,B=this.yData,u=(m=q.pointArrayMap)&&m.length;b=b||[];m=b.length;c=w(c,!0);if(!1!==k&&m&&l===m&&!q.cropped&&!q.hasGroupedData&&q.visible)t(b,function(a,b){f[b].update&&a!==n.data[b]&&f[b].update(a,!1,null,!1)});
|
||||
else{q.xIncrement=null;q.colorCounter=0;t(this.parallelArrays,function(a){q[a+"Data"].length=0});if(r&&m>r){for(d=0;null===z&&d<m;)z=b[d],d++;if(h(z))for(d=0;d<m;d++)A[d]=this.autoIncrement(),B[d]=b[d];else if(F(z))if(u)for(d=0;d<m;d++)z=b[d],A[d]=z[0],B[d]=z.slice(1,u+1);else for(d=0;d<m;d++)z=b[d],A[d]=z[0],B[d]=z[1];else a.error(12)}else for(d=0;d<m;d++)void 0!==b[d]&&(z={series:q},q.pointClass.prototype.applyOptions.apply(z,[b[d]]),q.updateParallelArrays(z,d));e(B[0])&&a.error(14,!0);q.data=[];
|
||||
q.options.data=q.userOptions.data=b;for(d=l;d--;)f[d]&&f[d].destroy&&f[d].destroy();g&&(g.minRange=g.userMinRange);q.isDirty=p.isDirtyBox=!0;q.isDirtyData=!!f;d=!1}"point"===n.legendType&&(this.processData(),this.generatePoints());c&&p.redraw(d)},processData:function(b){var c=this.xData,d=this.yData,e=c.length,h;h=0;var f,l,q=this.xAxis,k,m=this.options;k=m.cropThreshold;var n=this.getExtremesFromAll||m.getExtremesFromAll,g=this.isCartesian,m=q&&q.val2lin,p=q&&q.isLog,r,t;if(g&&!this.isDirty&&!q.isDirty&&
|
||||
!this.yAxis.isDirty&&!b)return!1;q&&(b=q.getExtremes(),r=b.min,t=b.max);if(g&&this.sorted&&!n&&(!k||e>k||this.forceCrop))if(c[e-1]<r||c[0]>t)c=[],d=[];else if(c[0]<r||c[e-1]>t)h=this.cropData(this.xData,this.yData,r,t),c=h.xData,d=h.yData,h=h.start,f=!0;for(k=c.length||1;--k;)e=p?m(c[k])-m(c[k-1]):c[k]-c[k-1],0<e&&(void 0===l||e<l)?l=e:0>e&&this.requireSorting&&a.error(15);this.cropped=f;this.cropStart=h;this.processedXData=c;this.processedYData=d;this.closestPointRange=l},cropData:function(a,b,c,
|
||||
d){var e=a.length,f=0,h=e,q=w(this.cropShoulder,1),k;for(k=0;k<e;k++)if(a[k]>=c){f=Math.max(0,k-q);break}for(c=k;c<e;c++)if(a[c]>d){h=c+q;break}return{xData:a.slice(f,h),yData:b.slice(f,h),start:f,end:h}},generatePoints:function(){var a=this.options.data,b=this.data,c,d=this.processedXData,e=this.processedYData,f=this.pointClass,h=d.length,k=this.cropStart||0,m,n=this.hasGroupedData,p,g=[],r;b||n||(b=[],b.length=a.length,b=this.data=b);for(r=0;r<h;r++)m=k+r,n?(p=(new f).init(this,[d[r]].concat(M(e[r]))),
|
||||
p.dataGroup=this.groupMap[r]):(p=b[m])||void 0===a[m]||(b[m]=p=(new f).init(this,a[m],d[r])),p.index=m,g[r]=p;if(b&&(h!==(c=b.length)||n))for(r=0;r<c;r++)r!==k||n||(r+=h),b[r]&&(b[r].destroyElements(),b[r].plotX=void 0);this.data=b;this.points=g},getExtremes:function(a){var b=this.yAxis,c=this.processedXData,d,e=[],f=0;d=this.xAxis.getExtremes();var k=d.min,q=d.max,m,n,p,g;a=a||this.stackedYData||this.processedYData||[];d=a.length;for(g=0;g<d;g++)if(n=c[g],p=a[g],m=(h(p,!0)||F(p))&&(!b.isLog||p.length||
|
||||
0<p),n=this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||(c[g+1]||n)>=k&&(c[g-1]||n)<=q,m&&n)if(m=p.length)for(;m--;)null!==p[m]&&(e[f++]=p[m]);else e[f++]=p;this.dataMin=K(e);this.dataMax=E(e)},translate:function(){this.processedXData||this.processData();this.generatePoints();var a=this.options,b=a.stacking,d=this.xAxis,e=d.categories,k=this.yAxis,f=this.points,l=f.length,m=!!this.modifyValue,p=a.pointPlacement,r="between"===p||h(p),t=a.threshold,g=a.startFromThreshold?t:0,
|
||||
u,x,F,C,G=Number.MAX_VALUE;"between"===p&&(p=.5);h(p)&&(p*=w(a.pointRange||d.pointRange));for(a=0;a<l;a++){var y=f[a],H=y.x,E=y.y;x=y.low;var I=b&&k.stacks[(this.negStacks&&E<(g?0:t)?"-":"")+this.stackKey],K;k.isLog&&null!==E&&0>=E&&(y.isNull=!0);y.plotX=u=c(Math.min(Math.max(-1E5,d.translate(H,0,0,0,1,p,"flags"===this.type)),1E5));b&&this.visible&&!y.isNull&&I&&I[H]&&(C=this.getStackIndicator(C,H,this.index),K=I[H],E=K.points[C.key],x=E[0],E=E[1],x===g&&C.key===I[H].base&&(x=w(t,k.min)),k.isLog&&
|
||||
0>=x&&(x=null),y.total=y.stackTotal=K.total,y.percentage=K.total&&y.y/K.total*100,y.stackY=E,K.setOffset(this.pointXOffset||0,this.barW||0));y.yBottom=n(x)?k.translate(x,0,1,0,1):null;m&&(E=this.modifyValue(E,y));y.plotY=x="number"===typeof E&&Infinity!==E?Math.min(Math.max(-1E5,k.translate(E,0,1,0,1)),1E5):void 0;y.isInside=void 0!==x&&0<=x&&x<=k.len&&0<=u&&u<=d.len;y.clientX=r?c(d.translate(H,0,0,0,1,p)):u;y.negative=y.y<(t||0);y.category=e&&void 0!==e[y.x]?e[y.x]:y.x;y.isNull||(void 0!==F&&(G=
|
||||
Math.min(G,Math.abs(u-F))),F=u);y.zone=this.zones.length&&y.getZone()}this.closestPointRangePx=G},getValidPoints:function(a,b){var c=this.chart;return x(a||this.points||[],function(a){return b&&!c.isInsidePlot(a.plotX,a.plotY,c.inverted)?!1:!a.isNull})},setClip:function(a){var b=this.chart,c=this.options,d=b.renderer,e=b.inverted,f=this.clipBox,h=f||b.clipBox,k=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,h.height,c.xAxis,c.yAxis].join(),q=b[k],m=b[k+"m"];q||(a&&(h.width=0,b[k+"m"]=
|
||||
m=d.clipRect(-99,e?-b.plotLeft:-b.plotTop,99,e?b.chartWidth:b.chartHeight)),b[k]=q=d.clipRect(h),q.count={length:0});a&&!q.count[this.index]&&(q.count[this.index]=!0,q.count.length+=1);!1!==c.clip&&(this.group.clip(a||f?q:b.clipRect),this.markerGroup.clip(m),this.sharedClipKey=k);a||(q.count[this.index]&&(delete q.count[this.index],--q.count.length),0===q.count.length&&k&&b[k]&&(f||(b[k]=b[k].destroy()),b[k+"m"]&&(this.markerGroup.clip(),b[k+"m"]=b[k+"m"].destroy())))},animate:function(a){var b=this.chart,
|
||||
c=I(this.options.animation),d;a?this.setClip(c):(d=this.sharedClipKey,(a=b[d])&&a.animate({width:b.plotSizeX},c),b[d+"m"]&&b[d+"m"].animate({width:b.plotSizeX+99},c),this.animate=null)},afterAnimate:function(){this.setClip();k(this,"afterAnimate")},drawPoints:function(){var a=this.points,b=this.chart,c,d,e,f,k=this.options.marker,m,n,p,r,g=this.markerGroup,t=w(k.enabled,this.xAxis.isRadial?!0:null,this.closestPointRangePx>2*k.radius);if(!1!==k.enabled||this._hasPointMarkers)for(d=0;d<a.length;d++)e=
|
||||
a[d],c=e.plotY,f=e.graphic,m=e.marker||{},n=!!e.marker,p=t&&void 0===m.enabled||m.enabled,r=e.isInside,p&&h(c)&&null!==e.y?(c=w(m.symbol,this.symbol),e.hasImage=0===c.indexOf("url"),p=this.markerAttribs(e,e.selected&&"select"),f?f[r?"show":"hide"](!0).animate(p):r&&(0<p.width||e.hasImage)&&(e.graphic=f=b.renderer.symbol(c,p.x,p.y,p.width,p.height,n?m:k).add(g)),f&&f.attr(this.pointAttribs(e,e.selected&&"select")),f&&f.addClass(e.getClassName(),!0)):f&&(e.graphic=f.destroy())},markerAttribs:function(a,
|
||||
b){var c=this.options.marker,d=a.marker||{},e=w(d.radius,c.radius);b&&(c=c.states[b],b=d.states&&d.states[b],e=w(b&&b.radius,c&&c.radius,e+(c&&c.radiusPlus||0)));a.hasImage&&(e=0);a={x:Math.floor(a.plotX)-e,y:a.plotY-e};e&&(a.width=a.height=2*e);return a},pointAttribs:function(a,b){var c=this.options.marker,d=a&&a.options,e=d&&d.marker||{},f=this.color,h=d&&d.color,k=a&&a.color,d=w(e.lineWidth,c.lineWidth);a=a&&a.zone&&a.zone.color;f=h||a||k||f;a=e.fillColor||c.fillColor||f;f=e.lineColor||c.lineColor||
|
||||
f;b&&(c=c.states[b],b=e.states&&e.states[b]||{},d=w(b.lineWidth,c.lineWidth,d+w(b.lineWidthPlus,c.lineWidthPlus,0)),a=b.fillColor||c.fillColor||a,f=b.lineColor||c.lineColor||f);return{stroke:f,"stroke-width":d,fill:a}},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(C.navigator.userAgent),d,e=a.data||[],f,h,p;k(a,"destroy");H(a);t(a.axisTypes||[],function(b){(p=a[b])&&p.series&&(m(p.series,a),p.isDirty=p.forceRedraw=!0)});a.legendItem&&a.chart.legend.destroyItem(a);for(d=e.length;d--;)(f=
|
||||
e[d])&&f.destroy&&f.destroy();a.points=null;clearTimeout(a.animationTimeout);for(h in a)a[h]instanceof G&&!a[h].survive&&(d=c&&"group"===h?"hide":"destroy",a[h][d]());b.hoverSeries===a&&(b.hoverSeries=null);m(b.series,a);b.orderSeries();for(h in a)delete a[h]},getGraphPath:function(a,b,c){var d=this,e=d.options,f=e.step,h,k=[],m=[],q;a=a||d.points;(h=a.reversed)&&a.reverse();(f={right:1,center:2}[f]||f&&3)&&h&&(f=4-f);!e.connectNulls||b||c||(a=this.getValidPoints(a));t(a,function(h,g){var l=h.plotX,
|
||||
p=h.plotY,r=a[g-1];(h.leftCliff||r&&r.rightCliff)&&!c&&(q=!0);h.isNull&&!n(b)&&0<g?q=!e.connectNulls:h.isNull&&!b?q=!0:(0===g||q?g=["M",h.plotX,h.plotY]:d.getPointSpline?g=d.getPointSpline(a,h,g):f?(g=1===f?["L",r.plotX,p]:2===f?["L",(r.plotX+l)/2,r.plotY,"L",(r.plotX+l)/2,p]:["L",l,r.plotY],g.push("L",l,p)):g=["L",l,p],m.push(h.x),f&&m.push(h.x),k.push.apply(k,g),q=!1)});k.xMap=m;return d.graphPath=k},drawGraph:function(){var a=this,b=this.options,c=(this.gappedPath||this.getGraphPath).call(this),
|
||||
d=[["graph","highcharts-graph",b.lineColor||this.color,b.dashStyle]];t(this.zones,function(c,e){d.push(["zone-graph-"+e,"highcharts-graph highcharts-zone-graph-"+e+" "+(c.className||""),c.color||a.color,c.dashStyle||b.dashStyle])});t(d,function(d,e){var f=d[0],h=a[f];h?(h.endX=c.xMap,h.animate({d:c})):c.length&&(a[f]=a.chart.renderer.path(c).addClass(d[1]).attr({zIndex:1}).add(a.group),h={stroke:d[2],"stroke-width":b.lineWidth,fill:a.fillGraph&&a.color||"none"},d[3]?h.dashstyle=d[3]:"square"!==b.linecap&&
|
||||
(h["stroke-linecap"]=h["stroke-linejoin"]="round"),h=a[f].attr(h).shadow(2>e&&b.shadow));h&&(h.startX=c.xMap,h.isArea=c.isArea)})},applyZones:function(){var a=this,b=this.chart,c=b.renderer,d=this.zones,e,f,h=this.clips||[],k,m=this.graph,p=this.area,n=Math.max(b.chartWidth,b.chartHeight),g=this[(this.zoneAxis||"y")+"Axis"],r,u,x=b.inverted,F,y,C,G,H=!1;d.length&&(m||p)&&g&&void 0!==g.min&&(u=g.reversed,F=g.horiz,m&&m.hide(),p&&p.hide(),r=g.getExtremes(),t(d,function(d,l){e=u?F?b.plotWidth:0:F?0:
|
||||
g.toPixels(r.min);e=Math.min(Math.max(w(f,e),0),n);f=Math.min(Math.max(Math.round(g.toPixels(w(d.value,r.max),!0)),0),n);H&&(e=f=g.toPixels(r.max));y=Math.abs(e-f);C=Math.min(e,f);G=Math.max(e,f);g.isXAxis?(k={x:x?G:C,y:0,width:y,height:n},F||(k.x=b.plotHeight-k.x)):(k={x:0,y:x?G:C,width:n,height:y},F&&(k.y=b.plotWidth-k.y));x&&c.isVML&&(k=g.isXAxis?{x:0,y:u?C:G,height:k.width,width:b.chartWidth}:{x:k.y-b.plotLeft-b.spacingBox.x,y:0,width:k.height,height:b.chartHeight});h[l]?h[l].animate(k):(h[l]=
|
||||
c.clipRect(k),m&&a["zone-graph-"+l].clip(h[l]),p&&a["zone-area-"+l].clip(h[l]));H=d.value>r.max}),this.clips=h)},invertGroups:function(a){function b(){t(["group","markerGroup"],function(b){c[b]&&(c[b].width=c.yAxis.len,c[b].height=c.xAxis.len,c[b].invert(a))})}var c=this,d;c.xAxis&&(d=y(c.chart,"resize",b),y(c,"destroy",d),b(a),c.invertGroups=b)},plotGroup:function(a,b,c,d,e){var f=this[a],h=!f;h&&(this[a]=f=this.chart.renderer.g(b).attr({zIndex:d||.1}).add(e),f.addClass("highcharts-series-"+this.index+
|
||||
" highcharts-"+this.type+"-series highcharts-color-"+this.colorIndex+" "+(this.options.className||"")));f.attr({visibility:c})[h?"attr":"animate"](this.getPlotBox());return f},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;a.inverted&&(b=c,c=this.xAxis);return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this,b=a.chart,c,d=a.options,e=!!a.animate&&b.renderer.isSVG&&I(d.animation).duration,f=a.visible?"inherit":"hidden",h=
|
||||
d.zIndex,k=a.hasRendered,m=b.seriesGroup,p=b.inverted;c=a.plotGroup("group","series",f,h,m);a.markerGroup=a.plotGroup("markerGroup","markers",f,h,m);e&&a.animate(!0);c.inverted=a.isCartesian?p:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(p);!1===d.clip||a.sharedClipKey||k||c.clip(b.clipRect);e&&a.animate();k||(a.animationTimeout=N(function(){a.afterAnimate()},
|
||||
e));a.isDirty=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirty||this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:w(d&&d.left,a.plotLeft),translateY:w(e&&e.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree},kdDimensions:1,kdAxisArray:["clientX","plotY"],searchPoint:function(a,b){var c=this.xAxis,d=this.yAxis,e=this.chart.inverted;return this.searchKDTree({clientX:e?
|
||||
c.len-a.chartY+c.pos:a.chartX-c.pos,plotY:e?d.len-a.chartX+d.pos:a.chartY-d.pos},b)},buildKDTree:function(){function a(c,d,e){var f,h;if(h=c&&c.length)return f=b.kdAxisArray[d%e],c.sort(function(a,b){return a[f]-b[f]}),h=Math.floor(h/2),{point:c[h],left:a(c.slice(0,h),d+1,e),right:a(c.slice(h+1),d+1,e)}}this.buildingKdTree=!0;var b=this,c=b.kdDimensions;delete b.kdTree;N(function(){b.kdTree=a(b.getValidPoints(null,!b.directTouch),c,c);b.buildingKdTree=!1},b.options.kdNow?0:1)},searchKDTree:function(a,
|
||||
b){function c(a,b,k,m){var g=b.point,l=d.kdAxisArray[k%m],p,q,r=g;q=n(a[e])&&n(g[e])?Math.pow(a[e]-g[e],2):null;p=n(a[f])&&n(g[f])?Math.pow(a[f]-g[f],2):null;p=(q||0)+(p||0);g.dist=n(p)?Math.sqrt(p):Number.MAX_VALUE;g.distX=n(q)?Math.sqrt(q):Number.MAX_VALUE;l=a[l]-g[l];p=0>l?"left":"right";q=0>l?"right":"left";b[p]&&(p=c(a,b[p],k+1,m),r=p[h]<r[h]?p:g);b[q]&&Math.sqrt(l*l)<r[h]&&(a=c(a,b[q],k+1,m),r=a[h]<r[h]?a:r);return r}var d=this,e=this.kdAxisArray[0],f=this.kdAxisArray[1],h=b?"distX":"dist";
|
||||
this.kdTree||this.buildingKdTree||this.buildKDTree();if(this.kdTree)return c(a,this.kdTree,this.kdDimensions,this.kdDimensions)}})})(Q);(function(a){var y=a.animObject,I=a.color,E=a.each,K=a.extend,c=a.isNumber,d=a.merge,p=a.pick,r=a.Series,n=a.seriesType,t=a.svg;n("column","line",{borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1,brightness:.1,shadow:!1},select:{color:"#cccccc",borderColor:"#000000",shadow:!1}},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(){r.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&E(b.series,function(b){b.type===a.type&&(b.isDirty=!0)})},getColumnMetrics:function(){var a=this,b=a.options,c=a.xAxis,d=a.yAxis,n=c.reversed,h,e={},r=0;!1===b.grouping?r=1:E(a.chart.series,
|
||||
function(b){var c=b.options,k=b.yAxis,m;b.type===a.type&&b.visible&&d.len===k.len&&d.pos===k.pos&&(c.stacking?(h=b.stackKey,void 0===e[h]&&(e[h]=r++),m=e[h]):!1!==c.grouping&&(m=r++),b.columnIndex=m)});var t=Math.min(Math.abs(c.transA)*(c.ordinalSlope||b.pointRange||c.closestPointRange||c.tickInterval||1),c.len),y=t*b.groupPadding,I=(t-2*y)/(r||1),b=Math.min(b.maxPointWidth||c.len,p(b.pointWidth,I*(1-2*b.pointPadding)));a.columnMetrics={width:b,offset:(I-b)/2+(y+((a.columnIndex||0)+(n?1:0))*I-t/2)*
|
||||
(n?-1:1)};return a.columnMetrics},crispCol:function(a,b,c,d){var k=this.chart,h=this.borderWidth,e=-(h%2?.5:0),h=h%2?.5:1;k.inverted&&k.renderer.isVML&&(h+=1);c=Math.round(a+c)+e;a=Math.round(a)+e;d=Math.round(b+d)+h;e=.5>=Math.abs(b)&&.5<d;b=Math.round(b)+h;d-=b;e&&d&&(--b,d+=1);return{x:a,y:b,width:c-a,height:d}},translate:function(){var a=this,b=a.chart,c=a.options,d=a.dense=2>a.closestPointRange*a.xAxis.transA,d=a.borderWidth=p(c.borderWidth,d?0:1),n=a.yAxis,h=a.translatedThreshold=n.getThreshold(c.threshold),
|
||||
e=p(c.minPointLength,5),t=a.getColumnMetrics(),w=t.width,y=a.barW=Math.max(w,1+2*d),I=a.pointXOffset=t.offset;b.inverted&&(h-=.5);c.pointPadding&&(y=Math.ceil(y));r.prototype.translate.apply(a);E(a.points,function(c){var d=p(c.yBottom,h),k=999+Math.abs(d),k=Math.min(Math.max(-k,c.plotY),n.len+k),m=c.plotX+I,r=y,t=Math.min(k,d),u,x=Math.max(k,d)-t;Math.abs(x)<e&&e&&(x=e,u=!n.reversed&&!c.negative||n.reversed&&c.negative,t=Math.abs(t-h)>e?d-e:h-(u?e:0));c.barX=m;c.pointWidth=w;c.tooltipPos=b.inverted?
|
||||
[n.len+n.pos-b.plotLeft-k,a.xAxis.len-m-r/2,x]:[m+r/2,k+n.pos-b.plotTop,x];c.shapeType="rect";c.shapeArgs=a.crispCol.apply(a,c.isNull?[c.plotX,n.len/2,0,0]:[m,t,r,x])})},getSymbol:a.noop,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(a,b){var c=this.options,d,m=this.pointAttrToOptions||{};d=m.stroke||"borderColor";var h=m["stroke-width"]||"borderWidth",e=a&&a.color||this.color,
|
||||
p=a[d]||c[d]||this.color||e,n=a[h]||c[h]||this[h]||0,m=c.dashStyle;a&&this.zones.length&&(e=(e=a.getZone())&&e.color||a.options.color||this.color);b&&(a=c.states[b],b=a.brightness,e=a.color||void 0!==b&&I(e).brighten(a.brightness).get()||e,p=a[d]||p,n=a[h]||n,m=a.dashStyle||m);d={fill:e,stroke:p,"stroke-width":n};c.borderRadius&&(d.r=c.borderRadius);m&&(d.dashstyle=m);return d},drawPoints:function(){var a=this,b=this.chart,k=a.options,p=b.renderer,n=k.animationLimit||250,h;E(a.points,function(e){var m=
|
||||
e.graphic;if(c(e.plotY)&&null!==e.y){h=e.shapeArgs;if(m)m[b.pointCount<n?"animate":"attr"](d(h));else e.graphic=m=p[e.shapeType](h).attr({"class":e.getClassName()}).add(e.group||a.group);m.attr(a.pointAttribs(e,e.selected&&"select")).shadow(k.shadow,null,k.stacking&&!k.borderRadius)}else m&&(e.graphic=m.destroy())})},animate:function(a){var b=this,c=this.yAxis,d=b.options,m=this.chart.inverted,h={};t&&(a?(h.scaleY=.001,a=Math.min(c.pos+c.len,Math.max(c.pos,c.toPixels(d.threshold))),m?h.translateX=
|
||||
a-c.len:h.translateY=a,b.group.attr(h)):(h[m?"translateX":"translateY"]=c.pos,b.group.animate(h,K(y(b.options.animation),{step:function(a,c){b.group.attr({scaleY:Math.max(.001,c.pos)})}})),b.animate=null))},remove:function(){var a=this,b=a.chart;b.hasRendered&&E(b.series,function(b){b.type===a.type&&(b.isDirty=!0)});r.prototype.remove.apply(a,arguments)}})})(Q);(function(a){var y=a.addEvent,I=a.defined,E=a.each,K=a.extend,c=a.inArray,d=a.noop,p=a.pick,r=a.Point,n=a.Series,t=a.seriesType,m=a.setAnimation;
|
||||
t("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return null===this.y?void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,states:{hover:{brightness:.1,shadow:!1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],
|
||||
pointAttribs:a.seriesTypes.column.prototype.pointAttribs,animate:function(a){var b=this,c=b.points,d=b.startAngleRad;a||(E(c,function(a){var c=a.graphic,h=a.shapeArgs;c&&(c.attr({r:a.startR||b.center[3]/2,start:d,end:d}),c.animate({r:h.r,start:h.start,end:h.end},b.options.animation))}),b.animate=null)},updateTotals:function(){var a,c=0,d=this.points,m=d.length,h,e=this.options.ignoreHiddenPoint;for(a=0;a<m;a++)h=d[a],0>h.y&&(h.y=null),c+=e&&!h.visible?0:h.y;this.total=c;for(a=0;a<m;a++)h=d[a],h.percentage=
|
||||
0<c&&(h.visible||!e)?h.y/c*100:0,h.total=c},generatePoints:function(){n.prototype.generatePoints.call(this);this.updateTotals()},translate:function(a){this.generatePoints();var b=0,c=this.options,d=c.slicedOffset,h=d+(c.borderWidth||0),e,m,n,r=c.startAngle||0,t=this.startAngleRad=Math.PI/180*(r-90),r=(this.endAngleRad=Math.PI/180*(p(c.endAngle,r+360)-90))-t,y=this.points,E=c.dataLabels.distance,c=c.ignoreHiddenPoint,C,q=y.length,z;a||(this.center=a=this.getCenter());this.getX=function(b,c){n=Math.asin(Math.min((b-
|
||||
a[1])/(a[2]/2+E),1));return a[0]+(c?-1:1)*Math.cos(n)*(a[2]/2+E)};for(C=0;C<q;C++){z=y[C];e=t+b*r;if(!c||z.visible)b+=z.percentage/100;m=t+b*r;z.shapeType="arc";z.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:Math.round(1E3*e)/1E3,end:Math.round(1E3*m)/1E3};n=(m+e)/2;n>1.5*Math.PI?n-=2*Math.PI:n<-Math.PI/2&&(n+=2*Math.PI);z.slicedTranslation={translateX:Math.round(Math.cos(n)*d),translateY:Math.round(Math.sin(n)*d)};e=Math.cos(n)*a[2]/2;m=Math.sin(n)*a[2]/2;z.tooltipPos=[a[0]+.7*e,a[1]+.7*
|
||||
m];z.half=n<-Math.PI/2||n>Math.PI/2?1:0;z.angle=n;h=Math.min(h,E/5);z.labelPos=[a[0]+e+Math.cos(n)*E,a[1]+m+Math.sin(n)*E,a[0]+e+Math.cos(n)*h,a[1]+m+Math.sin(n)*h,a[0]+e,a[1]+m,0>E?"center":z.half?"right":"left",n]}},drawGraph:null,drawPoints:function(){var a=this,c=a.chart.renderer,d,m,h,e,n=a.options.shadow;n&&!a.shadowGroup&&(a.shadowGroup=c.g("shadow").add(a.group));E(a.points,function(b){if(null!==b.y){m=b.graphic;e=b.shapeArgs;d=b.sliced?b.slicedTranslation:{};var k=b.shadowGroup;n&&!k&&(k=
|
||||
b.shadowGroup=c.g("shadow").add(a.shadowGroup));k&&k.attr(d);h=a.pointAttribs(b,b.selected&&"select");m?m.setRadialReference(a.center).attr(h).animate(K(e,d)):(b.graphic=m=c[b.shapeType](e).addClass(b.getClassName()).setRadialReference(a.center).attr(d).add(a.group),b.visible||m.attr({visibility:"hidden"}),m.attr(h).attr({"stroke-linejoin":"round"}).shadow(n,k))}})},searchPoint:d,sortByAngle:function(a,c){a.sort(function(a,b){return void 0!==a.angle&&(b.angle-a.angle)*c})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,
|
||||
getCenter:a.CenteredSeriesMixin.getCenter,getSymbol:d},{init:function(){r.prototype.init.apply(this,arguments);var a=this,c;a.name=p(a.name,"Slice");c=function(b){a.slice("select"===b.type)};y(a,"select",c);y(a,"unselect",c);return a},setVisible:function(a,d){var b=this,k=b.series,h=k.chart,e=k.options.ignoreHiddenPoint;d=p(d,e);a!==b.visible&&(b.visible=b.options.visible=a=void 0===a?!b.visible:a,k.options.data[c(b,k.data)]=b.options,E(["graphic","dataLabel","connector","shadowGroup"],function(c){if(b[c])b[c][a?
|
||||
"show":"hide"](!0)}),b.legendItem&&h.legend.colorizeItem(b,a),a||"hover"!==b.state||b.setState(""),e&&(k.isDirty=!0),d&&h.redraw())},slice:function(a,d,n){var b=this.series;m(n,b.chart);p(d,!0);this.sliced=this.options.sliced=a=I(a)?a:!this.sliced;b.options.data[c(this,b.data)]=this.options;a=a?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var b=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(b.x,
|
||||
b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}})})(Q);return Q});
|
|
@ -1,25 +1,29 @@
|
|||
{% extends "layout.html" %}
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
<h2>Toi aussi, joue au rézoman !</h2>
|
||||
<p>
|
||||
Voici la rezo-roulette metzquetaire.
|
||||
</p>
|
||||
<p id="play" style="text-align: center; font-size: 1.5em">
|
||||
<h2>Toi aussi, joue au rézoman avec la rezo-roulette Les Metzquetaires !</h2>
|
||||
<table style="width:100%"><tr>
|
||||
<td>
|
||||
<div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
|
||||
</td>
|
||||
<td>
|
||||
<p id="play" style="text-align: center; font-size: 1.5em">
|
||||
<a href="{{url_for('play')}}">Jouer</a>
|
||||
</p>
|
||||
<h2>Historique personnel</h2>
|
||||
</p>
|
||||
<h2>Historique personnel</h2>
|
||||
|
||||
{% if bans_hist != [] %}
|
||||
<ul id="history">
|
||||
{% if bans_hist != [] %}
|
||||
<ul id="history">
|
||||
{% for entry in bans_hist %}
|
||||
<li class="{{ entry[0] }}" class="events">
|
||||
<span class="normal"> {{ entry[1] }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>
|
||||
Rien pour l'instant
|
||||
</p>
|
||||
</p>
|
||||
</td>
|
||||
</tr></table>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
content="text/html;charset=utf-8" />
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='javascript.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='highcharts-custom.js') }}"></script>
|
||||
<link rel="shortcut icon" type="image/x-icon"
|
||||
href="{{ url_for('static', filename='favicon.ico') }}" />
|
||||
</head>
|
||||
|
|
43
templates/layout_precampagne.html
Normal file
43
templates/layout_precampagne.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Rezo-roulette Metzquetaires</title>
|
||||
<meta http-equiv="content-type"
|
||||
content="text/html;charset=utf-8" />
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='javascript.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='highcharts-custom.js') }}"></script>
|
||||
<link rel="shortcut icon" type="image/x-icon"
|
||||
href="{{ url_for('static', filename='favicon.ico') }}" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="body_bis">
|
||||
|
||||
<div id="content_container">
|
||||
<div id="content_topleft" class="corner">
|
||||
</div>
|
||||
<div id="content_topright" class="corner">
|
||||
</div>
|
||||
<div id="content">
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<ul class=flashes>
|
||||
{% for message in messages %}
|
||||
<li>{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<div id="content_bottomleft" class="corner">
|
||||
</div>
|
||||
<div id="content_bottomright" class="corner">
|
||||
</div>
|
||||
<div id="footer">contact technique : <a href="mailto:roulette@metzquetaires.fr">roulette@metzquetaires.fr</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -3,7 +3,7 @@
|
|||
<h1>Vous n'êtes pas inscrit</h1>
|
||||
<p>
|
||||
Si vous désirez participer malgré les risques que le jeu comporte, veuillez
|
||||
envoyer un email à <div id="footer">contact technique : <a href="mailto:roulette@metzquetaires.fr">roulette@metzquetaires.fr</a></div> .
|
||||
envoyer un email au contact technique.
|
||||
(Vous ne pouvez pas jouer depuis Supélec)
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "layout.html" %}
|
||||
{% extends "layout_precampagne.html" %}
|
||||
{% block content %}
|
||||
<h2>Pas de précampagne!</h2>
|
||||
<p>
|
||||
|
|
Loading…
Reference in a new issue