vue-data-ui-hq
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
3 lines (2 loc) • 29 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-ZfICPrrM.cjs"),ie=require("./useResponsive-BJ7DTGpm.cjs"),_e=require("./Title-FbHK83tB.cjs"),de=require("./usePrinter-B-gh2f22.cjs"),ze=require("./Tooltip-C7TJODUx.cjs"),Ve=require("./DataTable-CC6dPSer.cjs"),Ee=require("./vue-ui-skeleton-Bvmpr51u.cjs"),Te=require("./Slicer-CtTQxL9r.cjs"),Ae=require("./vue-ui-accordion-Dp6uTsJi.cjs"),ce=require("./useNestedProp-C14rfl0j.cjs"),Fe=require("./PackageVersion-D3dK8oA3.cjs"),Ie=require("./PenAndPaper-PL3bp4ud.cjs"),Pe=require("./useUserOptionState-BgepsfED.cjs"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Re=["id"],Oe=["xmlns","viewBox"],Ue=["x","y","width","height"],Me={key:1},De=["id"],qe=["stop-color"],We=["stop-color"],Ge=["stop-color"],He=["id"],je=["stop-color"],Xe=["stop-color"],Ye=["stop-color"],Je={key:0},Ke=["x1","x2","y1","y2","stroke","stroke-width"],Qe=["x1","x2","y1","y2","stroke","stroke-width"],Ze={key:1},et=["x1","x2","y1","y2","stroke","stroke-width"],tt=["x","y","font-size","fill","font-weight"],ot={key:2},lt=["transform","text-anchor","font-size","fill","font-weight"],nt=["x1","x2","y1","y2","stroke","stroke-width"],rt={key:0},at=["cx","cy","r","fill"],ut=["cx","cy","r","fill"],st={key:1},it=["x1","x2","y1","y2","stroke","stroke-width"],dt=["x1","x2","y1","y2","stroke","stroke-width"],ct=["x","y","height","width","fill","rx"],ft=["x","y","height","width","fill","rx","stroke","stroke-width"],yt=["x","y","height","width","fill","onMouseover"],ht={key:5,class:"vue-data-ui-watermark"},pt=["innerHTML"],vt={__name:"vue-ui-candlestick",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(v,{expose:fe}){const{vue_ui_candlestick:ye}=a.useConfig(),d=v,b=e.computed(()=>!!d.dataset&&d.dataset.length),h=e.ref(a.createUid()),he=e.ref(null),V=e.ref(!1),E=e.ref(""),T=e.ref(void 0),L=e.ref(0),g=e.ref(null),R=e.ref(null),O=e.ref(null),U=e.ref(null),M=e.ref(null),D=e.ref(null),C=e.ref(0),q=e.ref(0),W=e.ref(0),t=e.computed({get:()=>j(),set:o=>o}),{userOptionsVisible:A,setUserOptionsVisibility:G,keepUserOptionState:H}=Pe.useUserOptionState({config:t.value});function j(){const o=ce.useNestedProp({userConfig:d.config,defaultConfig:ye});let n={};return o.theme?n={...ce.useNestedProp({userConfig:a.themes.vue_ui_candlestick[o.theme]||d.config,defaultConfig:o})}:n=o,d.config&&a.hasDeepProperty(d.config,"style.zoom.startIndex")?n.style.zoom.startIndex=d.config.style.zoom.startIndex:n.style.zoom.startIndex=null,d.config&&a.hasDeepProperty(d.config,"style.zoom.endIndex")?n.style.zoom.endIndex=d.config.style.zoom.endIndex:n.style.zoom.endIndex=null,n}e.watch(()=>d.config,o=>{t.value=j(),A.value=!t.value.showOnChartHover,X(),C.value+=1,W.value+=1,q.value+=1},{deep:!0}),e.watch(()=>d.dataset,o=>{c.value.start=0,c.value.end=o.length,C.value+=1},{deep:!0});const i=e.ref({height:t.value.style.height,width:t.value.style.width,xAxisFontSize:t.value.style.layout.grid.xAxis.dataLabels.fontSize,yAxisFontSize:t.value.style.layout.grid.yAxis.dataLabels.fontSize}),N=e.ref(null);e.onMounted(()=>{X()});function X(){if(a.objectIsEmpty(d.dataset)&&a.error({componentName:"VueUiCandlestick",type:"dataset"}),t.value.responsive){const o=ie.throttle(()=>{const{width:n,height:l}=ie.useResponsive({chart:g.value,title:t.value.style.title.text?R.value:null,slicer:U.value,legend:O.value,source:M.value,noTitle:D.value});i.value.width=n,i.value.height=l,i.value.xAxisFontSize=a.translateSize({relator:Math.min(n,l),adjuster:t.value.style.width,source:t.value.style.layout.grid.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),i.value.yAxisFontSize=a.translateSize({relator:Math.min(n,l),adjuster:t.value.style.width,source:t.value.style.layout.grid.yAxis.dataLabels.fontSize,threshold:6,fallback:6})});N.value=new ResizeObserver(o),N.value.observe(g.value.parentNode)}te()}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:Y,isImaging:J,generatePdf:K,generateImage:Q}=de.usePrinter({elementId:`vue-ui-candlestick_${h.value}`,fileName:t.value.style.title.text||"vue-ui-candlestick"}),pe=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),u=e.computed(()=>{const{top:o,right:n,bottom:l,left:r}=t.value.style.layout.padding;return{top:o,right:i.value.width-n,left:r,bottom:i.value.height-l,width:i.value.width-r-n,height:i.value.height-o-l}}),w=e.computed(()=>d.dataset.length),c=e.ref({start:0,end:w.value}),Z=e.computed(()=>d.dataset.slice(c.value.start,c.value.end)),F=e.computed(()=>(d.dataset.forEach((o,n)=>{[null,void 0].includes(o[0])&&a.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"period (index 0)",index:n}),[null,void 0].includes(o[1])&&a.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"open (index 1)",index:n}),[null,void 0].includes(o[2])&&a.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"high (index 2)",index:n}),[null,void 0].includes(o[3])&&a.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"low (index 3)",index:n}),[null,void 0].includes(o[4])&&a.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"last (index 4)",index:n}),[null,void 0].includes(o[5])&&a.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"volume (index 5)",index:n})}),Z.value.map(o=>({period:o[0],open:o[1],high:o[2],low:o[3],last:o[4],volume:o[5]})))),s=e.computed(()=>u.value.width/Z.value.length),ee=e.computed(()=>({max:Math.max(...F.value.map(o=>o.high)),min:0})),m=e.computed(()=>a.calculateNiceScale(ee.value.min,ee.value.max,t.value.style.layout.grid.yAxis.dataLabels.steps));function $(o,n){return{...o,x:a.checkNaN(u.value.left+n*s.value+s.value/2),y:a.checkNaN(u.value.top+(1-o/m.value.max)*u.value.height),value:a.checkNaN(o)}}const f=e.computed(()=>F.value.map((o,n)=>{const l=$(o.open,n),r=$(o.high,n),y=$(o.low,n),_=$(o.last,n),z=o.last>o.open;return{period:o.period,open:l,high:r,low:y,last:_,volume:o.volume,isBullish:z}}));function ve(o){return a.checkNaN(o/m.value.max)}const me=e.computed(()=>m.value.ticks.map(o=>({y:u.value.bottom-u.value.height*ve(o),value:a.checkNaN(o)}))),ge=e.computed(()=>F.value.map(o=>o.period)),I=e.ref(null);function ke(o,n){T.value=o,I.value={datapoint:n,seriesIndex:o,series:f.value,config:t.value};const l=t.value.style.tooltip.customFormat;if(a.isFunction(l)&&a.functionReturnsString(()=>l({seriesIndex:o,datapoint:n,series:f.value,config:t.value})))E.value=l({seriesIndex:o,datapoint:n,series:f.value,config:t.value});else if(t.value.style.tooltip.show){let r="";const{period:y,open:_,high:z,low:re,last:ae,volume:ue,isBullish:se}=f.value[o],{period:gt,open:Ce,high:Ne,low:$e,last:Be,volume:Se}=t.value.translations;r+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${t.value.style.layout.candle.borderRadius*3}" stroke="${t.value.style.layout.candle.stroke}" stroke-width="${t.value.style.layout.candle.strokeWidth}"
fill="${t.value.style.layout.candle.gradient.show?se?`url(#bullish_gradient_${h.value})`:`url(#bearish_gradient_${h.value})`:se?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg>${y}</div>`,r+=`${Se} : <b>${isNaN(ue)?"-":Number(ue.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()}</b>`,r+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,r+=`<div>${Ce}: <b>${t.value.style.tooltip.prefix} ${isNaN(_.value)?"-":Number(_.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,r+=`<div>${Ne}: <b>${t.value.style.tooltip.prefix} ${isNaN(z.value)?"-":Number(z.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,r+=`<div>${$e}: <b>${t.value.style.tooltip.prefix} ${isNaN(re.value)?"-":Number(re.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,r+=`<div>${Be}: <b>${t.value.style.tooltip.prefix} ${isNaN(ae.value)?"-":Number(ae.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,r+="</div>",E.value=`<div style="text-align:right">${r}</div>`}V.value=!0}function xe(){te()}const k=e.ref(null);async function te(){(t.value.style.zoom.startIndex!==null||t.value.style.zoom.endIndex!==null)&&k.value?(t.value.style.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),k.value&&k.value.setStartValue(t.value.style.zoom.startIndex)),t.value.style.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),k.value&&k.value.setEndValue(be(t.value.style.zoom.endIndex+1)))):(c.value={start:0,end:w.value},C.value+=1)}function be(o){const n=w.value;return o>n?n:o<0||t.value.style.zoom.startIndex!==null&&o<t.value.style.zoom.startIndex?t.value.style.zoom.startIndex!==null?t.value.style.zoom.startIndex+1:1:o}function oe(){e.nextTick(()=>{const o=[t.value.translations.period,t.value.translations.open,t.value.translations.high,t.value.translations.low,t.value.translations.last,t.value.translations.volume],n=f.value.map(y=>[y.period,y.open.value,y.high.value,y.low.value,y.last.value,y.volume]),l=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([o]).concat(n),r=a.createCsvContent(l);a.downloadCsv({csvContent:r,title:t.value.style.title.text||"vue-ui-candlestick"})})}const B=e.computed(()=>{const o=f.value.map(r=>[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" :rx="${t.value.style.layout.candle.borderRadius*3}" fill="${t.value.style.layout.candle.gradient.show?r.isBullish?`url(#bullish_gradient_${h.value}`:`url(#bearish_gradient_${h.value})`:r.isBullish?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg> ${r.period}`,`${t.value.table.td.prefix} ${isNaN(r.open.value)?"-":Number(r.open.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(r.high.value)?"-":Number(r.high.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(r.low.value)?"-":Number(r.low.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(r.last.value)?"-":Number(r.last.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${isNaN(r.volume)?"-":r.volume.toLocaleString()}`]),n={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},l=[t.value.translations.period,t.value.translations.open,t.value.translations.high,t.value.translations.low,t.value.translations.last,t.value.translations.volume];return{head:l,body:o,config:n,colNames:l}}),x=e.ref(!1);function we(o){x.value=o,L.value+=1}function le(){p.value.showTable=!p.value.showTable}function ne(){p.value.showTooltip=!p.value.showTooltip}const S=e.ref(!1);function P(){S.value=!S.value}return fe({generatePdf:K,generateCsv:oe,generateImage:Q,toggleTable:le,toggleTooltip:ne,toggleAnnotator:P}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"candlestickChart",ref:g,class:e.normalizeClass(`vue-ui-candlestick ${e.unref(x)?"vue-data-ui-wrapper-fullscreen":""} ${e.unref(t).useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`position:relative;font-family:${e.unref(t).style.fontFamily}; text-align:center;background:${e.unref(t).style.backgroundColor}; ${e.unref(t).responsive?"height: 100%":""}`),id:`vue-ui-candlestick_${e.unref(h)}`,onMouseenter:n[4]||(n[4]=()=>e.unref(G)(!0)),onMouseleave:n[5]||(n[5]=()=>e.unref(G)(!1))},[e.unref(t).userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ie.PenAndPaper,{key:0,parent:e.unref(g),backgroundColor:e.unref(t).style.backgroundColor,color:e.unref(t).style.color,active:e.unref(S),onClose:P},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.unref(pe)?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:D,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),e.unref(t).style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:R,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(_e._sfc_main,{key:`title_${e.unref(W)}`,config:{title:{cy:"candlestick-div-title",...e.unref(t).style.title},subtitle:{cy:"candlestick-div-subtitle",...e.unref(t).style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),e.unref(t).userOptions.show&&e.unref(b)&&(e.unref(H)||e.unref(A))?(e.openBlock(),e.createBlock(de.UserOptions,{ref_key:"details",ref:he,key:`user_options_${e.unref(L)}`,backgroundColor:e.unref(t).style.backgroundColor,color:e.unref(t).style.color,isImaging:e.unref(J),isPrinting:e.unref(Y),uid:e.unref(h),hasTooltip:e.unref(t).userOptions.buttons.tooltip&&e.unref(t).style.tooltip.show,hasPdf:e.unref(t).userOptions.buttons.pdf,hasImg:e.unref(t).userOptions.buttons.img,hasXls:e.unref(t).userOptions.buttons.csv,hasTable:e.unref(t).userOptions.buttons.table,hasFullscreen:e.unref(t).userOptions.buttons.fullscreen,isFullscreen:e.unref(x),isTooltip:e.unref(p).showTooltip,titles:{...e.unref(t).userOptions.buttonTitles},chartElement:e.unref(g),position:e.unref(t).userOptions.position,hasAnnotator:e.unref(t).userOptions.buttons.annotator,isAnnotation:e.unref(S),onToggleFullscreen:we,onGeneratePdf:e.unref(K),onGenerateCsv:oe,onGenerateImage:e.unref(Q),onToggleTable:le,onToggleTooltip:ne,onToggleAnnotator:P,style:e.normalizeStyle({visibility:e.unref(H)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.unref(b)?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":e.unref(x),"vue-data-ui-fulscreen--off":!e.unref(x)}),viewBox:`0 0 ${e.unref(i).width<=0?10:e.unref(i).width} ${e.unref(i).height<=0?10:e.unref(i).height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${e.unref(t).style.color}`)},[e.createVNode(Fe._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:e.unref(u).left,y:e.unref(u).top,width:e.unref(u).width,height:e.unref(u).height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Ue)):e.createCommentVNode("",!0),e.unref(f).length>0?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`bearish_gradient_${e.unref(h)}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(t).style.layout.candle.colors.bearish},null,8,qe),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(a.shiftHue)(e.unref(t).style.layout.candle.colors.bearish,.02)}DE`},null,8,We),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(a.shiftHue)(e.unref(t).style.layout.candle.colors.bearish,.05)}66`},null,8,Ge)],8,De),e.createElementVNode("linearGradient",{id:`bullish_gradient_${e.unref(h)}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(t).style.layout.candle.colors.bullish},null,8,je),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(a.shiftHue)(e.unref(t).style.layout.candle.colors.bullish,.02)}DE`},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(a.shiftHue)(e.unref(t).style.layout.candle.colors.bullish,.05)}66`},null,8,Ye)],8,He)]),e.unref(t).style.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Je,[e.createElementVNode("line",{x1:e.unref(u).left,x2:e.unref(u).left,y1:e.unref(u).top,y2:e.unref(u).bottom,stroke:e.unref(t).style.layout.grid.stroke,"stroke-width":e.unref(t).style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ke),e.createElementVNode("line",{x1:e.unref(u).left,x2:e.unref(u).right,y1:e.unref(u).bottom,y2:e.unref(u).bottom,stroke:e.unref(t).style.layout.grid.stroke,"stroke-width":e.unref(t).style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Qe)])):e.createCommentVNode("",!0),e.unref(t).style.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(me),(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[l.value>=e.unref(m).min&&l.value<=e.unref(m).max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:e.unref(u).left,x2:e.unref(u).left-5,y1:l.y,y2:l.y,stroke:e.unref(t).style.layout.grid.stroke,"stroke-width":e.unref(t).style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,et)):e.createCommentVNode("",!0),l.value>=e.unref(m).min&&l.value<=e.unref(m).max?(e.openBlock(),e.createElementBlock("text",{key:1,x:e.unref(u).left-8+e.unref(t).style.layout.grid.yAxis.dataLabels.offsetX,y:l.y+e.unref(i).yAxisFontSize/3,"font-size":e.unref(i).yAxisFontSize,"text-anchor":"end",fill:e.unref(t).style.layout.grid.yAxis.dataLabels.color,"font-weight":e.unref(t).style.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(e.unref(t).style.layout.grid.yAxis.dataLabels.prefix)+" "+e.toDisplayString(e.unref(a.canShowValue)(l.value)?l.value.toFixed(e.unref(t).style.layout.grid.yAxis.dataLabels.roundingValue):"")+" "+e.toDisplayString(e.unref(t).style.layout.grid.yAxis.dataLabels.suffix),9,tt)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),e.unref(t).style.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ge),(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{transform:`translate(${e.unref(u).left+e.unref(s)*r+e.unref(s)/2}, ${e.unref(u).bottom+e.unref(i).xAxisFontSize*2+e.unref(t).style.layout.grid.xAxis.dataLabels.offsetY}), rotate(${e.unref(t).style.layout.grid.xAxis.dataLabels.rotation})`,"text-anchor":e.unref(t).style.layout.grid.xAxis.dataLabels.rotation>0?"start":e.unref(t).style.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":e.unref(i).xAxisFontSize,fill:e.unref(t).style.layout.grid.xAxis.dataLabels.color,"font-weight":e.unref(t).style.layout.grid.xAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(l),9,lt)]))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("line",{x1:l.open.x,x2:l.open.x,y1:l.high.y,y2:l.low.y,stroke:e.unref(t).style.layout.wick.stroke,"stroke-width":e.unref(t).style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,nt),e.unref(t).style.layout.wick.extremity.shape==="circle"?(e.openBlock(),e.createElementBlock("g",rt,[e.createElementVNode("circle",{cx:l.high.x,cy:l.high.y,r:e.unref(t).style.layout.wick.extremity.size==="auto"?e.unref(s)/20:e.unref(t).style.layout.wick.extremity.size,fill:e.unref(t).style.layout.wick.extremity.color},null,8,at),e.createElementVNode("circle",{cx:l.low.x,cy:l.low.y,r:e.unref(t).style.layout.wick.extremity.size==="auto"?e.unref(s)/20:e.unref(t).style.layout.wick.extremity.size,fill:e.unref(t).style.layout.wick.extremity.color},null,8,ut)])):e.createCommentVNode("",!0),e.unref(t).style.layout.wick.extremity.shape==="line"?(e.openBlock(),e.createElementBlock("g",st,[e.createElementVNode("line",{x1:l.high.x-(e.unref(t).style.layout.wick.extremity.size==="auto"?e.unref(s)*e.unref(t).style.layout.candle.widthRatio:e.unref(t).style.layout.wick.extremity.size)/2,x2:l.high.x+(e.unref(t).style.layout.wick.extremity.size==="auto"?e.unref(s)*e.unref(t).style.layout.candle.widthRatio:e.unref(t).style.layout.wick.extremity.size)/2,y1:l.high.y,y2:l.high.y,stroke:e.unref(t).style.layout.wick.extremity.color,"stroke-width":e.unref(t).style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,it),e.createElementVNode("line",{x1:l.low.x-(e.unref(t).style.layout.wick.extremity.size==="auto"?e.unref(s)*e.unref(t).style.layout.candle.widthRatio:e.unref(t).style.layout.wick.extremity.size)/2,x2:l.low.x+(e.unref(t).style.layout.wick.extremity.size==="auto"?e.unref(s)*e.unref(t).style.layout.candle.widthRatio:e.unref(t).style.layout.wick.extremity.size)/2,y1:l.low.y,y2:l.low.y,stroke:e.unref(t).style.layout.wick.extremity.color,"stroke-width":e.unref(t).style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,dt)])):e.createCommentVNode("",!0)]))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(l,r)=>(e.openBlock(),e.createElementBlock("rect",{x:l.open.x-e.unref(s)/2+e.unref(s)*(1-e.unref(t).style.layout.candle.widthRatio)/2,y:l.isBullish?l.last.y:l.open.y,height:Math.abs(l.last.y-l.open.y)<=0?1e-4:Math.abs(l.last.y-l.open.y),width:e.unref(s)*e.unref(t).style.layout.candle.widthRatio<=0?1e-4:e.unref(s)*e.unref(t).style.layout.candle.widthRatio,fill:e.unref(t).style.layout.candle.gradient.underlayer,rx:e.unref(t).style.layout.candle.borderRadius,stroke:"none"},null,8,ct))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(l,r)=>(e.openBlock(),e.createElementBlock("rect",{x:l.open.x-e.unref(s)/2+e.unref(s)*(1-e.unref(t).style.layout.candle.widthRatio)/2,y:l.isBullish?l.last.y:l.open.y,height:Math.abs(l.last.y-l.open.y)<=0?1e-4:Math.abs(l.last.y-l.open.y),width:e.unref(s)*e.unref(t).style.layout.candle.widthRatio<=0?1e-4:e.unref(s)*e.unref(t).style.layout.candle.widthRatio,fill:l.isBullish?e.unref(t).style.layout.candle.gradient.show?`url(#bullish_gradient_${e.unref(h)})`:e.unref(t).style.layout.candle.colors.bullish:e.unref(t).style.layout.candle.gradient.show?`url(#bearish_gradient_${e.unref(h)})`:e.unref(t).style.layout.candle.colors.bearish,rx:e.unref(t).style.layout.candle.borderRadius,stroke:e.unref(t).style.layout.candle.stroke,"stroke-width":e.unref(t).style.layout.candle.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,ft))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(l,r)=>(e.openBlock(),e.createElementBlock("rect",{x:e.unref(u).left+r*e.unref(s),y:e.unref(u).top,height:e.unref(u).height<=0?1e-4:e.unref(u).height,width:e.unref(s)<=0?1e-4:e.unref(s),fill:e.unref(T)===r?e.unref(a.setOpacity)(e.unref(t).style.layout.selector.color,e.unref(t).style.layout.selector.opacity):"transparent",onMouseover:y=>ke(r,l),onMouseleave:n[0]||(n[0]=y=>{T.value=void 0,V.value=!1})},null,40,yt))),256))])])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:e.unref(i)},void 0,!0)],14,Oe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ht,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),e.unref(b)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ee.default,{key:6,config:{type:"candlesticks",style:{backgroundColor:e.unref(t).style.backgroundColor,candlesticks:{axis:{color:"#CCCCCC"},candle:{color:"#CCCCCC"}}}}},null,8,["config"])),e.unref(t).style.zoom.show&&e.unref(b)?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"chartSlicer",ref:U},[(e.openBlock(),e.createBlock(Te.Slicer,{ref_key:"slicerComponent",ref:k,key:`slicer_${e.unref(C)}`,background:e.unref(t).style.zoom.color,borderColor:e.unref(t).style.backgroundColor,fontSize:e.unref(t).style.zoom.fontSize,useResetSlot:e.unref(t).style.zoom.useResetSlot,labelLeft:v.dataset[e.unref(c).start]?v.dataset[e.unref(c).start][0]:v.dataset[0][0],labelRight:v.dataset[e.unref(c).end-1]?v.dataset[e.unref(c).end-1][0]:v.dataset.at(-1)[0],textColor:e.unref(t).style.color,inputColor:e.unref(t).style.zoom.color,selectColor:e.unref(t).style.zoom.highlightColor,max:e.unref(w),min:0,valueStart:e.unref(c).start,valueEnd:e.unref(c).end,start:e.unref(c).start,"onUpdate:start":n[1]||(n[1]=l=>e.unref(c).start=l),end:e.unref(c).end,"onUpdate:end":n[2]||(n[2]=l=>e.unref(c).end=l),refreshStartPoint:e.unref(t).style.zoom.startIndex!==null?e.unref(t).style.zoom.startIndex:0,refreshEndPoint:e.unref(t).style.zoom.endIndex!==null?e.unref(t).style.zoom.endIndex+1:e.unref(w),onReset:xe},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(o.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint"]))],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"chartLegend",ref:O},[e.renderSlot(o.$slots,"legend",{legend:e.unref(f)},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:8,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:e.unref(p).showTooltip&&e.unref(V),backgroundColor:e.unref(t).style.tooltip.backgroundColor,color:e.unref(t).style.tooltip.color,borderRadius:e.unref(t).style.tooltip.borderRadius,borderColor:e.unref(t).style.tooltip.borderColor,borderWidth:e.unref(t).style.tooltip.borderWidth,fontSize:e.unref(t).style.tooltip.fontSize,backgroundOpacity:e.unref(t).style.tooltip.backgroundOpacity,position:e.unref(t).style.tooltip.position,offsetY:e.unref(t).style.tooltip.offsetY,parent:e.unref(g),content:e.unref(E),isFullscreen:e.unref(x),isCustom:e.unref(t).style.tooltip.customFormat&&typeof e.unref(t).style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...e.unref(I)})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...e.unref(I)})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),e.unref(b)?(e.openBlock(),e.createBlock(Ae.default,{key:9,hideDetails:"",config:{open:e.unref(p).showTable,maxHeight:1e4,body:{backgroundColor:e.unref(t).style.backgroundColor,color:e.unref(t).style.color},head:{backgroundColor:e.unref(t).style.backgroundColor,color:e.unref(t).style.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ve.DataTable,{key:`table_${e.unref(q)}`,colNames:e.unref(B).colNames,head:e.unref(B).head,body:e.unref(B).body,config:e.unref(B).config,title:`${e.unref(t).style.title.text}${e.unref(t).style.title.subtitle.text?` : ${e.unref(t).style.title.subtitle.text}`:""}`,onClose:n[3]||(n[3]=l=>e.unref(p).showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[e.createElementVNode("div",{innerHTML:l},null,8,pt)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Re))}},mt=Le._export_sfc(vt,[["__scopeId","data-v-0dd3964d"]]);exports.default=mt;
;