/*
 Highcharts Gantt JS v7.2.1 (2019-10-31)

 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,u,f,p){e.hasOwnProperty(u)||(e[u]=p.apply(null,f))}e=e?e._modules:{};p(e,"parts-gantt/GridAxis.js",[e["parts/Globals.js"],e["parts/Utilities.js"]],function(e,u){var f=u.defined,p=u.erase,B=u.isArray,
x=u.isNumber,y=u.pick,v=e.addEvent,E=e.dateFormat,l=function(a){return u.isObject(a,!0)},z=e.merge,C=e.wrap,F=e.Chart,m=e.Axis,G=e.Tick,H=function(a){var b=a.options,c=b&&l(b.grid)?b.grid:{},k=25/11,d=a.chart.renderer.fontMetrics(b.labels.style.fontSize);b.labels||(b.labels={});b.labels.align=y(b.labels.align,"center");a.categories||(b.showLastLabel=!1);a.horiz&&(b.tickLength=c.cellHeight||d.h*k);a.labelRotation=0;b.labels.rotation=0},A={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,k=b?a.linkedParent:a,d=-1,g=0;a.chart[a.coll].forEach(function(b,c){b.side!==a.side||b.options.isInternal||(g=c,b===k&&(d=c))});return g===d&&(x(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(l(b)){var d=l(b.label)?b.label:{};b=d.getBBox?d.getBBox().height:0;d.textStr&&!x(d.textPxLength)&&(d.textPxLength=
d.getBBox().width);d=x(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 Date(a);a.setHours(0,0,0,0);a.setDate(a.getDate()-(a.getDay()||7));var b=new Date(a.getFullYear(),0,1);return Math.ceil(((a-b)/864E5+1)/7)};e.dateFormats.E=function(a){return E("%a",a,!0).charAt(0)};v(G,"afterGetLabelPosition",function(a){var b=this.label,c=this.axis,k=c.reversed,d=c.chart,g=c.options,e=g&&l(g.grid)?g.grid:{};
g=c.options.labels;var q=g.align,h=A[c.side],n=a.tickmarkOffset,r=c.tickPositions,w=this.pos-n;r=x(r[a.index+1])?r[a.index+1]-n:c.max+n;var t=c.tickSize("tick",!0);n=B(t)?t[0]:0;t=t&&t[1]/2;if(!0===e.enabled){if("top"===h){e=c.top+c.offset;var f=e-n}else"bottom"===h?(f=d.chartHeight-c.bottom+c.offset,e=f+n):(e=c.top+c.len-c.translate(k?r:w),f=c.top+c.len-c.translate(k?w:r));"right"===h?(h=d.chartWidth-c.right+c.offset,k=h+n):"left"===h?(k=c.left+c.offset,h=k-n):(h=Math.round(c.left+c.translate(k?
r:w))-t,k=Math.round(c.left+c.translate(k?w:r))-t);this.slotWidth=k-h;a.pos.x="left"===q?h:"right"===q?k:h+(k-h)/2;a.pos.y=f+(e-f)/2;d=d.renderer.fontMetrics(g.style.fontSize,b.element);b=b.getBBox().height;g.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&&g.x||0}});v(m,"afterTickSize",function(a){var b=this.maxLabelDimensions,c=this.options;!0===(c&&l(c.grid)?c.grid:{}).enabled&&(c=2*Math.abs(this.defaultLeftAxisOptions.labels.x),b=c+
(this.horiz?b.height:b.width),B(a.tickSize)?a.tickSize[0]=b:a.tickSize=[b])});v(m,"afterGetTitlePosition",function(a){var b=this.options;if(!0===(b&&l(b.grid)?b.grid:{}).enabled){var c=this.axisTitle,k=c&&c.getBBox().width,d=this.horiz,e=this.left,f=this.top,q=this.width,h=this.height,n=b.title;b=this.opposite;var r=this.offset,w=this.tickSize()||[0],t=n.x||0,m=n.y||0,p=y(n.margin,d?5:10);c=this.chart.renderer.fontMetrics(n.style&&n.style.fontSize,c).f;w=(d?f+h:e)+w[0]/2*(b?-1:1)*(d?1:-1)+(this.side===
A.bottom?c:0);a.titlePosition.x=d?e-k/2-p+t:w+(b?q:0)+r+t;a.titlePosition.y=d?w-(b?h:0)+(b?c:-c)/2+r+m:f-p+m}});C(m.prototype,"unsquish",function(a){var b=this.options;return!0===(b&&l(b.grid)?b.grid:{}).enabled&&this.categories?this.tickInterval:a.apply(this,Array.prototype.slice.call(arguments,1))});v(m,"afterSetOptions",function(a){var b=this.options;a=a.userOptions;var c=b&&l(b.grid)?b.grid:{};if(!0===c.enabled){var k=z(!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&&(f(a.linkedTo)&&!f(a.tickPixelInterval)&&(k.tickPixelInterval=350),f(a.tickPixelInterval)||!f(a.linkedTo)||
f(a.tickPositioner)||f(a.tickInterval)||(k.tickPositioner=function(a,b){var c=this.linkedParent&&this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info;if(c){var d,h=k.units;for(d=0;d<h.length;d++)if(h[d][0]===c.unitName){var g=d;break}if(h[g][1]){if(h[g+1]){var f=h[g+1][0];var l=(h[g+1][1]||[1])[0]}c=e.timeUnits[f];this.tickInterval=c*l;return this.getTimeTicks({unitRange:c,count:l,unitName:f},a,b,this.options.startOfWeek)}}}));z(!0,this.options,k);this.horiz&&(b.minPadding=y(a.minPadding,
0),b.maxPadding=y(a.maxPadding,0));x(b.grid.borderWidth)&&(b.tickWidth=b.lineWidth=c.borderWidth)}});v(m,"afterSetAxisTranslation",function(){var a=this.options,b=a&&l(a.grid)?a.grid:{},c=this.tickPositions&&this.tickPositions.info,e=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)&&!f(e.align)&&(a.labels.align="left",f(e.x)||(a.labels.x=3)))});v(m,"trimTicks",function(){var a=
this.options,b=a&&l(a.grid)?a.grid:{},c=this.categories,e=this.tickPositions,d=e[0],g=e[e.length-1],f=this.linkedParent&&this.linkedParent.min||this.min,q=this.linkedParent&&this.linkedParent.max||this.max,h=this.tickInterval;!0!==b.enabled||c||!this.horiz&&!this.isLinked||(d<f&&d+h>f&&!a.startOnTick&&(e[0]=f),g>q&&g-h<q&&!a.endOnTick&&(e[e.length-1]=q))});v(m,"afterRender",function(){var a=this.options,b=a&&l(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 e=a.lineWidth;if(e){var d=this.getLinePath(e);var g=d.indexOf("M")+1;var f=d.indexOf("L")+1;b=d.indexOf("M")+2;var q=d.indexOf("L")+2;var h=(this.tickSize("tick")[0]-1)*(this.side===A.top||this.side===A.left?-1:1);this.horiz?(d[b]+=h,d[q]+=h):(d[g]+=h,d[f]+=h);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":e}));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&&l(c.grid)?c.grid:{};c.enabled&&(H(this),C(this,"labelFormatter",function(a){var b=this.axis,c=b.tickPositions,d=this.value,f=(b.isLinked?b.linkedParent:b).series[0],
g=d===c[0];c=d===c[c.length-1];f=f&&e.find(f.options.data,function(a){return a[b.isXAxis?"x":"y"]===d});this.isFirst=g;this.isLast=c;this.point=f;return a.call(this)}));if(c.columns)for(var f=this.columns=[],d=this.columnIndex=0;++d<c.columns.length;){var g=z(b,c.columns[c.columns.length-d-1],{linkedTo:0,type:"category"});delete g.grid.columns;g=new m(this.chart,g,!0);g.isColumn=!0;g.columnIndex=d;p(a.axes,g);p(a[this.coll],g);f.push(g)}},afterSetOptions:function(a){a=(a=a.userOptions)&&l(a.grid)?
a.grid:{};var b=a.columns;a.enabled&&b&&z(!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)&&l(a.grid)?a.grid:{};b.enabled&&f(b.borderColor)&&(a.tickColor=a.lineColor=b.borderColor)}};Object.keys(D).forEach(function(a){v(m,a,D[a])});v(F,"afterSetChartSize",function(){this.axes.forEach(function(a){(a.columns||[]).forEach(function(a){a.setAxisSize();
a.setAxisTranslation()})})})});p(e,"masters/modules/grid-axis.src.js",[],function(){})});
//# sourceMappingURL=grid-axis.js.map