/* Highcharts JS v7.1.1 (2019-04-09) (c) 2009-2019 Torstein Honsi License: www.highcharts.com/license */ (function(g){"object"===typeof module&&module.exports?(g["default"]=g,module.exports=g):"function"===typeof define&&define.amd?define("highcharts/modules/series-label",["highcharts"],function(p){g(p);g.Highcharts=p;return g}):g("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(g){function p(w,g,t,p){w.hasOwnProperty(g)||(w[g]=p.apply(null,t))}g=g?g._modules:{};p(g,"modules/series-label.src.js",[g["parts/Globals.js"]],function(g){function p(d,c,a,h,e,f){d=(f-c)*(a-d)-(h-c)*(e-d);return 0< d?!0:!(0>d)}function t(d,c,a,h,e,f,b,k){return p(d,c,e,f,b,k)!==p(a,h,e,f,b,k)&&p(d,c,a,h,e,f)!==p(d,c,a,h,b,k)}function w(d,c,a,h,e,f,b,k){return t(d,c,d+a,c,e,f,b,k)||t(d+a,c,d+a,c+h,e,f,b,k)||t(d,c+h,d+a,c+h,e,f,b,k)||t(d,c,d,c+h,e,f,b,k)}function B(d){var c=this,a=Math.max(g.animObject(c.renderer.globalAnimation).duration,250);c.labelSeries=[];c.labelSeriesMaxSum=0;g.clearTimeout(c.seriesLabelTimer);c.series.forEach(function(h){var e=h.options.label,f=h.labelBySeries,b=f&&f.closest;e.enabled&& h.visible&&(h.graph||h.area)&&!h.isSeriesBoosting&&(c.labelSeries.push(h),e.minFontSize&&e.maxFontSize&&(h.sum=h.yData.reduce(function(a,b){return(a||0)+(b||0)},0),c.labelSeriesMaxSum=Math.max(c.labelSeriesMaxSum,h.sum)),"load"===d.type&&(a=Math.max(a,g.animObject(h.options.animation).duration)),b&&(void 0!==b[0].plotX?f.animate({x:b[0].plotX+b[1],y:b[0].plotY+b[2]}):f.attr({opacity:0})))});c.seriesLabelTimer=g.syncTimeout(function(){c.series&&c.labelSeries&&c.drawSeriesLabels()},c.renderer.forExport? 0:a)}var C=g.addEvent,D=g.extend,x=g.isNumber,y=g.pick,z=g.Series,E=g.SVGRenderer,A=g.Chart;g.setOptions({plotOptions:{series:{label:{enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,minFontSize:null,maxFontSize:null,onArea:null,style:{fontWeight:"bold"},boxesToAvoid:[]}}}});E.prototype.symbols.connector=function(d,c,a,h,e){var f=e&&e.anchorX;e=e&&e.anchorY;var b,k,l=a/2;x(f)&&x(e)&&(b=["M",f,e],k=c-e,0>k&&(k=-h-k),kc+h?b.push("L",d+l,c+h):ed+a&&b.push("L",d+a,c+h/2));return b||[]};z.prototype.getPointsOnGraph=function(){function d(a){var b=Math.round(a.plotX/8)+","+Math.round(a.plotY/8);p[b]||(p[b]=1,e.push(a))}if(this.xAxis||this.yAxis){var c=this.points,a,h,e=[],f,b,k,l;b=this.graph||this.area;k=b.element;var g=this.chart.inverted,v=this.xAxis;a=this.yAxis;var r=g?a.pos:v.pos,g=g?v.pos:a.pos,v=y(this.options.label.onArea,!!this.area),m=a.getThreshold(this.options.threshold),p={};if(this.getPointSpline&&k.getPointAtLength&& !v&&c.lengthm.right||nm.bottom||p=d-16&&m[n-1].chartX<=d+a.width+16){if(w(d,c,a.width,a.height,m[n-1].chartX,m[n-1].chartY,m[n].chartX,m[n].chartY))return!1;this===r&&!b&&h&&(b=w(d-16,c-16,a.width+32,a.height+ 32,m[n-1].chartX,m[n-1].chartY,m[n].chartX,m[n].chartY))}!g&&!b||this===r&&!l||(p=d+a.width/2-m[n].chartX,t=c+a.height/2-m[n].chartY,e=Math.min(e,p*p+t*t))}if(!l&&g&&this===r&&(h&&!b||ed&&a<=e-c.width&&b>=m&&b<=m+w-c.height}if(a.xAxis||a.yAxis){var e,f,b,k=[],l,g,p=a.options.label,r=(b=d.inverted)?a.yAxis.pos:a.xAxis.pos,m=b?a.xAxis.pos:a.yAxis.pos,t=d.inverted?a.yAxis.len:a.xAxis.len,w=d.inverted?a.xAxis.len:a.yAxis.len,q=a.interpolatedPoints,n=y(p.onArea,!!a.area),u=a.labelBySeries;e=p.minFontSize;f=p.maxFontSize;var x,z;n&&!b&&(b=[a.xAxis.toPixels(a.xData[0]),a.xAxis.toPixels(a.xData[a.xData.length-1])],x=Math.min.apply(Math,b),z=Math.max.apply(Math,b));if(a.visible&& !a.isSeriesBoosting&&q){u||(a.labelBySeries=u=d.renderer.label(a.name,0,-9999,"connector").addClass("highcharts-series-label highcharts-series-label-"+a.index+" "+(a.options.className||"")).css(D({color:n?d.renderer.getContrast(a.color):a.color},a.options.label.style)),e&&f&&u.css({fontSize:a.labelFontSize(e,f)}),u.attr({padding:0,opacity:d.renderer.forExport?1:0,stroke:a.color,"stroke-width":1,zIndex:3}).add().animate({opacity:1},{duration:200}));e=u.getBBox();e.width=Math.round(e.width);for(g=q.length- 1;0=r;f-=16)for(b=m;b=k&&(q={x:p.x,y:p.y},p={}),a.labelBySeries.attr(D(p,{anchorX:l.connectorPoint&&l.connectorPoint.plotX+ r,anchorY:l.connectorPoint&&l.connectorPoint.plotY+m})).animate(q),a.options.kdNow=!0,a.buildKDTree(),a=a.searchPoint({chartX:l.x,chartY:l.y},!0),u.closest=[a,l.x-a.plotX,l.y-a.plotY]}else u&&(a.labelBySeries=u.destroy())}else u&&(a.labelBySeries=u.destroy())}});g.fireEvent(d,"afterDrawSeriesLabels")};C(A,"load",B);C(A,"redraw",B)});p(g,"masters/modules/series-label.src.js",[],function(){})}); //# sourceMappingURL=series-label.js.map