import{G as d}from"./GraphinaApexChartBase.js";class x extends d{constructor(){super(),this.observer={}}setUpChartsHandler(){this.chartHandlers={candle:e=>this.observeChartElement(e,"candle")}}dateFormat(e,t=!1,s=!1){let l="-",a=new Date(e),n=a.getHours(),r="0"+a.getMinutes(),o=a.getDate(),h=a.getMonth()+1,i=a.getFullYear();return(s?o+l+h+l+i:"")+(s&&t?" ":"")+(t?n+":"+r.substr(-2):"")}candleChartXaxisFormat(e,t){const s=t.xaxis_show_time,l=t.xaxis_show_date;let a="",n="";t.xaxis_label_prefix_show&&(a=t.xaxis_label_prefix,n=t.xaxis_label_postfix),e.xaxis.labels.formatter=r=>(r=a+this.dateFormat(r,s,l)+n,r)}getChartOptions(e,t,s,l){return t==="candle"&&(e.xaxis.type="datetime",e.chart.events={mounted:(a,n)=>{const r=document.querySelector(`.graphina-elementor-chart[data-element_id="${l}"]`);r&&(r.style.height="")}}),this.candleChartXaxisFormat(e,s),e}}window.graphinaCandleChart=new x;
//# sourceMappingURL=candle.js.map
