/** * Highcharts Gantt JS v11.2.0 (2023-10-30) * * GridAxis * * (c) 2016-2021 Lars A. V. Cabrera * * License: www.highcharts.com/license */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/grid-axis",["highcharts"],function(i){return t(i),t.Highcharts=i,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var i=t?t._modules:{};function e(t,i,e,s){t.hasOwnProperty(i)||(t[i]=s.apply(null,e),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:i,module:t[i]}})))}e(i,"Core/Axis/GridAxis.js",[i["Core/Axis/Axis.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],function(t,i,e){var s,n;let{dateFormats:r}=i,{addEvent:o,defined:h,erase:l,find:a,isArray:d,isNumber:c,merge:g,pick:f,timeUnits:u,wrap:p}=e;(n=s||(s={}))[n.top=0]="top",n[n.right=1]="right",n[n.bottom=2]="bottom",n[n.left=3]="left";let m=[];function k(t){return e.isObject(t,!0)}function x(t,i){let e={width:0,height:0};if(i.forEach(function(i){let s=t[i],n=0,r=0,o;k(s)&&(n=(o=k(s.label)?s.label:{}).getBBox?o.getBBox().height:0,o.textStr&&!c(o.textPxLength)&&(o.textPxLength=o.getBBox().width),r=c(o.textPxLength)?Math.round(o.textPxLength):0,o.textStr&&(r=Math.round(o.getBBox().width)),e.height=Math.max(n,e.height),e.width=Math.max(r,e.width))}),"treegrid"===this.options.type&&this.treeGrid&&this.treeGrid.mapOfPosToGridNode){let t=this.treeGrid.mapOfPosToGridNode[-1].height||0;e.width+=this.options.labels.indentation*(t-1)}return e}function b(){let{grid:t}=this;(t&&t.columns||[]).forEach(function(t){t.getOffset()})}function P(t){let i=this.options,e=i.grid||{};if(!0===e.enabled){let{axisTitle:i,height:e,horiz:n,left:r,offset:o,opposite:h,options:l,top:a,width:d}=this,c=this.tickSize(),g=i&&i.getBBox().width,u=l.title.x,p=l.title.y,m=f(l.title.margin,n?5:10),k=i?this.chart.renderer.fontMetrics(i).f:0,x=c?c[0]/2:0,b=(n?a+e:r)+(n?1:-1)*(h?-1:1)*x+(this.side===s.bottom?k:0);t.titlePosition.x=n?r-(g||0)/2-m+u:b+(h?d:0)+o+u,t.titlePosition.y=n?b-(h?e:0)+(h?k:-k)/2+o+p:a-m+p}}function y(){let{chart:i,options:{grid:e={}},userOptions:s}=this;if(e.enabled&&function(t){let i=t.options;i.labels.align=f(i.labels.align,"center"),t.categories||(i.showLastLabel=!1),t.labelRotation=0,i.labels.rotation=0,i.minTickInterval=1}(this),e.columns){let n=this.grid.columns=[],r=this.grid.columnIndex=0;for(;++rt.render()),!this.horiz&&this.chart.hasRendered&&(this.scrollbar||this.linkedParent&&this.linkedParent.scrollbar)){let t,i;let s=this.tickmarkOffset,r=this.tickPositions[this.tickPositions.length-1],o=this.tickPositions[0];for(;(t=this.hiddenLabels.pop())&&t.element;)t.show();for(;(i=this.hiddenMarks.pop())&&i.element;)i.show();(t=this.ticks[o].label)&&(e-o>s?this.hiddenLabels.push(t.hide()):t.show()),(t=this.ticks[r].label)&&(r-n>s?this.hiddenLabels.push(t.hide()):t.show());let h=this.ticks[r].mark;h&&r-n0&&this.ticks[r].isLast&&this.hiddenMarks.push(h.hide())}}}function L(){let t=this.tickPositions&&this.tickPositions.info,i=this.options,e=i.grid||{},s=this.userOptions.labels||{};e.enabled&&(this.horiz?(this.series.forEach(t=>{t.options.pointRange=0}),t&&i.dateTimeLabelFormats&&i.labels&&!h(s.align)&&(!1===i.dateTimeLabelFormats[t.unitName].range||t.count>1)&&(i.labels.align="left",h(s.x)||(i.labels.x=3))):"treegrid"!==this.options.type&&this.grid&&this.grid.columns&&(this.minPointOffset=this.tickInterval))}function B(t){let i;let e=this.options,s=t.userOptions,n=e&&k(e.grid)?e.grid:{};!0===n.enabled&&(i=g(!0,{className:"highcharts-grid-axis "+(s.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:"0.9em"}},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]]},s),"xAxis"===this.coll&&(h(s.linkedTo)&&!h(s.tickPixelInterval)&&(i.tickPixelInterval=350),!h(s.tickPixelInterval)&&h(s.linkedTo)&&!h(s.tickPositioner)&&!h(s.tickInterval)&&(i.tickPositioner=function(t,e){let s=this.linkedParent&&this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info;if(s){let n=i.units||[],r,o=1,h="year";for(let t=0;tt.setScale())}function v(t){let{horiz:i,maxLabelDimensions:e,options:{grid:s={}}}=this;if(s.enabled&&e){let n=2*this.options.labels.distance,r=i?s.cellHeight||n+e.height:n+e.width;d(t.tickSize)?t.tickSize[0]=r:t.tickSize=[r,0]}}function S(){this.axes.forEach(t=>{(t.grid&&t.grid.columns||[]).forEach(t=>{t.setAxisSize(),t.setAxisTranslation()})})}function C(t){let{grid:i}=this;(i.columns||[]).forEach(i=>i.destroy(t.keepEvents)),i.columns=void 0}function T(t){let i=t.userOptions||{},e=i.grid||{};e.enabled&&h(e.borderColor)&&(i.tickColor=i.lineColor=e.borderColor),this.grid||(this.grid=new I(this)),this.hiddenLabels=[],this.hiddenMarks=[]}function W(t){let i=this.label,e=this.axis,n=e.reversed,r=e.chart,o=e.options,h=o.grid||{},l=e.options.labels,a=l.align,d=s[e.side],g=t.tickmarkOffset,f=e.tickPositions,u=this.pos-g,p=c(f[t.index+1])?f[t.index+1]-g:(e.max||0)+g,m=e.tickSize("tick"),k=m?m[0]:0,x=m?m[1]/2:0;if(!0===h.enabled){let s,o,h,c;if("top"===d?o=(s=e.top+e.offset)-k:"bottom"===d?s=(o=r.chartHeight-e.bottom+e.offset)+k:(s=e.top+e.len-(e.translate(n?p:u)||0),o=e.top+e.len-(e.translate(n?u:p)||0)),"right"===d?c=(h=r.chartWidth-e.right+e.offset)+k:"left"===d?h=(c=e.left+e.offset)-k:(h=Math.round(e.left+(e.translate(n?p:u)||0))-x,c=Math.min(Math.round(e.left+(e.translate(n?u:p)||0))-x,e.left+e.len)),this.slotWidth=c-h,t.pos.x="left"===a?h:"right"===a?c:h+(c-h)/2,t.pos.y=o+(s-o)/2,i){let e=r.renderer.fontMetrics(i),s=i.getBBox().height;if(l.useHTML)t.pos.y+=e.b+-(s/2);else{let i=Math.round(s/e.h);t.pos.y+=(e.b-(e.h-e.f))/2+-((i-1)*e.h/2)}}t.pos.x+=e.horiz&&l.x||0}}function A(t){let{axis:e,value:s}=t;if(e.options.grid&&e.options.grid.enabled){let n;let r=e.tickPositions,o=(e.linkedParent||e).series[0],h=s===r[0],l=s===r[r.length-1],d=o&&a(o.options.data,function(t){return t[e.isXAxis?"x":"y"]===s});d&&o.is("gantt")&&(n=g(d),i.seriesTypes.gantt.prototype.pointClass.setGanttPointAliases(n)),t.isFirst=h,t.isLast=l,t.point=n}}function E(){let t=this.options,i=t.grid||{},e=this.categories,s=this.tickPositions,n=s[0],r=s[s.length-1],o=this.linkedParent&&this.linkedParent.min,h=this.linkedParent&&this.linkedParent.max,l=o||this.min,a=h||this.max,d=this.tickInterval;!0===i.enabled&&!e&&(this.horiz||this.isLinked)&&(nl&&!t.startOnTick&&(s[0]=l),r>a&&r-d{i.side!==t.side||i.options.isInternal||(o=e,i!==n||(r=e))}),o===r&&(!c(e)||s.length===e)}renderBorder(t){let i=this.axis,e=i.chart.renderer,s=i.options,n=e.path(t).addClass("highcharts-axis-line").add(i.axisBorder);return e.styledMode||n.attr({stroke:s.lineColor,"stroke-width":s.lineWidth,zIndex:7}),n}}return r.E=function(t){return this.dateFormat("%a",t,!0).charAt(0)},r.W=function(t){let i=this,e=new this.Date(t);["Hours","Milliseconds","Minutes","Seconds"].forEach(function(t){i.set(t,e,0)});let s=(this.get("Day",e)+6)%7,n=new this.Date(e.valueOf());this.set("Date",n,this.get("Date",e)-s+3);let r=new this.Date(this.get("FullYear",n),0,1);return 4!==this.get("Day",r)&&(this.set("Month",e,0),this.set("Date",e,1+(11-this.get("Day",r))%7)),(1+Math.floor((n.valueOf()-r.valueOf())/6048e5)).toString()},{compose:function(t,i,s){return e.pushUnique(m,t)&&(t.keepProps.push("grid"),t.prototype.getMaxLabelDimensions=x,p(t.prototype,"unsquish",z),o(t,"init",T),o(t,"afterGetOffset",b),o(t,"afterGetTitlePosition",P),o(t,"afterInit",y),o(t,"afterRender",w),o(t,"afterSetAxisTranslation",L),o(t,"afterSetOptions",B),o(t,"afterSetOptions",M),o(t,"afterSetScale",O),o(t,"afterTickSize",v),o(t,"trimTicks",E),o(t,"destroy",C)),e.pushUnique(m,i)&&o(i,"afterSetChartSize",S),e.pushUnique(m,s)&&(o(s,"afterGetLabelPosition",W),o(s,"labelFormat",A)),t}}}),e(i,"masters/modules/grid-axis.src.js",[i["Core/Globals.js"],i["Core/Axis/GridAxis.js"]],function(t,i){i.compose(t.Axis,t.Chart,t.Tick)})});//# sourceMappingURL=grid-axis.js.map