highcharts
Version:
JavaScript charting framework
13 lines • 3.43 kB
JavaScript
/**
* Highcharts Gantt JS v12.6.0 (2026-04-13)
* @module highcharts/modules/current-date-indicator
* @requires highcharts
*
* CurrentDateIndicator
*
* (c) 2010-2026 Highsoft AS
* Author: Lars A. V. Cabrera
*
* A commercial license may be required depending on use.
* See www.highcharts.com/license
*/import*as t from"../highcharts.js";var e={};e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let r=t.default;var n=e.n(r);let{doc:o,win:a}=n();function l(t,e,r,o={}){let a="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(a,"hcEvents")||(a.hcEvents={});let i=a.hcEvents;n().Point&&t instanceof n().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let c=t.addEventListener;c&&c.call(t,e,r,!!n().supportsPassiveEvents&&{passive:void 0===o.passive?-1!==e.indexOf("touch"):o.passive,capture:!1}),i[e]||(i[e]=[]);let s={fn:r,order:"number"==typeof o.order?o.order:1/0};return i[e].push(s),i[e].sort((t,e)=>t.order-e.order),function(){!function(t,e,r){function n(e,r){let n=t.removeEventListener;n&&n.call(t,e,r,!1)}function o(r){let o,a;t.nodeName&&(e?(o={})[e]=!0:o=r,f(o,function(t,e){if(r[e])for(a=r[e].length;a--;)n(e,r[e][a].fn)}))}let a="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(a,"hcEvents")){let t=a.hcEvents;if(e){let a=t[e]||[];r?(t[e]=a.filter(function(t){return r!==t.fn}),n(e,r)):(o(t),t[e]=[])}else o(t),delete a.hcEvents}}(t,e,r)}}function i(t){return c(t)&&"number"==typeof t.nodeType}function c(t,e){let r;return!!t&&"object"==typeof t&&(!e||"[object Array]"!==(r=Object.prototype.toString.call(t))&&"[object Array Iterator]"!==r)}function s(t,...e){let r,n=[t,...e],o={},a=function(t,e){return"object"!=typeof t&&(t={}),f(e,function(r,n){if("__proto__"!==n&&"constructor"!==n){let o;!c(r,!0)||(o=r?.constructor,c(r,!0)&&!i(r)&&o?.name&&"Object"!==o.name)||i(r)?t[n]=e[n]:t[n]=a(t[n]||{},r)}}),t};!0===t&&(o=n[1],n=Array.prototype.slice.call(n,2));let l=n.length;for(r=0;r<l;r++)o=a(o,n[r]);return o}function f(t,e,r){for(let n in t)Object.hasOwnProperty.call(t,n)&&e.call(r||t[n],t[n],n,t)}Array.prototype.find;let{composed:u}=n(),p={color:"#ccd3ff",width:2,label:{format:"%[abdYHM]",formatter:function(t,e){return this.axis.chart.time.dateFormat(e||"",t,!0)},rotation:0,style:{fontSize:"0.7em"}}};function h(){let t=this.options,e=t.currentDateIndicator;if(e){let r="object"==typeof e?s(p,e):s(p);r.value=Date.now(),r.className="highcharts-current-date-indicator",t.plotLines||(t.plotLines=[]),t.plotLines.push(r)}}function d(){this.label&&this.label.attr({text:this.getLabelText(this.options.label)})}function y(t,e){let r=this.options;return r&&r.className&&-1!==r.className.indexOf("highcharts-current-date-indicator")&&r.label&&"function"==typeof r.label.formatter?(r.value=Date.now(),r.label.formatter.call(this,r.value,r.label.format,this)):t.call(this,e)}let b=n();({compose:function(t,e){var r,n,o;if(r="CurrentDateIndication",0>u.indexOf(r)&&u.push(r)){let r;l(t,"afterSetOptions",h),l(e,"render",d),n=e.prototype,r=n[o="getLabelText"],n[o]=function(){let t=arguments,e=this;return y.apply(this,[function(){return r.apply(e,arguments.length?arguments:t)}].concat([].slice.call(arguments)))}}}}).compose(b.Axis,b.PlotLineOrBand);let v=n();export{v as default};