import{G as u}from"./GraphinaGoogleChartBase.js";class c extends u{constructor(e){super(e),this.chart=null,this.data=null,this.options={}}setUpChartsHandler(){this.chartHandlers={gauge_google:e=>this.observeChartElement(e,"Gauge")}}observeChartElement(e,r){gcfe_public_localize.view_port==="off"?(this.observer||(this.observer=new IntersectionObserver(s=>{s.forEach(t=>{t.isIntersecting&&(this.setupChart(jQuery(t.target),r),this.observer.unobserve(t.target))})},{threshold:.1})),this.observer.observe(e[0])):this.setupChart(e,r)}getFinalChartOptions(e,r){return e}setupTableData(e,r,s,t,i){var l;((l=e==null?void 0:e.google_chart_data)==null?void 0:l.data.length)>0?(r.addColumn("string","Label"),r.addColumn("number","Value"),e.google_chart_data.data.forEach(o=>r.addRow(o)),s.show(),t.hide()):(e==null?void 0:e.columns.length)>0&&e.rows.length>0?(e.columns.forEach((o,f)=>{r.addColumn(o[0],o[1])}),e.rows.forEach(o=>r.addRow(o))):(s.hide(),t.show());var h=new google.visualization.NumberFormat({prefix:i.prefix??"",suffix:i.suffix??"",fractionDigits:i.fractionDigits??0});h.format(r,1)}afterSetupChart(e,r,s,t,i){const h={"#4684ee":r.ballColor??"#4684ee","#f7f7f7":r.innerCircleColor??"#f7f7f7","#cccccc":r.outerCircleColor??"#cccccc"},l=r.needleColor??"#c63310";e.querySelectorAll("circle").forEach(o=>{const f=h[o.getAttribute("fill")];f&&o.setAttribute("fill",f)}),e.querySelectorAll("path").forEach(o=>{o.getAttribute("stroke")==="#c63310"&&(o.setAttribute("stroke",l),o.setAttribute("fill",l))})}}window.graphinaGoogleGaugeChart=new c;
//# sourceMappingURL=gauge_google.js.map
