apexcharts
Version:
A JavaScript Chart Library
6 lines (5 loc) • 19.1 kB
JavaScript
/*!
* ApexCharts v6.6.1
* (c) 2018-2026 ApexCharts
*/
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("apexcharts/core");function s(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const e in t)if("default"!==e){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,i.get?i:{enumerable:!0,get:()=>t[e]})}return s.default=t,Object.freeze(s)}const e=s(t),i=e.__apex_Graphics,r={fill:"fill",stroke:"stroke","stroke-width":"strokeWidth","stroke-dasharray":"strokeDash","stroke-linecap":"lineCap","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","fill-rule":"fillRule"},l=Symbol("never"),a={circle:0,square:1,rect:1,triangle:2,diamond:3,star:4,sparkle:5,cross:6,plus:7,line:8},n=["circle","square","triangle","diamond","star","sparkle","cross","plus","line"],h={attr:()=>h,plot:()=>h,during:()=>h,after:t=>("function"==typeof t&&t(),h),animate:()=>h,delay:()=>h,loop:()=>h,finish:()=>h,stop:()=>h},o={nodeName:"path",style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(){},getAttribute:()=>null,removeAttribute(){},hasAttribute:()=>!1,addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})},c={__isCanvasMark:!0,node:{nodeName:"g",instance:null,style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(){},getAttribute:()=>null,removeAttribute(){},addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})},attr:()=>c,add:()=>c,addTo:()=>c,remove:()=>c,clear:()=>c,css:()=>c,hide:()=>c,show:()=>c,removeClass:()=>c,animate:()=>h};class _{constructor(t,s){this.__isCanvasMark=!0,this._g=t,this._i=s}get node(){return o}attr(t,s){return"string"==typeof t?("fill"===t&&void 0!==s&&this._g._setMarkerFill(this._i,s),void 0===s?null:this):(t&&void 0!==t.fill&&this._g._setMarkerFill(this._i,t.fill),this)}add(t){return this}addTo(t){return this}remove(){return this}css(t){return this}fill(t){return void 0!==t&&this._g._setMarkerFill(this._i,t),this}stroke(t){return this}hide(){return this}show(){return this}removeClass(t){return this}animate(){return h}}const d={__isCanvasMark:!0,node:o,attr:()=>d,add:()=>d,addTo:()=>d,remove:()=>d,css:()=>d,animate:()=>h};class p{constructor(t){this.__isCanvasMark=!0,this._cmd=t;const s=this;this.node={nodeName:t?t.tag:"g",instance:this,style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(t,e){s._applyAttr(t,e)},getAttribute:()=>null,removeAttribute(){},hasAttribute:()=>!1,addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})}}_applyAttr(t,s){const e=this._cmd;if(!e)return;const i=r[t];void 0!==i&&(e[i]=s)}attr(t,s){if("string"==typeof t)return void 0===s?null:(this._applyAttr(t,s),this);for(const s in t)void 0!==t[s]&&this._applyAttr(s,t[s]);return this}add(t){return this}addTo(t){return this}remove(){return this}clear(){return this}css(t){return this}fill(t){return"object"==typeof t?this.attr(t):this.attr("fill",t)}stroke(t){return"object"==typeof t?(void 0!==t.color&&this.attr("stroke",t.color),void 0!==t.width&&this.attr("stroke-width",t.width),this):this.attr("stroke",t)}plot(t){return"string"==typeof t&&this._cmd&&"path"===this._cmd.tag&&(this._cmd.d=t),this}hide(){return this}show(){return this}removeClass(t){return this}bbox(){return{x:0,y:0,width:0,height:0}}animate(){return h}}class u{constructor(t){this.w=t,this._g=new i(t),this._list=[],this._mx=new Float64Array(16),this._my=new Float64Array(16),this._msize=new Float64Array(16),this._mshape=new Int16Array(16),this._mstyle=new Int32Array(16),this._msi=new Int32Array(16),this._mn=0,this._mcap=16,this._crx=new Float64Array(16),this._cry=new Float64Array(16),this._crw=new Float64Array(16),this._crh=new Float64Array(16),this._crstyle=new Int32Array(16),this._crsi=new Int32Array(16),this._crdi=new Int32Array(16),this._crn=0,this._crcap=16,this._cellRadius=0,this._styles=[],this._styleMap=new Map,this._lf=l,this._ls=l,this._lsw=l,this._ld=l,this._lfo=l,this._lso=l,this._lid=-1,this._lofFill=l,this._lofBase=-1,this._lofId=-1,this._rlf=l,this._rls=l,this._rlsw=l,this._rlfo=l,this._rlso=l,this._rlid=-1}_resetStyleCache(){this._lf=l,this._ls=l,this._lsw=l,this._ld=l,this._lfo=l,this._lso=l,this._lid=-1,this._lofFill=l,this._lofBase=-1,this._lofId=-1,this._rlf=l,this._rls=l,this._rlsw=l,this._rlfo=l,this._rlso=l,this._rlid=-1}reset(){this._list=[],this._mn=0,this._styles=[],this._styleMap=new Map,this._resetStyleCache();const t=this.w.config.series||[];let s=16;for(let e=0;e<t.length;e++){const i=t[e]&&t[e].data;Array.isArray(i)&&(s+=i.length)}s=Math.ceil(1.15*s)+16,s>this._mcap&&this._allocMarkers(s),this._crn=0,this._cellRadius=0,s>this._crcap&&this._allocRects(s)}_allocRects(t){this._crcap=t,this._crx=new Float64Array(t),this._cry=new Float64Array(t),this._crw=new Float64Array(t),this._crh=new Float64Array(t),this._crstyle=new Int32Array(t),this._crsi=new Int32Array(t),this._crdi=new Int32Array(t)}_growRects(){const t=2*this._crcap,s=new Float64Array(t);s.set(this._crx),this._crx=s;const e=new Float64Array(t);e.set(this._cry),this._cry=e;const i=new Float64Array(t);i.set(this._crw),this._crw=i;const r=new Float64Array(t);r.set(this._crh),this._crh=r;const l=new Int32Array(t);l.set(this._crstyle),this._crstyle=l;const a=new Int32Array(t);a.set(this._crsi),this._crsi=a;const n=new Int32Array(t);n.set(this._crdi),this._crdi=n,this._crcap=t}_allocMarkers(t){this._mcap=t,this._mx=new Float64Array(t),this._my=new Float64Array(t),this._msize=new Float64Array(t),this._mshape=new Int16Array(t),this._mstyle=new Int32Array(t),this._msi=new Int32Array(t)}_growMarkers(){const t=2*this._mcap,s=new Float64Array(t);s.set(this._mx),this._mx=s;const e=new Float64Array(t);e.set(this._my),this._my=e;const i=new Float64Array(t);i.set(this._msize),this._msize=i;const r=new Int16Array(t);r.set(this._mshape),this._mshape=r;const l=new Int32Array(t);l.set(this._mstyle),this._mstyle=l;const a=new Int32Array(t);a.set(this._msi),this._msi=a,this._mcap=t}displayList(){return this._list}markerCount(){return this._mn}_internStyle(t,s,e,i,r,l){const a=`${t}|${s}|${e}|${i}|${r}|${l}`,n=this._styleMap.get(a);if(void 0!==n)return n;const h=this._styles.length;return this._styles.push({fill:t,stroke:s,strokeWidth:e,strokeDash:i,fillOpacity:r,strokeOpacity:l}),this._styleMap.set(a,h),h}_setMarkerFill(t,s){const e=this._mstyle[t];if(s===this._lofFill&&e===this._lofBase)return void(this._mstyle[t]=this._lofId);const i=this._styles[e];if(!i||i.fill===s)return this._lofFill=s,this._lofBase=e,void(this._lofId=e);const r=this._internStyle(s,i.stroke,i.strokeWidth,i.strokeDash,i.fillOpacity,i.strokeOpacity);this._mstyle[t]=r,this._lofFill=s,this._lofBase=e,this._lofId=r}markerStyle(t){return this._styles[this._mstyle[t]]}markerSeries(t){return this._msi[t]}shapeName(t){return n[t]||"circle"}drawRectCell(t,s,e,i,r={}){const l=this._rectStyleId(r);this._crn>=this._crcap&&this._growRects();const a=this._crn++;return this._crx[a]=t||0,this._cry[a]=s||0,this._crw[a]=e>0?e:0,this._crh[a]=i>0?i:0,this._crstyle[a]=l,this._crsi[a]=null==r.seriesIndex?-1:r.seriesIndex,this._crdi[a]=null==r.dataPointIndex?-1:r.dataPointIndex,r.radius&&(this._cellRadius=r.radius),d}_rectStyleId(t){const s=t.fill,e=t.stroke,i=t.strokeWidth,r=t.fillOpacity,l=t.strokeOpacity;if(s===this._rlf&&e===this._rls&&i===this._rlsw&&r===this._rlfo&&l===this._rlso)return this._rlid;const a=this._internStyle(s,e,i,0,r,l);return this._rlf=s,this._rls=e,this._rlsw=i,this._rlfo=r,this._rlso=l,this._rlid=a,a}rectCount(){return this._crn}rectStyle(t){return this._styles[this._crstyle[t]]}rectSeries(t){return this._crsi[t]}_cmd(t,s){const e={tag:t,z:s||0,fill:void 0,stroke:void 0,strokeWidth:void 0,strokeDash:void 0,lineCap:void 0,fillOpacity:void 0,strokeOpacity:void 0,fillRule:void 0};return this._list.push(e),e}group(t){return c}drawMarker(t,s,e={}){var i;const r=this._markerStyleId(e);this._mn>=this._mcap&&this._growMarkers();const l=this._mn++;return this._mx[l]=t||0,this._my[l]="number"==typeof s?s:NaN,this._msize[l]=e.pSize||0,this._mshape[l]=null!=(i=a[e.shape||"circle"])?i:0,this._mstyle[l]=r,this._msi[l]=null==e.seriesIndex?-1:e.seriesIndex,new _(this,l)}_markerStyleId(t){const s=t.shape||"circle",e="line"===s||"plus"===s||"cross"===s,i=e?"none":t.pointFillColor,r=e?t.pointFillColor:t.pointStrokeColor,l=t.pointStrokeWidth,a=t.pointStrokeDashArray,n=t.pointFillOpacity,h=e?t.pointFillOpacity:t.pointStrokeOpacity;if(i===this._lf&&r===this._ls&&l===this._lsw&&a===this._ld&&n===this._lfo&&h===this._lso)return this._lid;const o=this._internStyle(i,r,l,a,n,h);return this._lf=i,this._ls=r,this._lsw=l,this._ld=a,this._lfo=n,this._lso=h,this._lid=o,o}renderPaths(t){const s=this._cmd("path",t.realIndex);return s.d=t.pathTo,t.pathToNumeric&&(s.nxs=t.pathToNumeric.xs,s.nys=t.pathToNumeric.ys,s.ncloseY=t.pathToNumeric.closeY),s.stroke=t.stroke,s.strokeWidth=t.strokeWidth,s.fill=t.fill,s.lineCap=t.strokeLinecap,s.si=t.realIndex,this.w.globals.animationEnded=!0,new p(s)}drawPath(t){const s=this._cmd("path",0);return s.d=t.d,s.stroke=t.stroke,s.strokeWidth=t.strokeWidth,s.fill=t.fill,s.fillOpacity=t.fillOpacity,s.strokeOpacity=t.strokeOpacity,s.lineCap=t.strokeLinecap,s.strokeDash=t.strokeDashArray,new p(s)}drawLine(t,s,e,i,r="#a8a8a8",l=0,a=1){const n=this._cmd("line",0);return n.lx1=t,n.ly1=s,n.lx2=e,n.ly2=i,n.stroke=r,n.strokeDash=l,n.strokeWidth=a,new p(n)}drawRect(t=0,s=0,e=0,i=0,r=0,l="#fefefe",a=1,n=null,h=null,o=0){const c=this._cmd("rect",0);return c.x1=t,c.y1=s,c.rw=e>0?e:0,c.rh=i>0?i:0,c.radius=r,c.fill=l,c.fillOpacity=a,null!=h&&(c.stroke=h,c.strokeWidth=null==n?1:n,c.strokeDash=o),new p(c)}drawCircle(t,s=null){const e=this._cmd("circle",0);return e.r=t<0?0:t,s&&(e.cx=s.cx,e.cy=s.cy,void 0!==s.fill&&(e.fill=s.fill),void 0!==s.stroke&&(e.stroke=s.stroke)),new p(e)}drawText(t){const s=this._cmd("text",0);return s.text=Array.isArray(t.text)?t.text.join(" "):t.text,s.tx=t.x,s.ty=t.y,s.textAnchor=t.textAnchor||"start",s.fontSize=t.fontSize,s.fontFamily=t.fontFamily,s.fill=t.foreColor,new p(s)}markerPath(t,s,e,i){return this._g.getMarkerPath(t,s,n[e]||"circle",i)}}const y=e.__apex_SVGElement,f=e.__apex_math_SVGNS,m=e.__apex_BrowserAPIs_BrowserAPIs,g=2*Math.PI;class w{constructor(t){this.w=t,this._host=null,this._canvas=null,this._c2d=null,this._margin=0,this._dpr=1,this._dim=null,this._alpha=1,this._unitPaths=new Map,this._markerBatches=0}markerBatchCount(){return this._markerBatches}_seriesAlpha(t){const s=this._dim;return!s||null==s.active||s.active<0||null==t||t<0||t===s.active?1:null==s.opacity?.2:s.opacity}_plotDims(){var t;const s=Math.max(0,Math.ceil(this.w.layout.gridWidth||0)),e=Math.max(0,Math.ceil(this.w.layout.gridHeight||0)),i=(null==(t=this.w.globals.markers)?void 0:t.largestSize)||0;return{gw:s,gh:e,margin:Math.ceil(i+8)}}createHost(){const t=m.getWindow();this._dpr=Math.min(2,t&&t.devicePixelRatio||1);const{gw:s,gh:e,margin:i}=this._plotDims();this._margin=i;const r=s+2*i,l=e+2*i,a=m.createElementNS(f,"foreignObject");a.setAttribute("x",String(-i)),a.setAttribute("y",String(-i)),a.setAttribute("width",String(r)),a.setAttribute("height",String(l)),a.setAttribute("class","apexcharts-canvas-series"),a.style.overflow="visible";const n=m.createElement("canvas");return n.setAttribute("class","apexcharts-series-canvas"),n.width=Math.max(1,Math.round(r*this._dpr)),n.height=Math.max(1,Math.round(l*this._dpr)),n.style.width=r+"px",n.style.height=l+"px",n.style.pointerEvents="none",a.appendChild(n),this._canvas=n,this._c2d=n.getContext("2d"),this._host=new y(a),this._host}getHost(){return this._host}clear(){this._c2d&&this._canvas&&(this._c2d.setTransform(1,0,0,1,0,0),this._c2d.clearRect(0,0,this._canvas.width,this._canvas.height))}_syncDpr(){if(!this._canvas)return;const t=m.getWindow(),s=Math.min(2,t&&t.devicePixelRatio||1);if(s===this._dpr)return;this._dpr=s;const e=parseFloat(this._canvas.style.width)||0,i=parseFloat(this._canvas.style.height)||0;this._canvas.width=Math.max(1,Math.round(e*s)),this._canvas.height=Math.max(1,Math.round(i*s))}paint(t,s,e=null){const i=this._c2d;if(!i)return;this._dim=e||null,this._syncDpr(),this.clear();const r=this._dpr,l=this._margin;if(i.setTransform(r,0,0,r,l*r,l*r),t.length){const s=t.length>1?t.map((t,s)=>[t,s]).sort((t,s)=>t[0].z===s[0].z?t[1]-s[1]:t[0].z-s[0].z).map(t=>t[0]):t;for(let t=0;t<s.length;t++){const e=s[t];this._alpha=this._dim?this._seriesAlpha(e.si):1,this._paintOne(i,e)}}this._paintRects(i,s),this._paintMarkers(i,s),this._alpha=1}_paintRects(t,s){const e=s.rectCount?s.rectCount():0;if(!e)return;const i=s._crx,r=s._cry,l=s._crw,a=s._crh,n=s._crstyle,h=s._cellRadius||0,o=t,c=h>0&&"function"==typeof o.roundRect,_=!!this._dim,d=Math.max(0,this.w.layout.gridWidth||0),p=Math.max(0,this.w.layout.gridHeight||0);t.save(),t.beginPath(),t.rect(0,0,d,p),t.clip();let u=0;for(;u<e;){const d=n[u],p=s.rectStyle(u);if(!p){u++;continue}const y=p.fill,f=y&&"none"!==y&&!("string"==typeof y&&0===y.indexOf("url(")),m=p.stroke,g=null==p.strokeWidth?0:Number(p.strokeWidth),w=m&&"none"!==m&&g>0&&!("string"==typeof m&&0===m.indexOf("url("));f&&(t.fillStyle=y),w&&(t.strokeStyle=m,t.lineWidth=g,t.setLineDash([]));const k=null==p.fillOpacity?1:Number(p.fillOpacity),A=null==p.strokeOpacity?1:Number(p.strokeOpacity);let x=u;for(;x<e&&n[x]===d;){const e=l[x],n=a[x];if(e>0&&n>0){const l=_?this._seriesAlpha(s.rectSeries(x)):1;c?(t.beginPath(),o.roundRect(i[x],r[x],e,n,h),f&&(t.globalAlpha=k*l,t.fill()),w&&(t.globalAlpha=A*l,t.stroke())):(f&&(t.globalAlpha=k*l,t.fillRect(i[x],r[x],e,n)),w&&(t.globalAlpha=A*l,t.strokeRect(i[x],r[x],e,n)))}x++}u=x}t.globalAlpha=1,t.restore()}_unitPath(t,s,e){const i=s+"|"+e;let r=this._unitPaths.get(i);if(void 0===r){try{r=new Path2D(t.markerPath(0,0,s,e))}catch(t){r=null}this._unitPaths.set(i,r)}return r}_paintMarkers(t,s){this._markerBatches=0;const e=s.markerCount();if(!e)return;const i=s._mx,r=s._my,l=s._msize,a=s._mshape,n=s._mstyle,h=!!this._dim;h||(this._alpha=1);let o=0;for(;o<e;){const c=n[o],_=a[o],d=s.markerStyle(o);if(!d){o++;continue}const p=this._applyFill(t,d),u=this._applyStroke(t,d);this._markerBatches++;const y=null==d.fillOpacity?1:Number(d.fillOpacity),f=null==d.strokeOpacity?1:Number(d.strokeOpacity);if(0===_){let _=o;for(;_<e&&0===a[_]&&n[_]===c;){const e=l[_]||0,a=r[_];if(e>0&&a==a)if(t.beginPath(),t.arc(i[_],a,e,0,g),h){const e=this._seriesAlpha(s.markerSeries(_));p&&(t.globalAlpha=y*e,t.fill()),u&&(t.globalAlpha=f*e,t.stroke())}else p&&t.fill(),u&&t.stroke();_++}t.globalAlpha=1,o=_}else{const d=this._dpr,m=this._margin;let g=o;for(;g<e&&a[g]===_&&n[g]===c;){const e=r[g],a=l[g];if(e==e&&a>0){const r=this._unitPath(s,_,a);if(r){t.setTransform(d,0,0,d,(m+i[g])*d,(m+e)*d);const l=h?this._seriesAlpha(s.markerSeries(g)):1;p&&(t.globalAlpha=y*l,t.fill(r)),u&&(t.globalAlpha=f*l,t.stroke(r))}}g++}t.setTransform(d,0,0,d,m*d,m*d),t.globalAlpha=1,o=g}}}_paintNumericPath(t,s){const e=s.nxs,i=s.nys,r=e.length;if(r){t.beginPath(),t.moveTo(e[0],i[0]);for(let s=1;s<r;s++)t.lineTo(e[s],i[s]);null!=s.ncloseY&&(t.lineTo(e[r-1],s.ncloseY),t.lineTo(e[0],s.ncloseY),t.closePath()),this._applyFill(t,s)&&t.fill("evenodd"===s.fillRule?"evenodd":"nonzero"),this._applyStroke(t,s)&&t.stroke(),t.globalAlpha=1}}_paintOne(t,s){switch(s.tag){case"path":if(s.nxs){this._paintNumericPath(t,s);break}if(!s.d)return;if(!s.path2d)try{s.path2d=new Path2D(s.d)}catch(t){return}this._fillStrokePath(t,s,s.path2d);break;case"rect":{const e=new Path2D;s.radius&&"function"==typeof e.roundRect?e.roundRect(s.x1,s.y1,s.rw,s.rh,s.radius):e.rect(s.x1,s.y1,s.rw,s.rh),this._fillStrokePath(t,s,e);break}case"circle":if(!(s.r>0))return;t.beginPath(),t.arc(s.cx,s.cy,s.r,0,g),this._fillStroke(t,s);break;case"line":t.beginPath(),t.moveTo(s.lx1,s.ly1),t.lineTo(s.lx2,s.ly2),this._strokeOnly(t,s);break;case"text":{if(null==s.text)return;t.save(),t.globalAlpha=this._alpha,t.fillStyle=s.fill||"#000";const e=s.fontSize||"11px";t.font=`${"number"==typeof e?e+"px":e} ${s.fontFamily||"Helvetica, Arial, sans-serif"}`,t.textAlign="middle"===s.textAnchor?"center":"end"===s.textAnchor?"right":"left",t.fillText(String(s.text),s.tx,s.ty),t.restore();break}}}_fillStrokePath(t,s,e){this._applyFill(t,s)&&t.fill(e,"evenodd"===s.fillRule?"evenodd":"nonzero"),this._applyStroke(t,s)&&t.stroke(e),t.globalAlpha=1}_fillStroke(t,s){this._applyFill(t,s)&&t.fill(),this._applyStroke(t,s)&&t.stroke(),t.globalAlpha=1}_strokeOnly(t,s){this._applyStroke(t,s)&&t.stroke(),t.globalAlpha=1}_applyFill(t,s){const e=s.fill;return!(!e||"none"===e)&&(("string"!=typeof e||0!==e.indexOf("url("))&&(t.globalAlpha=(null==s.fillOpacity?1:Number(s.fillOpacity))*this._alpha,t.fillStyle=e,!0))}_applyStroke(t,s){const e=s.stroke,i=null==s.strokeWidth?1:Number(s.strokeWidth);if(!(e&&"none"!==e&&i>0))return!1;if("string"==typeof e&&0===e.indexOf("url("))return!1;t.globalAlpha=(null==s.strokeOpacity?1:Number(s.strokeOpacity))*this._alpha,t.strokeStyle=e,t.lineWidth=i,t.lineCap=s.lineCap||"butt";const r=s.strokeDash;return r&&0!==r?t.setLineDash(Array.isArray(r)?r:[Number(r)]):t.setLineDash([]),!0}toDataURL(){return this._canvas?this._canvas.toDataURL():null}destroy(){this._host=null,this._canvas=null,this._c2d=null,this._unitPaths.clear()}}class k{constructor(t,s){this.w=t,this.ctx=s,this.kind="canvas",this._g=new u(t),this._compositor=new w(t)}beginSeries(){this._g.reset()}present(){const t=this._compositor.createHost();return this._compositor.paint(this._g.displayList(),this._g),t}clear(){this._compositor.clear()}canRepaintInPlace(){const t=this._compositor.getHost();return!!(t&&t.node&&t.node.isConnected)}repaintInPlace(){this._compositor.paint(this._g.displayList(),this._g)}group(t){return this._g.group(t)}drawPath(t){return this._g.drawPath(t)}drawLine(...t){return this._g.drawLine(...t)}drawRect(...t){return this._g.drawRect(...t)}drawRectCell(t,s,e,i,r){return this._g.drawRectCell(t,s,e,i,r)}drawCircle(t,s){return this._g.drawCircle(t,s)}drawMarker(t,s,e){return this._g.drawMarker(t,s,e)}renderPaths(t){return this._g.renderPaths(t)}drawText(t){return this._g.drawText(t)}supports(t){return"solidFill"===t||"dashArray"===t}hitTest(t,s){const e=this._g,i=e.rectCount?e.rectCount():0;if(!i)return null;const r=e._crx,l=e._cry,a=e._crw,n=e._crh;for(let h=i-1;h>=0;h--){const i=a[h],o=n[h];if(!(i<=0||o<=0)&&(t>=r[h]&&t<r[h]+i&&s>=l[h]&&s<l[h]+o))return{seriesIndex:e._crsi[h],dataPointIndex:e._crdi[h],x:r[h],y:l[h],width:i,height:o}}return null}restyle(t){this._compositor.paint(this._g.displayList(),this._g,t||null)}toBitmap(){const t=this._compositor.toDataURL();if(!t)return null;const s=this.w.globals,e=this.w.config.chart,i=this._compositor._margin;return{dataURL:t,x:(s.translateX||0)+(e.offsetX||0)-i,y:(s.translateY||0)+(e.offsetY||0)-i,w:(this.w.layout.gridWidth||0)+2*i,h:(this.w.layout.gridHeight||0)+2*i}}destroy(){this._compositor.destroy()}}t.registerRenderer("canvas",(t,s)=>new k(t,s)),exports.default=t;