/*
 Highcharts Gantt JS v8.0.4 (2020-03-10)

 GridAxis

 (c) 2016-2019 Lars A. V. Cabrera

 License: www.highcharts.com/license
*/
(function(e){"object"===typeof module&&module.exports?(e["default"]=e,module.exports=e):"function"===typeof define&&define.amd?define("highcharts/modules/grid-axis",["highcharts"],function(p){e(p);e.Highcharts=p;return e}):e("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(e){function p(e,p,g,h){e.hasOwnProperty(p)||(e[p]=h.apply(null,g))}e=e?e._modules:{};p(e,"parts-gantt/GridAxis.js",[e["parts/Globals.js"],e["parts/Tick.js"],e["parts/Utilities.js"]],function(e,p,g){var h=g.addEvent,
q=g.defined,A=g.erase,E=g.find,B=g.isArray,v=g.isNumber,w=g.merge,x=g.pick,F=g.timeUnits,C=g.wrap,G=e.dateFormat,r=function(a){return g.isObject(a,!0)},H=e.Chart,m=e.Axis,I=function(a){var b=a.options;b.labels||(b.labels={});b.labels.align=x(b.labels.align,"center");a.categories||(b.showLastLabel=!1);a.labelRotation=0;b.labels.rotation=0},y={top:0,right:1,bottom:2,left:3,0:"top",1:"right",2:"bottom",3:"left"};m.prototype.isOuterAxis=function(){var a=this,b=a.columnIndex,c=a.linkedParent&&a.linkedParent.columns||
a.columns,f=b?a.linkedParent:a,d=-1,l=0;a.chart[a.coll].forEach(function(b,c){b.side!==a.side||b.options.isInternal||(l=c,b===f&&(d=c))});return l===d&&(v(b)?c.length===b:!0)};m.prototype.getMaxLabelDimensions=function(a,b){var c={width:0,height:0};b.forEach(function(b){b=a[b];if(r(b)){var d=r(b.label)?b.label:{};b=d.getBBox?d.getBBox().height:0;d.textStr&&!v(d.textPxLength)&&(d.textPxLength=d.getBBox().width);d=v(d.textPxLength)?Math.round(d.textPxLength):0;c.height=Math.max(b,c.height);c.width=
Math.max(d,c.width)}});return c};e.dateFormats.W=function(a){a=new this.Date(a);var b=(this.get("Day",a)+6)%7,c=new this.Date(a.valueOf());this.set("Date",c,this.get("Date",a)-b+3);b=new this.Date(this.get("FullYear",c),0,1);4!==this.get("Day",b)&&(this.set("Month",a,0),this.set("Date",a,1+(11-this.get("Day",b))%7));return(1+Math.floor((c.valueOf()-b.valueOf())/6048E5)).toString()};e.dateFormats.E=function(a){return G("%a",a,!0).charAt(0)};h(p,"afterGetLabelPosition",function(a){var b=this.label,
c=this.axis,f=c.reversed,d=c.chart,l=c.options,u=l&&r(l.grid)?l.grid:{};l=c.options.labels;var e=l.align,k=y[c.side],n=a.tickmarkOffset,t=c.tickPositions,z=this.pos-n;t=v(t[a.index+1])?t[a.index+1]-n:c.max+n;var g=c.tickSize("tick",!0);n=B(g)?g[0]:0;g=g&&g[1]/2;if(!0===u.enabled){if("top"===k){u=c.top+c.offset;var h=u-n}else"bottom"===k?(h=d.chartHeight-c.bottom+c.offset,u=h+n):(u=c.top+c.len-c.translate(f?t:z),h=c.top+c.len-c.translate(f?z:t));"right"===k?(k=d.chartWidth-c.right+c.offset,f=k+n):
"left"===k?(f=c.left+c.offset,k=f-n):(k=Math.round(c.left+c.translate(f?t:z))-g,f=Math.round(c.left+c.translate(f?z:t))-g);this.slotWidth=f-k;a.pos.x="left"===e?k:"right"===e?f:k+(f-k)/2;a.pos.y=h+(u-h)/2;d=d.renderer.fontMetrics(l.style.fontSize,b.element);b=b.getBBox().height;l.useHTML?a.pos.y+=d.b+-(b/2):(b=Math.round(b/d.h),a.pos.y+=(d.b-(d.h-d.f))/2+-((b-1)*d.h/2));a.pos.x+=c.horiz&&l.x||0}});h(m,"afterTickSize",function(a){var b=this.defaultLeftAxisOptions,c=this.horiz,f=this.options.grid;f=
void 0===f?{}:f;var d=this.maxLabelDimensions;f.enabled&&(b=2*Math.abs(b.labels.x),c=c?f.cellHeight||b+d.height:b+d.width,B(a.tickSize)?a.tickSize[0]=c:a.tickSize=[c])});h(m,"afterGetTitlePosition",function(a){var b=this.options;if(!0===(b&&r(b.grid)?b.grid:{}).enabled){var c=this.axisTitle,f=c&&c.getBBox().width,d=this.horiz,l=this.left,e=this.top,g=this.width,k=this.height,n=b.title;b=this.opposite;var t=this.offset,h=this.tickSize()||[0],m=n.x||0,p=n.y||0,q=x(n.margin,d?5:10);c=this.chart.renderer.fontMetrics(n.style&&
n.style.fontSize,c).f;h=(d?e+k:l)+h[0]/2*(b?-1:1)*(d?1:-1)+(this.side===y.bottom?c:0);a.titlePosition.x=d?l-f/2-q+m:h+(b?g:0)+t+m;a.titlePosition.y=d?h-(b?k:0)+(b?c:-c)/2+t+p:e-q+p}});C(m.prototype,"unsquish",function(a){var b=this.options;return!0===(b&&r(b.grid)?b.grid:{}).enabled&&this.categories?this.tickInterval:a.apply(this,Array.prototype.slice.call(arguments,1))});h(m,"afterSetOptions",function(a){var b=this.options;a=a.userOptions;var c=b&&r(b.grid)?b.grid:{};if(!0===c.enabled){var f=w(!0,
{className:"highcharts-grid-axis "+(a.className||""),dateTimeLabelFormats:{hour:{list:["%H:%M","%H"]},day:{list:["%A, %e. %B","%a, %e. %b","%E"]},week:{list:["Week %W","W%W"]},month:{list:["%B","%b","%o"]}},grid:{borderWidth:1},labels:{padding:2,style:{fontSize:"13px"}},margin:0,title:{text:null,reserveSpace:!1,rotation:0},units:[["millisecond",[1,10,100]],["second",[1,10]],["minute",[1,5,15]],["hour",[1,6]],["day",[1]],["week",[1]],["month",[1]],["year",null]]},a);"xAxis"===this.coll&&(q(a.linkedTo)&&
!q(a.tickPixelInterval)&&(f.tickPixelInterval=350),q(a.tickPixelInterval)||!q(a.linkedTo)||q(a.tickPositioner)||q(a.tickInterval)||(f.tickPositioner=function(a,b){var c=this.linkedParent&&this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info;if(c){var d,k=f.units;for(d=0;d<k.length;d++)if(k[d][0]===c.unitName){var e=d;break}if(k[e+1]){var l=k[e+1][0];var g=(k[e+1][1]||[1])[0]}else"year"===c.unitName&&(l="year",g=10*c.count);c=F[l];this.tickInterval=c*g;return this.getTimeTicks({unitRange:c,
count:g,unitName:l},a,b,this.options.startOfWeek)}}));w(!0,this.options,f);this.horiz&&(b.minPadding=x(a.minPadding,0),b.maxPadding=x(a.maxPadding,0));v(b.grid.borderWidth)&&(b.tickWidth=b.lineWidth=c.borderWidth)}});h(m,"afterSetAxisTranslation",function(){var a=this.options,b=a&&r(a.grid)?a.grid:{},c=this.tickPositions&&this.tickPositions.info,f=this.userOptions.labels||{};this.horiz&&(!0===b.enabled&&this.series.forEach(function(a){a.options.pointRange=0}),c&&(!1===a.dateTimeLabelFormats[c.unitName].range||
1<c.count)&&!q(f.align)&&(a.labels.align="left",q(f.x)||(a.labels.x=3)))});h(m,"trimTicks",function(){var a=this.options,b=a&&r(a.grid)?a.grid:{},c=this.categories,f=this.tickPositions,d=f[0],e=f[f.length-1],g=this.linkedParent&&this.linkedParent.min||this.min,h=this.linkedParent&&this.linkedParent.max||this.max,k=this.tickInterval;!0!==b.enabled||c||!this.horiz&&!this.isLinked||(d<g&&d+k>g&&!a.startOnTick&&(f[0]=g),e>h&&e-k<h&&!a.endOnTick&&(f[f.length-1]=h))});h(m,"afterRender",function(){var a=
this.options,b=a&&r(a.grid)?a.grid:{},c=this.chart.renderer;if(!0===b.enabled){this.maxLabelDimensions=this.getMaxLabelDimensions(this.ticks,this.tickPositions);this.rightWall&&this.rightWall.destroy();if(this.isOuterAxis()&&this.axisLine){var f=a.lineWidth;if(f){var d=this.getLinePath(f);var e=d.indexOf("M")+1;var g=d.indexOf("L")+1;b=d.indexOf("M")+2;var h=d.indexOf("L")+2;var k=(this.tickSize("tick")[0]-1)*(this.side===y.top||this.side===y.left?-1:1);this.horiz?(d[b]+=k,d[h]+=k):(d[e]+=k,d[g]+=
k);this.axisLineExtra?this.axisLineExtra.animate({d:d}):(this.axisLineExtra=c.path(d).attr({zIndex:7}).addClass("highcharts-axis-line").add(this.axisGroup),c.styledMode||this.axisLineExtra.attr({stroke:a.lineColor,"stroke-width":f}));this.axisLine[this.showAxis?"show":"hide"](!0)}}(this.columns||[]).forEach(function(a){a.render()})}});var D={afterGetOffset:function(){(this.columns||[]).forEach(function(a){a.getOffset()})},afterInit:function(){var a=this.chart,b=this.userOptions,c=this.options;c=c&&
r(c.grid)?c.grid:{};c.enabled&&(I(this),C(this,"labelFormatter",function(a){var b=this.axis,c=b.tickPositions,d=this.value,e=(b.isLinked?b.linkedParent:b).series[0],f=d===c[0];c=d===c[c.length-1];e=e&&E(e.options.data,function(a){return a[b.isXAxis?"x":"y"]===d});this.isFirst=f;this.isLast=c;this.point=e;return a.call(this)}));if(c.columns)for(var f=this.columns=[],d=this.columnIndex=0;++d<c.columns.length;){var e=w(b,c.columns[c.columns.length-d-1],{linkedTo:0,type:"category"});delete e.grid.columns;
e=new m(this.chart,e,!0);e.isColumn=!0;e.columnIndex=d;A(a.axes,e);A(a[this.coll],e);f.push(e)}},afterSetOptions:function(a){a=(a=a.userOptions)&&r(a.grid)?a.grid:{};var b=a.columns;a.enabled&&b&&w(!0,this.options,b[b.length-1])},afterSetScale:function(){(this.columns||[]).forEach(function(a){a.setScale()})},destroy:function(a){(this.columns||[]).forEach(function(b){b.destroy(a.keepEvents)})},init:function(a){var b=(a=a.userOptions)&&r(a.grid)?a.grid:{};b.enabled&&q(b.borderColor)&&(a.tickColor=a.lineColor=
b.borderColor)}};Object.keys(D).forEach(function(a){h(m,a,D[a])});h(H,"afterSetChartSize",function(){this.axes.forEach(function(a){(a.columns||[]).forEach(function(a){a.setAxisSize();a.setAxisTranslation()})})})});p(e,"masters/modules/grid-axis.btx.js",[],function(){})});
//# sourceMappingURL=grid-axis.js.map