mirror of
https://github.com/overte-org/overte.git
synced 2025-04-05 20:50:01 +02:00
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.
This commit is contained in:
parent
d09a927a82
commit
5ee31d6055
3 changed files with 0 additions and 309 deletions
|
@ -1,14 +1,10 @@
|
|||
<!--#include virtual="header.html"-->
|
||||
<div class="col-xs-12 table-lead" id="stats-lead"><h3>Stats</h3><div class="lead-line"></div></div>
|
||||
<div class="col-xs-12">
|
||||
<p class="help"><em>Click on any of the numerical values in the tables below to view a line graph of the incoming values.</em></p>
|
||||
</div>
|
||||
<div class="col-xs-12" id="stats-container"></div>
|
||||
<!--#include virtual="footer.html"-->
|
||||
<script src='/js/query-string.js'></script>
|
||||
<script src='js/stats.js'></script>
|
||||
<script src='js/json.human.js'></script>
|
||||
<script src='js/highcharts-custom.js'></script>
|
||||
<script src='/js/underscore-min.js'></script>
|
||||
<script src='/js/underscore-keypath.min.js'></script>
|
||||
<script src='/js/bootbox.min.js'></script>
|
||||
|
|
|
@ -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;a<c;a++)d=e(d,b[a]);return d}function E(a,b){return parseInt(a,
|
||||
b||10)}function pa(a){return"string"===typeof a}function da(a){return a&&"object"===typeof a}function ta(a){return"[object Array]"===Object.prototype.toString.call(a)}function ga(a){return"number"===typeof a}function ab(a){return R.log(a)/R.LN10}function ia(a){return R.pow(10,a)}function qa(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function w(a){return a!==u&&null!==a}function N(a,b,c){var d,e;if(pa(b))w(c)?a.setAttribute(b,c):a&&a.getAttribute&&(e=a.getAttribute(b));else if(w(b)&&
|
||||
da(b))for(d in b)a.setAttribute(d,b[d]);return e}function ea(a){return ta(a)?a:[a]}function n(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++)if(c=a[b],c!==u&&null!==c)return c}function J(a,b){ra&&!Z&&b&&b.opacity!==u&&(b.filter="alpha(opacity="+100*b.opacity+")");v(a.style,b)}function ja(a,b,c,d,e){a=y.createElement(a);b&&v(a,b);e&&J(a,{padding:0,border:"none",margin:0});c&&J(a,c);d&&d.appendChild(a);return a}function nb(a,b){var c=function(){return u};c.prototype=new a;v(c.prototype,b);return c}
|
||||
function ka(a,b,c,d){var e=U.numberFormat,f=M.lang,g=+a||0,h=-1===b?(g.toString().split(".")[1]||"").length:isNaN(b=X(b))?2:b,k=void 0===c?f.decimalPoint:c,f=void 0===d?f.thousandsSep:d,l=0>g?"-":"",m=String(E(g=X(g).toFixed(h))),q=3<m.length?m.length%3:0;return e!==ka?e(a,b,c,d):l+(q?m.substr(0,q)+f:"")+m.substr(q).replace(/(\d{3})(?=\d)/g,"$1"+f)+(h?k+X(g-m).toFixed(h).slice(2):"")}function sa(a,b){return Array((b||2)+1-String(a).length).join(0)+a}function bb(a,b,c){var d=a[b];a[b]=function(){var a=
|
||||
Array.prototype.slice.call(arguments);a.unshift(d);return c.apply(this,a)}}function ua(a,b){for(var c="{",d=!1,e,f,g,h,k,l=[];-1!==(c=a.indexOf(c));){e=a.slice(0,c);if(d){f=e.split(":");g=f.shift().split(".");k=g.length;e=b;for(h=0;h<k;h++)e=e[g[h]];f.length&&(f=f.join(":"),g=/\.([0-9])/,h=M.lang,k=void 0,/f$/.test(f)?(k=(k=f.match(g))?k[1]:-1,null!==e&&(e=ka(e,k,h.decimalPoint,-1<f.indexOf(",")?h.thousandsSep:""))):e=Ka(f,e))}l.push(e);a=a.slice(c+1);c=(d=!d)?"}":"{"}l.push(a);return l.join("")}
|
||||
function ob(a,b,c,d){var e;c=n(c,1);e=a/c;b||(b=[1,2,2.5,5,10],!1===d&&(1===c?b=[1,2,5,10]:.1>=c&&(b=[1/c])));for(d=0;d<b.length&&!(a=b[d],e<=(b[d]+(b[d+1]||b[d]))/2);d++);return a*c}function cb(a,b){var c=a.length,d,e;for(e=0;e<c;e++)a[e].ss_i=e;a.sort(function(a,c){d=b(a,c);return 0===d?a.ss_i-c.ss_i:d});for(e=0;e<c;e++)delete a[e].ss_i}function La(a){for(var b=a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}function va(a){for(var b=a.length,c=a[0];b--;)a[b]>c&&(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=-1<b.indexOf("C"),f=e?7:3,g;b=b.split(" ");c=[].concat(c);var h,k,l=function(a){for(g=a.length;g--;)"M"===a[g]&&a.splice(g+1,0,a[g+1],a[g+2],a[g+1],a[g+2])};e&&(l(b),l(c));a.isArea&&(h=b.splice(b.length-6,6),k=c.splice(c.length-6,6));if(d<=c.length/f&&b.length===c.length)for(;d--;)c=[].concat(c).splice(0,f).concat(c);
|
||||
a.shift=0;if(b.length)for(a=c.length;b.length<a;)d=[].concat(b).splice(b.length-f,f),e&&(d[f-6]=d[f-2],d[f-5]=d[f-1]),b=b.concat(d);h&&(b=b.concat(h),c=c.concat(k));return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(1===c)e=d;else if(f===b.length&&1>c)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<g;c++)if(!1===b.call(a[c],a[c],c,a))return c};a.fn.highcharts=function(){var a="Chart",b=arguments,c,g;this[0]&&(pa(b[0])&&(a=b[0],b=Array.prototype.slice.call(b,1)),c=b[0],c!==u&&(c.chart=c.chart||{},c.chart.renderTo=this[0],new U[a](c,b[1]),g=this),c===u&&(g=Y[N(this[0],"data-highcharts-chart")]));
|
||||
return g}},addAnimSetter:function(b,c){a.Tween?a.Tween.propHooks[b]={set:c}:a.fx.step[b]=c},getScript:a.getScript,inArray:a.inArray,adapterRun:function(b,c){return a(b)[c]()},grep:a.grep,map:function(a,c){for(var d=[],e=0,f=a.length;e<f;e++)d[e]=c.call(a[e],a[e],e,a);return d},offset:function(b){return a(b).offset()},addEvent:function(b,c,d){a(b).bind(c,d)},removeEvent:function(b,c,d){var e=y.removeEventListener?"removeEventListener":"detachEvent";y[e]&&b&&!b[e]&&(b[e]=function(){});a(b).unbind(c,
|
||||
d)},fireEvent:function(b,c,d,e){var f=a.Event(c),g="detached"+c,h;!ra&&d&&(delete d.layerX,delete d.layerY,delete d.returnValue);v(f,d);b[c]&&(b[g]=b[c],b[c]=null);a.each(["preventDefault","stopPropagation"],function(a,b){var c=f[b];f[b]=function(){try{c.call(f)}catch(a){"preventDefault"===b&&(h=!0)}}});a(b).trigger(f);b[g]&&(b[c]=b[g],b[g]=null);!e||f.isDefaultPrevented()||h||e(f)},washMouseEvent:function(a){var c=a.originalEvent||a;c.pageX===u&&(c.pageX=a.pageX,c.pageY=a.pageY);return c},animate:function(b,
|
||||
c,d){var e=a(b);b.style||(b.style={});c.d&&(b.toD=c.d,c.d=1);e.stop();c.opacity!==u&&b.attr&&(c.opacity+="px");b.hasAnim=1;e.animate(c,d)},stop:function(b){b.hasAnim&&a(b).stop()}}})(I.jQuery);var Ua=I.HighchartsAdapter,ba=Ua||{};Ua&&Ua.init.call(Ua,ib);var Va=ba.adapterRun,Ia=ba.inArray,t=ba.each,jb=ba.grep,Gb=ba.offset,kb=ba.map,F=ba.addEvent,L=ba.removeEvent,B=ba.fireEvent,Hb=ba.washMouseEvent,Wa=ba.animate,Xa=ba.stop,lb={enabled:!0,x:0,y:15,style:{color:"#606060",cursor:"default",fontSize:"11px"}};
|
||||
M={colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #8085e8 #8d4653 #91e8e1".split(" "),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),
|
||||
resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:!0,canvasToolsURL:"http://code.highcharts.com@product.cdnpath@//Highstock 2.0.4/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com@product.cdnpath@//Highstock 2.0.4/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},
|
||||
position:{align:"right",x:-10,y:10}}},title:{text:"Chart title",align:"center",margin:15,style:{color:"#333333",fontSize:"18px"}},subtitle:{text:"",align:"center",style:{color:"#555555"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},lineWidth:2,marker:{lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0,lineWidthPlus:1,radiusPlus:2},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:G(lb,{align:"center",
|
||||
enabled:!1,formatter:function(){return null===this.y?"":ka(this.y,-1)},verticalAlign:"bottom",y:0}),cropThreshold:300,pointRange:0,states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3}},labels:{style:{position:"absolute",color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#909090",borderRadius:0,navigation:{activeColor:"#274b6d",inactiveColor:"#CCC"},
|
||||
shadow:!1,itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000"},itemHiddenStyle:{color:"#CCC"},itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"white",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:Z,backgroundColor:"rgba(249, 249, 249, .85)",
|
||||
borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{series.color}">\u25cf</span> {series.name}: <b>{point.y}</b><br/>',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),255<b[c]&&(b[c]=255)}return this},rgba:b,setOpacity:function(a){b[3]=a;return this}}};O.prototype={opacity:1,textProps:"fontSize fontWeight fontFamily color lineHeight width textDecoration textShadow HcTextStroke".split(" "),init:function(a,b){this.element="span"===b?ja(b):y.createElementNS("http://www.w3.org/2000/svg",b);this.renderer=a},animate:function(a,b,c){b=n(b,S,!0);Xa(this);b?(b=G(b,{}),c&&(b.complete=c),Wa(this,
|
||||
a,b)):(this.attr(a),c&&c());return this},colorGradient:function(a,b,c){var d=this.renderer,e,f,g,h,k,l,m,q,r,p,n=[];a.linearGradient?f="linearGradient":a.radialGradient&&(f="radialGradient");if(f){g=a[f];h=d.gradients;l=a.stops;r=c.radialReference;ta(g)&&(a[f]=g={x1:g[0],y1:g[1],x2:g[2],y2:g[3],gradientUnits:"userSpaceOnUse"});"radialGradient"===f&&r&&!w(g.gradientUnits)&&(g=G(g,{cx:r[0]-r[2]/2+g.cx*r[2],cy:r[1]-r[2]/2+g.cy*r[2],r:g.r*r[2],gradientUnits:"userSpaceOnUse"}));for(p in g)"id"!==p&&n.push(p,
|
||||
g[p]);for(p in l)n.push(l[p]);n=n.join(",");h[n]?a=h[n].attr("id"):(g.id=a="highcharts-"+hb++,h[n]=k=d.createElement(f).attr(g).add(d.defs),k.stops=[],t(l,function(a){0===a[1].indexOf("rgba")?(e=za(a[1]),m=e.get("rgb"),q=e.get("a")):(m=a[1],q=1);a=d.createElement("stop").attr({offset:a[0],"stop-color":m,"stop-opacity":q}).add(k);k.stops.push(a)}));c.setAttribute(b,"url("+d.url+"#"+a+")")}},attr:function(a,b){var c,d,e=this.element,f,g=this,h;"string"===typeof a&&b!==u&&(c=a,a={},a[c]=b);if("string"===
|
||||
typeof a)g=(this[a+"Getter"]||this._defaultGetter).call(this,a,e);else{for(c in a)d=a[c],h=!1,this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(c)&&(f||(this.symbolAttr(a),f=!0),h=!0),!this.rotation||"x"!==c&&"y"!==c||(this.doTransform=!0),h||(this[c+"Setter"]||this._defaultSetter).call(this,d,c,e),this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c)&&this.updateShadows(c,d);this.doTransform&&(this.updateTransform(),this.doTransform=!1)}return g},
|
||||
updateShadows:function(a,b){for(var c=this.shadows,d=c.length;d--;)c[d].setAttribute(a,"height"===a?x(b-(c[d].cutHeight||0),0):"d"===a?this.d:b)},addClass:function(a){var b=this.element,c=N(b,"class")||"";-1===c.indexOf(a)&&N(b,"class",c+" "+a);return this},symbolAttr:function(a){var b=this;t("x y r start end width height innerR anchorX anchorY".split(" "),function(c){b[c]=n(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](b.x,b.y,b.width,b.height,b)})},clip:function(a){return this.attr("clip-path",
|
||||
a?"url("+this.renderer.url+"#"+a.id+")":"none")},crisp:function(a){var b,c={},d,e=a.strokeWidth||this.strokeWidth||0;d=A(e)%2/2;a.x=K(a.x||this.x||0)+d;a.y=K(a.y||this.y||0)+d;a.width=K((a.width||this.width||0)-2*d);a.height=K((a.height||this.height||0)-2*d);a.strokeWidth=e;for(b in a)this[b]!==a[b]&&(this[b]=c[b]=a[b]);return c},css:function(a){var b=this.styles,c={},d=this.element,e,f,g="";e=!b;a&&a.color&&(a.fill=a.color);if(b)for(f in a)a[f]!==b[f]&&(c[f]=a[f],e=!0);if(e){e=this.textWidth=a&&
|
||||
a.width&&"text"===d.nodeName.toLowerCase()&&E(a.width);b&&(a=v(b,c));this.styles=a;e&&(ca||!Z&&this.renderer.forExport)&&delete a.width;if(ra&&!Z)J(this.element,a);else{b=function(a,b){return"-"+b.toLowerCase()};for(f in a)g+=f.replace(/([A-Z])/g,b)+":"+a[f]+";";N(d,"style",g)}e&&this.added&&this.renderer.buildText(this)}return this},on:function(a,b){var c=this,d=c.element;Ga&&"click"===a?(d.ontouchstart=function(a){c.touchEventFired=la.now();a.preventDefault();b.call(d,a)},d.onclick=function(a){(-1===
|
||||
na.indexOf("Android")||1100<la.now()-(c.touchEventFired||0))&&b.call(d,a)}):d["on"+a]=b;return this},setRadialReference:function(a){this.element.radialReference=a;return this},translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=!0;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.scaleX,d=this.scaleY,e=this.inverted,f=this.rotation,g=this.element;e&&(a+=this.attr("width"),b+=this.attr("height"));
|
||||
a=["translate("+a+","+b+")"];e?a.push("rotate(90) scale(-1,1)"):f&&a.push("rotate("+f+" "+(g.getAttribute("x")||0)+" "+(g.getAttribute("y")||0)+")");(w(c)||w(d))&&a.push("scale("+n(c,1)+" "+n(d,1)+")");a.length&&g.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){var d,e,f,g,h={};e=this.renderer;f=e.alignedObjects;if(a){if(this.alignOptions=a,this.alignByTranslate=b,!c||pa(c))this.alignTo=d=c||"renderer",qa(f,
|
||||
this),f.push(this),c=null}else a=this.alignOptions,b=this.alignByTranslate,d=this.alignTo;c=n(c,e[d],e);d=a.align;e=a.verticalAlign;f=(c.x||0)+(a.x||0);g=(c.y||0)+(a.y||0);if("right"===d||"center"===d)f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=A(f);if("bottom"===e||"middle"===e)g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1);h[b?"translateY":"y"]=A(g);this[this.placed?"animate":"attr"](h);this.placed=!0;this.alignAttr=h;return this},getBBox:function(){var a=this.bBox,
|
||||
b=this.renderer,c,d,e=this.rotation;c=this.element;var f=this.styles,g=e*vb;d=this.textStr;var h;if(""===d||Fb.test(d))h="num."+d.toString().length+(f?"|"+f.fontSize+"|"+f.fontFamily:"");h&&(a=b.cache[h]);if(!a){if("http://www.w3.org/2000/svg"===c.namespaceURI||b.forExport){try{a=c.getBBox?v({},c.getBBox()):{width:c.offsetWidth,height:c.offsetHeight}}catch(k){}if(!a||0>a.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;g<a.length;g++)if(b=a[g],c=N(b,"zIndex"),b!==e&&(E(c)>f||!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<a.stops.length;f++)a.stops[f]=a.stops[f].destroy();a.stops=null}a.safeRemoveChild(b);for(c&&t(c,function(b){a.safeRemoveChild(b)});d&&d.div&&0===d.div.childNodes.length;)b=d.parentGroup,a.safeRemoveChild(d.div),delete d.div,d=b;a.alignTo&&qa(a.renderer.alignedObjects,a);for(e in a)delete a[e];
|
||||
return null},shadow:function(a,b,c){var d=[],e,f,g=this.element,h,k,l,m;if(a){k=n(a.width,3);l=(a.opacity||.15)/k;m=this.parentInverted?"(-1,-1)":"("+n(a.offsetX,1)+", "+n(a.offsetY,1)+")";for(e=1;e<=k;e++)f=g.cloneNode(0),h=2*k+1-2*e,N(f,{isShadow:"true",stroke:a.color||"black","stroke-opacity":l*e,"stroke-width":h,transform:"translate"+m,fill:"none"}),c&&(N(f,"height",x(N(f,"height")-h,0)),f.cutHeight=h),b?b.element.appendChild(f):g.parentNode.insertBefore(f,g),d.push(f);this.shadows=d}return this},
|
||||
xGetter:function(a){"circle"===this.element.nodeName&&(a={x:"cx",y:"cy"}[a]||a);return this._defaultGetter(a)},_defaultGetter:function(a){a=n(this[a],this.element?this.element.getAttribute(a):null,0);/^[\-0-9\.]+$/.test(a)&&(a=parseFloat(a));return a},dSetter:function(a,b,c){a&&a.join&&(a=a.join(" "));/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");c.setAttribute(b,a);this[b]=a},dashstyleSetter:function(a){var b;if(a=a&&a.toLowerCase()){a=a.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot",
|
||||
"1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(b=a.length;b--;)a[b]=E(a[b])*this["stroke-width"];a=a.join(",").replace("NaN","none");this.element.setAttribute("stroke-dasharray",a)}},alignSetter:function(a){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[a])},opacitySetter:function(a,b,c){this[b]=a;c.setAttribute(b,a)},titleSetter:function(a){var b=this.element.getElementsByTagName("title")[0];
|
||||
b||(b=y.createElementNS("http://www.w3.org/2000/svg","title"),this.element.appendChild(b));b.textContent=n(a,"").replace(/<[^>]*>/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,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g):[e],""===e[e.length-1]&&e.pop(),t(e,function(e,f){var g,r=0;e=e.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");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=1<g.length||1<e.length&&"nowrap"!==m.whiteSpace,t,C,H=m.HcHeight,u=[],w=D(n),yb=1;p&&(e.length||
|
||||
u.length);)delete a.bBox,t=a.getBBox(),C=t.width,!Z&&c.forExport&&(C=c.measureSpanWidth(n.firstChild.data,a.styles)),(t=C>q)&&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"};1<arguments.length&&v(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e,f){var g,h=this.symbols[a],h=h&&h(A(b),A(c),d,e,f),k=/^url\((.*?)\)$/,l,m;h?(g=this.path(h),v(g,{symbolName:a,x:b,y:c,width:d,height:e}),f&&v(g,f)):k.test(a)&&(m=function(a,b){a.element&&
|
||||
(a.attr({width:b[0],height:b[1]}),a.alignByTranslate||a.translate(A((d-b[0])/2),A((e-b[1])/2)))},l=a.match(k)[1],a=xb[l]||f&&f.width&&f.height&&[f.width,f.height],g=this.image(l).attr({x:b,y:c}),g.isImg=!0,a?m(g,a):(g.attr({width:0,height:0}),ja("img",{onload:function(){m(g,xb[l]=[this.width,this.height])},src:l})));return g},symbols:{circle:function(a,b,c,d){var e=.166*c;return["M",a+c/2,b,"C",a+c+e,b,a+c+e,b+d,a+c/2,b+d,"C",a-e,b+d,a-e,b,a+c/2,b,"Z"]},square:function(a,b,c,d){return["M",a,b,"L",
|
||||
a+c,b,a+c,b+d,a,b+d,"Z"]},triangle:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d,a,b+d,"Z"]},"triangle-down":function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c/2,b+d,"Z"]},diamond:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d/2,a+c/2,b+d,a,b+d/2,"Z"]},arc:function(a,b,c,d,e){var f=e.start;c=e.r||c||d;var g=e.end-.001;d=e.innerR;var h=e.open,k=Fa(f),l=Sa(f),m=Fa(g),g=Sa(g);e=e.end-f<ub?0:1;return["M",a+c*k,b+c*l,"A",c,c,0,e,1,a+c*m,b+c*g,h?"M":"L",a+d*m,b+d*g,"A",d,d,0,e,0,a+d*k,b+d*l,h?"":"Z"]},
|
||||
callout:function(a,b,c,d,e){var f=T(e&&e.r||0,c,d),g=f+6,h=e&&e.anchorX,k=e&&e.anchorY;e=A(e.strokeWidth||0)%2/2;a+=e;b+=e;e=["M",a+f,b,"L",a+c-f,b,"C",a+c,b,a+c,b,a+c,b+f,"L",a+c,b+d-f,"C",a+c,b+d,a+c,b+d,a+c-f,b+d,"L",a+f,b+d,"C",a,b+d,a,b+d,a,b+d-f,"L",a,b+f,"C",a,b,a,b,a+f,b];h&&h>c&&k>b+g&&k<b+d-g?e.splice(13,3,"L",a+c,k-6,a+c+6,k,a+c,k+6,a+c,b+d-f):h&&0>h&&k>b+g&&k<b+d-g?e.splice(33,3,"L",a,k+6,a-6,k,a,k-6,a,b+f):k&&k>d&&h>a+g&&h<a+c-g?e.splice(23,3,"L",h+6,b+d,h,b+d+6,h-6,b+d,a+f,b+d):k&&0>
|
||||
k&&h>a+g&&h<a+c-g&&e.splice(3,3,"L",h-6,b,h,b-6,h+6,b,c-f,b);return e}},clipRect:function(a,b,c,d){var e="highcharts-"+hb++,f=this.createElement("clipPath").attr({id:e}).add(this.defs);a=this.rect(a,b,c,d,0).add(f);a.id=e;a.clipPath=f;return a},text:function(a,b,c,d){var e=ca||!Z&&this.forExport,f={};if(d&&!this.forExport)return this.html(a,b,c);f.x=Math.round(b||0);c&&(f.y=Math.round(c));if(a||0===a)f.text=a;a=this.createElement("text").attr(f);e&&a.css({position:"absolute"});d||(a.xSetter=function(a,
|
||||
b,c){var d=c.getElementsByTagName("tspan"),e,f=c.getAttribute(b),r;for(r=0;r<d.length;r++)e=d[r],e.getAttribute(b)===f&&e.setAttribute(b,a);c.setAttribute(b,a)});return a},fontMetrics:function(a,b){a=a||this.style.fontSize;b&&I.getComputedStyle&&(b=b.element||b,a=I.getComputedStyle(b,"").fontSize);a=/px/.test(a)?E(a):/em/.test(a)?12*parseFloat(a):12;var c=24>a?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+m<q&&(g=q-m,p&&g+l>d&&(c=!1)):g+l>r&&(g=r-l,p&&g+m<d&&(c=!1));b.x=g}return c},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||f.chartWidth)-e.right-e.left:0),y:a?g-e.bottom+e.offset-
|
||||
(e.opposite?e.height:0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var k=this.axis,l=k.transA,m=k.reversed,q=k.staggerLines;a=a+e.x-(f&&d?f*l*(m?-1:1):0);b=b+this.yOffset-(f&&!d?f*l*(m?1:-1):0);q&&(c.line=g/(h||1)%q,b+=k.labelOffset/q*c.line);return{x:a,y:b}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine(["M",a,b,"L",a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,f=d.chart.renderer,g=d.horiz,h=this.type,k=this.label,l=
|
||||
this.pos,m=e.labels,q=this.gridLine,r=h?h+"Grid":"grid",p=h?h+"Tick":"tick",t=e[r+"LineWidth"],D=e[r+"LineColor"],H=e[r+"LineDashStyle"],V=e[p+"Length"],r=e[p+"Width"]||0,w=e[p+"Color"],x=e[p+"Position"],p=this.mark,v=m.step,A=!0,z=d.tickmarkOffset,y=this.getPosition(g,l,z,b),B=y.x,y=y.y,C=g&&B===d.pos+d.len||!g&&y===d.pos?-1:1;c=n(c,1);this.isActive=!0;if(t&&(l=d.getPlotLinePath(l+z,t*C,b,!0),q===u&&(q={stroke:D,"stroke-width":t},H&&(q.dashstyle=H),h||(q.zIndex=1),b&&(q.opacity=0),this.gridLine=
|
||||
q=t?f.path(l).attr(q).add(d.gridGroup):null),!b&&q&&l))q[this.isNew?"attr":"animate"]({d:l,opacity:c});r&&V&&("inside"===x&&(V=-V),d.opposite&&(V=-V),h=this.getMarkPath(B,y,V,r*C,g,f),p?p.animate({d:h,opacity:c}):this.mark=f.path(h).attr({stroke:w,"stroke-width":r,opacity:c}).add(d.axisGroup));k&&!isNaN(B)&&(k.xy=y=this.getLabelPosition(B,y,k,g,m,z,a,v),this.isFirst&&!this.isLast&&!n(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!n(e.showLastLabel,1)?A=!1:d.isRadial||m.step||m.rotation||b||0===
|
||||
c||(A=this.handleOverflow(a,y)),v&&a%v&&(A=!1),A&&!isNaN(y.y)?(y.opacity=c,k[this.isNew?"attr":"animate"](y),this.isNew=!1):k.attr("y",-9999))},destroy:function(){Ma(this,this.axis)}};ma.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:lb,lineColor:"#C0D0E0",lineWidth:1,minPadding:.01,maxPadding:.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,
|
||||
minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:.05,minPadding:.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,
|
||||
formatter:function(){return ka(this.total,-1)},style:lb.style}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:null},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-15},title:{rotation:0}},init:function(a,b){var c=b.isX;this.horiz=a.inverted?!c:c;this.coll=(this.isXAxis=c)?"xAxis":"yAxis";this.opposite=b.opposite;this.side=b.side||(this.horiz?this.opposite?0:2:
|
||||
this.opposite?1:3);this.setOptions(b);var d=this.options,e=d.type;this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter;this.userOptions=b;this.minPixelPadding=0;this.chart=a;this.reversed=d.reversed;this.zoomEnabled=!1!==d.zoomEnabled;this.categories=d.categories||"category"===e;this.names=[];this.isLog="logarithmic"===e;this.isDatetimeAxis="datetime"===e;this.isLinked=w(d.linkedTo);this.tickmarkOffset=this.categories&&"between"===d.tickmarkPlacement&&1===n(d.tickInterval,1)?.5:0;this.ticks=
|
||||
{};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=d.minRange||d.maxZoom;this.range=d.range;this.offset=d.offset||0;this.stacks={};this.oldStacks={};this.min=this.max=null;this.crosshair=n(d.crosshair,ea(a.options.tooltip.crosshairs)[c?0:1],!1);var f,d=this.options.events;-1===Ia(this,a.axes)&&(c&&!this.isColorAxis?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||
|
||||
[];a.inverted&&c&&this.reversed===u&&(this.reversed=!0);this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(f in d)F(this,f,d[f]);this.isLog&&(this.val2lin=ab,this.lin2val=ia)},setOptions:function(a){this.options=G(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],G(M[this.coll],a))},defaultLabelFormatter:function(){var a=this.axis,b=this.value,
|
||||
c=a.categories,d=this.dateTimeLabelFormat,e=M.lang.numericSymbols,f=e&&e.length,g,h=a.options.labels.format,a=a.isLog?b:a.tickInterval;if(h)g=ua(h,this);else if(c)g=b;else if(d)g=Ka(d,b);else if(f&&1E3<=a)for(;f--&&g===u;)c=Math.pow(1E3,f+1),a>=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.dataMax<d&&(a.dataMax=d,a.ignoreMaxPadding=!0)))}})},translate:function(a,b,c,
|
||||
d,e,f){var g=1,h=0,k=d?this.oldTransA:this.transA;d=d?this.oldMin:this.min;var l=this.minPixelPadding;e=(this.options.ordinal||this.isLog&&e)&&this.lin2val;k||(k=this.transA);c&&(g*=-1,h=this.len);this.reversed&&(g*=-1,h-=g*(this.sector||this.len));b?(a=a*g+h-l,a=a/k+d,e&&(a=this.lin2val(a))):(e&&(a=this.val2lin(a)),"between"===f&&(f=.5),a=g*(a-d)*k+h+g*l+(ga(f)?k*f*this.pointRange:0));return a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,
|
||||
b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,b,c,d,e){var f=this.chart,g=this.left,h=this.top,k,l,m=c&&f.oldChartHeight||f.chartHeight,q=c&&f.oldChartWidth||f.chartWidth,r;k=this.transB;e=n(e,this.translate(a,null,null,c));a=c=A(e+k);k=l=A(m-e-k);if(isNaN(e))r=!0;else if(this.horiz){if(k=h,l=m-this.bottom,a<g||a>g+this.width)r=!0}else if(a=g,c=q-this.right,k<h||k>h+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<e;a++)d=d.concat(this.getLogTickPositions(c,b[a-1],b[a],!0));else if(this.isDatetimeAxis&&"auto"===a.minorTickInterval)d=d.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c),this.min,this.max,a.startOfWeek)),d[0]<this.min&&
|
||||
d.shift();else for(b=this.min+(b[0]-this.min)%c;b<=this.max;b+=c)d.push(b);return d},adjustForMinRange:function(){var a=this.options,b=this.min,c=this.max,d,e=this.dataMax-this.dataMin>=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;0<g;g--)if(h=k[g]-k[g-1],f===u||h<f)f=h}),this.minRange=T(5*f,this.dataMax-this.dataMin)));if(c-b<this.minRange){var m=this.minRange;d=
|
||||
(m-c+b)/2;d=[b-d,n(a.min,b-d)];e&&(d[2]=this.dataMin);b=va(d);c=[b+m,n(a.max,b+m)];e&&(c[2]=this.dataMax);c=La(c);c-b<m&&(d[0]=c-m,d[1]=n(a.min,c-m),b=va(d))}this.min=b;this.max=c},setAxisTranslation:function(a){var b=this,c=b.max-b.min,d=b.axisPointRange||0,e,f=0,g=0,h=b.linkedParent,k=!!b.categories,l=b.transA;if(b.isXAxis||k||d)h?(f=h.minPointOffset,g=h.pointRangePadding):t(b.series,function(a){var h=k?1:b.isXAxis?a.pointRange:b.axisPointRange||0,l=a.options.pointPlacement,p=a.closestPointRange;
|
||||
h>c&&(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||!(0<b.dataMax)&&b.ignoreMaxPadding||(b.max+=c*q));ga(d.floor)&&(b.min=x(b.min,d.floor));ga(d.ceiling)&&(b.max=T(b.max,d.ceiling));b.min===b.max||void 0===b.min||void 0===b.max?b.tickInterval=1:l&&!p&&D===b.linkedParent.options.tickPixelInterval?
|
||||
b.tickInterval=b.linkedParent.tickInterval:(b.tickInterval=n(p,u?1:(b.max-b.min)*D/x(b.len,D)),!w(p)&&b.len<D&&!this.isRadial&&!this.isLog&&!u&&e&&f&&(H=!0,b.tickInterval/=4));k&&!a&&t(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)});b.setAxisTranslation(!0);b.beforeSetTickPositions&&b.beforeSetTickPositions();b.postProcessTickInterval&&(b.tickInterval=b.postProcessTickInterval(b.tickInterval));b.pointRange&&(b.tickInterval=x(b.pointRange,b.tickInterval));!p&&b.tickInterval<
|
||||
Q&&(b.tickInterval=Q);h||g||p||(b.tickInterval=ob(b.tickInterval,null,R.pow(10,K(R.log(b.tickInterval)/R.LN10)),n(d.allowDecimals,!(1<b.tickInterval&&5>b.tickInterval&&1E3<b.max&&9999>b.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<g&&a.pop(),0===a.length&&w(d)&&a.push((g+d)/2),1===a.length&&(e=1E13<X(b.max)?1:.001,b.min-=e,b.max+=e))},setMaxTicks:function(){var a=this.chart,b=a.maxTicks||{},c=this.tickPositions,
|
||||
d=this._maxTicksKey=[this.coll,this.pos,this.len].join("-");!this.isLinked&&!this.isDatetimeAxis&&c&&c.length>(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<a){for(;b.length<a;)b.push(ha(b[b.length-1]+this.tickInterval));
|
||||
this.transA*=(e-1)/(a-1);this.max=b[b.length-1]}w(d)&&a!==d&&(this.isDirty=!0)}},setScale:function(){var a=this.stacks,b,c,d,e;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();e=this.len!==this.oldAxisLength;t(this.series,function(a){if(a.isDirtyData||a.isDirty||a.xAxis.isDirty)d=!0});if(e||d||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(b in a)for(c in a[b])a[b][c].total=null,a[b][c].cum=
|
||||
0;this.forceRedraw=!1;this.getSeriesExtremes();this.setTickPositions();this.oldUserMin=this.userMin;this.oldUserMax=this.userMax;this.isDirty||(this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax)}else if(!this.isXAxis)for(b in this.oldStacks&&(a=this.stacks=this.oldStacks),a)for(c in a[b])a[b][c].cum=a[b][c].total;this.setMaxTicks()},setExtremes:function(a,b,c,d,e){var f=this,g=f.chart;c=n(c,!0);e=v(e,{min:a,max:b});B(f,"setExtremes",e,function(){f.userMin=a;f.userMax=b;f.eventArgs=e;
|
||||
f.isDirtyExtremes=!0;c&&g.redraw(d)})},zoom:function(a,b){var c=this.dataMin,d=this.dataMax,e=this.options;this.allowZoomOutside||(w(c)&&a<=T(c,n(e.min,c))&&(a=u),w(d)&&b>=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:b<a&&(a=b);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=(n(a,0)-90*this.side+720)%360;return 15<a&&165>a?"right":195<a&&345>a?"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<y;){z=[];B=!1;for(v=0;v<l.length;v++)G=l[v],C=(C=f[G].label&&f[G].label.getBBox())?C.width:0,oa=v%A,C&&(G=a.translate(G),z[oa]!==u&&G<z[oa]&&(B=!0),z[oa]=G+C);if(B)A++;else break}1<A&&(a.staggerLines=A)}t(e,function(b){if(0===h||2===h||{1:"left",3:"right"}[h]===a.labelAlign)H=x(f[b].getLabelSize(),H)});a.staggerLines&&(H*=a.staggerLines,a.labelOffset=H)}else for(v in f)f[v].destroy(),delete f[v];Q&&Q.text&&!1!==Q.enabled&&(a.axisTitle||(a.axisTitle=
|
||||
c.text(Q.text,0,0,Q.useHTML).attr({zIndex:7,rotation:Q.rotation||0,align:Q.textAlign||{low:"left",middle:"center",high:"right"}[Q.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(Q.style).add(a.axisGroup),a.axisTitle.isNew=!0),m&&(q=a.axisTitle.getBBox()[g?"height":"width"],r=Q.offset,p=w(r)?0:n(Q.margin,g?5:10)),a.axisTitle[m?"show":"hide"]());a.offset=W*n(d.offset,V[h]);c=2===h?a.tickBaseline:0;g=H+p+(H&&W*(g?n(D.y,a.tickBaseline+8):D.x)-c);a.axisTitleMargin=n(r,g);V[h]=x(V[h],
|
||||
a.axisTitleMargin+q+W*a.offset,g);b[k]=x(b[k],2*K(d.lineWidth/2))},getLinePath:function(a){var b=this.chart,c=this.opposite,d=this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;c&&(a*=-1);return b.renderer.crispLine(["M",e?this.left:f,e?d:this.top,"L",e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,
|
||||
k=E(e.style.fontSize||12),d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align],b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(2===this.side?k:0);return{x:a?d:b+(g?this.width:0)+h+(e.x||0),y:a?b-(g?this.height:0)+h:d+(e.y||0)}},render:function(){var a=this,b=a.horiz,c=a.reversed,d=a.chart,e=d.renderer,f=a.options,g=a.isLog,h=a.isLinked,k=a.tickPositions,l,m=a.axisTitle,q=a.ticks,r=a.minorTicks,p=a.alternateBands,n=f.stackLabels,D=f.alternateGridColor,H=a.tickmarkOffset,v=f.lineWidth,
|
||||
x=d.hasRendered&&w(a.oldMin)&&!isNaN(a.oldMin),A=a.hasData,y=a.showAxis,z,B=f.labels.overflow,G=a.justifyLabels=b&&!1!==B,E;a.labelEdge.length=0;a.justifyToPlot="justify"===B;t([q,r,p],function(a){for(var b in a)a[b].isActive=!1});if(A||h)a.minorTickInterval&&!a.categories&&t(a.getMinorTickPositions(),function(b){r[b]||(r[b]=new xa(a,b,"minor"));x&&r[b].isNew&&r[b].render(null,!0);r[b].render(null,!1,1)}),k.length&&(l=k.slice(),(b&&c||!b&&!c)&&l.reverse(),G&&(l=l.slice(1).concat([l[0]])),t(l,function(b,
|
||||
c){G&&(c=c===l.length-1?0:c+1);if(!h||b>=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<a.max&&(p[b]||(p[b]=new U.PlotLineOrBand(a)),z=b+H,E=k[c+1]!==u?k[c+1]+H:a.max,p[b].options={from:g?ia(z):z,to:g?ia(E):E,color:D},p[b].render(),p[b].isActive=!0)}),a._addedPlotLB||(t((f.plotLines||[]).concat(f.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=
|
||||
!0);t([q,r,p],function(a){var b,c,e=[],f=S?S.duration||500:0,g=function(){for(c=e.length;c--;)a[e[c]]&&!a[e[c]].isActive&&(a[e[c]].destroy(),delete a[e[c]])};for(b in a)a[b].isActive||(a[b].render(b,!1,0),a[b].isActive=!1,e.push(b));a!==p&&d.hasRendered&&f?f&&setTimeout(g,f):g()});v&&(b=a.getLinePath(v),a.axisLine?a.axisLine.animate({d:b}):a.axisLine=e.path(b).attr({stroke:f.lineColor,"stroke-width":v,zIndex:7}).add(a.axisGroup),a.axisLine[y?"show":"hide"]());m&&y&&(m[m.isNew?"attr":"animate"](a.getTitlePosition()),
|
||||
m.isNew=!1);n&&n.enabled&&a.renderStackTotals();a.isDirty=!1},redraw:function(){this.render();t(this.plotLinesAndBands,function(a){a.render()});t(this.series,function(a){a.isDirty=!0})},destroy:function(a){var b=this,c=b.stacks,d,e=b.plotLinesAndBands;a||L(b);for(d in c)Ma(c[d]),c[d]=null;t([b.ticks,b.minorTicks,b.alternateBands],function(a){Ma(a)});for(a=e.length;a--;)e[a].destroy();t("stackTotalGroup axisLine axisTitle axisGroup cross gridGroup labelGroup".split(" "),function(a){b[a]&&(b[a]=b[a].destroy())});
|
||||
this.cross&&this.cross.destroy()},drawCrosshair:function(a,b){if(this.crosshair)if(!1===(w(b)||!n(this.crosshair.snap,!0)))this.hideCrosshair();else{var c,d=this.crosshair,e=d.animation;n(d.snap,!0)?w(b)&&(c=this.chart.inverted!=this.horiz?b.plotX:this.len-b.plotY):c=this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos;c=this.isRadial?this.getPlotLinePath(this.isXAxis?b.x:n(b.stackY,b.y)):this.getPlotLinePath(null,null,null,null,c);if(null===c)this.hideCrosshair();else if(this.cross)this.cross.attr({visibility:"visible"})[e?
|
||||
"animate":"attr"]({d:c},e);else e={"stroke-width":d.width||1,stroke:d.color||"#C0C0C0",zIndex:d.zIndex||2},d.dashStyle&&(e.dashstyle=d.dashStyle),this.cross=this.chart.renderer.path(c).attr(e).add()}},hideCrosshair:function(){this.cross&&this.cross.hide()}};v(ma.prototype,void 0);ma.prototype.getTimeTicks=function(a,b,c,d){var e=[],f={},g=M.global.useUTC,h,k=new la(b-wa),l=a.unitRange,m=a.count;if(w(b)){l>=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;d<c;)e.push(d),d=l===z.year?Pa(h+b*m,0):l===z.month?Pa(h,q+b*m):g||l!==z.day&&l!==z.week?d+l*m:Pa(h,q,r+b*m*(l===z.day?
|
||||
1:7)),b++;e.push(d);t(jb(e,function(a){return l<=z.hour&&a%z.day===p}),function(a){f[a]="day"})}e.info=v(a,{higherRanks:f,totalRange:l*m});return e};ma.prototype.normalizeTimeTickInterval=function(a,b){var c=b||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],d=c[c.length-1],e=z[d[0]],f=d[1],g;for(g=0;g<c.length&&!(d=c[g],e=z[d[0]],f=d[1],c[g+1]&&a<=(e*
|
||||
f[f.length-1]+z[c[g+1][0]])/2);g++);e===z.year&&a<5*e&&(f=[1,2,5]);c=ob(a/e,f,"year"===d[0]?x(R.pow(10,K(R.log(a/e)/R.LN10)),1):1);return{unitRange:e,count:c,unitName:d[0]}};var zb=U.Tooltip=function(){this.init.apply(this,arguments)};zb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=E(d.padding);this.chart=a;this.options=b;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:e,
|
||||
fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8}).css(d).css({padding:0}).add().attr({y:-9999});ca||this.label.shadow(b.shadow);this.shared=b.shared},destroy:function(){this.label&&(this.label=this.label.destroy());clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=this,f=e.now,g=!1!==e.options.animation&&!e.isHidden&&(1<X(a-f.x)||1<X(b-f.y)),h=e.followPointer||1<e.len;v(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:h?u:g?(2*f.anchorX+c)/
|
||||
3:c,anchorY:h?u:g?(f.anchorY+d)/2:d});e.label.attr(f);g&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,d)},32))},hide:function(a){var b=this,c;clearTimeout(this.hideTimer);this.isHidden||(c=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){b.label.fadeOut();b.isHidden=!0},n(a,this.options.hideDelay,500)),c&&t(c,function(a){a.setState()}),this.chart.hoverPoints=null)},getAnchor:function(a,b){var c,d=this.chart,e=d.inverted,f=d.plotTop,g=0,h=
|
||||
0,k;a=ea(a);c=a[0].tooltipPos;this.followPointer&&b&&(b.chartX===u&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]);c||(t(a,function(a){k=a.series.yAxis;g+=a.plotX;h+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&k?k.top-f:0)}),g/=a.length,h/=a.length,c=[e?d.plotWidth-h:g,this.shared&&!e&&1<a.length&&b?b.chartY-f:e?d.plotHeight-g:h]);return kb(c,A)},getPosition:function(a,b,c){var d=this.chart,e=this.distance,f={},g,h=["y",d.chartHeight,b,c.plotY+d.plotTop],k=["x",d.chartWidth,
|
||||
a,c.plotX+d.plotLeft],l=c.ttBelow||d.inverted&&!c.negative||!d.inverted&&c.negative,m=function(a,b,c,d){var g=c<d-e;b=d+e+c<b;c=d-e-c;d+=e;if(l&&b)f[a]=d;else if(!l&&g)f[a]=c;else if(g)f[a]=c;else if(b)f[a]=d;else return!1},q=function(a,b,c,d){if(d<e||d>b-e)return!1;f[a]=d<c/2?1:d>b-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<this.len)&&r();p();return f},defaultFormatter:function(a){var b=
|
||||
this.points||ea(this),c=b[0].series,d;d=[a.tooltipHeaderFormatter(b[0])];t(b,function(a){c=a.series;d.push(c.tooltipFormatter&&c.tooltipFormatter(a)||a.point.tooltipFormatter(c.tooltipOptions.pointFormat))});d.push(a.options.footerFormat||"");return d.join("")},refresh:function(a,b){var c=this.chart,d=this.label,e=this.options,f,g,h={},k,l=[];k=e.formatter||this.defaultFormatter;var h=c.hoverPoints,m,q=this.shared;clearTimeout(this.hideTimer);this.followPointer=ea(a)[0].series.tooltipOptions.followPointer;
|
||||
g=this.getAnchor(a,b);f=g[0];g=g[1];!q||a.series&&a.series.noSharedTooltip?h=a.getLabelConfig():(c.hoverPoints=a,h&&t(h,function(a){a.setState()}),t(a,function(a){a.setState("hover");l.push(a.getLabelConfig())}),h={x:a[0].category,y:a[0].y},h.points=l,this.len=l.length,a=a[0]);k=k.call(h,this);h=a.series;this.distance=n(h.tooltipOptions.distance,16);!1===k?this.hide():(this.isHidden&&(Xa(d),d.attr("opacity",1).show()),d.attr({text:k}),m=e.borderColor||a.color||h.color||"#606060",d.attr({stroke:m}),
|
||||
this.updatePosition({plotX:f,plotY:g,negative:a.negative,ttBelow:a.ttBelow}),this.isHidden=!1);B(c,"tooltipRefresh",{text:k,x:f+c.plotLeft,y:g+c.plotTop,borderColor:m})},updatePosition:function(a){var b=this.chart,c=this.label,c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(A(c.x),A(c.y),a.plotX+b.plotLeft,a.plotY+b.plotTop)},tooltipHeaderFormatter:function(a){var b=a.series,c=b.tooltipOptions,d=c.dateTimeLabelFormats,e=c.xDateFormat,f=b.xAxis,g=f&&"datetime"===
|
||||
f.options.type&&ga(a.key),c=c.headerFormat,f=f&&f.closestPointRange,h;if(g&&!e){if(f)for(h in z){if(z[h]>=f||z[h]<=z.day&&0<a.key%z[h]){e=d[h];break}}else e=d.day;e=e||d.year}g&&e&&(c=c.replace("{point.key}","{point.key:"+e+"}"));return ua(c,{point:a,series:b})}};var Ba;Ga=y.documentElement.ontouchstart!==u;var Ab=U.Pointer=function(a,b){this.init(a,b)};Ab.prototype={init:function(a,b){var c=b.chart,d=c.events,e=ca?"":c.zoomType,c=a.inverted,f;this.options=b;this.chart=a;this.zoomX=f=/x/.test(e);
|
||||
this.zoomY=e=/y/.test(e);this.zoomHor=f&&!c||e&&c;this.zoomVert=e&&!c||f&&c;this.hasZoom=f||e;this.runChartClick=d&&!!d.click;this.pinchDown=[];this.lastValidTouch={};U.Tooltip&&b.tooltip.enabled&&(a.tooltip=new zb(a,b.tooltip),this.followTouchMove=b.tooltip.followTouchMove);this.setDOMEvents()},normalize:function(a,b){var c,d;a=a||window.event;a=Hb(a);a.target||(a.target=a.srcElement);d=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;b||(this.chartPosition=b=Gb(this.chart.container));
|
||||
d.pageX===u?(c=x(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top);return v(a,{chartX:A(c),chartY:A(d)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};t(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},getIndex:function(a){var b=this.chart;return b.inverted?b.plotHeight+b.plotTop-a.chartY:a.chartX-b.plotLeft},runPointActions:function(a){var b=this.chart,c=b.series,d=b.tooltip,e,f,g=b.hoverPoint,
|
||||
h=b.hoverSeries,k,l,m=b.chartWidth,q=this.getIndex(a);if(d&&this.options.tooltip.shared&&(!h||!h.noSharedTooltip)){f=[];k=c.length;for(l=0;l<k;l++)c[l].visible&&!1!==c[l].options.enableMouseTracking&&!c[l].noSharedTooltip&&!0!==c[l].singularTooltips&&c[l].tooltipPoints.length&&(e=c[l].tooltipPoints[q])&&e.series&&(e._dist=X(q-e.clientX),m=T(m,e._dist),f.push(e));for(k=f.length;k--;)f[k]._dist>m&&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"];d<h?d=h:d>h+l&&(d=h+l);e<k?e=k:e>k+m&&(e=k+m);this.hasDragged=
|
||||
Math.sqrt(Math.pow(r-d,2)+Math.pow(p-e,2));10<this.hasDragged&&(q=b.isInsidePlot(r-h,p-k),b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&q&&!n&&!this.selectionMarker&&(this.selectionMarker=b.renderer.rect(h,k,f?1:l,g?1:m,0).attr({fill:c.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add()),this.selectionMarker&&f&&(d-=r,this.selectionMarker.attr({width:X(d),x:(0<d?0:d)+r})),this.selectionMarker&&g&&(d=e-p,this.selectionMarker.attr({height:X(d),y:(0<d?0:d)+p})),q&&!this.selectionMarker&&
|
||||
c.panning&&b.pan(a,c.panning))},drop:function(a){var b=this.chart,c=this.hasPinched;if(this.selectionMarker){var d={xAxis:[],yAxis:[],originalEvent:a.originalEvent||a},e=this.selectionMarker,f=e.attr?e.attr("x"):e.x,g=e.attr?e.attr("y"):e.y,h=e.attr?e.attr("width"):e.width,k=e.attr?e.attr("height"):e.height,l;if(this.hasDragged||c)t(b.axes,function(b){if(b.zoomEnabled){var c=b.horiz,e="touchend"===a.type?b.minPixelPadding:0,p=b.toValue((c?f:g)+e),c=b.toValue((c?f+h:g+k)-e);isNaN(p)||isNaN(c)||(d[b.coll].push({axis:b,
|
||||
min:T(p,c),max:x(p,c)}),l=!0)}}),l&&B(b,"selection",d,function(a){b.zoom(v(a,c?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();c&&this.scaleGroups()}b&&(J(b.container,{cursor:b._cursor}),b.cancelClick=10<this.hasDragged,b.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(a){a=this.normalize(a);a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(a){Y[Ba]&&Y[Ba].pointer.drop(a)},onDocumentMouseMove:function(a){var b=
|
||||
this.chart,c=this.chartPosition,d=b.hoverSeries;a=this.normalize(a,c);c&&d&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(){var a=Y[Ba];a&&(a.pointer.reset(),a.pointer.chartPosition=null)},onContainerMouseMove:function(a){var b=this.chart;Ba=b.index;a=this.normalize(a);a.returnValue=!1;"mousedown"===b.mouseIsDown&&this.drag(a);!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-
|
||||
b.plotLeft,a.chartY-b.plotTop)||b.openMenu||this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=N(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,c=(a=a.relatedTarget||a.toElement)&&a.point&&a.point.series;if(b&&!b.options.stickyTracking&&!this.inClass(a,"highcharts-tooltip")&&c!==b)b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,
|
||||
e=b.plotTop;a=this.normalize(a);a.cancelBubble=!0;b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(B(c.series,"click",v(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(v(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&B(b,"click",a)))},setDOMEvents:function(){var a=this,b=a.chart.container;b.onmousedown=function(b){a.onContainerMouseDown(b)};b.onmousemove=function(b){a.onContainerMouseMove(b)};b.onclick=function(b){a.onContainerClick(b)};F(b,"mouseleave",
|
||||
a.onContainerMouseLeave);1===Ha&&F(y,"mouseup",a.onDocumentMouseUp);Ga&&(b.ontouchstart=function(b){a.onContainerTouchStart(b)},b.ontouchmove=function(b){a.onContainerTouchMove(b)},1===Ha&&F(y,"touchend",a.onDocumentTouchEnd))},destroy:function(){var a;L(this.chart.container,"mouseleave",this.onContainerMouseLeave);Ha||(L(y,"mouseup",this.onDocumentMouseUp),L(y,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(a in this)this[a]=null}};var Za=U.Legend=function(a,b){this.init(a,
|
||||
b)};Za.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=n(b.padding,8),f=b.itemMarginTop||0;this.options=b;b.enabled&&(c.itemStyle=d,c.itemHiddenStyle=G(d,b.itemHiddenStyle),c.itemMarginTop=f,c.padding=e,c.initialItemX=e,c.initialItemY=e-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.lastLineHeight=0,c.symbolWidth=n(b.symbolWidth,16),c.pages=[],c.render(),F(c.chart,"endResize",function(){c.positionCheckboxes()}))},colorizeItem:function(a,b){var c=this.options,d=a.legendItem,e=a.legendLine,
|
||||
f=a.legendSymbol,g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.legendColor||a.color||"#CCC":g,g=a.options&&a.options.marker,k={fill:h},l;d&&d.css({fill:c,color:c});e&&e.attr({stroke:h});if(f){if(g&&f.isMarker)for(l in k.stroke=h,g=a.convertAttribs(g),g)d=g[l],d!==u&&(k[l]=d);f.attr(k)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;a.legendGroup&&a.legendGroup.translate(b?e:this.legendWidth-e-2*c-4,d);f&&(f.x=e,f.y=
|
||||
d)},destroyItem:function(a){var b=a.checkbox;t(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});b&&Na(a.checkbox)},destroy:function(){var a=this.group,b=this.box;b&&(this.box=b.destroy());a&&(this.group=a.destroy())},positionCheckboxes:function(a){var b=this.group.alignAttr,c,d=this.clipHeight||this.legendHeight;b&&(c=b.translateY,t(this.allItems,function(e){var f=e.checkbox,g;f&&(g=c+f.y+(a||0)+3,J(f,{left:b.translateX+e.checkboxOffset+f.x-20+"px",
|
||||
top:g+"px",display:g>c-6&&g<c+d-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},renderItem:function(a){var b=this.chart,c=b.renderer,d=this.options,e="horizontal"===d.layout,f=this.symbolWidth,
|
||||
g=d.symbolPadding,h=this.itemStyle,k=this.itemHiddenStyle,l=this.padding,m=e?n(d.itemDistance,20):0,q=!d.rtl,r=d.width,p=d.itemMarginBottom||0,t=this.itemMarginTop,D=this.initialItemX,u=a.legendItem,v=a.series&&a.series.drawLegendSymbol?a.series:a,w=v.options,w=this.createCheckboxForItem&&w&&w.showCheckbox,y=d.useHTML;u||(a.legendGroup=c.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),a.legendItem=u=c.text(d.labelFormat?ua(d.labelFormat,a):d.labelFormatter.call(a),q?f+g:-g,this.baseline||
|
||||
0,y).css(G(a.visible?h:k)).attr({align:q?"left":"right",zIndex:2}).add(a.legendGroup),this.baseline||(this.baseline=c.fontMetrics(h.fontSize,u).f+3+t,u.attr("y",this.baseline)),v.drawLegendSymbol(this,a),this.setItemEvents&&this.setItemEvents(a,u,y,h,k),this.colorizeItem(a,a.visible),w&&this.createCheckboxForItem(a));c=u.getBBox();f=a.checkboxOffset=d.itemWidth||a.legendItemWidth||f+g+c.width+m+(w?20:0);this.itemHeight=g=A(a.legendItemHeight||c.height);e&&this.itemX-D+f>(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?0<g&&0<h&&(k[k.isNew?"attr":"animate"](k.crisp({width:g,height:h})),k.isNew=!1):(a.box=k=c.rect(0,0,g,h,l.borderRadius,q||0).attr({stroke:l.borderColor,"stroke-width":q||0,fill:r||"none"}).add(d).shadow(l.shadow),k.isNew=!0),k[f?"show":"hide"]();a.legendWidth=g;a.legendHeight=h;t(e,function(b){a.positionItem(b)});
|
||||
f&&d.align(v({width:g,height:h},l),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+("top"===e.verticalAlign?-f:f)-this.padding,g=e.maxHeight,h,k=this.clipRect,l=e.navigation,m=n(l.animation,!0),q=l.arrowSize||12,r=this.nav,p=this.pages,u,D=this.allItems;"horizontal"===e.layout&&(f/=2);g&&(f=T(f,g));p.length=0;a>f&&!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);0<e&&(b!==u&&(S=n(b,this.chart.animation)),this.nav.attr({translateX:l,
|
||||
translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:1===e?g:h}).css({cursor:1===e?"default":"pointer"}),k.attr({text:e+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,fill:e===d?g:h}).css({cursor:e===d?"default":"pointer"}),c=-c[e-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=e,this.positionCheckboxes(c))}};var Lb=U.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.options.symbolHeight||12;b.legendSymbol=this.chart.renderer.rect(0,
|
||||
a.baseline-5-c/2,a.symbolWidth,c,a.options.symbolRadius||0).attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var b=this.options,c=b.marker,d;d=a.symbolWidth;var e=this.chart.renderer,f=this.legendGroup;a=a.baseline-A(.3*e.fontMetrics(a.options.itemStyle.fontSize,this.legendItem).b);var g;b.lineWidth&&(g={"stroke-width":b.lineWidth},b.dashStyle&&(g.dashstyle=b.dashStyle),this.legendLine=e.path(["M",0,a,"L",d,a]).attr(g).add(f));c&&!1!==c.enabled&&(b=c.radius,this.legendSymbol=d=e.symbol(this.symbol,
|
||||
d/2-b,a-b,2*b,2*b).add(f),d.isMarker=!0)}};(/Trident\/7\.0/.test(na)||Ta)&&bb(Za.prototype,"positionItem",function(a,b){var c=this,d=function(){b._legendItemPos&&a.call(c,b)};d();setTimeout(d)});Ea.prototype={init:function(a,b){var c,d=a.series;a.series=null;c=G(M,a);c.series=a.series=d;this.userOptions=a;d=c.chart;this.margin=this.splashArray("margin",d);this.spacing=this.splashArray("spacing",d);var e=d.events;this.bounds={h:{},v:{}};this.callback=b;this.isResizing=0;this.options=c;this.axes=[];
|
||||
this.series=[];this.hasCartesianSeries=d.showAxes;var f=this,g;f.index=Y.length;Y.push(f);Ha++;!1!==d.reflow&&F(f,"load",function(){f.initReflow()});if(e)for(g in e)F(f,g,e[g]);f.xAxis=[];f.yAxis=[];f.animation=ca?!1:n(d.animation,!0);f.pointCount=f.colorCounter=f.symbolCounter=0;f.firstRender()},initSeries:function(a){var b=this.options.chart;(b=P[a.type||b.type||b.defaultSeriesType])||aa(17,!0);b=new b;b.init(this,a);return b},isInsidePlot:function(a,b,c){var d=c?b:a;a=c?a:b;return 0<=d&&d<=this.plotWidth&&
|
||||
0<=a&&a<=this.plotHeight},adjustTickAmounts:function(){!1!==this.options.chart.alignTicks&&t(this.axes,function(a){a.adjustTickAmount()});this.maxTicks=null},redraw:function(a){var b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,g,h,k=this.hasCartesianSeries,l=this.isDirtyBox,m=c.length,q=m,r=this.renderer,p=r.isHidden(),u=[];S=n(a,this.animation);p&&this.cloneRenderTo();for(this.layOutTitles();q--;)if(a=c[q],a.options.stacking&&(g=!0,a.isDirty)){h=!0;break}if(h)for(q=
|
||||
m;q--;)a=c[q],a.options.stacking&&(a.isDirty=!0);t(c,function(a){a.isDirty&&"point"===a.options.legendType&&(f=!0)});f&&e.options.enabled&&(e.render(),this.isDirtyLegend=!1);g&&this.getStacks();k&&(this.isResizing||(this.maxTicks=null,t(b,function(a){a.setScale()})),this.adjustTickAmounts());this.getMargins();k&&(t(b,function(a){a.isDirty&&(l=!0)}),t(b,function(a){a.isDirtyExtremes&&(a.isDirtyExtremes=!1,u.push(function(){B(a,"afterSetExtremes",v(a.eventArgs,a.getExtremes()));delete a.eventArgs}));
|
||||
(l||g)&&a.redraw()}));l&&this.drawChartBox();t(c,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()});d&&d.reset(!0);r.draw();B(this,"redraw");p&&this.cloneRenderTo(!0);t(u,function(a){a.call()})},get:function(a){var b=this.axes,c=this.series,d,e;for(d=0;d<b.length;d++)if(b[d].options.id===a)return b[d];for(d=0;d<c.length;d++)if(c[d].options.id===a)return c[d];for(d=0;d<c.length;d++)for(e=c[d].points||[],b=0;b<e.length;b++)if(e[b].id===a)return e[b];return null},getAxes:function(){var a=
|
||||
this,b=this.options,c=b.xAxis=ea(b.xAxis||{}),b=b.yAxis=ea(b.yAxis||{});t(c,function(a,b){a.index=b;a.isX=!0});t(b,function(a,b){a.index=b});c=c.concat(b);t(c,function(b){new ma(a,b)});a.adjustTickAmounts()},getSelectedPoints:function(){var a=[];t(this.series,function(b){a=a.concat(jb(b.points||[],function(a){return a.selected}))});return a},getSelectedSeries:function(){return jb(this.series,function(a){return a.selected})},getStacks:function(){var a=this;t(a.yAxis,function(a){a.stacks&&a.hasVisibleSeries&&
|
||||
(a.oldStacks=a.stacks)});t(a.series,function(b){!b.options.stacking||!0!==b.visible&&!1!==a.options.chart.ignoreHiddenSeries||(b.stackKey=b.type+n(b.options.stack,""))})},setTitle:function(a,b,c){var d=this,e=d.options,f;f=e.title=G(e.title,a);e=e.subtitle=G(e.subtitle,b);t([["title",a,f],["subtitle",b,e]],function(a){var b=a[0],c=d[b],e=a[1];a=a[2];c&&e&&(d[b]=c=c.destroy());a&&a.text&&!c&&(d[b]=d.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+b,zIndex:a.zIndex||4}).css(a.style).add())});
|
||||
d.layOutTitles(c)},layOutTitles:function(a){var b=0,c=this.title,d=this.subtitle,e=this.options,f=e.title,e=e.subtitle,g=this.renderer,h=this.spacingBox.width-44;c&&(c.css({width:(f.width||h)+"px"}).align(v({y:g.fontMetrics(f.style.fontSize,c).b-3},f),!1,"spacingBox"),f.floating||f.verticalAlign||(b=c.getBBox().height));d&&(d.css({width:(e.width||h)+"px"}).align(v({y:b+(f.margin-13)+g.fontMetrics(f.style.fontSize,d).b},e),!1,"spacingBox"),e.floating||e.verticalAlign||(b=ya(b+d.getBBox().height)));
|
||||
c=this.titleOffset!==b;this.titleOffset=b;!this.isDirtyBox&&c&&(this.isDirtyBox=c,this.hasRendered&&n(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a=this.options.chart,b=a.width,a=a.height,c=this.renderToClone||this.renderTo;w(b)||(this.containerWidth=Va(c,"width"));w(a)||(this.containerHeight=Va(c,"height"));this.chartWidth=x(0,b||this.containerWidth||600);this.chartHeight=x(0,n(a,19<this.containerHeight?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,
|
||||
c=this.container;a?b&&(this.renderTo.appendChild(c),Na(b),delete this.renderToClone):(c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),J(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),y.body.appendChild(b),c&&b.appendChild(c))},getContainer:function(){var a,b=this.options.chart,c,d,e;this.renderTo=a=b.renderTo;e="highcharts-"+hb++;pa(a)&&(this.renderTo=a=y.getElementById(a));
|
||||
a||aa(13,!0);c=E(N(a,"data-highcharts-chart"));!isNaN(c)&&Y[c]&&Y[c].hasRendered&&Y[c].destroy();N(a,"data-highcharts-chart",this.index);a.innerHTML="";b.skipClone||a.offsetWidth||this.cloneRenderTo();this.getChartSize();c=this.chartWidth;d=this.chartHeight;this.container=a=ja("div",{className:"highcharts-container"+(b.className?" "+b.className:""),id:e},v({position:"relative",overflow:"hidden",width:c+"px",height:d+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},
|
||||
b.style),this.renderToClone||a);this._cursor=a.style.cursor;this.renderer=b.forExport?new Ja(a,c,d,b.style,!0):new Ja(a,c,d,b.style);ca&&this.renderer.create(this,a,c,d)},getMargins:function(){var a=this.spacing,b,c=this.legend,d=this.margin,e=this.options.legend,f=n(e.margin,20),g=e.x,h=e.y,k=e.align,l=e.verticalAlign,m=this.titleOffset;this.resetMargins();b=this.axisOffset;m&&!w(d[0])&&(this.plotTop=x(this.plotTop,m+this.options.title.margin+a[0]));c.display&&!e.floating&&("right"===k?w(d[1])||
|
||||
(this.marginRight=x(this.marginRight,c.legendWidth-g+f+a[1])):"left"===k?w(d[3])||(this.plotLeft=x(this.plotLeft,c.legendWidth+g+f+a[3])):"top"===l?w(d[0])||(this.plotTop=x(this.plotTop,c.legendHeight+h+f+a[0])):"bottom"!==l||w(d[2])||(this.marginBottom=x(this.marginBottom,c.legendHeight-h+f+a[2])));this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);this.hasCartesianSeries&&t(this.axes,function(a){a.getOffset()});w(d[3])||(this.plotLeft+=
|
||||
b[3]);w(d[0])||(this.plotTop+=b[0]);w(d[2])||(this.marginBottom+=b[2]);w(d[1])||(this.marginRight+=b[1]);this.setChartSize()},reflow:function(a){var b=this,c=b.options.chart,d=b.renderTo,e=c.width||Va(d,"width"),f=c.height||Va(d,"height"),c=a?a.target:I,d=function(){b.container&&(b.setSize(e,f,!1),b.hasUserSize=null)};if(!b.hasUserSize&&e&&f&&(c===I||c===y)){if(e!==b.containerWidth||f!==b.containerHeight)clearTimeout(b.reflowTimeout),a?b.reflowTimeout=setTimeout(d,100):d();b.containerWidth=e;b.containerHeight=
|
||||
f}},initReflow:function(){var a=this,b=function(b){a.reflow(b)};F(I,"resize",b);F(a,"destroy",function(){L(I,"resize",b)})},setSize:function(a,b,c){var d=this,e,f,g;d.isResizing+=1;g=function(){d&&B(d,"endResize",null,function(){--d.isResizing})};S=n(c,d.animation);d.oldChartHeight=d.chartHeight;d.oldChartWidth=d.chartWidth;w(a)&&(d.chartWidth=e=x(0,A(a)),d.hasUserSize=!!e);w(b)&&(d.chartHeight=f=x(0,A(b)));(S?Wa:J)(d.container,{width:e+"px",height:f+"px"},S);d.setChartSize(!0);d.renderer.setSize(e,
|
||||
f,c);d.maxTicks=null;t(d.axes,function(a){a.isDirty=!0;a.setScale()});t(d.series,function(a){a.isDirty=!0});d.isDirtyLegend=!0;d.isDirtyBox=!0;d.layOutTitles();d.getMargins();d.redraw(c);d.oldChartHeight=null;B(d,"resize");!1===S?g():setTimeout(g,S&&S.duration||500)},setChartSize:function(a){var b=this.inverted,c=this.renderer,d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,h=this.clipOffset,k,l,m,q;this.plotLeft=k=A(this.plotLeft);this.plotTop=l=A(this.plotTop);this.plotWidth=
|
||||
m=x(0,A(d-k-this.marginRight));this.plotHeight=q=x(0,A(e-l-this.marginBottom));this.plotSizeX=b?q:m;this.plotSizeY=b?m:q;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]};this.plotBox=c.plotBox={x:k,y:l,width:m,height:q};d=2*K(this.plotBorderWidth/2);b=ya(x(d,h[3])/2);c=ya(x(d,h[0])/2);this.clipBox={x:b,y:c,width:K(this.plotSizeX-x(d,h[1])/2-b),height:x(0,K(this.plotSizeY-x(d,h[2])/2-c))};a||t(this.axes,function(a){a.setAxisSize();
|
||||
a.setAxisTranslation()})},resetMargins:function(){var a=this.spacing,b=this.margin;this.plotTop=n(b[0],a[0]);this.marginRight=n(b[1],a[1]);this.marginBottom=n(b[2],a[2]);this.plotLeft=n(b[3],a[3]);this.axisOffset=[0,0,0,0];this.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,g=this.plotBorder,h=this.plotBGImage,k=a.borderWidth||0,l=a.backgroundColor,m=a.plotBackgroundColor,q=a.plotBackgroundImage,
|
||||
r=a.plotBorderWidth||0,p,n=this.plotLeft,t=this.plotTop,u=this.plotWidth,v=this.plotHeight,w=this.plotBox,x=this.clipRect,A=this.clipBox;p=k+(a.shadow?8:0);if(k||l)e?e.animate(e.crisp({width:c-p,height:d-p})):(e={fill:l||"none"},k&&(e.stroke=a.borderColor,e["stroke-width"]=k),this.chartBackground=b.rect(p/2,p/2,c-p,d-p,a.borderRadius,k).attr(e).addClass("highcharts-background").add().shadow(a.shadow));m&&(f?f.animate(w):this.plotBackground=b.rect(n,t,u,v,0).attr({fill:m}).add().shadow(a.plotShadow));
|
||||
q&&(h?h.animate(w):this.plotBGImage=b.image(q,n,t,u,v).add());x?x.animate({width:A.width,height:A.height}):this.clipRect=b.clipRect(A);r&&(g?g.animate(g.crisp({x:n,y:t,width:u,height:v,strokeWidth:-r})):this.plotBorder=b.rect(n,t,u,v,0,-r).attr({stroke:a.plotBorderColor,"stroke-width":r,fill:"none",zIndex:1}).add());this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart,c,d=a.options.series,e,f;t(["inverted","angular","polar"],function(g){c=P[b.type||b.defaultSeriesType];f=a[g]||
|
||||
b[g]||c&&c.prototype[g];for(e=d&&d.length;!f&&e--;)(c=P[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=this,b=a.series;t(b,function(a){a.linkedSeries.length=0});t(b,function(b){var d=b.options.linkedTo;pa(d)&&(d=":previous"===d?a.series[b.index-1]:a.get(d))&&(d.linkedSeries.push(b),b.linkedParent=d)})},renderSeries:function(){t(this.series,function(a){a.translate();a.setTooltipPoints&&a.setTooltipPoints();a.render()})},renderLabels:function(){var a=this,b=a.options.labels;
|
||||
b.items&&t(b.items,function(c){var d=v(b.style,c.style),e=E(d.left)+a.plotLeft,f=E(d.top)+a.plotTop+12;delete d.left;delete d.top;a.renderer.text(c.html,e,f).attr({zIndex:2}).css(d).add()})},render:function(){var a=this.axes,b=this.renderer,c=this.options;this.setTitle();this.legend=new Za(this,c.legend);this.getStacks();t(a,function(a){a.setScale()});this.getMargins();this.maxTicks=null;t(a,function(a){a.setTickPositions(!0);a.setMaxTicks()});this.adjustTickAmounts();this.getMargins();this.drawChartBox();
|
||||
this.hasCartesianSeries&&t(a,function(a){a.render()});this.seriesGroup||(this.seriesGroup=b.g("series-group").attr({zIndex:3}).add());this.renderSeries();this.renderLabels();this.showCredits(c.credits);this.hasRendered=!0},showCredits:function(a){a.enabled&&!this.credits&&(this.credits=this.renderer.text(a.text,0,0).on("click",function(){a.href&&(location.href=a.href)}).attr({align:a.position.align,zIndex:8}).css(a.style).add().align(a.position))},destroy:function(){var a=this,b=a.axes,c=a.series,
|
||||
d=a.container,e,f=d&&d.parentNode;B(a,"destroy");Y[a.index]=u;Ha--;a.renderTo.removeAttribute("data-highcharts-chart");L(a);for(e=b.length;e--;)b[e]=b[e].destroy();for(e=c.length;e--;)c[e]=c[e].destroy();t("title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer scroller rangeSelector legend resetZoomButton tooltip renderer".split(" "),function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())});d&&(d.innerHTML="",L(d),f&&Na(d));for(e in a)delete a[e]},
|
||||
isReadyToRender:function(){var a=this;return!Z&&I==I.top&&"complete"!==y.readyState||ca&&!I.canvg?(ca?CanVGController.push(function(){a.firstRender()},a.options.global.canvasToolsURL):y.attachEvent("onreadystatechange",function(){y.detachEvent("onreadystatechange",a.firstRender);"complete"===y.readyState&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options,c=a.callback;a.isReadyToRender()&&(a.getContainer(),B(a,"init"),a.resetMargins(),a.setChartSize(),a.propFromSeries(),a.getAxes(),
|
||||
t(b.series||[],function(b){a.initSeries(b)}),a.linkSeries(),B(a,"beforeRender"),U.Pointer&&(a.pointer=new Ab(a,b)),a.render(),a.renderer.draw(),c&&c.apply(a,[a]),t(a.callbacks,function(b){b.apply(a,[a])}),a.cloneRenderTo(!0),B(a,"load"))},splashArray:function(a,b){var c=b[a],c=da(c)?c:[c,c,c,c];return[n(b[a+"Top"],c[0]),n(b[a+"Right"],c[1]),n(b[a+"Bottom"],c[2]),n(b[a+"Left"],c[3])]}};Ea.prototype.callbacks=[];var Ca=function(){};Ca.prototype={init:function(a,b,c){this.series=a;this.applyOptions(b,
|
||||
c);this.pointAttr={};a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter++],a.colorCounter===b.length&&(a.colorCounter=0));a.chart.pointCount++;return this},applyOptions:function(a,b){var c=this.series,d=c.options.pointValKey||c.pointValKey;a=Ca.prototype.optionsToObject.call(this,a);v(this,a);this.options=this.options?v(this.options,a):a;d&&(this.y=this[d]);this.x===u&&c&&(this.x=b===u?c.autoIncrement():b);return this},optionsToObject:function(a){var b=
|
||||
{},c=this.series,d=c.pointArrayMap||["y"],e=d.length,f=0,g=0;if("number"===typeof a||null===a)b[d[0]]=a;else if(ta(a))for(a.length>e&&(c=typeof a[0],"string"===c?b.name=a[0]:"number"===c&&(b.x=a[0]),f++);g<e;)b[d[g++]]=a[f++];else"object"===typeof a&&(b=a,a.dataLabels&&(c._hasPointLabels=!0),a.marker&&(c._hasPointMarkers=!0));return b},destroy:function(){var a=this.series.chart,b=a.hoverPoints,c;a.pointCount--;b&&(this.setState(),qa(b,this),b.length||(a.hoverPoints=null));if(this===a.hoverPoint)this.onMouseOut();
|
||||
if(this.graphic||this.dataLabel)L(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(c in this)this[c]=null},destroyElements:function(){for(var a="graphic dataLabel dataLabelUpper group connector shadowGroup".split(" "),b,c=6;c--;)b=a[c],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var b=
|
||||
this.series,c=b.tooltipOptions,d=n(c.valueDecimals,""),e=c.valuePrefix||"",f=c.valueSuffix||"";t(b.pointArrayMap||["y"],function(b){b="{point."+b;if(e||f)a=a.replace(b+"}",e+b+"}"+f);a=a.replace(b+"}",b+":,."+d+"f}")});return ua(a,{point:this,series:this.series})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])&&this.importEvents();"click"===a&&e.allowPointSelect&&(c=function(a){d.select(null,a.ctrlKey||a.metaKey||
|
||||
a.shiftKey)});B(this,a,b,c)}};var fa=function(){};fa.prototype={isCartesian:!0,type:"line",pointClass:Ca,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(a,b){var c=this,d,e,f=a.series,g=function(a,b){return n(a.options.index,a._i)-n(b.options.index,b._i)};c.chart=a;c.options=b=c.setOptions(b);c.linkedSeries=[];c.bindAxes();v(c,{name:b.name,state:"",
|
||||
pointAttr:{},visible:!1!==b.visible,selected:!0===b.selected});ca&&(b.animation=!1);e=b.events;for(d in e)F(c,d,e[d]);if(e&&e.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=!0;c.getColor();c.getSymbol();t(c.parallelArrays,function(a){c[a+"Data"]=[]});c.setData(b.data,!1);c.isCartesian&&(a.hasCartesianSeries=!0);f.push(c);c._i=f.length-1;cb(f,g);this.yAxis&&cb(this.yAxis.series,g);t(f,function(a,b){a.index=b;a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var a=
|
||||
this,b=a.options,c=a.chart,d;t(a.axisTypes||[],function(e){t(c[e],function(c){d=c.options;if(b[e]===d.index||b[e]!==u&&b[e]===d.id||b[e]===u&&0===d.index)c.series.push(a),a[e]=c,c.isDirty=!0});a[e]||a.optionalAxis===e||aa(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,d=arguments;t(c.parallelArrays,"number"===typeof 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))})},autoIncrement:function(){var a=
|
||||
this.options,b=this.xIncrement,b=n(b,a.pointStart,0);this.pointInterval=n(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},getSegments:function(){var a=-1,b=[],c,d=this.points,e=d.length;if(e)if(this.options.connectNulls){for(c=e;c--;)null===d[c].y&&d.splice(c,1);d.length&&(b=[d])}else t(d,function(c,g){null===c.y?(g>a+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&&c<h;)m=a[c],c++;if(ga(m)){r=n(k.pointStart,0);k=n(k.pointInterval,1);for(c=0;c<h;c++)D[c]=r,w[c]=a[c],r+=k;e.xIncrement=r}else if(ta(m))if(x)for(c=0;c<h;c++)k=a[c],D[c]=k[0],w[c]=k.slice(1,x+1);else for(c=0;c<h;c++)k=a[c],D[c]=k[0],w[c]=k[1];else aa(12)}else for(c=0;c<h;c++)a[c]!==u&&(k={series:e},
|
||||
e.pointClass.prototype.applyOptions.apply(k,[a[c]]),e.updateParallelArrays(k,c),r&&k.name&&(q.names[k.x]=k.name));pa(w[0])&&aa(14,!0);e.data=[];e.options.data=a;for(c=g;c--;)f[c]&&f[c].destroy&&f[c].destroy();p&&(p.length=0);q&&(q.minRange=q.userMinRange);e.isDirty=e.isDirtyData=l.isDirtyBox=!0;c=!1}else t(a,function(a,b){f[b].update(a,!1,null,!1)});b&&l.redraw(c)},processData:function(a){var b=this.xData,c=this.yData,d=b.length,e;e=0;var f,g,h=this.xAxis,k,l=this.options;k=l.cropThreshold;var m=
|
||||
0,q=this.isCartesian,r,p;if(q&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;h&&(r=h.getExtremes(),p=r.min,r=r.max);if(q&&this.sorted&&(!k||d>k||this.forceCrop))if(b[d-1]<p||b[0]>r)b=[],c=[];else if(b[0]<p||b[d-1]>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]<r&&m++,0<d&&(g===u||d<g)?g=d:0>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<e;k++)if(a[k]>=c){f=x(0,k-h);break}for(;k<e;k++)if(a[k]>d){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;r++)k=h+r,l?q[r]=(new f).init(this,[d[r]].concat(ea(e[r]))):(b[k]?m=b[k]:a[k]!==u&&(b[k]=m=(new f).init(this,a[k],d[r])),q[r]=m),q[r].index=k;if(b&&(g!==(c=b.length)||l))for(r=0;r<c;r++)r!==h||l||(r+=g),b[r]&&(b[r].destroyElements(),b[r].plotX=u);this.data=b;this.points=q},getExtremes:function(a){var b=this.yAxis,c=this.processedXData,d,e=[],f=0;d=this.xAxis.getExtremes();var g=d.min,h=d.max,k,l,m,q;a=a||this.stackedYData||this.processedYData;
|
||||
d=a.length;for(q=0;q<d;q++)if(l=c[q],m=a[q],k=null!==m&&m!==u&&(!b.isLog||m.length||0<m),l=this.getExtremesFromAll||this.cropped||(c[q+1]||l)>=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<g;a++){var q=f[a],r=q.x,p=q.y,t=q.low,v=b&&e.stacks[(this.negStacks&&p<m?"-":"")+this.stackKey];e.isLog&&0>=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&&(0<h||l)&&(g.graphic=c.renderer.symbol(k,d-h,e-h,2*h,2*h,t?p:q).attr(a).add(x))):m&&(g.graphic=m.destroy())},convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={};a=a||{};b=b||{};c=c||{};d=d||{};for(f in e)g=e[f],h[f]=n(a[g],b[f],c[f],d[f]);return h},getAttribs:function(){var a=
|
||||
this,b=a.options,c=Ya[a.type].marker?b.marker:b,d=c.states,e=d.hover,f,g=a.color;f={stroke:g,fill:g};var h=a.points||[],k,l=[],m,q=a.pointAttrToOptions;m=a.hasPointSpecificOptions;var r=b.negativeColor,p=c.lineColor,n=c.fillColor;k=b.turboThreshold;var u;b.marker?(e.radius=e.radius||c.radius+e.radiusPlus,e.lineWidth=e.lineWidth||c.lineWidth+e.lineWidthPlus):e.color=e.color||za(e.color||g).brighten(e.brightness).get();l[""]=a.convertAttribs(c,f);t(["hover","select"],function(b){l[b]=a.convertAttribs(d[b],
|
||||
l[""])});a.pointAttr=l;g=h.length;if(!k||g<k||m)for(;g--;){k=h[g];(c=k.options&&k.options.marker||k.options)&&!1===c.enabled&&(c.radius=0);k.negative&&r&&(k.color=k.fillColor=r);m=b.colorByPoint||k.color;if(k.options)for(u in q)w(c[q[u]])&&(m=!0);m?(c=c||{},m=[],d=c.states||{},f=d.hover=d.hover||{},b.marker||(f.color=f.color||!k.options.color&&e.color||za(k.color).brighten(f.brightness||e.brightness).get()),f={color:k.color},n||(f.fillColor=k.color),p||(f.lineColor=k.color),m[""]=a.convertAttribs(v(f,
|
||||
c),l[""]),m.hover=a.convertAttribs(d.hover,l.hover,m[""]),m.select=a.convertAttribs(d.select,l.select,m[""])):m=l;k.pointAttr=m}},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(na),d,e,f=a.data||[],g,h,k;B(a,"destroy");L(a);t(a.axisTypes||[],function(b){if(k=a[b])qa(k.series,a),k.isDirty=k.forceRedraw=!0});a.legendItem&&a.chart.legend.destroyItem(a);for(e=f.length;e--;)(g=f[e])&&g.destroy&&g.destroy();a.points=null;clearTimeout(a.animationTimeout);t("area graph dataLabelsGroup group markerGroup tracker graphNeg areaNeg posClip negClip".split(" "),
|
||||
function(b){a[b]&&(d=c&&"group"===b?"hide":"destroy",a[b][d]())});b.hoverSeries===a&&(b.hoverSeries=null);qa(b.series,a);for(h in a)delete a[h]},getSegmentPath:function(a){var b=this,c=[],d=b.options.step;t(a,function(e,f){var g=e.plotX,h=e.plotY,k;b.getPointSpline?c.push.apply(c,b.getPointSpline(a,e,f)):(c.push(f?"L":"M"),d&&f&&(k=a[f-1],"right"===d?c.push(k.plotX,h):"center"===d?c.push((k.plotX+g)/2,k.plotY,(k.plotX+g)/2,h):c.push(g,k.plotY)),c.push(e.plotX,e.plotY))});return c},getGraphPath:function(){var a=
|
||||
this,b=[],c,d=[];t(a.segments,function(e){c=a.getSegmentPath(e);1<e.length?b=b.concat(c):d.push(e[0])});a.singlePoints=d;return a.graphPath=b},drawGraph:function(){var a=this,b=this.options,c=[["graph",b.lineColor||this.color]],d=b.lineWidth,e=b.dashStyle,f="square"!==b.linecap,g=this.getGraphPath(),h=b.negativeColor;h&&c.push(["graphNeg",h]);t(c,function(c,h){var m=c[0],q=a[m];q?(Xa(q),q.animate({d:g})):d&&g.length&&(q={stroke:c[1],"stroke-width":d,fill:"none",zIndex:1},e?q.dashstyle=e:f&&(q["stroke-linecap"]=
|
||||
q["stroke-linejoin"]="round"),a[m]=a.chart.renderer.path(g).attr(q).add(a.group).shadow(!h&&b.shadow))})},clipNeg:function(){var a=this.options,b=this.chart,c=b.renderer,d=a.negativeColor||a.negativeFillColor,e,f=this.graph,g=this.area,h=this.posClip,k=this.negClip;e=b.chartWidth;var l=b.chartHeight,m=x(e,l),q=this.yAxis;d&&(f||g)&&(d=A(q.toPixels(a.threshold||0,!0)),0>d&&(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&&g<p[h-1])for(r=!0;h&&p[h-1]>g;)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=0<r,y,z,B,G=[[],[]],E,F,N,M,C,I=[0,0,0,0],R=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){fa.prototype.drawDataLabels.apply(a);t(b,function(a){a.dataLabel&&a.visible&&G[a.half].push(a)});for(M=2;M--;){var K=[],P=[],J=G[M],O=J.length,L;if(O){a.sortByAngle(J,M-.5);for(C=b=0;!b&&J[C];)b=J[C]&&J[C].dataLabel&&(J[C].dataLabel.getBBox().height||21),C++;if(0<r){z=T(v+u+r,d.plotHeight);
|
||||
for(C=x(0,v-u-r);C<=z;C+=b)K.push(C);z=K.length;if(O>z){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;C<O;C++){c=J[C];B=c.labelPos;c=9999;var U,S;for(S=0;S<z;S++)U=X(K[S]-B[1]),U<c&&(c=U,L=S);if(L<C&&null!==K[C])L=C;else for(z<O-C+L&&null!==K[C]&&(L=z-O+C);null===K[L];)L++;P.push({i:L,y:K[L]});K[L]=null}P.sort(R)}for(C=0;C<O;C++){c=J[C];B=c.labelPos;y=c.dataLabel;N=!1===c.visible?"hidden":"visible";c=B[1];if(0<r){if(z=P.pop(),L=z.i,F=
|
||||
z.y,c>F&&null!==K[L+1]||c<F&&null!==K[L-1])F=T(x(0,c),d.plotHeight)}else F=c;E=e.justify?p[0]+(M?-1:1)*(u+r):a.getX(F===v-u-r||F===v+u+r?c:F,M);y._attr={visibility:N,align:B[6]};y._pos={x:E+e.x+({left:f,right:-f}[B[6]]||0),y:F+e.y-10};y.connX=E;y.connY=F;null===this.options.size&&(z=y.width,E-z<f?I[3]=x(A(z-E+f),I[3]):E+z>h-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);e<b[2]?(b[2]=e,this.translate(b),
|
||||
t(this.points,function(a){a.dataLabel&&(a.dataLabel._pos=null)}),this.drawDataLabels&&this.drawDataLabels()):f=!0;return f});P.column&&(P.column.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=a.dlBox||a.shapeArgs,k=a.below||a.plotY>n(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;n<m.length;n++)e=m[n],d.push("M",e.plotX-k,e.plotY,"L",e.plotX+k,e.plotY);l?l.attr({d:d}):(a.tracker=h.path(d).attr({"stroke-linejoin":"round",visibility:a.visible?"visible":"hidden",stroke:u,fill:c?u:"none","stroke-width":b.lineWidth+(c?0:2*k),zIndex:2}).add(a.group),t([a.tracker,
|
||||
a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",p).on("mouseout",function(a){g.onTrackerMouseOut(a)}).css(q);if(Ga)a.on("touchstart",p)}))}};P.column&&(ColumnSeries.prototype.drawTracker=$a.drawTrackerPoint);P.pie&&(P.pie.prototype.drawTracker=$a.drawTrackerPoint);P.scatter&&(ScatterSeries.prototype.drawTracker=$a.drawTrackerPoint);v(Za.prototype,{setItemEvents:function(a,b,c,d,e){var f=this;(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover");b.css(f.options.itemHoverStyle)}).on("mouseout",
|
||||
function(){b.css(a.visible?d:e);a.setState()}).on("click",function(b){var c=function(){a.setVisible()};b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):B(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=ja("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);F(a.checkbox,"click",function(b){B(a,"checkboxClick",{checked:b.target.checked},function(){a.select()})})}});M.legend.itemStyle.cursor=
|
||||
"pointer";v(Ea.prototype,{showResetZoom:function(){var a=this,b=M.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,f="chart"===c.relativeTo?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,e&&e.hover).attr({align:c.position.align,title:b.resetZoomTitle}).add().align(c.position,!1,f)},zoomOut:function(){var a=this;B(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var b,c=this.pointer,d=!1,e;!a||a.resetSelection?
|
||||
t(this.axes,function(a){b=a.zoom()}):t(a.xAxis.concat(a.yAxis),function(a){var e=a.axis,h=e.isXAxis;if(c[h?"zoomX":"zoomY"]||c[h?"pinchX":"pinchY"])b=e.zoom(a.min,a.max),e.displayBtn&&(d=!0)});e=this.resetZoomButton;d&&!e?this.showResetZoom():!d&&da(e)&&(this.resetZoomButton=e.destroy());b&&this.redraw(n(this.options.chart.animation,a&&a.animation,100>this.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<x(m.dataMax,m.max)&&(h.setExtremes(n,k,!1,!1,{trigger:"pan"}),e=!0);c[b?"mouseDownX":"mouseDownY"]=d});e&&c.redraw(!1);J(c.container,{cursor:"move"})}});v(Ca.prototype,{select:function(a,b){var c=this,d=c.series,e=d.chart;a=n(a,!c.selected);c.firePointEvent(a?"select":"unselect",
|
||||
{accumulate:b},function(){c.selected=c.options.selected=a;d.options.data[Ia(c,d.data)]=c.options;c.setState(a&&"select");b||t(e.getSelectedPoints(),function(a){a.selected&&a!==c&&(a.selected=a.options.selected=!1,d.options.data[Ia(a,d.data)]=a.options,a.setState(""),a.firePointEvent("unselect"))})})},onMouseOver:function(a){var b=this.series,c=b.chart,d=c.tooltip,e=c.hoverPoint;if(e&&e!==this)e.onMouseOut();this.firePointEvent("mouseOver");!d||d.shared&&!b.noSharedTooltip||d.refresh(this,a);this.setState("hover");
|
||||
c.hoverPoint=this},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;this.firePointEvent("mouseOut");b&&-1!==Ia(this,b)||(this.setState(),a.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var a=G(this.series.options.point,this.options).events,b;this.events=a;for(b in a)F(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a,b){var c=this.plotX,d=this.plotY,e=this.series,f=e.options.states,g=Ya[e.type].marker&&e.options.marker,h=g&&!g.enabled,k=g&&g.states[a],
|
||||
l=k&&!1===k.enabled,m=e.stateMarkerGraphic,n=this.marker||{},r=e.chart,p=e.halo,t;a=a||"";t=this.pointAttr[a]||e.pointAttr[a];if(!(a===this.state&&!b||this.selected&&"select"!==a||f[a]&&!1===f[a].enabled||a&&(l||h&&!1===k.enabled)||a&&n.states&&n.states[a]&&!1===n.states[a].enabled)){if(this.graphic)g=g&&this.graphic.symbolName&&t.r,this.graphic.attr(G(t,g?{x:c-g,y:d-g,width:2*g,height:2*g}:{})),m&&m.hide();else{if(a&&k)if(g=k.radius,n=n.symbol||e.symbol,m&&m.currentSymbol!==n&&(m=m.destroy()),m)m[b?
|
||||
"animate":"attr"]({x:c-g,y:d-g});else n&&(e.stateMarkerGraphic=m=r.renderer.symbol(n,c-g,d-g,2*g,2*g).attr(t).add(e.markerGroup),m.currentSymbol=n);if(m)m[a&&r.isInsidePlot(c,d,r.inverted)?"show":"hide"]()}(c=f[a]&&f[a].halo)&&c.size?(p||(e.halo=p=r.renderer.path().add(e.seriesGroup)),p.attr(v({fill:za(this.color||e.color).setOpacity(c.opacity).get()},c.attributes))[b?"animate":"attr"]({d:this.haloPath(c.size)})):p&&p.attr({d:[]});this.state=a}},haloPath:function(a){var b=this.series,c=b.chart,d=
|
||||
b.getPlotBox(),e=c.inverted;return c.renderer.symbols.circle(d.translateX+(e?b.yAxis.len-this.plotY:this.plotX)-a,d.translateY+(e?b.xAxis.len-this.plotX:this.plotY)-a,2*a,2*a)}});v(fa.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&B(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;if(d)d.onMouseOut();this&&a.events.mouseOut&&
|
||||
B(this,"mouseOut");!c||a.stickyTracking||c.shared&&!this.noSharedTooltip||c.hide();this.setState();b.hoverSeries=null},setState:function(a){var b=this.options,c=this.graph,d=this.graphNeg,e=b.states,b=b.lineWidth;a=a||"";this.state!==a&&(this.state=a,e[a]&&!1===e[a].enabled||(a&&(b=e[a].lineWidth||b+(e[a].lineWidthPlus||0)),c&&!c.dashstyle&&(a={"stroke-width":b},c.attr(a),d&&d.attr(a))))},setVisible:function(a,b){var c=this,d=c.chart,e=c.legendItem,f,g=d.options.chart.ignoreHiddenSeries,h=c.visible;
|
||||
f=(c.visible=a=c.userOptions.visible=a===u?!h:a)?"show":"hide";t(["group","dataLabelsGroup","markerGroup","tracker"],function(a){if(c[a])c[a][f]()});if(d.hoverSeries===c)c.onMouseOut();e&&d.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&t(d.series,function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)});t(c.linkedSeries,function(b){b.setVisible(a,!1)});g&&(d.isDirtyBox=!0);!1!==b&&d.redraw();B(c,f)},setTooltipPoints:function(a){var b=[],c,d,e=this.xAxis,f=e&&e.getExtremes(),g=e?e.tooltipLen||
|
||||
e.len:this.chart.plotSizeX,h,k,l=[];if(!1!==this.options.enableMouseTracking&&!this.singularTooltips){a&&(this.tooltipPoints=null);t(this.segments||this.points,function(a){b=b.concat(a)});e&&e.reversed&&(b=b.reverse());this.orderTooltipPoints&&this.orderTooltipPoints(b);a=b.length;for(k=0;k<a;k++)if(e=b[k],c=e.x,c>=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"})})();
|
|
@ -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: "<div id='highchart-container'></div>",
|
||||
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();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue