From 5ee31d6055893ac06569fbd9324b43c647eb149c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Mon, 17 Mar 2025 10:45:59 +0100 Subject: [PATCH 1/2] Rip out Highcharts proprietary graphing code. This completely removes the graphing functionality of the Domain server control panel. I really don't think anyone actually uses this though, if people are even aware of its existence. The statistics themselves, without the pretty graphing, are still functional. --- domain-server/resources/web/stats/index.shtml | 4 - .../web/stats/js/highcharts-custom.js | 247 ------------------ domain-server/resources/web/stats/js/stats.js | 58 ---- 3 files changed, 309 deletions(-) delete mode 100644 domain-server/resources/web/stats/js/highcharts-custom.js diff --git a/domain-server/resources/web/stats/index.shtml b/domain-server/resources/web/stats/index.shtml index c60f156cea..d67db39342 100644 --- a/domain-server/resources/web/stats/index.shtml +++ b/domain-server/resources/web/stats/index.shtml @@ -1,14 +1,10 @@

Stats

-
-

Click on any of the numerical values in the tables below to view a line graph of the incoming values.

-
- diff --git a/domain-server/resources/web/stats/js/highcharts-custom.js b/domain-server/resources/web/stats/js/highcharts-custom.js deleted file mode 100644 index a772936a78..0000000000 --- a/domain-server/resources/web/stats/js/highcharts-custom.js +++ /dev/null @@ -1,247 +0,0 @@ -/* - Highcharts 4.0.4 JS v/Highstock 2.0.4 (2014-09-02) - - (c) 2009-2014 Torstein Honsi - - License: www.highcharts.com/license -*/ -(function(){function v(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function G(){var a,b=arguments,c,d={},e=function(a,b){var c,d;"object"!==typeof a&&(a={});for(d in b)b.hasOwnProperty(d)&&((c=b[d])&&"object"===typeof c&&"[object Array]"!==Object.prototype.toString.call(c)&&"renderTo"!==d&&"number"!==typeof c.nodeType?a[d]=e(a[d]||{},c):a[d]=b[d]);return a};!0===b[0]&&(d=b[1],b=Array.prototype.slice.call(b,2));c=b.length;for(a=0;ag?"-":"",m=String(E(g=X(g).toFixed(h))),q=3=c&&(b=[1/c])));for(d=0;dc&&(c=a[b]);return c}function Ma(a,b){for(var c in a)a[c]&& -a[c]!==b&&a[c].destroy&&a[c].destroy(),delete a[c]}function Na(a){Oa||(Oa=ja("div"));a&&Oa.appendChild(a);Oa.innerHTML=""}function ha(a){return parseFloat(a.toPrecision(14))}function pb(){var a=M.global.useUTC,b=a?"getUTC":"get",c=a?"setUTC":"set";la=M.global.Date||window.Date;wa=6E4*(a&&M.global.timezoneOffset||0);Pa=a?la.UTC:function(a,b,c,g,h,k){return(new la(a,b,n(c,1),n(g,0),n(h,0),n(k,0))).getTime()};db=b+"Minutes";eb=b+"Hours";fb=b+"Day";Da=b+"Date";Qa=b+"Month";Ra=b+"FullYear";qb=c+"Minutes"; -rb=c+"Hours";gb=c+"Date";sb=c+"Month";tb=c+"FullYear"}function O(){}function xa(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!0;c||d||this.addLabel()}function ma(){this.init.apply(this,arguments)}function Ea(){this.init.apply(this,arguments)}var u,y=document,I=window,R=Math,A=R.round,K=R.floor,ya=R.ceil,x=R.max,T=R.min,X=R.abs,Fa=R.cos,Sa=R.sin,ub=R.PI,vb=2*ub/360,na=navigator.userAgent,Bb=I.opera,ra=/msie/i.test(na)&&!Bb,Cb=/AppleWebKit/.test(na),Ta=/Firefox/.test(na),wb=/(Mobile|Android|Windows Phone)/.test(na), -Z=!!y.createElementNS&&!!y.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,Db=Ta&&4>parseInt(na.split("Firefox/")[1],10),ca=!Z&&!ra&&!!y.createElement("canvas").getContext,Ga,xb={},hb=0,Oa,M,Ka,S,ib,z,aa,Eb=function(){return u},Y=[],Ha=0,Fb=/^[0-9]+$/,la,Pa,wa,db,eb,fb,Da,Qa,Ra,qb,rb,gb,sb,tb,P={},U;I.Highcharts?aa(16,!0):U=I.Highcharts={};Ka=function(a,b,c){if(!w(b)||isNaN(b))return"Invalid date";a=n(a,"%Y-%m-%d %H:%M:%S");var d=new la(b-wa),e,f=d[eb](),g=d[fb](),h=d[Da](),k=d[Qa](), -l=d[Ra](),m=M.lang,q=m.weekdays,d=v({a:q[g].substr(0,3),A:q[g],d:sa(h),e:h,b:m.shortMonths[k],B:m.months[k],m:sa(k+1),y:l.toString().substr(2,2),Y:l,H:sa(f),I:sa(f%12||12),l:f%12||12,M:sa(d[db]()),p:12>f?"AM":"PM",P:12>f?"am":"pm",S:sa(d.getSeconds()),L:sa(A(b%1E3),3)},U.dateFormats);for(e in d)for(;-1!==a.indexOf("%"+e);)a=a.replace("%"+e,"function"===typeof d[e]?d[e](b):d[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};aa=function(a,b){var c="Highcharts error #"+a+": www.highcharts.com/errors/"+ -a;if(b)throw c;I.console&&console.log(c)};z={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:26784E5,year:31556952E3};ib={init:function(a,b,c){b=b||"";var d=a.shift,e=-1c)for(;f--;)d=parseFloat(a[f]),e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d;else e=b;return e}};(function(a){I.HighchartsAdapter=I.HighchartsAdapter||a&&{init:function(b){var c=a.fx;a.extend(a.easing,{easeOutQuad:function(a,b,c,g,h){return-g*(b/= -h)*(b-2)+c}});a.each(["cur","_default","width","height","opacity"],function(b,e){var f=c.step,g;"cur"===e?f=c.prototype:"_default"===e&&a.Tween&&(f=a.Tween.propHooks[e],e="set");(g=f[e])&&(f[e]=function(a){var c;a=b?a:this;if("align"!==a.prop)return c=a.elem,c.attr?c.attr(a.prop,"cur"===e?u:a.now):g.apply(this,arguments)})});bb(a.cssHooks.opacity,"get",function(a,b,c){return b.attr?b.opacity||0:a.call(this,b,c)});this.addAnimSetter("d",function(a){var c=a.elem,f;a.started||(f=b.init(c,c.d,c.toD), -a.start=f[0],a.end=f[1],a.started=!0);c.attr("d",b.step(a.start,a.end,a.pos,c.toD))});this.each=Array.prototype.forEach?function(a,b){return Array.prototype.forEach.call(a,b)}:function(a,b){var c,g=a.length;for(c=0;c{point.key}
',pointFormat:'\u25cf {series.name}: {point.y}
',shadow:!0,snap:wb?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px", -whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}};var Ya=M.plotOptions;pb();var Ib=/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*\)/,Jb=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,Kb=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,za=function(a){var b=[],c,d;(function(a){a&& -a.stops?d=kb(a.stops,function(a){return za(a[1])}):(c=Ib.exec(a))?b=[E(c[1]),E(c[2]),E(c[3]),parseFloat(c[4],10)]:(c=Jb.exec(a))?b=[E(c[1],16),E(c[2],16),E(c[3],16),1]:(c=Kb.exec(a))&&(b=[E(c[1]),E(c[2]),E(c[3]),1])})(a);return{get:function(c){var f;d?(f=G(a),f.stops=[].concat(f.stops),t(d,function(a,b){f.stops[b]=[f.stops[b][0],a.get(c)]})):f=b&&!isNaN(b[0])?"rgb"===c?"rgb("+b[0]+","+b[1]+","+b[2]+")":"a"===c?b[3]:"rgba("+b.join(",")+")":a;return f},brighten:function(a){if(d)t(d,function(b){b.brighten(a)}); -else if(ga(a)&&0!==a){var c;for(c=0;3>c;c++)b[c]+=E(255*a),0>b[c]&&(b[c]=0),255a.width)a={width:0,height:0}}else a=this.htmlGetBBox();b.isSVG&&(c=a.width,d=a.height,ra&&f&&"11px"===f.fontSize&&"16.9"===d.toPrecision(3)&& -(a.height=d=14),e&&(a.width=X(d*Sa(g))+X(c*Fa(g)),a.height=X(d*Fa(g))+X(c*Sa(g))));this.bBox=a;h&&(b.cache[h]=a)}return a},show:function(a){a&&"http://www.w3.org/2000/svg"===this.element.namespaceURI?this.element.removeAttribute("visibility"):this.attr({visibility:a?"inherit":"visible"});return this},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var b=this;b.animate({opacity:0},{duration:a||150,complete:function(){b.attr({y:-9999})}})},add:function(a){var b=this.renderer, -c=a||b,d=c.element||b.box,e=this.element,f=this.zIndex,g,h;a&&(this.parentGroup=a);this.parentInverted=a&&a.inverted;void 0!==this.textStr&&b.buildText(this);f&&(c.handleZ=!0,f=E(f));if(c.handleZ)for(a=d.childNodes,g=0;gf||!w(f)&&w(c))){d.insertBefore(e,b);h=!0;break}h||d.appendChild(e);this.added=!0;if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element|| -{},c=a.shadows,d=a.renderer.isSVG&&"SPAN"===b.nodeName&&a.parentGroup,e,f;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=b.point=null;Xa(a);a.clipPath&&(a.clipPath=a.clipPath.destroy());if(a.stops){for(f=0;f]*>/g,"")},textSetter:function(a){a!==this.textStr&&(delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this))},fillSetter:function(a,b,c){"string"===typeof a?c.setAttribute(b,a):a&&this.colorGradient(a,b,c)},zIndexSetter:function(a,b,c){c.setAttribute(b,a);this[b]=a},_defaultSetter:function(a,b,c){c.setAttribute(b,a)}};O.prototype.yGetter=O.prototype.xGetter; -O.prototype.translateXSetter=O.prototype.translateYSetter=O.prototype.rotationSetter=O.prototype.verticalAlignSetter=O.prototype.scaleXSetter=O.prototype.scaleYSetter=function(a,b){this[b]=a;this.doTransform=!0};O.prototype["stroke-widthSetter"]=O.prototype.strokeSetter=function(a,b,c){this[b]=a;this.stroke&&this["stroke-width"]?(this.strokeWidth=this["stroke-width"],O.prototype.fillSetter.call(this,this.stroke,"stroke",c),c.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"=== -b&&0===a&&this.hasStroke&&(c.removeAttribute("stroke"),this.hasStroke=!1)};var Ja=function(){this.init.apply(this,arguments)};Ja.prototype={Element:O,init:function(a,b,c,d,e){var f=location,g;d=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(d));g=d.element;a.appendChild(g);-1===a.innerHTML.indexOf("xmlns")&&N(g,"xmlns","http://www.w3.org/2000/svg");this.isSVG=!0;this.box=g;this.boxWrapper=d;this.alignedObjects=[];this.url=(Ta||Cb)&&y.getElementsByTagName("base").length?f.href.replace(/#.*?$/, -"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(y.createTextNode("Created with Highcharts 4.0.4 /Highstock 2.0.4"));this.defs=this.createElement("defs").add();this.forExport=e;this.gradients={};this.cache={};this.setSize(b,c,!1);var h;Ta&&a.getBoundingClientRect&&(this.subPixelFix=b=function(){J(a,{left:0,top:0});h=a.getBoundingClientRect();J(a,{left:ya(h.left)-h.left+"px",top:ya(h.top)-h.top+"px"})},b(),F(I,"resize",b))},getStyle:function(a){return this.style= -v({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();Ma(this.gradients||{});this.gradients=null;a&&(this.defs=a.destroy());this.subPixelFix&&L(I,"resize",this.subPixelFix);return this.alignedObjects=null},createElement:function(a){var b=new this.Element;b.init(this,a);return b},draw:function(){}, -buildText:function(a){for(var b=a.element,c=this,d=c.forExport,e=n(a.textStr,"").toString(),f=-1!==e.indexOf("<"),g=b.childNodes,h,k,l=N(b,"x"),m=a.styles,q=a.textWidth,r=m&&m.lineHeight,p=m&&m.HcTextStroke,Q=g.length,D=function(a){return r?E(r):c.fontMetrics(/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:m&&m.fontSize||c.style.fontSize||12,a).h};Q--;)b.removeChild(g[Q]);f||p||-1!==e.indexOf(" ")?(h=/<.*style="([^"]+)".*>/,k=/<.*href="(http[^"]+)".*>/,q&&!a.added&&this.box.appendChild(b),e= -f?e.replace(/<(b|strong)>/g,'').replace(/<(i|em)>/g,'').replace(//g,"").split(//g):[e],""===e[e.length-1]&&e.pop(),t(e,function(e,f){var g,r=0;e=e.replace(//g,"|||");g=e.split("|||");t(g,function(e){if(""!==e||1===g.length){var p={},n=y.createElementNS("http://www.w3.org/2000/svg","tspan"),Q;h.test(e)&&(Q=e.match(h)[1].replace(/(;| |^)color([ :])/, -"$1fill$2"),N(n,"style",Q));k.test(e)&&!d&&(N(n,"onclick",'location.href="'+e.match(k)[1]+'"'),J(n,{cursor:"pointer"}));e=(e.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"<").replace(/>/g,">");if(" "!==e){n.appendChild(y.createTextNode(e));r?p.dx=0:f&&null!==l&&(p.x=l);N(n,p);b.appendChild(n);!r&&f&&(!Z&&d&&J(n,{display:"block"}),N(n,"dy",D(n)));if(q){e=e.replace(/([^\^])-/g,"$1- ").split(" ");for(var p=1q)&&1!==e.length?(n.removeChild(n.firstChild),u.unshift(e.pop())):(e=u,u=[],e.length&&(yb++,H&&yb*w>H?(e=["..."],a.attr("title",a.textStr)):(n=y.createElementNS("http://www.w3.org/2000/svg","tspan"),N(n,{dy:w,x:l}),Q&&N(n,"style",Q),b.appendChild(n))),C>q&&(q=C)),e.length&&n.appendChild(y.createTextNode(e.join(" ").replace(/- /g,"-")))}r++}}})})):b.appendChild(y.createTextNode(e))}, -button:function(a,b,c,d,e,f,g,h,k){var l=this.label(a,b,c,k,null,null,null,null,"button"),m=0,q,r,p,n,D,t;a={x1:0,y1:0,x2:0,y2:1};e=G({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:a,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},e);p=e.style;delete e.style;f=G(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#FFF"],[1,"#ACF"]]}},f);n=f.style;delete f.style;g=G(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#9BD"],[1,"#CDF"]]}},g);D=g.style;delete g.style; -h=G(e,{style:{color:"#CCC"}},h);t=h.style;delete h.style;F(l.element,ra?"mouseover":"mouseenter",function(){3!==m&&l.attr(f).css(n)});F(l.element,ra?"mouseout":"mouseleave",function(){3!==m&&(q=[e,f,g][m],r=[p,n,D][m],l.attr(q).css(r))});l.setState=function(a){(l.state=m=a)?2===a?l.attr(g).css(D):3===a&&l.attr(h).css(t):l.attr(e).css(p)};return l.on("click",function(){3!==m&&d.call(l)}).attr(e).css(v({cursor:"default"},p))},crispLine:function(a,b){a[1]===a[4]&&(a[1]=a[4]=A(a[1])-b%2/2);a[2]===a[5]&& -(a[2]=a[5]=A(a[2])+b%2/2);return a},path:function(a){var b={fill:"none"};ta(a)?b.d=a:da(a)&&v(b,a);return this.createElement("path").attr(b)},circle:function(a,b,c){a=da(a)?a:{x:a,y:b,r:c};b=this.createElement("circle");b.xSetter=function(a){this.element.setAttribute("cx",a)};b.ySetter=function(a){this.element.setAttribute("cy",a)};return b.attr(a)},arc:function(a,b,c,d,e,f){da(a)&&(b=a.y,c=a.r,d=a.innerR,e=a.start,f=a.end,a=a.x);a=this.symbol("arc",a||0,b||0,c||0,c||0,{innerR:d||0,start:e||0,end:f|| -0});a.r=c;return a},rect:function(a,b,c,d,e,f){e=da(a)?a.r:e;var g=this.createElement("rect");a=da(a)?a:a===u?{}:{x:a,y:b,width:x(c,0),height:x(d,0)};f!==u&&(a.strokeWidth=f,a=g.crisp(a));e&&(a.r=e);g.rSetter=function(a){N(this.element,{rx:a,ry:a})};return g.attr(a)},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a;this.height=b;for(this.boxWrapper[n(c,!0)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return w(a)?b.attr({"class":"highcharts-"+ -a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:"none"};1c&&k>b+g&&kh&&k>b+g&&kd&&h>a+g&&h -k&&h>a+g&&ha?a+4:A(1.2*a),d=A(.8*c);return{h:c,b:d,f:a}},label:function(a,b,c,d,e,f,g,h,k){function l(){var a,b;a=n.element.style;H=(void 0===Aa||void 0=== -z||p.styles.textAlign)&&n.textStr&&n.getBBox();p.width=(Aa||H.width||0)+2*W+x;p.height=(z||H.height||0)+2*W;oa=W+r.fontMetrics(a&&a.fontSize,n).b;E&&(D||(a=A(-V*W),b=h?-oa:0,p.box=D=d?r.symbol(d,a,b,p.width,p.height,C):r.rect(a,b,p.width,p.height,0,C["stroke-width"]),D.attr("fill","none").add(p)),D.isImg||D.attr(v({width:A(p.width),height:A(p.height)},C)),C=null)}function m(){var a=p.styles,a=a&&a.textAlign,b=x+W*(1-V),c;c=h?0:oa;w(Aa)&&H&&("center"===a||"right"===a)&&(b+={center:.5,right:1}[a]*(Aa- -H.width));if(b!==n.x||c!==n.y)n.attr("x",b),c!==u&&n.attr("y",c);n.x=b;n.y=c}function q(a,b){D?D.attr(a,b):C[a]=b}var r=this,p=r.g(k),n=r.text("",0,0,g).attr({zIndex:1}),D,H,V=0,W=3,x=0,Aa,z,mb,y,B=0,C={},oa,E;p.onAdd=function(){n.add(p);p.attr({text:a||0===a?a:"",x:b,y:c});D&&w(e)&&p.attr({anchorX:e,anchorY:f})};p.widthSetter=function(a){Aa=a};p.heightSetter=function(a){z=a};p.paddingSetter=function(a){w(a)&&a!==W&&(W=a,m())};p.paddingLeftSetter=function(a){w(a)&&a!==x&&(x=a,m())};p.alignSetter= -function(a){V={left:0,center:.5,right:1}[a]};p.textSetter=function(a){a!==u&&n.textSetter(a);l();m()};p["stroke-widthSetter"]=function(a,b){a&&(E=!0);B=a%2/2;q(b,a)};p.strokeSetter=p.fillSetter=p.rSetter=function(a,b){"fill"===b&&a&&(E=!0);q(b,a)};p.anchorXSetter=function(a,b){e=a;q(b,a+B-mb)};p.anchorYSetter=function(a,b){f=a;q(b,a-y)};p.xSetter=function(a){p.x=a;V&&(a-=V*((Aa||H.width)+W));mb=A(a);p.attr("translateX",mb)};p.ySetter=function(a){y=p.y=A(a);p.attr("translateY",y)};var F=p.css;return v(p, -{css:function(a){if(a){var b={};a=G(a);t(p.textProps,function(c){a[c]!==u&&(b[c]=a[c],delete a[c])});n.css(b)}return F.call(p,a)},getBBox:function(){return{width:H.width+2*W,height:H.height+2*W,x:H.x-W,y:H.y-W}},shadow:function(a){D&&D.shadow(a);return p},destroy:function(){L(p.element,"mouseenter");L(p.element,"mouseleave");n&&(n=n.destroy());D&&(D=D.destroy());O.prototype.destroy.call(p);p=r=l=m=q=null}})}};xa.prototype={addLabel:function(){var a=this.axis,b=a.options,c=a.chart,d=a.horiz,e=a.categories, -f=a.names,g=this.pos,h=b.labels,k=h.rotation,l=a.tickPositions,d=d&&e&&!h.step&&!h.staggerLines&&!h.rotation&&c.plotWidth/l.length||!d&&(c.margin[3]||.33*c.chartWidth),m=g===l[0],q=g===l[l.length-1],r,f=e?n(e[g],f[g],g):g,e=this.label,p=l.info;a.isDatetimeAxis&&p&&(r=b.dateTimeLabelFormats[p.higherRanks[g]||p.unitName]);this.isFirst=m;this.isLast=q;b=a.labelFormatter.call({axis:a,chart:c,isFirst:m,isLast:q,dateTimeLabelFormat:r,value:a.isLog?ha(ia(f)):f});g=d&&{width:x(1,A(d-2*(h.padding||10)))+"px"}; -w(e)?e&&e.attr({text:b}).css(g):(r={align:a.labelAlign},ga(k)&&(r.rotation=k),d&&h.ellipsis&&(g.HcHeight=a.len/l.length),this.label=e=w(b)&&h.enabled?c.renderer.text(b,0,0,h.useHTML).attr(r).css(v(g,h.style)).add(a.labelGroup):null,a.tickBaseline=c.renderer.fontMetrics(h.style.fontSize,e).b,k&&2===a.side&&(a.tickBaseline*=Fa(k*vb)));this.yOffset=e?n(h.y,a.tickBaseline+(2===a.side?8:-(e.getBBox().height/2))):0},getLabelSize:function(){var a=this.label,b=this.axis;return a?a.getBBox()[b.horiz?"height": -"width"]:0},getLabelSides:function(){var a=this.label.getBBox(),b=this.axis,c=b.horiz,d=b.options.labels,a=c?a.width:a.height,b=c?d.x-a*{left:0,center:.5,right:1}[b.labelAlign]:0;return[b,c?a+b:a]},handleOverflow:function(a,b){var c=!0,d=this.axis,e=this.isFirst,f=this.isLast,g=d.horiz?b.x:b.y,h=d.reversed,k=d.tickPositions,l=this.getLabelSides(),m=l[0],l=l[1],q,r,p,n=this.label.line;q=n||0;r=d.labelEdge;p=d.justifyLabels&&(e||f);r[q]===u||g+m>r[q]?r[q]=g+l:p||(c=!1);if(p){q=(r=d.justifyToPlot)?d.pos: -0;r=r?q+d.len:d.chart.chartWidth;do a+=e?1:-1,p=d.ticks[k[a]];while(k[a]&&(!p||!p.label||p.label.line!==n));d=p&&p.label.xy&&p.label.xy.x+p.getLabelSides()[e?0:1];e&&!h||f&&h?g+md&&(c=!1)):g+l>r&&(g=r-l,p&&g+m=c&&null!==e[f]&&(g=ka(b/c,-1)+e[f]);g===u&&(g=1E4<=X(b)?ka(b,0):ka(b,-1,u,""));return g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.ignoreMinPadding=a.ignoreMaxPadding=null;a.buildStacks&&a.buildStacks();t(a.series, -function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var d;d=c.options.threshold;var e;a.hasVisibleSeries=!0;a.isLog&&0>=d&&(d=null);a.isXAxis?(d=c.xData,d.length&&(a.dataMin=T(n(a.dataMin,d[0]),La(d)),a.dataMax=x(n(a.dataMax,d[0]),va(d)))):(c.getExtremes(),e=c.dataMax,c=c.dataMin,w(c)&&w(e)&&(a.dataMin=T(n(a.dataMin,c),c),a.dataMax=x(n(a.dataMax,e),e)),w(d)&&(a.dataMin>=d?(a.dataMin=d,a.ignoreMinPadding=!0):a.dataMaxg+this.width)r=!0}else if(a=g,c=q-this.right,kh+this.height)r=!0;return r&&!d?null:f.renderer.crispLine(["M",a,k,"L",c,l],b||1)},getLinearTickPositions:function(a, -b,c){var d,e=ha(K(b/a)*a),f=ha(ya(c/a)*a),g=[];if(b===c&&ga(b))return[b];for(b=e;b<=f;){g.push(b);b=ha(b+a);if(b===d)break;d=b}return g},getMinorTickPositions:function(){var a=this.options,b=this.tickPositions,c=this.minorTickInterval,d=[],e;if(this.isLog)for(e=b.length,a=1;a=this.minRange,f,g,h,k,l;this.isXAxis&&this.minRange===u&&!this.isLog&&(w(a.min)||w(a.max)?this.minRange=null:(t(this.series,function(a){k=a.xData;for(g=l=a.xIncrement?1:k.length-1;0c&&(h=0);d=x(d,h);f=x(f,pa(l)?0:h/2);g=x(g,"on"===l?0:h);!a.noSharedTooltip&&w(p)&&(e=w(e)?T(e,p):p)}),h=b.ordinalSlope&&e?b.ordinalSlope/e:1,b.minPointOffset=f*=h,b.pointRangePadding=g*=h,b.pointRange=T(d,c),b.closestPointRange=e;a&&(b.oldTransA=l);b.translationSlope=b.transA=l=b.len/(c+g||1);b.transB=b.horiz?b.left:b.bottom;b.minPixelPadding=l*f},setTickPositions:function(a){var b=this,c=b.chart,d=b.options,e=d.startOnTick,f=d.endOnTick,g=b.isLog,h=b.isDatetimeAxis,k=b.isXAxis,l=b.isLinked,m= -b.options.tickPositioner,q=d.maxPadding,r=d.minPadding,p=d.tickInterval,Q=d.minTickInterval,D=d.tickPixelInterval,H,u=b.categories;l?(b.linkedParent=c[b.coll][d.linkedTo],c=b.linkedParent.getExtremes(),b.min=n(c.min,c.dataMin),b.max=n(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&aa(11,1)):(b.min=n(b.userMin,d.min,b.dataMin),b.max=n(b.userMax,d.max,b.dataMax));g&&(!a&&0>=T(b.min,n(b.dataMin,b.min))&&aa(10,1),b.min=ha(ab(b.min)),b.max=ha(ab(b.max)));b.range&&w(b.max)&&(b.userMin=b.min=x(b.min, -b.max-b.range),b.userMax=b.max,b.range=null);b.beforePadding&&b.beforePadding();b.adjustForMinRange();!(u||b.axisPointRange||b.usePercentage||l)&&w(b.min)&&w(b.max)&&(c=b.max-b.min)&&(w(d.min)||w(b.userMin)||!r||!(0>b.dataMin)&&b.ignoreMinPadding||(b.min-=c*r),w(d.max)||w(b.userMax)||!q||!(0b.tickInterval&&1E3b.max))));b.minorTickInterval="auto"===d.minorTickInterval&&b.tickInterval?b.tickInterval/5:d.minorTickInterval;b.tickPositions=a=d.tickPositions?[].concat(d.tickPositions):m&&m.apply(b,[b.min,b.max]);a||(!b.ordinalPositions&&(b.max-b.min)/b.tickInterval>x(2*b.len,200)&&aa(19,!0),a=h?b.getTimeTicks(b.normalizeTimeTickInterval(b.tickInterval, -d.units),b.min,b.max,d.startOfWeek,b.ordinalPositions,b.closestPointRange,!0):g?b.getLogTickPositions(b.tickInterval,b.min,b.max):b.getLinearTickPositions(b.tickInterval,b.min,b.max),H&&a.splice(1,a.length-2),b.tickPositions=a);l||(d=a[0],g=a[a.length-1],h=b.minPointOffset||0,e?b.min=d:b.min-h>d&&a.shift(),f?b.max=g:b.max+h(b[d]||0)&&!1!==this.options.alignTicks&&(b[d]=c.length);a.maxTicks=b},adjustTickAmount:function(){var a=this._maxTicksKey,b=this.tickPositions,c=this.chart.maxTicks;if(c&&c[a]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&!1!==this.options.alignTicks&&this.min!==u){var d=this.tickAmount,e=b.length;this.tickAmount=a=c[a];if(e=x(d,n(e.max,d))&&(b=u));this.displayBtn=a!==u||b!==u;this.setExtremes(a,b,!1,u,{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft||0,d=this.horiz,e=n(b.width,a.plotWidth-c+(b.offsetRight||0)),f=n(b.height,a.plotHeight),g=n(b.top,a.plotTop),b=n(b.left,a.plotLeft+c),c=/%$/;c.test(f)&& -(f=parseInt(f,10)/100*a.plotHeight);c.test(g)&&(g=parseInt(g,10)/100*a.plotHeight+a.plotTop);this.left=b;this.top=g;this.width=e;this.height=f;this.bottom=a.chartHeight-f-g;this.right=a.chartWidth-e-b;this.len=x(d?e:f,0);this.pos=d?b:g},getExtremes:function(){var a=this.isLog;return{min:a?ha(ia(this.min)):this.min,max:a?ha(ia(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=b?ia(this.min):this.min, -b=b?ia(this.max):this.max;c>a||null===a?a=c:ba?"right":195a?"left":"center"},getOffset:function(){var a=this,b=a.chart,c=b.renderer,d=a.options,e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,k=b.inverted?[1,0,3,2][h]:h,l,m,q=0,r,p=0,Q=d.title,D=d.labels,H=0,V=b.axisOffset,b=b.clipOffset,W=[-1,1,1,-1][h],v,A=1,y=n(D.maxStaggerLines,5),z,B,G,C,oa;a.hasData=l=a.hasVisibleSeries|| -w(a.min)&&w(a.max)&&!!e;a.showAxis=m=l||n(d.showEmpty,!0);a.staggerLines=a.horiz&&D.staggerLines;a.axisGroup||(a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex||2}).add(),a.labelGroup=c.g("axis-labels").attr({zIndex:D.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add());if(l||a.isLinked){a.labelAlign=n(D.align||a.autoLabelAlign(D.rotation));t(e,function(b){f[b]?f[b].addLabel():f[b]=new xa(a,b)});if(a.horiz&&!a.staggerLines&& -y&&!D.rotation){for(l=a.reversed?[].concat(e).reverse():e;A=a.min&&b<=a.max)q[b]||(q[b]=new xa(a,b)),x&&q[b].isNew&&q[b].render(c,!0,.1),q[b].render(c)}),H&&0===a.min&&(q[-1]||(q[-1]=new xa(a,-1,null,!0)),q[-1].render(-1))),D&&t(k,function(b,c){0===c%2&&b=z.second&&(k.setMilliseconds(0),k.setSeconds(l>=z.minute?0:m*K(k.getSeconds()/m)));if(l>=z.minute)k[qb](l>= -z.hour?0:m*K(k[db]()/m));if(l>=z.hour)k[rb](l>=z.day?0:m*K(k[eb]()/m));if(l>=z.day)k[gb](l>=z.month?1:m*K(k[Da]()/m));l>=z.month&&(k[sb](l>=z.year?0:m*K(k[Qa]()/m)),h=k[Ra]());if(l>=z.year)k[tb](h-h%m);if(l===z.week)k[gb](k[Da]()-k[fb]()+n(d,1));b=1;wa&&(k=new la(k.getTime()+wa));h=k[Ra]();d=k.getTime();for(var q=k[Qa](),r=k[Da](),p=(z.day+(g?wa:6E4*k.getTimezoneOffset()))%z.day;db-e)return!1;f[a]=db-c/2?b-c-2:d-c/2},r=function(a){var b=h;h=k;k=b;g=a},p=function(){!1!==m.apply(0,h)?!1!==q.apply(0,k)||g||(r(!0),p()):g?f.x=f.y=0:(r(!0),p())};(d.inverted||1=f||z[h]<=z.day&&0m&&f.splice(k,1);f.length&&f[0].clientX!==this.hoverX&&(d.refresh(f,a),this.hoverX=f[0].clientX)}c=h&&h.tooltipOptions.followPointer; -if(h&&h.tracker&&!c){if((e=h.tooltipPoints[q])&&e!==g)e.onMouseOver(a)}else d&&c&&!d.isHidden&&(h=d.getAnchor([{}],a),d.updatePosition({plotX:h[0],plotY:h[1]}));d&&!this._onDocumentMouseMove&&(this._onDocumentMouseMove=function(a){if(Y[Ba])Y[Ba].pointer.onDocumentMouseMove(a)},F(y,"mousemove",this._onDocumentMouseMove));t(b.axes,function(b){b.drawCrosshair(a,n(e,g))})},reset:function(a,b){var c=this.chart,d=c.hoverSeries,e=c.hoverPoint,f=c.tooltip,g=f&&f.shared?c.hoverPoints:e;(a=a&&f&&g)&&ea(g)[0].plotX=== -u&&(a=!1);if(a)f.refresh(g),e&&e.setState(e.state,!0);else{if(e)e.onMouseOut();if(d)d.onMouseOut();f&&f.hide(b);this._onDocumentMouseMove&&(L(y,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null);t(c.axes,function(a){a.hideCrosshair()});this.hoverX=null}},scaleGroups:function(a,b){var c=this.chart,d;t(c.series,function(e){d=a||e.getPlotBox();e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(d),e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&& -e.dataLabelsGroup.attr(d))});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,d=a.chartX,e=a.chartY,f=this.zoomHor,g=this.zoomVert,h=b.plotLeft,k=b.plotTop,l=b.plotWidth,m=b.plotHeight,q,r=this.mouseDownX,p=this.mouseDownY,n=c.panKey&&a[c.panKey+"Key"];dh+l&&(d=h+l);ek+m&&(e=k+m);this.hasDragged= -Math.sqrt(Math.pow(r-d,2)+Math.pow(p-e,2));10c-6&&g(r||b.chartWidth-2*l-D-d.x)&& -(this.itemX=D,this.itemY+=t+this.lastLineHeight+p,this.lastLineHeight=0);this.maxItemWidth=x(this.maxItemWidth,f);this.lastItemY=t+this.itemY+p;this.lastLineHeight=x(g,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];e?this.itemX+=f:(this.itemY+=t+g+p,this.lastLineHeight=g);this.offsetWidth=r||x((e?this.itemX-D-m:f)+l,this.offsetWidth)},getAllItems:function(){var a=[];t(this.chart.series,function(b){var c=b.options;n(c.showInLegend,w(c.linkedTo)?!1:u,!0)&&(a=a.concat(b.legendItems||("point"=== -c.legendType?b.data:b)))});return a},render:function(){var a=this,b=a.chart,c=b.renderer,d=a.group,e,f,g,h,k=a.box,l=a.options,m=a.padding,q=l.borderWidth,r=l.backgroundColor;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;d||(a.group=d=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup));a.renderTitle();e=a.getAllItems();cb(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex|| -0)});l.reversed&&e.reverse();a.allItems=e;a.display=f=!!e.length;t(e,function(b){a.renderItem(b)});g=l.width||a.offsetWidth;h=a.lastItemY+a.lastLineHeight+a.titleHeight;h=a.handleOverflow(h);if(q||r)g+=m,h+=m,k?0f&&!e.useHTML?(this.clipHeight=h=x(f-20-this.titleHeight-this.padding,0), -this.currentPage=n(this.currentPage,1),this.fullHeight=a,t(D,function(a,b){var c=a._legendItemPos[1],d=A(a.legendItem.getBBox().height),e=p.length;if(!e||c-p[e-1]>h&&(u||c)!==p[e-1])p.push(u||c),e++;b===D.length-1&&c+d-p[e-1]>h&&p.push(c);c!==u&&(u=c)}),k||(k=b.clipRect=d.clipRect(0,this.padding,9999,0),b.contentGroup.clip(k)),k.attr({height:h}),r||(this.nav=r=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,q,q).on("click",function(){b.scroll(-1,m)}).add(r),this.pager=d.text("", -15,10).css(l.style).add(r),this.down=d.symbol("triangle-down",0,0,q,q).on("click",function(){b.scroll(1,m)}).add(r)),b.scroll(0),a=f):r&&(k.attr({height:c.chartHeight}),r.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return a},scroll:function(a,b){var c=this.pages,d=c.length,e=this.currentPage+a,f=this.clipHeight,g=this.options.navigation,h=g.activeColor,g=g.inactiveColor,k=this.pager,l=this.padding;e>d&&(e=d);0e&&(c=typeof a[0],"string"===c?b.name=a[0]:"number"===c&&(b.x=a[0]),f++);ga+1&&b.push(d.slice(a+1,g)),a=g):g===e-1&&b.push(d.slice(a+1,g+1))});this.segments=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=G(e,c.series,a);this.tooltipOptions=G(M.tooltip,M.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;return c},getCyclic:function(a,b,c){var d=this.userOptions,e="_"+a+"Index",f=a+"Counter";b||(w(d[e])?b=d[e]:(d[e]=b=this.chart[f]%c.length,this.chart[f]+=1),b=c[b]);this[a]=b},getColor:function(){this.options.colorByPoint||this.getCyclic("color", -this.options.color||Ya[this.type].color,this.chart.options.colors)},getSymbol:function(){var a=this.options.marker;this.getCyclic("symbol",a.symbol,this.chart.options.symbols);/^url/.test(this.symbol)&&(a.radius=0)},drawLegendSymbol:Lb.drawLineMarker,setData:function(a,b,c,d){var e=this,f=e.points,g=f&&f.length||0,h,k=e.options,l=e.chart,m=null,q=e.xAxis,r=q&&!!q.categories,p=e.tooltipPoints,v=k.turboThreshold,D=this.xData,w=this.yData,x=(h=e.pointArrayMap)&&h.length;a=a||[];h=a.length;b=n(b,!0); -if(!1===d||!h||g!==h||e.cropped||e.hasGroupedData){e.xIncrement=null;e.pointRange=r?1:k.pointRange;e.colorCounter=0;t(this.parallelArrays,function(a){e[a+"Data"].length=0});if(v&&h>v){for(c=0;null===m&&ck||this.forceCrop))if(b[d-1]r)b=[],c=[];else if(b[0]r)e=this.cropData(this.xData,this.yData,p,r),b=e.xData,c=e.yData,e=e.start,f=!0,m=b.length;for(k=b.length-1;0<=k;k--)d=b[k]-b[k-1],!f&&b[k]>p&&b[k]d&&this.requireSorting&&aa(15);this.cropped=f;this.cropStart=e;this.processedXData=b;this.processedYData= -c;this.activePointCount=m;null===l.pointRange&&(this.pointRange=g||1);this.closestPointRange=g},cropData:function(a,b,c,d){var e=a.length,f=0,g=e,h=n(this.cropShoulder,1),k;for(k=0;k=c){f=x(0,k-h);break}for(;kd){g=k+h;break}return{xData:a.slice(f,g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var a=this.options.data,b=this.data,c,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,k,l=this.hasGroupedData,m,q=[], -r;b||l||(b=[],b.length=a.length,b=this.data=b);for(r=0;r=g&&(c[q-1]||l)<=h,k&&l)if(k=m.length)for(;k--;)null!==m[k]&&(e[f++]=m[k]);else e[f++]=m;this.dataMin=n(void 0,La(e));this.dataMax=n(void 0,va(e))},translate:function(){this.processedXData||this.processData();this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,k=a.pointPlacement, -l="between"===k||ga(k),m=a.threshold,a=0;a=p&&(q.y=p=null,aa(10));q.plotX=c.translate(r,0,0,0,1,k,"flags"===this.type);b&&this.visible&&v&&v[r]&&(v=v[r],p=v.points[this.index+","+a],t=p[0],p=p[1],0===t&&(t=n(m,e.min)),e.isLog&&0>=t&&(t=null),q.total=q.stackTotal=v.total,q.percentage=v.total&&q.y/v.total*100,q.stackY=p,v.setOffset(this.pointXOffset||0,this.barW||0));q.yBottom=w(t)?e.translate(t, -0,1,0,1):null;h&&(p=this.modifyValue(p,q));q.plotY="number"===typeof p&&Infinity!==p?e.translate(p,0,1,0,1):u;q.clientX=l?c.translate(r,0,0,0,1):q.plotX;q.negative=q.y<(m||0);q.category=d&&d[q.x]!==u?d[q.x]:q.x}this.getSegments()},animate:function(a){var b=this.chart,c=b.renderer,d;d=this.options.animation;var e=this.clipBox||b.clipBox,f=b.inverted,g;d&&!da(d)&&(d=Ya[this.type].animation);g=["_sharedClip",d.duration,d.easing,e.height].join();a?(a=b[g],d=b[g+"m"],a||(b[g]=a=c.clipRect(v(e,{width:0})), -b[g+"m"]=d=c.clipRect(-99,f?-b.plotLeft:-b.plotTop,99,f?b.chartWidth:b.chartHeight)),this.group.clip(a),this.markerGroup.clip(d),this.sharedClipKey=g):((a=b[g])&&a.animate({width:b.plotSizeX},d),b[g+"m"]&&b[g+"m"].animate({width:b.plotSizeX+99},d),this.animate=null)},afterAnimate:function(){var a=this.chart,b=this.sharedClipKey,c=this.group,d=this.clipBox;c&&!1!==this.options.clip&&(b&&d||c.clip(d?a.renderer.clipRect(d):a.clipRect),this.markerGroup.clip());B(this,"afterAnimate");setTimeout(function(){b&& -a[b]&&(d||(a[b]=a[b].destroy()),a[b+"m"]&&(a[b+"m"]=a[b+"m"].destroy()))},100)},drawPoints:function(){var a,b=this.points,c=this.chart,d,e,f,g,h,k,l,m,q=this.options.marker,r=this.pointAttr[""],p,t,w,x=this.markerGroup,y=n(q.enabled,!this.requireSorting||this.activePointCount<.5*this.xAxis.len/q.radius);if(!1!==q.enabled||this._hasPointMarkers)for(f=b.length;f--;)g=b[f],d=K(g.plotX),e=g.plotY,m=g.graphic,p=g.marker||{},t=!!g.marker,a=y&&p.enabled===u||p.enabled,w=c.isInsidePlot(A(d),e,c.inverted), -a&&e!==u&&!isNaN(e)&&null!==g.y?(a=g.pointAttr[g.selected?"select":""]||r,h=a.r,k=n(p.symbol,this.symbol),l=0===k.indexOf("url"),m?m[w?"show":"hide"](!0).animate(v({x:d-h,y:e-h},m.symbolName?{width:2*h,height:2*h}:{})):w&&(0d&&(m-=d),a={x:0,y:0,width:m,height:d},m={x:0,y:d,width:m,height:m},b.inverted&&(a.height=m.y=b.plotWidth-d,c.isVML&&(a={x:b.plotWidth- -d-b.plotLeft,y:0,width:e,height:l},m={x:d+b.plotLeft-e,y:0,width:b.plotLeft+d,height:e})),q.reversed?(b=m,e=a):(b=a,e=m),h?(h.animate(b),k.animate(e)):(this.posClip=h=c.clipRect(b),this.negClip=k=c.clipRect(e),f&&this.graphNeg&&(f.clip(h),this.graphNeg.clip(k)),g&&(g.clip(h),this.areaNeg.clip(k))))},invertGroups:function(){function a(){var a={width:b.yAxis.len,height:b.xAxis.len};t(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})}var b=this,c=b.chart;b.xAxis&&(F(c,"resize",a),F(b, -"destroy",function(){L(c,"resize",a)}),a(),b.invertGroups=a)},plotGroup:function(a,b,c,d,e){var f=this[a],g=!f;g&&(this[a]=f=this.chart.renderer.g(b).attr({visibility:c,zIndex:d||.1}).add(e));f[g?"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=(c=d.animation)&&!!a.animate&& -b.renderer.isSVG&&n(c.duration,500)||0,f=a.visible?"visible":"hidden",g=d.zIndex,h=a.hasRendered,k=b.seriesGroup;c=a.plotGroup("group","series",f,g,k);a.markerGroup=a.plotGroup("markerGroup","markers",f,g,k);e&&a.animate(!0);a.getAttribs();c.inverted=a.isCartesian?b.inverted:!1;a.drawGraph&&(a.drawGraph(),a.clipNeg());t(a.points,function(a){a.redraw&&a.redraw()});a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();b.inverted&& -a.invertGroups();!1===d.clip||a.sharedClipKey||h||c.clip(b.clipRect);e&&a.animate();h||(e?a.animationTimeout=setTimeout(function(){a.afterAnimate()},e):a.afterAnimate());a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=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:n(d&&d.left,a.plotLeft),translateY:n(e&&e.top,a.plotTop)}));this.translate();this.setTooltipPoints&&this.setTooltipPoints(!0); -this.render();b&&B(this,"updatedData")}};v(Ea.prototype,{addSeries:function(a,b,c){var d,e=this;a&&(b=n(b,!0),B(e,"addSeries",{options:a},function(){d=e.initSeries(a);e.isDirtyLegend=!0;e.linkSeries();b&&e.redraw(c)}));return d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;new ma(this,G(a,{index:this[e].length,isX:b}));f[e]=ea(f[e]||{});f[e].push(a);n(c,!0)&&this.redraw(d)},showLoading:function(a){var b=this,c=b.options,d=b.loadingDiv,e=c.loading,f=function(){d&&J(d,{left:b.plotLeft+ -"px",top:b.plotTop+"px",width:b.plotWidth+"px",height:b.plotHeight+"px"})};d||(b.loadingDiv=d=ja("div",{className:"highcharts-loading"},v(e.style,{zIndex:10,display:"none"}),b.container),b.loadingSpan=ja("span",null,e.labelStyle,d),F(b,"redraw",f));b.loadingSpan.innerHTML=a||c.lang.loading;b.loadingShown||(J(d,{opacity:0,display:""}),Wa(d,{opacity:e.style.opacity},{duration:e.showDuration||0}),b.loadingShown=!0);f()},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&Wa(b,{opacity:0}, -{duration:a.loading.hideDuration||100,complete:function(){J(b,{display:"none"})}});this.loadingShown=!1}});v(Ca.prototype,{update:function(a,b,c,d){function e(){f.applyOptions(a);da(a)&&!ta(a)&&(f.redraw=function(){h&&(a&&a.marker&&a.marker.symbol?f.graphic=h.destroy():h.attr(f.pointAttr[f.state||""]));a&&a.dataLabels&&f.dataLabel&&(f.dataLabel=f.dataLabel.destroy());f.redraw=null});k=f.index;g.updateParallelArrays(f,k);m.data[k]=f.options;g.isDirty=g.isDirtyData=!0;!g.fixedBox&&g.hasCartesianSeries&& -(l.isDirtyBox=!0);"point"===m.legendType&&l.legend.destroyItem(f);b&&l.redraw(c)}var f=this,g=f.series,h=f.graphic,k,l=g.chart,m=g.options;b=n(b,!0);!1===d?e():f.firePointEvent("update",{options:a},e)},remove:function(a,b){var c=this,d=c.series,e=d.points,f=d.chart,g,h=d.data;S=n(b,f.animation);a=n(a,!0);c.firePointEvent("remove",null,function(){g=Ia(c,h);h.length===e.length&&e.splice(g,1);h.splice(g,1);d.options.data.splice(g,1);d.updateParallelArrays(c,"splice",g,1);c.destroy();d.isDirty=!0;d.isDirtyData= -!0;a&&f.redraw()})}});v(fa.prototype,{addPoint:function(a,b,c,d){var e=this.options,f=this.data,g=this.graph,h=this.area,k=this.chart,l=this.xAxis&&this.xAxis.names,m=g&&g.shift||0,q=e.data,r,p=this.xData;S=n(d,k.animation);c&&t([g,h,this.graphNeg,this.areaNeg],function(a){a&&(a.shift=m+1)});h&&(h.isArea=!0);b=n(b,!0);d={series:this};this.pointClass.prototype.applyOptions.apply(d,[a]);g=d.x;h=p.length;if(this.requireSorting&&gg;)h--;this.updateParallelArrays(d,"splice", -h,0,0);this.updateParallelArrays(d,h);l&&d.name&&(l[g]=d.name);q.splice(h,0,a);r&&(this.data.splice(h,0,null),this.processData());"point"===e.legendType&&this.generatePoints();c&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),this.updateParallelArrays(d,"shift"),q.shift()));this.isDirtyData=this.isDirty=!0;b&&(this.getAttribs(),k.redraw())},remove:function(a,b){var c=this,d=c.chart;a=n(a,!0);c.isRemoving||(c.isRemoving=!0,B(c,"remove",null,function(){c.destroy();d.isDirtyLegend=d.isDirtyBox=!0;d.linkSeries(); -a&&d.redraw(b)}));c.isRemoving=!1},update:function(a,b){var c=this,d=this.chart,e=this.userOptions,f=this.type,g=P[f].prototype,h=["group","markerGroup","dataLabelsGroup"],k;t(h,function(a){h[a]=c[a];delete c[a]});a=G(e,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1);for(k in g)g.hasOwnProperty(k)&&(this[k]=u);v(this,P[a.type||f].prototype);t(h,function(a){c[a]=h[a]});this.init(d,a);d.linkSeries();n(b,!0)&&d.redraw(!1)}});v(ma.prototype,{update:function(a, -b){var c=this.chart;a=c.options[this.coll][this.options.index]=G(this.userOptions,a);this.destroy(!0);this._addedPlotLB=u;this.init(c,v(a,{events:u}));c.isDirtyBox=!0;n(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,d=this.series,e=d.length;e--;)d[e]&&d[e].remove(!1);qa(b.axes,this);qa(b[c],this);b.options[c].splice(this.options.index,1);t(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;n(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a}, -b)},setCategories:function(a,b){this.update({categories:a},b)}});var Mb=nb(fa);P.line=Mb;fa.prototype.drawDataLabels=function(){var a=this,b=a.options,c=b.cursor,d=b.dataLabels,e=a.points,f,g,h=a.hasRendered||0,k,l;if(d.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(d),l=a.plotGroup("dataLabelsGroup","data-labels",d.defer?"hidden":"visible",d.zIndex||6),n(d.defer,!0)&&(l.attr({opacity:+h}),h||F(a,"afterAnimate",function(){a.visible&&l.show();l[b.animation?"animate":"attr"]({opacity:1}, -{duration:200})})),g=d,t(e,function(b){var e,h=b.dataLabel,p,t,x=b.connector,A=!0;f=b.options&&b.options.dataLabels;e=n(f&&f.enabled,g.enabled);if(h&&!e)b.dataLabel=h.destroy();else if(e){d=G(g,f);e=d.rotation;p=b.getLabelConfig();k=d.format?ua(d.format,p):d.formatter.call(p,d);d.style.color=n(d.color,d.style.color,a.color,"black");if(h)w(k)?(h.attr({text:k}),A=!1):(b.dataLabel=h=h.destroy(),x&&(b.connector=x.destroy()));else if(w(k)){h={fill:d.backgroundColor,stroke:d.borderColor,"stroke-width":d.borderWidth, -r:d.borderRadius||0,rotation:e,padding:d.padding,zIndex:1};for(t in h)h[t]===u&&delete h[t];h=b.dataLabel=a.chart.renderer[e?"text":"label"](k,0,-999,null,null,null,d.useHTML).attr(h).css(v(d.style,c&&{cursor:c})).add(l).shadow(d.shadow)}h&&a.alignDataLabel(b,h,d,null,A)}})};fa.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=n(a.plotX,-999),k=n(a.plotY,-999),l=b.getBBox();if(a=this.visible&&(a.series.forceDL||f.isInsidePlot(h,A(k),g)||d&&f.isInsidePlot(h,g?d.x+1:d.y+d.height- -1,g)))d=v({x:g?f.plotWidth-k:h,y:A(g?f.plotHeight-h:k),width:0,height:0},d),v(c,{width:l.width,height:l.height}),c.rotation?b[e?"attr":"animate"]({x:d.x+c.x+d.width/2,y:d.y+c.y+d.height/2}).attr({align:c.align}):(b.align(c,null,d),g=b.alignAttr,"justify"===n(c.overflow,"justify")?this.justifyDataLabel(b,c,g,l,d,e):n(c.crop,!0)&&(a=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+l.width,g.y+l.height)));a||(b.attr({y:-999}),b.placed=!1)};fa.prototype.justifyDataLabel=function(a,b,c,d,e,f){var g=this.chart, -h=b.align,k=b.verticalAlign,l,m;l=c.x;0>l&&("right"===h?b.align="left":b.x=-l,m=!0);l=c.x+d.width;l>g.plotWidth&&("left"===h?b.align="right":b.x=g.plotWidth-l,m=!0);l=c.y;0>l&&("bottom"===k?b.verticalAlign="top":b.y=-l,m=!0);l=c.y+d.height;l>g.plotHeight&&("top"===k?b.verticalAlign="bottom":b.y=g.plotHeight-l,m=!0);m&&(a.placed=!f,a.align(b,null,e))};P.pie&&(P.pie.prototype.drawDataLabels=function(){var a=this,b=a.data,c,d=a.chart,e=a.options.dataLabels,f=n(e.connectorPadding,10),g=n(e.connectorWidth, -1),h=d.plotWidth,k=d.plotHeight,l,m,q=n(e.softConnector,!0),r=e.distance,p=a.center,u=p[2]/2,v=p[1],w=0z){c=[].concat(J);c.sort(R);for(C=O;C--;)c[C].rank=C;for(C=O;C--;)J[C].rank>=z&&J.splice(C,1);O=J.length}for(C=0;CF&&null!==K[L+1]||ch-f&&(I[1]=x(A(E+z-h+f),I[1])),0>F-b/2?I[0]=x(A(-F+b/2),I[0]):F+b/2>k&&(I[2]=x(A(F+b/2-k),I[2])))}}}if(0===va(I)||this.verifyDataLabelOverflow(I))this.placeDataLabels(),w&&g&&t(this.points, -function(b){l=b.connector;B=b.labelPos;(y=b.dataLabel)&&y._pos?(N=y._attr.visibility,E=y.connX,F=y.connY,m=q?["M",E+("left"===B[6]?5:-5),F,"C",E,F,2*B[2]-B[4],2*B[3]-B[5],B[2],B[3],"L",B[4],B[5]]:["M",E+("left"===B[6]?5:-5),F,"L",B[2],B[3],"L",B[4],B[5]],l?(l.animate({d:m}),l.attr("visibility",N)):b.connector=l=a.chart.renderer.path(m).attr({"stroke-width":g,stroke:e.connectorColor||b.color||"#606060",visibility:N}).add(a.dataLabelsGroup)):l&&(b.connector=l.destroy())})}},P.pie.prototype.placeDataLabels= -function(){t(this.points,function(a){a=a.dataLabel;var b;a&&((b=a._pos)?(a.attr(a._attr),a[a.moved?"animate":"attr"](b),a.moved=!0):a&&a.attr({y:-999}))})},P.pie.prototype.alignDataLabel=Eb,P.pie.prototype.verifyDataLabelOverflow=function(a){var b=this.center,c=this.options,d=c.center,e=c=c.minSize||80,f;null!==d[0]?e=x(b[2]-x(a[1],a[3]),c):(e=x(b[2]-a[1]-a[3],c),b[0]+=(a[3]-a[1])/2);null!==d[1]?e=x(T(e,b[2]-x(a[0],a[2])),c):(e=x(T(e,b[2]-a[0]-a[2]),c),b[1]+=(a[0]-a[2])/2);en(this.translatedThreshold,f.plotSizeY),l=n(c.inside,!!this.options.stacking);h&&(d=G(h),g&&(d={x:f.plotWidth-d.y-d.height,y:f.plotHeight-d.x-d.width,width:d.height,height:d.width}),l||(g?(d.x+=k?0:d.width,d.width=0):(d.y+=k?d.height:0,d.height= -0)));c.align=n(c.align,!g||l?"center":k?"right":"left");c.verticalAlign=n(c.verticalAlign,g||l?"middle":k?"top":"bottom");fa.prototype.alignDataLabel.call(this,a,b,c,d,e)});var $a=U.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,d=a.options.cursor,e=d&&{cursor:d},f=function(c){var d=c.target,e;if(b.hoverSeries!==a)a.onMouseOver();for(;d&&!e;)e=d.point,d=d.parentNode;if(e!==u&&e!==b.hoverPoint)e.onMouseOver(c)};t(a.points,function(a){a.graphic&&(a.graphic.element.point= -a);a.dataLabel&&(a.dataLabel.element.point=a)});a._hasTracking||(t(a.trackerGroups,function(b){if(a[b]&&(a[b].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",function(a){c.onTrackerMouseOut(a)}).css(e),Ga))a[b].on("touchstart",f)}),a._hasTracking=!0)},drawTrackerGraph:function(){var a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:a.graphPath),e=d.length,f=a.chart,g=f.pointer,h=f.renderer,k=f.options.tooltip.snap,l=a.tracker,m=b.cursor,q=m&&{cursor:m},m=a.singlePoints,n, -p=function(){if(f.hoverSeries!==a)a.onMouseOver()},u="rgba(192,192,192,"+(Z?1E-4:.002)+")";if(e&&!c)for(n=e+1;n--;)"M"===d[n]&&d.splice(n+1,0,d[n+1]-k,d[n+2],"L"),(n&&"M"===d[n]||n===e)&&d.splice(n,0,"L",d[n-2]+k,d[n-1]);for(n=0;nthis.pointCount))},pan:function(a,b){var c=this,d=c.hoverPoints,e;d&&t(d,function(a){a.setState()});t("xy"===b?[1,0]:[1],function(b){var d=a[b?"chartX": -"chartY"],h=c[b?"xAxis":"yAxis"][0],k=c[b?"mouseDownX":"mouseDownY"],l=(h.pointRange||0)/2,m=h.getExtremes(),n=h.toValue(k-d,!0)+l,k=h.toValue(k+c[b?"plotWidth":"plotHeight"]-d,!0)-l;h.series.length&&n>T(m.dataMin,m.min)&&k=f.min&&c<=f.max)for(h=b[k+1],c=d===u?0:d+1,d=b[k+1]?T(x(0,K((e.clientX+(h?h.wrappedClientX||h.clientX:g))/2)),g):g;0<=c&&c<=d;)l[c++]=e;this.tooltipPoints=l}},show:function(){this.setVisible(!0)}, -hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===u?!this.selected:a;this.checkbox&&(this.checkbox.checked=a);B(this,a?"select":"unselect")},drawTracker:$a.drawTrackerGraph});v(U,{Axis:ma,Chart:Ea,Color:za,Point:Ca,Tick:xa,Renderer:Ja,Series:fa,SVGElement:O,SVGRenderer:Ja,arrayMin:La,arrayMax:va,charts:Y,dateFormat:Ka,format:ua,pathAnim:ib,getOptions:function(){return M},hasBidiBug:Db,isTouchDevice:wb,numberFormat:ka,seriesTypes:P,setOptions:function(a){M=G(!0,M,a);pb(); -return M},addEvent:F,removeEvent:L,createElement:ja,discardElement:Na,css:J,each:t,extend:v,map:kb,merge:G,pick:n,splat:ea,extendClass:nb,pInt:E,wrap:bb,svg:Z,canvas:ca,vml:!Z&&!ca,product:"Highcharts 4.0.4",version:"/Highstock 2.0.4"})})(); diff --git a/domain-server/resources/web/stats/js/stats.js b/domain-server/resources/web/stats/js/stats.js index 6ea233a6e6..d0cc5d506a 100644 --- a/domain-server/resources/web/stats/js/stats.js +++ b/domain-server/resources/web/stats/js/stats.js @@ -49,62 +49,4 @@ $(document).ready(function(){ getNodeStats(); // grab the new assignments JSON every second var getNodeStatsInterval = setInterval(getNodeStats, 1000); - - var graphKeypath = ""; - - // set the global Highcharts option - Highcharts.setOptions({ - global: { - useUTC: false - } - }); - - // add a function to help create the graph modal - function createGraphModal() { - var chartModal = bootbox.dialog({ - title: graphKeypath, - message: "
", - buttons: {}, - className: 'highchart-modal' - }); - - chartModal.on('hidden.bs.modal', function(e) { - currentHighchart.destroy(); - currentHighchart = null; - }); - - currentHighchart = new Highcharts.Chart({ - chart: { - renderTo: 'highchart-container', - defaultSeriesType: 'line' - }, - title: { - text: '' - }, - xAxis: { - type: 'datetime', - tickPixelInterval: 150 - }, - yAxis: { - title: { - text: 'Value' - } - }, - legend: { - enabled: false - }, - series: [{ - name: graphKeypath, - data: [] - }] - }); - } - - // handle clicks on numerical values - this lets the user show a line graph in a modal - $('#stats-container').on('click', '.graphable-stat', function(){ - graphKeypath = $(this).data('keypath'); - - // setup the new graph modal - createGraphModal(); - }); }); From 65cdd8b97fdda27834912b7ef643c32cb78c7f08 Mon Sep 17 00:00:00 2001 From: armored-dragon Date: Mon, 17 Mar 2025 11:54:39 -0500 Subject: [PATCH 2/2] Removed extra code no longer required. --- domain-server/resources/web/stats/js/stats.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/domain-server/resources/web/stats/js/stats.js b/domain-server/resources/web/stats/js/stats.js index d0cc5d506a..cf7fe599c7 100644 --- a/domain-server/resources/web/stats/js/stats.js +++ b/domain-server/resources/web/stats/js/stats.js @@ -1,6 +1,5 @@ $(document).ready(function(){ - var currentHighchart; // setup a function to grab the nodeStats function getNodeStats() { @@ -22,22 +21,11 @@ $(document).ready(function(){ $('.jh-value span').each(function(val){ console.log(val); if (!isNaN($(this).text())) { - // this looks like a number - give it the clickable class so we can get graphs for it + // this looks like a number - give it the clickable class $(this).addClass('graphable-stat'); } }); - if (currentHighchart) { - // get the current time to set with the point - var x = (new Date()).getTime(); - - // get the last value using underscore-keypath - var y = Number(_(json).valueForKeyPath(graphKeypath)); - - // start shifting the chart once we hit 20 data points - var shift = currentHighchart.series[0].data.length > 20; - currentHighchart.series[0].addPoint([x, y], true, shift); - } }).fail(function(data) { $('#stats-container th').each(function(){ $(this).addClass('stale');