vue-data-ui 2.4.21 → 2.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/{Arrow-BuVX2WoN.js → Arrow-BW_I0Vmx.js} +1 -1
  2. package/dist/{Arrow-DDe-g8rw.cjs → Arrow-D2zjDsxe.cjs} +1 -1
  3. package/dist/{BaseIcon-BdKOa64A.cjs → BaseIcon-BCC16NCl.cjs} +1 -1
  4. package/dist/{BaseIcon-BRSPQaGQ.js → BaseIcon-BbbAnrZI.js} +1 -1
  5. package/dist/{DataTable-BpVz3DBX.js → DataTable-Ce4R8v-3.js} +2 -2
  6. package/dist/{DataTable-H-KTkjfv.cjs → DataTable-DeevzR8O.cjs} +1 -1
  7. package/dist/{Legend-G5Zc4QaZ.cjs → Legend-BksImVUi.cjs} +1 -1
  8. package/dist/{Legend-hnLfwhmm.js → Legend-C6q2bLVV.js} +1 -1
  9. package/dist/{PackageVersion-BbQFSVXm.cjs → PackageVersion-AftniVVo.cjs} +1 -1
  10. package/dist/{PackageVersion-wqab02xF.js → PackageVersion-g2UOsY7H.js} +1 -1
  11. package/dist/{PenAndPaper-C_laA5mt.js → PenAndPaper-DRFeGfqV.js} +3 -3
  12. package/dist/{PenAndPaper-BX8pR5oV.cjs → PenAndPaper-j5noaKJZ.cjs} +1 -1
  13. package/dist/{Shape-QdnXSUyn.js → Shape-CBu7ails.js} +1 -1
  14. package/dist/{Shape-CJbFv4bs.cjs → Shape-Cf2Cj3g6.cjs} +1 -1
  15. package/dist/{Slicer-DV1kBscZ.js → Slicer-C0bRksfh.js} +2 -2
  16. package/dist/{Slicer-C1blYfez.cjs → Slicer-IneBjcpY.cjs} +1 -1
  17. package/dist/{Title-DBozX6nP.js → Title-B2orjUIW.js} +1 -1
  18. package/dist/{Title-BRqTk-nT.cjs → Title-BxrsVY3-.cjs} +1 -1
  19. package/dist/{Tooltip-DvGSIp31.cjs → Tooltip-BXc56Oxr.cjs} +1 -1
  20. package/dist/{Tooltip-Com_T8vc.js → Tooltip-CXjc5vb3.js} +1 -1
  21. package/dist/{index-CsQwCVqU.cjs → index-3oZdQf6G.cjs} +1 -1
  22. package/dist/{index-hV0hU1iE.js → index-D020Kb3z.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-CRAUOmT5.js → useNestedProp-CZkNAGQh.js} +1 -1
  25. package/dist/{useNestedProp-DSYpaLxP.cjs → useNestedProp-vPTP0Wem.cjs} +1 -1
  26. package/dist/{usePrinter-O2fMMTMe.cjs → usePrinter-BKzxQK4e.cjs} +1 -1
  27. package/dist/{usePrinter-y3d31M4g.js → usePrinter-CN0J0NFL.js} +1 -1
  28. package/dist/{vue-data-ui-qBad3a6z.cjs → vue-data-ui-CWDZLUkp.cjs} +1 -1
  29. package/dist/{vue-data-ui-bEKZH8jG.js → vue-data-ui-e2cclW_4.js} +58 -58
  30. package/dist/vue-data-ui.cjs +1 -1
  31. package/dist/vue-data-ui.js +1 -1
  32. package/dist/{vue-ui-3d-bar-CkqKnqQt.cjs → vue-ui-3d-bar-DCeFCwb0.cjs} +1 -1
  33. package/dist/{vue-ui-3d-bar-f7YaBbrh.js → vue-ui-3d-bar-DggyGAlC.js} +9 -9
  34. package/dist/{vue-ui-accordion-m-s-7akB.js → vue-ui-accordion-B0fEWLwn.js} +3 -3
  35. package/dist/{vue-ui-accordion-CaktYQoo.cjs → vue-ui-accordion-QoJofzqF.cjs} +1 -1
  36. package/dist/{vue-ui-age-pyramid-EKKYQu3N.cjs → vue-ui-age-pyramid-CXtRGpVa.cjs} +1 -1
  37. package/dist/{vue-ui-age-pyramid-DkfNZR86.js → vue-ui-age-pyramid-DGDvfcvP.js} +10 -10
  38. package/dist/{vue-ui-annotator-DrVu5Pu0.js → vue-ui-annotator-BETCQ-pV.js} +1 -1
  39. package/dist/{vue-ui-annotator-v07J6oQG.cjs → vue-ui-annotator-BEZ0D_12.cjs} +1 -1
  40. package/dist/{vue-ui-bullet-CYDMehDZ.js → vue-ui-bullet-BK3d_nhc.js} +8 -8
  41. package/dist/{vue-ui-bullet-CdG92x7A.cjs → vue-ui-bullet-qAGQkwN4.cjs} +1 -1
  42. package/dist/{vue-ui-candlestick-Bw1O3QmK.js → vue-ui-candlestick-DQR8cYLr.js} +11 -11
  43. package/dist/{vue-ui-candlestick-D9yN-yRo.cjs → vue-ui-candlestick-DwfFHSRG.cjs} +1 -1
  44. package/dist/{vue-ui-carousel-table-kcQa0FHw.js → vue-ui-carousel-table-B6TSxUwp.js} +4 -4
  45. package/dist/{vue-ui-carousel-table-Cg6hAEVv.cjs → vue-ui-carousel-table-BrIXFgJp.cjs} +1 -1
  46. package/dist/{vue-ui-chestnut-Qu8c3_vB.cjs → vue-ui-chestnut-CWtw_edx.cjs} +1 -1
  47. package/dist/{vue-ui-chestnut-DE1AMXeX.js → vue-ui-chestnut-CpINqXRz.js} +8 -8
  48. package/dist/{vue-ui-cursor-DG8oufeh.cjs → vue-ui-cursor-DvX6FbhZ.cjs} +1 -1
  49. package/dist/{vue-ui-cursor-DbfjKtpf.js → vue-ui-cursor-yI58QC1O.js} +2 -2
  50. package/dist/{vue-ui-dashboard-BbwgfxLx.cjs → vue-ui-dashboard-BCic2CfN.cjs} +1 -1
  51. package/dist/{vue-ui-dashboard-CAkCNUBh.js → vue-ui-dashboard-Bb7vJ0Nx.js} +2 -2
  52. package/dist/{vue-ui-digits-DgQkxULm.cjs → vue-ui-digits-C4dI1v6b.cjs} +1 -1
  53. package/dist/{vue-ui-digits-BaXAiH4u.js → vue-ui-digits-D4uy7_hL.js} +2 -2
  54. package/dist/{vue-ui-donut-7GM_Wd1Y.js → vue-ui-donut-CRiEc5mP.js} +11 -11
  55. package/dist/{vue-ui-donut-BHzCOBu6.cjs → vue-ui-donut-ClvjMOxC.cjs} +1 -1
  56. package/dist/{vue-ui-donut-evolution-C-TkUOr6.cjs → vue-ui-donut-evolution-DFkGtmhv.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-DbU4RlP6.js → vue-ui-donut-evolution-DgrQVEh2.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-DacMeiTU.cjs → vue-ui-dumbbell-BdkARfxX.cjs} +1 -1
  59. package/dist/{vue-ui-dumbbell-BacTx3zB.js → vue-ui-dumbbell-QCB4jZm4.js} +10 -10
  60. package/dist/{vue-ui-flow-D2G0YWL9.js → vue-ui-flow-CRnCk5Is.js} +9 -9
  61. package/dist/{vue-ui-flow-BUAvjG7i.cjs → vue-ui-flow-CYfdTIad.cjs} +1 -1
  62. package/dist/{vue-ui-galaxy-CxfV3BIw.cjs → vue-ui-galaxy-Cn9t3BG5.cjs} +1 -1
  63. package/dist/{vue-ui-galaxy-D6RFyIbQ.js → vue-ui-galaxy-WhRsA1Is.js} +11 -11
  64. package/dist/{vue-ui-gauge-DNJXnyLw.js → vue-ui-gauge-DwmCZiTj.js} +7 -7
  65. package/dist/{vue-ui-gauge-CJ5TKJpb.cjs → vue-ui-gauge-jYskVFUy.cjs} +1 -1
  66. package/dist/{vue-ui-gizmo-BBA51j_0.cjs → vue-ui-gizmo-C2P2qQYU.cjs} +1 -1
  67. package/dist/{vue-ui-gizmo-Db7-gRmB.js → vue-ui-gizmo-DpEZm4Uk.js} +3 -3
  68. package/dist/{vue-ui-heatmap-KQj8Jbpt.cjs → vue-ui-heatmap-D7TGNxC-.cjs} +1 -1
  69. package/dist/{vue-ui-heatmap-Ba6RMSTk.js → vue-ui-heatmap-u3SOjwts.js} +10 -10
  70. package/dist/{vue-ui-kpi-1srKxA1L.cjs → vue-ui-kpi-CCr0pHjp.cjs} +1 -1
  71. package/dist/{vue-ui-kpi-C8wyHy1H.js → vue-ui-kpi-Cdz5RM6j.js} +3 -3
  72. package/dist/{vue-ui-mini-loader-DutVmCuC.js → vue-ui-mini-loader-B2Xh0j5H.js} +2 -2
  73. package/dist/{vue-ui-mini-loader-BgKTecng.cjs → vue-ui-mini-loader-BuCeYPNP.cjs} +1 -1
  74. package/dist/{vue-ui-molecule-BOkIojio.js → vue-ui-molecule-GPDqR2rp.js} +11 -11
  75. package/dist/{vue-ui-molecule-CSezTn3m.cjs → vue-ui-molecule-z1A47zG1.cjs} +1 -1
  76. package/dist/{vue-ui-mood-radar-C8U8PHaq.js → vue-ui-mood-radar-DdQC5bH5.js} +11 -11
  77. package/dist/{vue-ui-mood-radar-CNTDrRs6.cjs → vue-ui-mood-radar-YZfCADah.cjs} +1 -1
  78. package/dist/{vue-ui-nested-donuts-DRWWnsdR.cjs → vue-ui-nested-donuts-CDSRcEX0.cjs} +1 -1
  79. package/dist/{vue-ui-nested-donuts-Bv2D1uFd.js → vue-ui-nested-donuts-Cf_KfoeP.js} +11 -11
  80. package/dist/{vue-ui-onion-CsnwbXED.cjs → vue-ui-onion-CmGZo3Sf.cjs} +1 -1
  81. package/dist/{vue-ui-onion-CT9YjU8v.js → vue-ui-onion-Lw3ohFAX.js} +11 -11
  82. package/dist/{vue-ui-parallel-coordinate-plot-C8KCRAX1.cjs → vue-ui-parallel-coordinate-plot-AHpf7ejC.cjs} +1 -1
  83. package/dist/{vue-ui-parallel-coordinate-plot-in5qpfXf.js → vue-ui-parallel-coordinate-plot-BsT0r0hr.js} +12 -12
  84. package/dist/{vue-ui-quadrant-Bw-0aW4F.cjs → vue-ui-quadrant-BPUIyB4-.cjs} +1 -1
  85. package/dist/{vue-ui-quadrant-C_9VNAXg.js → vue-ui-quadrant-BTmoe6UT.js} +12 -12
  86. package/dist/{vue-ui-quick-chart-C0YqMjyE.cjs → vue-ui-quick-chart-BYyXa06h.cjs} +1 -1
  87. package/dist/{vue-ui-quick-chart-BDBlm9uu.js → vue-ui-quick-chart-CRtE0pcc.js} +9 -9
  88. package/dist/{vue-ui-radar-C2QM_ee9.js → vue-ui-radar-BpkjOSOI.js} +12 -12
  89. package/dist/{vue-ui-radar-DXKMbeyW.cjs → vue-ui-radar-krdMX_hl.cjs} +1 -1
  90. package/dist/{vue-ui-rating-CsOknvaV.cjs → vue-ui-rating-9kj9GE7P.cjs} +1 -1
  91. package/dist/{vue-ui-rating-DVpgv2AY.js → vue-ui-rating-D1RlkwK9.js} +2 -2
  92. package/dist/{vue-ui-relation-circle-OXfdAyky.js → vue-ui-relation-circle-B7WGb08k.js} +7 -7
  93. package/dist/{vue-ui-relation-circle-ZA-M7aSc.cjs → vue-ui-relation-circle-Kv3G0P5k.cjs} +1 -1
  94. package/dist/{vue-ui-rings-qLQ-gl21.js → vue-ui-rings-DjXcLsY1.js} +11 -11
  95. package/dist/{vue-ui-rings-rftqDu-q.cjs → vue-ui-rings-DsZPnoqm.cjs} +1 -1
  96. package/dist/{vue-ui-scatter-Cv2IcrVH.cjs → vue-ui-scatter-D3ntjnfT.cjs} +1 -1
  97. package/dist/{vue-ui-scatter-4LbMvEAD.js → vue-ui-scatter-DEkTyyG8.js} +12 -12
  98. package/dist/{vue-ui-screenshot-BgjnQNxG.cjs → vue-ui-screenshot-BEbUxjNl.cjs} +1 -1
  99. package/dist/{vue-ui-screenshot-BV6ZYQRk.js → vue-ui-screenshot-kiJVXAGt.js} +1 -1
  100. package/dist/{vue-ui-skeleton-DsRTbz6d.cjs → vue-ui-skeleton-CI8sxaqr.cjs} +1 -1
  101. package/dist/{vue-ui-skeleton-BY8Jg9a_.js → vue-ui-skeleton-E1-7diF5.js} +3 -3
  102. package/dist/{vue-ui-smiley-BQ_3uicm.js → vue-ui-smiley-Cjbqlfre.js} +2 -2
  103. package/dist/{vue-ui-smiley-DB3y8CIb.cjs → vue-ui-smiley-CmkUQtfb.cjs} +1 -1
  104. package/dist/{vue-ui-spark-trend-Cgn7ONtS.cjs → vue-ui-spark-trend-C60Ypeev.cjs} +1 -1
  105. package/dist/{vue-ui-spark-trend-BhCJfY_p.js → vue-ui-spark-trend-DfpFe1UQ.js} +5 -5
  106. package/dist/{vue-ui-sparkbar-DxXt-GHr.js → vue-ui-sparkbar-B5oV2RUs.js} +4 -4
  107. package/dist/{vue-ui-sparkbar-D4GIhUXT.cjs → vue-ui-sparkbar-BAa71eZp.cjs} +1 -1
  108. package/dist/{vue-ui-sparkgauge-BbltbIrq.cjs → vue-ui-sparkgauge-UejPQm4b.cjs} +1 -1
  109. package/dist/{vue-ui-sparkgauge-BCPkJveV.js → vue-ui-sparkgauge-xlERw-g0.js} +4 -4
  110. package/dist/{vue-ui-sparkhistogram-DzX6lkk8.cjs → vue-ui-sparkhistogram-DC4jzkI0.cjs} +1 -1
  111. package/dist/{vue-ui-sparkhistogram-BKcr2mFc.js → vue-ui-sparkhistogram-nzFRlmgx.js} +5 -5
  112. package/dist/{vue-ui-sparkline-C-svTmFU.cjs → vue-ui-sparkline-BT4hxfBE.cjs} +1 -1
  113. package/dist/{vue-ui-sparkline-DYHUFUOp.js → vue-ui-sparkline-Duu0VrnG.js} +4 -4
  114. package/dist/{vue-ui-sparkstackbar-CL0uL_Te.cjs → vue-ui-sparkstackbar-K_vPau1u.cjs} +1 -1
  115. package/dist/{vue-ui-sparkstackbar-Btag2osm.js → vue-ui-sparkstackbar-tyoFIhva.js} +5 -5
  116. package/dist/{vue-ui-stackbar-CML7v_yU.cjs → vue-ui-stackbar-DRlvF164.cjs} +1 -1
  117. package/dist/{vue-ui-stackbar-C2mRU7ya.js → vue-ui-stackbar-e8BUjttp.js} +12 -12
  118. package/dist/{vue-ui-strip-plot-Vn5sEcME.cjs → vue-ui-strip-plot-8MOhIicL.cjs} +1 -1
  119. package/dist/{vue-ui-strip-plot-BIXF3VxN.js → vue-ui-strip-plot-Ef8oKjNV.js} +11 -11
  120. package/dist/{vue-ui-table-CyuRalnp.js → vue-ui-table-BOV6jtcL.js} +1 -1
  121. package/dist/{vue-ui-table-BbVpmm0B.cjs → vue-ui-table-DfevkNnK.cjs} +1 -1
  122. package/dist/{vue-ui-table-heatmap-DrQXQd41.cjs → vue-ui-table-heatmap-BMyRP1ol.cjs} +1 -1
  123. package/dist/{vue-ui-table-heatmap-DlGeS3l9.js → vue-ui-table-heatmap-CL-MybKI.js} +4 -4
  124. package/dist/{vue-ui-table-sparkline-DauDTktD.cjs → vue-ui-table-sparkline-CsqcT3ff.cjs} +1 -1
  125. package/dist/{vue-ui-table-sparkline-Yg2I33yZ.js → vue-ui-table-sparkline-DXvxiDJJ.js} +5 -5
  126. package/dist/{vue-ui-thermometer-Bglz0dOQ.cjs → vue-ui-thermometer-DyYqfAOW.cjs} +1 -1
  127. package/dist/{vue-ui-thermometer-DXwbqNrn.js → vue-ui-thermometer-WKzTNOOX.js} +7 -7
  128. package/dist/{vue-ui-timer-Brr7buaM.js → vue-ui-timer-CFDkyaxV.js} +5 -5
  129. package/dist/{vue-ui-timer-CpSEl8UD.cjs → vue-ui-timer-DQQGe1jt.cjs} +1 -1
  130. package/dist/{vue-ui-tiremarks-zdGmZNjo.cjs → vue-ui-tiremarks-C8iAWe-u.cjs} +1 -1
  131. package/dist/{vue-ui-tiremarks-DJowPFwY.js → vue-ui-tiremarks-aiUC8-YL.js} +7 -7
  132. package/dist/{vue-ui-treemap-a7NSP656.cjs → vue-ui-treemap-BORZ3g1I.cjs} +1 -1
  133. package/dist/{vue-ui-treemap-Bn5JU5BI.js → vue-ui-treemap-Bw-bWkza.js} +11 -11
  134. package/dist/{vue-ui-vertical-bar-CZxN7L9z.js → vue-ui-vertical-bar--mYbTcpi.js} +11 -11
  135. package/dist/{vue-ui-vertical-bar-BYG1vGlT.cjs → vue-ui-vertical-bar-B3ypOHUB.cjs} +1 -1
  136. package/dist/{vue-ui-waffle-CzUpKfkZ.js → vue-ui-waffle-Bj-tJs4n.js} +11 -11
  137. package/dist/{vue-ui-waffle-BbDBOivH.cjs → vue-ui-waffle-_84Hvek7.cjs} +1 -1
  138. package/dist/{vue-ui-wheel-CCje_ZSc.js → vue-ui-wheel-BywwqvY2.js} +7 -7
  139. package/dist/{vue-ui-wheel-lN3uYCr4.cjs → vue-ui-wheel-C-v9TgG1.cjs} +1 -1
  140. package/dist/{vue-ui-word-cloud-BjvG3n7x.cjs → vue-ui-word-cloud-CaQ4jLed.cjs} +1 -1
  141. package/dist/{vue-ui-word-cloud-D_5y92zN.js → vue-ui-word-cloud-CwExwCYc.js} +10 -10
  142. package/dist/{vue-ui-xy-Drm1aAb-.js → vue-ui-xy-CAYxRDzC.js} +14 -14
  143. package/dist/{vue-ui-xy-B-WlwJXZ.cjs → vue-ui-xy-CT3-xPpa.cjs} +1 -1
  144. package/dist/{vue-ui-xy-canvas-jieVsnBN.js → vue-ui-xy-canvas-BOElCo0f.js} +133 -131
  145. package/dist/vue-ui-xy-canvas-CdrfnVuI.cjs +9 -0
  146. package/package.json +1 -1
  147. package/dist/vue-ui-xy-canvas-BHrq_CYD.cjs +0 -9
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),n=require("./index-3oZdQf6G.cjs"),d=require("./useResponsive-BJ7DTGpm.cjs"),Je=require("./Tooltip-BXc56Oxr.cjs"),Ke=require("./Legend-BksImVUi.cjs"),Qe=require("./Title-BxrsVY3-.cjs"),et=require("./Slicer-IneBjcpY.cjs"),Pe=require("./usePrinter-BKzxQK4e.cjs"),tt=require("./vue-ui-accordion-QoJofzqF.cjs"),at=require("./DataTable-DeevzR8O.cjs"),lt=require("./vue-ui-skeleton-CI8sxaqr.cjs"),Me=require("./useNestedProp-vPTP0Wem.cjs"),ot=require("./PenAndPaper-j5noaKJZ.cjs"),rt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ut=["id"],nt=["onClick"],st={key:2,class:"vue-data-ui-watermark"},it=["innerHTML"],ct={__name:"vue-ui-xy-canvas",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(le,{expose:Re,emit:Oe}){const z=le,{vue_ui_xy_canvas:Ne}=n.useConfig(),U=a.ref(n.createUid()),B=a.ref(null),C=a.ref(null),I=a.ref(null),i=a.ref(null),p=a.ref(1),$=a.ref(1),A=a.ref(!1),f=a.ref(null),_=a.ref(""),oe=a.ref(null),L=a.ref([]),O=a.ref(1),R=a.ref(!0),w=a.ref(!0),X=a.ref(null),re=a.ref(0),ue=a.ref(0),Z=a.ref(!1),ne=a.ref(null),se=a.ref(null),ie=a.ref(null),ce=a.ref(null),G=a.ref(0),j=a.ref(0),J=a.ref(0),K=a.computed(()=>!!z.dataset&&z.dataset.length),t=a.computed({get:()=>ve(),set:e=>e});function ve(){const e=Me.useNestedProp({userConfig:z.config,defaultConfig:Ne});return e.theme?{...Me.useNestedProp({userConfig:n.themes.vue_ui_xy_canvas[e.theme]||z.config,defaultConfig:e}),customPalette:n.themePalettes[e.theme]||n.palette}:e}a.watch(()=>z.config,e=>{t.value=ve(),ee(),G.value+=1,j.value+=1,J.value+=1},{deep:!0}),a.watch(()=>z.dataset,()=>{ee(),G.value+=1,j.value+=1,J.value+=1},{deep:!0});const de=a.ref(t.value.style.chart.aspectRatio),{isPrinting:he,isImaging:fe,generatePdf:ye,generateImage:pe}=Pe.usePrinter({elementId:`xy_canvas_${U.value}`,fileName:t.value.style.chart.title.text||"vue-ui-xy-canvas"}),s=a.ref({showTable:t.value.table.show,showDataLabels:t.value.style.chart.dataLabels.show,stacked:t.value.style.chart.stacked,showTooltip:t.value.style.chart.tooltip.show});function Be(e){Z.value=e,ue.value+=1}const ge=a.computed(()=>n.convertCustomPalette(t.value.customPalette)),T=a.computed(()=>N.value?Math.max(...N.value.filter((e,o)=>!L.value.includes(e.absoluteIndex)).map(e=>e.series.length)):0),l=a.computed(()=>{const e=p.value-p.value*(t.value.style.chart.paddingProportions.left+t.value.style.chart.paddingProportions.right);return{canvasWidth:p.value,canvasHeight:$.value,left:p.value*t.value.style.chart.paddingProportions.left,top:$.value*t.value.style.chart.paddingProportions.top,right:p.value-p.value*t.value.style.chart.paddingProportions.right,bottom:$.value-$.value*t.value.style.chart.paddingProportions.bottom,width:e,height:$.value-$.value*(t.value.style.chart.paddingProportions.top+t.value.style.chart.paddingProportions.bottom),slot:e/(u.value.end-u.value.start)}});function me(e,o){return e/o}function Ie({hasAutoScale:e,series:o,min:r,max:v,scale:h,yOffset:g,individualHeight:c,stackIndex:m=null}){return o.map((k,ae)=>{const S=h.min<0?Math.abs(h.min):0,P=me(k+S,S+h.max);let M,E;e&&(M=Math.abs(h.min),E=me(k+M,h.max+M));let F=0;return m===null?F=l.value.bottom-l.value.height*(e?E:P):F=l.value.bottom-g-c*(e?E:P),{x:l.value.left+l.value.slot*ae+l.value.slot/2,y:F,value:k}})}const b=a.computed(()=>{const e=Math.min(...N.value.filter((c,m)=>!L.value.includes(c.absoluteIndex)).flatMap(c=>c.series.slice(u.value.start,u.value.end))),o=Math.max(...N.value.filter((c,m)=>!L.value.includes(c.absoluteIndex)).flatMap(c=>c.series.slice(u.value.start,u.value.end))),r=n.calculateNiceScale(e<0?e:0,o===e?e+1<0?0:e+1:o<0?0:o,t.value.style.chart.scale.ticks),v=r.min<0?Math.abs(r.min):0,h=l.value.bottom-l.value.height*(v/(r.max+v)),g=r.ticks.map(c=>({y:l.value.bottom-l.value.height*((c+v)/(r.max+v)),x:l.value.left-8,value:c}));return{absoluteMin:v,max:o,min:e,scale:r,yLabels:g,zero:h}}),Ee=a.computed(()=>y.value.map(e=>`
2
+ <div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
3
+ <svg viewBox="0 0 10 10" height="12" width="12">
4
+ <circle cx="5" cy="5" r="5" fill="${e.color}"/>
5
+ </svg>
6
+ <span>${e.name?e.name+": ":""}</span>
7
+ <span>${n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.series[f.value],n.dataLabel({p:e.prefix||"",v:e.series[f.value],s:e.suffix||"",r:e.rounding||0}),{datapoint:e,seriesIndex:f.value})}</span>
8
+ </div>
9
+ `)),N=a.computed(()=>z.dataset.map((e,o)=>({...e,series:n.largestTriangleThreeBucketsArray({data:n.sanitizeArray(e.series),threshold:t.value.downsample.threshold}),absoluteIndex:o,color:n.convertColorToHex(e.color||ge.value[o]||n.palette[o]||n.palette[o%n.palette.length])})));a.watch(T,e=>{e&&be()});const y=a.computed(()=>n.assignStackRatios(N.value.filter((e,o)=>!L.value.includes(e.absoluteIndex))).map((e,o)=>({...e,series:e.series.slice(u.value.start,u.value.end)})).map((e,o)=>{let r=Math.min(...e.series)||0,v=Math.max(...e.series)||1;r===v&&(r=r>=0?v-1:r,v=v>=0?v:r+1);const g={ratios:e.series.filter(D=>![null,void 0].includes(D)).map(D=>(D-r)/(v-r)),valueMin:r,valueMax:v},c=e.scaleSteps||t.value.style.chart.scale.ticks;let m;e.autoScaling?m=n.calculateNiceScale(g.valueMin,g.valueMax,c):m=n.calculateNiceScale(g.valueMin<0?g.valueMin:0,g.valueMax<=0?0:g.valueMax,c);const k=s.value.stacked?l.value.height*(1-e.cumulatedStackRatio):0,ae=s.value.stacked?l.value.height/t.value.style.chart.stackGap:0,S=s.value.stacked?l.value.height*e.stackRatio-ae:l.value.height,P=m.min<0?Math.abs(m.min):0;let M;e.autoScaling&&s.value.stacked&&v<=0?M=l.value.bottom-k-S:M=l.value.bottom-k-S*(P/(m.max+P));const E=m.ticks.map((D,je)=>({y:l.value.bottom-k-S*(je/(m.ticks.length-1)),x:l.value.left-8,value:D})),F=Ie({hasAutoScale:s.value.stacked&&e.autoScaling,series:e.series,min:s.value.stacked?r:b.value.min,max:s.value.stacked?v:b.value.max,scale:s.value.stacked?m:b.value.scale,yOffset:k,individualHeight:S,stackIndex:s.value.stacked?o:null});return{...e,coordinatesLine:F,min:r,max:v,localScale:m,localZero:M,localMin:P,localYLabels:E,yOffset:k,individualHeight:S}})),u=a.ref({start:0,end:T.value});function be(){u.value={start:0,end:T.value},re.value+=1}const Fe=a.computed(()=>y.value.filter(e=>["line","plot",void 0].includes(e.type))),x=a.computed(()=>y.value.filter(e=>e.type==="bar"));function De(){if(!C.value)return;const e=I.value.offsetWidth,o=I.value.offsetHeight;C.value.width=e*O.value*2,C.value.height=o*O.value*2,p.value=e*O.value*2,$.value=o*O.value*2,i.value.scale(O.value,O.value),Q()}function Ae(){if(i.value.clearRect(0,0,1e4,1e4),i.value.fillStyle=t.value.style.chart.backgroundColor,i.value.fillRect(0,0,l.value.canvasWidth,l.value.canvasHeight),s.value.stacked)t.value.style.chart.grid.y.verticalLines.show&&u.value.end-u.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength&&y.value.forEach(e=>{for(let o=0;o<u.value.end-u.value.start+1;o+=1)d.line(i.value,[{x:l.value.left+l.value.slot*o,y:l.value.bottom-e.yOffset-e.individualHeight},{x:l.value.left+l.value.slot*o,y:l.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}),t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?y.value.forEach(e=>{e.localYLabels.forEach((o,r)=>{r<e.localYLabels.length-1&&d.rect(i.value,[{x:l.value.left,y:o.y},{x:l.value.right,y:o.y},{x:l.value.right,y:e.localYLabels[r+1].y},{x:l.value.left,y:e.localYLabels[r+1].y}],{fillColor:r%2===0?"transparent":n.setOpacity(t.value.style.chart.grid.x.horizontalLines.color,t.value.style.chart.grid.x.horizontalLines.opacity),strokeColor:"transparent"})})}):y.value.forEach(e=>{e.localYLabels.slice(u.value.start,u.value.end).forEach(o=>{d.line(i.value,[{x:l.value.left,y:o.y},{x:l.value.right,y:o.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})})),t.value.style.chart.grid.zeroLine.show&&y.value.forEach(e=>{d.line(i.value,[{x:l.value.left,y:e.localZero},{x:l.value.right,y:e.localZero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]})}),t.value.style.chart.grid.y.axisLabels.show&&y.value.forEach(e=>{d.line(i.value,[{x:l.value.left,y:l.value.bottom-e.yOffset},{x:l.value.left,y:l.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),d.line(i.value,[{x:l.value.right,y:l.value.bottom-e.yOffset},{x:l.value.right,y:l.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),e.localYLabels.forEach((o,r)=>{d.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,o.value,n.dataLabel({p:e.prefix||t.value.style.chart.grid.y.axisLabels.prefix||"",v:o.value,s:e.suffix||t.value.style.chart.grid.y.axisLabels.suffix||"",r:e.rounding||t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:o,seriesIndex:r}),o.x+t.value.style.chart.grid.y.axisLabels.offsetX,o.y,{align:"right",font:`${Math.round(p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color})})}),y.value.forEach(e=>{d.text(i.value,e.name,p.value/35,l.value.bottom-e.yOffset-e.individualHeight/2,{align:"center",rotation:-90,color:e.color,font:`${Math.round(p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`})});else{if(t.value.style.chart.grid.y.verticalLines.show&&u.value.end-u.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength)for(let e=0;e<u.value.end-u.value.start+1;e+=1)d.line(i.value,[{x:l.value.left+l.value.slot*e,y:l.value.top},{x:l.value.left+l.value.slot*e,y:l.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?b.value.yLabels.forEach((e,o)=>{o<b.value.yLabels.length-1&&d.rect(i.value,[{x:l.value.left,y:e.y},{x:l.value.right,y:e.y},{x:l.value.right,y:b.value.yLabels[o+1].y},{x:l.value.left,y:b.value.yLabels[o+1].y}],{fillColor:o%2===0?"transparent":n.setOpacity(t.value.style.chart.grid.x.horizontalLines.color,t.value.style.chart.grid.x.horizontalLines.opacity),strokeColor:"transparent"})}):b.value.yLabels.forEach(e=>{d.line(i.value,[{x:l.value.left,y:e.y},{x:l.value.right,y:e.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})),t.value.style.chart.grid.y.showAxis&&d.line(i.value,[{x:l.value.left,y:l.value.top},{x:l.value.left,y:l.value.bottom}],{color:t.value.style.chart.grid.y.axisColor,lineWidth:t.value.style.chart.grid.y.axisThickness}),t.value.style.chart.grid.x.showAxis&&d.line(i.value,[{x:l.value.left,y:l.value.bottom},{x:l.value.right,y:l.value.bottom}],{color:t.value.style.chart.grid.x.axisColor,lineWidth:t.value.style.chart.grid.x.axisThickness}),t.value.style.chart.grid.zeroLine.show&&d.line(i.value,[{x:l.value.left,y:b.value.zero},{x:l.value.right,y:b.value.zero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]}),t.value.style.chart.grid.y.axisLabels.show&&b.value.yLabels.forEach((e,o)=>{d.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.value,n.dataLabel({p:t.value.style.chart.grid.y.axisLabels.prefix||"",v:e.value,s:t.value.style.chart.grid.y.axisLabels.suffix||"",r:t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:e,seriesIndex:o}),e.x+t.value.style.chart.grid.y.axisLabels.offsetX,e.y,{align:"right",font:`${Math.round(p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.axisLabels.color})})}t.value.style.chart.grid.y.axisName&&d.text(i.value,t.value.style.chart.grid.y.axisName,p.value-p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio*1.2,l.value.bottom-l.value.height/2,{font:`${Math.round(p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center",rotation:90}),t.value.style.chart.grid.x.axisName&&d.text(i.value,t.value.style.chart.grid.x.axisName,p.value/2,$.value,{font:`${Math.round(p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center"})}function _e(e){for(let o=0;o<e.coordinatesLine.length;o+=1){const r=(f.value===o?p.value/150:t.value.style.chart.line.plots.show?p.value/200:0)*t.value.style.chart.line.plots.radiusRatio;d.circle(i.value,{x:e.coordinatesLine[o].x,y:e.coordinatesLine[o].y},r,{color:t.value.style.chart.backgroundColor,fillStyle:e.color,strokeColor:"transparent"})}}function He(e){for(let o=0;o<e.coordinatesLine.length;o+=1)d.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[o].value,n.dataLabel({p:e.prefix||"",v:e.coordinatesLine[o].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[o],seriesIndex:o}),e.coordinatesLine[o].x,e.coordinatesLine[o].y+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(p.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})}function Ve(){for(let e=u.value.start;e<u.value.end;e+=1)(u.value.end-u.value.start<t.value.style.chart.grid.y.timeLabels.modulo||u.value.end-u.value.start>=t.value.style.chart.grid.y.timeLabels.modulo&&(e%Math.floor((u.value.end-u.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0||e===f.value+u.value.start))&&d.text(i.value,t.value.style.chart.grid.y.timeLabels.values[e]||e+1,l.value.left+l.value.slot*(e-u.value.start)+l.value.slot/2,l.value.bottom+p.value/t.value.style.chart.grid.y.timeLabels.offsetY,{align:t.value.style.chart.grid.y.timeLabels.rotation===0?"center":t.value.style.chart.grid.y.timeLabels.rotation>0?"left":"right",font:`${Math.round(p.value/40*t.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:n.setOpacity(t.value.style.chart.grid.y.timeLabels.color,f.value!==null?f.value+u.value.start===e?100:20:100),rotation:t.value.style.chart.grid.y.timeLabels.rotation})}function xe(){d.line(i.value,[{x:l.value.left+l.value.slot*f.value+l.value.slot/2,y:l.value.top},{x:l.value.left+l.value.slot*f.value+l.value.slot/2,y:l.value.bottom}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2,linceCap:"round"})}function We(){x.value.forEach((e,o)=>{for(let r=0;r<e.coordinatesLine.length;r+=1)d.rect(i.value,[{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o)),y:s.value.stacked?e.localZero:b.value.zero},{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o))+l.value.slot*.8/(s.value.stacked?1:x.value.length),y:s.value.stacked?e.localZero:b.value.zero},{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o))+l.value.slot*.8/(s.value.stacked?1:x.value.length),y:e.coordinatesLine[r].y},{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o)),y:e.coordinatesLine[r].y}],{strokeColor:t.value.style.chart.backgroundColor,gradient:{type:"linear",start:{x:e.coordinatesLine[r].x,y:e.coordinatesLine[r].y},end:{x:e.coordinatesLine[r].x,y:s.value.stacked?e.localZero:b.value.zero},stops:[{offset:0,color:e.color},{offset:1,color:n.lightenHexColor(e.color,.5)}]}}),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&d.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[r].value,n.dataLabel({p:e.prefix||"",v:e.coordinatesLine[r].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[r],seriesIndex:r}),l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o))+l.value.slot*.4/(s.value.stacked?1:x.value.length),(e.coordinatesLine[r].value<0?s.value.stacked?e.localZero:b.value.zero:e.coordinatesLine[r].y)+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(p.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})})}function qe(e){e.useArea?s.value.stacked?d.polygon(i.value,[{x:e.coordinatesLine[0].x,y:e.localZero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:e.localZero}],{fillColor:n.setOpacity(e.color,t.value.style.chart.area.opacity),strokeColor:"transparent"}):d.polygon(i.value,[{x:e.coordinatesLine[0].x,y:b.value.zero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:b.value.zero}],{fillColor:n.setOpacity(e.color,t.value.style.chart.area.opacity),strokeColor:"transparent"}):d.line(i.value,e.coordinatesLine,{color:e.color,lineWidth:3})}function Ye(){y.value.forEach((e,o)=>{d.line(i.value,[{x:l.value.left,y:l.value.bottom-e.yOffset},{x:l.value.right,y:l.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.x.horizontalLines.color,lineWidth:1})})}function Q(){Ae(),R.value?(w.value&&f.value!==null&&t.value.style.chart.selector.show&&xe(),We(),s.value.stacked&&t.value.style.chart.grid.x.showAxis&&Ye(),Fe.value.forEach(e=>{(e.type==="line"||!e.type)&&qe(e),w.value&&(_e(e),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&He(e))}),X.value=d.cloneCanvas(C.value)):(X.value&&(i.value.clearRect(0,0,1e4,1e4),i.value.drawImage(X.value,0,0)),w.value&&f.value!==null&&t.value.style.chart.selector.show&&xe(),w.value&&f.value!==null&&y.value.forEach(e=>{if(e.type==="line"||!e.type||e.type==="plot"){if(!e.coordinatesLine[f.value])return;e.coordinatesLine[f.value].x!==void 0&&e.coordinatesLine[f.value].y!==void 0&&d.circle(i.value,{x:e.coordinatesLine[f.value].x,y:e.coordinatesLine[f.value].y},p.value/150*t.value.style.chart.line.plots.radiusRatio,{color:t.value.style.chart.backgroundColor,fillStyle:e.color,strokeColor:"transparent"})}})),t.value.style.chart.grid.y.timeLabels.show&&Ve(),R.value=!1}const H=d.debounce(()=>{w.value=!0,De()},T.value>200?10:1,!w.value);function Ue(e){const{left:o}=C.value.getBoundingClientRect(),r=e.clientX-o;if(r*2<l.value.left||r*2>l.value.right){A.value=!1,f.value=null;return}const v=r*2-l.value.left;if(f.value=Math.floor(v/l.value.slot),A.value=!0,!w.value)return;let h="";const g=t.value.style.chart.tooltip.customFormat;n.isFunction(g)&&n.functionReturnsString(()=>g({seriesIndex:f.value,datapoint:y.value.map(c=>({shape:c.shape||null,name:c.name,color:c.color,type:c.type||"line",value:c.series.find((m,k)=>k===f.value)})),series:y.value,config:t.value}))?_.value=g({seriesIndex:f.value,datapoint:y.value.map(c=>({shape:c.shape||null,name:c.name,color:c.color,type:c.type||"line",value:c.series.find((m,k)=>k===f.value)})),series:y.value,config:t.value}):(t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[f.value]&&(h+=`<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; width:100%">${t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[f.value]}</div>`),h+=Ee.value.join(""),_.value=h),w.value=!1}a.watch(()=>f.value,e=>{H()}),a.watch(()=>u.value,e=>{R.value=!0,Q()},{deep:!0}),a.watch(()=>s.value.showDataLabels,e=>{R.value=!0,Q()}),a.watch(()=>s.value.stacked,e=>{R.value=!0,w.value=!0,H()});function Xe(){A.value=!1,f.value=null,_.value=""}const V=a.ref(null),W=a.ref(null);a.onMounted(()=>{ee()});function ee(){if(n.objectIsEmpty(z.dataset)?n.error({componentName:"VueUiXyCanvas",type:"dataset"}):C.value&&(i.value=C.value.getContext("2d",{willReadFrequently:!0})),t.value.responsive){const e=d.throttle(()=>{const{width:o,height:r}=d.useResponsive({chart:B.value,title:t.value.style.chart.title.text?ne.value:null,legend:t.value.style.chart.legend.show?se.value:null,slicer:t.value.style.chart.zoom.show&&T.value>1?ie.value:null,source:ce.value});de.value=`${o} / ${r}`});V.value=new ResizeObserver(e),V.value.observe(B.value.parentNode)}W.value=new ResizeObserver(e=>{for(const o of e)o.contentBoxSize&&I.value&&(R.value=!0,H())}),W.value.observe(I.value)}a.onBeforeUnmount(()=>{W.value&&W.value.disconnect(),V.value&&V.value.disconnect()});function ke(e){Oe("selectLegend",y.value.find(o=>o.absoluteIndex===e)),L.value.includes(e)?L.value=L.value.filter(o=>o!==e):L.value.push(e),R.value=!0,H()}const Le=a.computed(()=>N.value.map((e,o)=>({...e,name:e.name,color:n.convertColorToHex(e.color)||ge.value[o]||n.palette[o]||n.palette[o%n.palette.length],shape:e.shape||"circle",prefix:e.prefix||"",suffix:e.suffix||"",rounding:e.rounding||0})).map(e=>({...e,opacity:L.value.includes(e.absoluteIndex)?.5:1,segregate:()=>ke(e.absoluteIndex),isSegregated:L.value.includes(e.absoluteIndex)}))),Ze=a.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),q=a.computed(()=>{const e=[""].concat(y.value.map(h=>h.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');let o=[];for(let h=0;h<T.value;h+=1){const g=y.value.map(c=>c.series[h]??0).reduce((c,m)=>c+m,0);o.push([t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[h]??h+1].concat(y.value.map(c=>(c.series[h]??0).toFixed(t.value.table.rounding))).concat((g??0).toFixed(t.value.table.rounding)))}const r={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},v=[t.value.table.columnNames.period].concat(y.value.map(h=>h.name)).concat(t.value.table.columnNames.total);return{head:e,body:o.slice(0,u.value.end-u.value.start),config:r,colNames:v}}),Ce=a.computed(()=>{if(y.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const e=y.value.map(r=>({label:r.name,color:r.color,type:r.type})),o=[];for(let r=u.value.start;r<u.value.end;r+=1){const v=[t.value.style.chart.grid.y.timeLabels.values[r]||r+1];y.value.forEach(h=>{v.push(Number((h.series[r]||0).toFixed(t.value.table.rounding)))}),o.push(v)}return{head:e,body:o}});function we(){const e=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=["",...Ce.value.head.map(g=>g.label)],r=Ce.value.body,v=e.concat([o]).concat(r),h=n.createCsvContent(v);n.downloadCsv({csvContent:h,title:t.value.style.chart.title.text||"vue-ui-xy-canvas"})}function Ge(){return y.value}function Se(){s.value.showTable=!s.value.showTable}function ze(){s.value.showDataLabels=!s.value.showDataLabels}function $e(){s.value.stacked=!s.value.stacked}function Te(){s.value.showTooltip=!s.value.showTooltip}const Y=a.ref(!1);function te(){Y.value=!Y.value}return Re({getData:Ge,generateCsv:we,generatePdf:ye,generateImage:pe,toggleTable:Se,toggleLabels:ze,toggleStack:$e,toggleTooltip:Te,toggleAnnotator:te}),(e,o)=>(a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(`width:100%; position:relative; ${t.value.responsive?"height: 100%":""}`),ref_key:"xy",ref:B,id:`xy_canvas_${U.value}`,class:a.normalizeClass(`vue-ui-donut ${Z.value?"vue-data-ui-wrapper-fullscreen":""}`)},[t.value.style.chart.title.text?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:ne,style:a.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};`)},[(a.openBlock(),a.createBlock(Qe._sfc_main,{key:`title_${G.value}`,config:{title:{cy:"xy-canvas-title",...t.value.style.chart.title},subtitle:{cy:"xy-canvas-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):a.createCommentVNode("",!0),t.value.userOptions.show&&K.value?(a.openBlock(),a.createBlock(Pe.UserOptions,{ref:"details",key:`user_option_${ue.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:a.unref(he),isImaging:a.unref(fe),uid:U.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasLabel:t.value.userOptions.buttons.labels,hasStack:le.dataset.length>1&&t.value.userOptions.buttons.stack,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasTable:u.value.end-u.value.start<200&&t.value.userOptions.buttons.table,isFullscreen:Z.value,isTooltip:s.value.showTooltip,isStacked:s.value.stacked,titles:{...t.value.userOptions.buttonTitles},chartElement:B.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:Y.value,onToggleFullscreen:Be,onGeneratePdf:a.unref(ye),onGenerateCsv:we,onGenerateImage:a.unref(pe),onToggleTable:Se,onToggleLabels:ze,onToggleStack:$e,onToggleTooltip:Te,onToggleAnnotator:te},a.createSlots({_:2},[e.$slots.optionTooltip?{name:"optionTooltip",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,e.$slots.optionPdf?{name:"optionPdf",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,e.$slots.optionCsv?{name:"optionCsv",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,e.$slots.optionImg?{name:"optionImg",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,e.$slots.optionTable?{name:"optionTable",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,e.$slots.optionLabels?{name:"optionLabels",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,e.$slots.optionStack?{name:"optionStack",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionStack",{},void 0,!0)]),key:"6"}:void 0,e.$slots.optionFullscreen?{name:"optionFullscreen",fn:a.withCtx(({toggleFullscreen:r,isFullscreen:v})=>[a.renderSlot(e.$slots,"optionFullscreen",a.normalizeProps(a.guardReactiveProps({toggleFullscreen:r,isFullscreen:v})),void 0,!0)]),key:"7"}:void 0,e.$slots.optionAnnotator?{name:"optionAnnotator",fn:a.withCtx(({toggleAnnotator:r,isAnnotator:v})=>[a.renderSlot(e.$slots,"optionAnnotator",a.normalizeProps(a.guardReactiveProps({toggleAnnotator:r,isAnnotator:v})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasLabel","hasStack","hasFullscreen","hasTable","isFullscreen","isTooltip","isStacked","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"vue-ui-xy-canvas",style:a.normalizeStyle(`position: relative; aspect-ratio: ${de.value}`),ref_key:"container",ref:I},[K.value?(a.openBlock(),a.createElementBlock("canvas",{key:0,ref_key:"canvas",ref:C,style:{width:"100%",height:"100%"},onMousemove:o[0]||(o[0]=r=>Ue(r)),onMouseleave:Xe},null,544)):(a.openBlock(),a.createBlock(lt.default,{key:1,config:{type:"line",style:{backgroundColor:t.value.style.chart.backgroundColor,line:{axis:{color:"#CCCCCC"},path:{color:"#CCCCCC",strokeWidth:.5}}}}},null,8,["config"])),a.createVNode(Je._sfc_main,{show:s.value.showTooltip&&A.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:C.value,content:_.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,isCustom:a.unref(n.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":a.withCtx(()=>[a.renderSlot(e.$slots,"tooltip-before",a.normalizeProps(a.guardReactiveProps({...oe.value})),void 0,!0)]),"tooltip-after":a.withCtx(()=>[a.renderSlot(e.$slots,"tooltip-after",a.normalizeProps(a.guardReactiveProps({...oe.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","position","offsetY","parent","content","backgroundOpacity","isCustom"])],4),a.createElementVNode("div",{ref_key:"chartSlicer",ref:ie,style:a.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&T.value>1?(a.openBlock(),a.createBlock(et.Slicer,{key:`slicer_${re.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.grid.y.timeLabels.values[u.value.start]?t.value.style.chart.grid.y.timeLabels.values[u.value.start]:"",labelRight:t.value.style.chart.grid.y.timeLabels.values[u.value.end-1]?t.value.style.chart.grid.y.timeLabels.values[u.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:T.value,min:0,valueStart:u.value.start,valueEnd:u.value.end,start:u.value.start,"onUpdate:start":o[1]||(o[1]=r=>u.value.start=r),end:u.value.end,"onUpdate:end":o[2]||(o[2]=r=>u.value.end=r),onReset:be},{"reset-action":a.withCtx(({reset:r})=>[a.renderSlot(e.$slots,"reset-action",a.normalizeProps(a.guardReactiveProps({reset:r})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"])):a.createCommentVNode("",!0)],4),a.createElementVNode("div",{ref_key:"chartLegend",ref:se},[t.value.style.chart.legend.show&&K.value?(a.openBlock(),a.createBlock(Ke.Legend,{legendSet:Le.value,config:Ze.value,key:`legend_${J.value}`,onClickMarker:o[3]||(o[3]=({i:r})=>ke(r))},{item:a.withCtx(({legend:r,index:v})=>[a.createElementVNode("div",{onClick:h=>r.segregate(),style:a.normalizeStyle(`opacity:${L.value.includes(v)?.5:1}`)},a.toDisplayString(r.name),13,nt)]),_:1},8,["legendSet","config"])):a.renderSlot(e.$slots,"legend",{key:1,legend:Le.value},void 0,!0)],512),e.$slots.watermark?(a.openBlock(),a.createElementBlock("div",st,[a.renderSlot(e.$slots,"watermark",a.normalizeProps(a.guardReactiveProps({isPrinting:a.unref(he)||a.unref(fe)})),void 0,!0)])):a.createCommentVNode("",!0),e.$slots.source?(a.openBlock(),a.createElementBlock("div",{key:3,ref_key:"source",ref:ce,dir:"auto"},[a.renderSlot(e.$slots,"source",{},void 0,!0)],512)):a.createCommentVNode("",!0),u.value.end-u.value.start<200?(a.openBlock(),a.createBlock(tt.default,{key:4,hideDetails:"",config:{open:s.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:a.withCtx(()=>[(a.openBlock(),a.createBlock(at.DataTable,{key:`table_${j.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[4]||(o[4]=r=>s.value.showTable=!1)},{th:a.withCtx(({th:r})=>[a.createElementVNode("div",{innerHTML:r},null,8,it)]),td:a.withCtx(({td:r})=>[a.createTextVNode(a.toDisplayString(r),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):a.createCommentVNode("",!0),t.value.userOptions.buttons.annotator&&y.value.length?(a.openBlock(),a.createBlock(ot.PenAndPaper,{key:5,parent:B.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:Y.value,onClose:te},null,8,["parent","backgroundColor","color","active"])):a.createCommentVNode("",!0)],14,ut))}},vt=rt._export_sfc(ct,[["__scopeId","data-v-0c8b7e3c"]]);exports.default=vt;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-data-ui",
3
3
  "private": false,
4
- "version": "2.4.21",
4
+ "version": "2.4.22",
5
5
  "type": "module",
6
6
  "description": "A user-empowering data visualization Vue 3 components library for eloquent data storytelling",
7
7
  "keywords": [
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),n=require("./index-CsQwCVqU.cjs"),d=require("./useResponsive-BJ7DTGpm.cjs"),Je=require("./Tooltip-DvGSIp31.cjs"),Ke=require("./Legend-G5Zc4QaZ.cjs"),Qe=require("./Title-BRqTk-nT.cjs"),et=require("./Slicer-C1blYfez.cjs"),Pe=require("./usePrinter-O2fMMTMe.cjs"),tt=require("./vue-ui-accordion-CaktYQoo.cjs"),at=require("./DataTable-H-KTkjfv.cjs"),lt=require("./vue-ui-skeleton-DsRTbz6d.cjs"),Me=require("./useNestedProp-DSYpaLxP.cjs"),ot=require("./PenAndPaper-BX8pR5oV.cjs"),rt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ut=["id"],nt=["onClick"],st={key:2,class:"vue-data-ui-watermark"},it=["innerHTML"],ct={__name:"vue-ui-xy-canvas",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(Q,{expose:Re,emit:Oe}){const M=Q,{vue_ui_xy_canvas:Ne}=n.useConfig(),U=a.ref(n.createUid()),B=a.ref(null),C=a.ref(null),I=a.ref(null),i=a.ref(null),p=a.ref(1),z=a.ref(1),A=a.ref(!1),f=a.ref(null),_=a.ref(""),ee=a.ref(null),L=a.ref([]),O=a.ref(1),R=a.ref(!0),w=a.ref(!0),X=a.ref(null),te=a.ref(0),ae=a.ref(0),Z=a.ref(!1),le=a.ref(null),oe=a.ref(null),re=a.ref(null),ue=a.ref(null),ne=a.ref(0),se=a.ref(0),ie=a.ref(0),G=a.computed(()=>!!M.dataset&&M.dataset.length),t=a.computed({get:()=>ce(),set:e=>e});function ce(){const e=Me.useNestedProp({userConfig:M.config,defaultConfig:Ne});return e.theme?{...Me.useNestedProp({userConfig:n.themes.vue_ui_xy_canvas[e.theme]||M.config,defaultConfig:e}),customPalette:n.themePalettes[e.theme]||n.palette}:e}a.watch(()=>M.config,e=>{t.value=ce(),xe(),ne.value+=1,se.value+=1,ie.value+=1},{deep:!0});const ve=a.ref(t.value.style.chart.aspectRatio),{isPrinting:de,isImaging:he,generatePdf:fe,generateImage:ye}=Pe.usePrinter({elementId:`xy_canvas_${U.value}`,fileName:t.value.style.chart.title.text||"vue-ui-xy-canvas"}),s=a.ref({showTable:t.value.table.show,showDataLabels:t.value.style.chart.dataLabels.show,stacked:t.value.style.chart.stacked,showTooltip:t.value.style.chart.tooltip.show});function Be(e){Z.value=e,ae.value+=1}const pe=a.computed(()=>n.convertCustomPalette(t.value.customPalette)),$=a.computed(()=>N.value?Math.max(...N.value.filter((e,o)=>!L.value.includes(e.absoluteIndex)).map(e=>e.series.length)):0),l=a.computed(()=>{const e=p.value-p.value*(t.value.style.chart.paddingProportions.left+t.value.style.chart.paddingProportions.right);return{canvasWidth:p.value,canvasHeight:z.value,left:p.value*t.value.style.chart.paddingProportions.left,top:z.value*t.value.style.chart.paddingProportions.top,right:p.value-p.value*t.value.style.chart.paddingProportions.right,bottom:z.value-z.value*t.value.style.chart.paddingProportions.bottom,width:e,height:z.value-z.value*(t.value.style.chart.paddingProportions.top+t.value.style.chart.paddingProportions.bottom),slot:e/(u.value.end-u.value.start)}});function ge(e,o){return e/o}function Ie({hasAutoScale:e,series:o,min:r,max:v,scale:h,yOffset:g,individualHeight:c,stackIndex:m=null}){return o.map((k,K)=>{const S=h.min<0?Math.abs(h.min):0,T=ge(k+S,S+h.max);let P,E;e&&(P=Math.abs(h.min),E=ge(k+P,h.max+P));let F=0;return m===null?F=l.value.bottom-l.value.height*(e?E:T):F=l.value.bottom-g-c*(e?E:T),{x:l.value.left+l.value.slot*K+l.value.slot/2,y:F,value:k}})}const b=a.computed(()=>{const e=Math.min(...N.value.filter((c,m)=>!L.value.includes(c.absoluteIndex)).flatMap(c=>c.series.slice(u.value.start,u.value.end))),o=Math.max(...N.value.filter((c,m)=>!L.value.includes(c.absoluteIndex)).flatMap(c=>c.series.slice(u.value.start,u.value.end))),r=n.calculateNiceScale(e<0?e:0,o===e?e+1<0?0:e+1:o<0?0:o,t.value.style.chart.scale.ticks),v=r.min<0?Math.abs(r.min):0,h=l.value.bottom-l.value.height*(v/(r.max+v)),g=r.ticks.map(c=>({y:l.value.bottom-l.value.height*((c+v)/(r.max+v)),x:l.value.left-8,value:c}));return{absoluteMin:v,max:o,min:e,scale:r,yLabels:g,zero:h}}),Ee=a.computed(()=>y.value.map(e=>`
2
- <div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
3
- <svg viewBox="0 0 10 10" height="12" width="12">
4
- <circle cx="5" cy="5" r="5" fill="${e.color}"/>
5
- </svg>
6
- <span>${e.name?e.name+": ":""}</span>
7
- <span>${n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.series[f.value],n.dataLabel({p:e.prefix||"",v:e.series[f.value],s:e.suffix||"",r:e.rounding||0}),{datapoint:e,seriesIndex:f.value})}</span>
8
- </div>
9
- `)),N=a.computed(()=>M.dataset.map((e,o)=>({...e,series:n.largestTriangleThreeBucketsArray({data:n.sanitizeArray(e.series),threshold:t.value.downsample.threshold}),absoluteIndex:o,color:n.convertColorToHex(e.color||pe.value[o]||n.palette[o]||n.palette[o%n.palette.length])})));a.watch($,e=>{e&&me()});const y=a.computed(()=>n.assignStackRatios(N.value.filter((e,o)=>!L.value.includes(e.absoluteIndex))).map((e,o)=>({...e,series:e.series.slice(u.value.start,u.value.end)})).map((e,o)=>{let r=Math.min(...e.series)||0,v=Math.max(...e.series)||1;r===v&&(r=r>=0?v-1:r,v=v>=0?v:r+1);const g={ratios:e.series.filter(D=>![null,void 0].includes(D)).map(D=>(D-r)/(v-r)),valueMin:r,valueMax:v},c=e.scaleSteps||t.value.style.chart.scale.ticks;let m;e.autoScaling?m=n.calculateNiceScale(g.valueMin,g.valueMax,c):m=n.calculateNiceScale(g.valueMin<0?g.valueMin:0,g.valueMax<=0?0:g.valueMax,c);const k=s.value.stacked?l.value.height*(1-e.cumulatedStackRatio):0,K=s.value.stacked?l.value.height/t.value.style.chart.stackGap:0,S=s.value.stacked?l.value.height*e.stackRatio-K:l.value.height,T=m.min<0?Math.abs(m.min):0;let P;e.autoScaling&&s.value.stacked&&v<=0?P=l.value.bottom-k-S:P=l.value.bottom-k-S*(T/(m.max+T));const E=m.ticks.map((D,je)=>({y:l.value.bottom-k-S*(je/(m.ticks.length-1)),x:l.value.left-8,value:D})),F=Ie({hasAutoScale:s.value.stacked&&e.autoScaling,series:e.series,min:s.value.stacked?r:b.value.min,max:s.value.stacked?v:b.value.max,scale:s.value.stacked?m:b.value.scale,yOffset:k,individualHeight:S,stackIndex:s.value.stacked?o:null});return{...e,coordinatesLine:F,min:r,max:v,localScale:m,localZero:P,localMin:T,localYLabels:E,yOffset:k,individualHeight:S}})),u=a.ref({start:0,end:$.value});function me(){u.value={start:0,end:$.value},te.value+=1}const Fe=a.computed(()=>y.value.filter(e=>["line","plot",void 0].includes(e.type))),x=a.computed(()=>y.value.filter(e=>e.type==="bar"));function De(){if(!C.value)return;const e=I.value.offsetWidth,o=I.value.offsetHeight;C.value.width=e*O.value*2,C.value.height=o*O.value*2,p.value=e*O.value*2,z.value=o*O.value*2,i.value.scale(O.value,O.value),j()}function Ae(){if(i.value.clearRect(0,0,1e4,1e4),i.value.fillStyle=t.value.style.chart.backgroundColor,i.value.fillRect(0,0,l.value.canvasWidth,l.value.canvasHeight),s.value.stacked)t.value.style.chart.grid.y.verticalLines.show&&u.value.end-u.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength&&y.value.forEach(e=>{for(let o=0;o<u.value.end-u.value.start+1;o+=1)d.line(i.value,[{x:l.value.left+l.value.slot*o,y:l.value.bottom-e.yOffset-e.individualHeight},{x:l.value.left+l.value.slot*o,y:l.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}),t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?y.value.forEach(e=>{e.localYLabels.forEach((o,r)=>{r<e.localYLabels.length-1&&d.rect(i.value,[{x:l.value.left,y:o.y},{x:l.value.right,y:o.y},{x:l.value.right,y:e.localYLabels[r+1].y},{x:l.value.left,y:e.localYLabels[r+1].y}],{fillColor:r%2===0?"transparent":n.setOpacity(t.value.style.chart.grid.x.horizontalLines.color,t.value.style.chart.grid.x.horizontalLines.opacity),strokeColor:"transparent"})})}):y.value.forEach(e=>{e.localYLabels.slice(u.value.start,u.value.end).forEach(o=>{d.line(i.value,[{x:l.value.left,y:o.y},{x:l.value.right,y:o.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})})),t.value.style.chart.grid.zeroLine.show&&y.value.forEach(e=>{d.line(i.value,[{x:l.value.left,y:e.localZero},{x:l.value.right,y:e.localZero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]})}),t.value.style.chart.grid.y.axisLabels.show&&y.value.forEach(e=>{d.line(i.value,[{x:l.value.left,y:l.value.bottom-e.yOffset},{x:l.value.left,y:l.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),d.line(i.value,[{x:l.value.right,y:l.value.bottom-e.yOffset},{x:l.value.right,y:l.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),e.localYLabels.forEach((o,r)=>{d.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,o.value,n.dataLabel({p:e.prefix||t.value.style.chart.grid.y.axisLabels.prefix||"",v:o.value,s:e.suffix||t.value.style.chart.grid.y.axisLabels.suffix||"",r:e.rounding||t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:o,seriesIndex:r}),o.x+t.value.style.chart.grid.y.axisLabels.offsetX,o.y,{align:"right",font:`${Math.round(p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color})})}),y.value.forEach(e=>{d.text(i.value,e.name,p.value/35,l.value.bottom-e.yOffset-e.individualHeight/2,{align:"center",rotation:-90,color:e.color,font:`${Math.round(p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`})});else{if(t.value.style.chart.grid.y.verticalLines.show&&u.value.end-u.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength)for(let e=0;e<u.value.end-u.value.start+1;e+=1)d.line(i.value,[{x:l.value.left+l.value.slot*e,y:l.value.top},{x:l.value.left+l.value.slot*e,y:l.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?b.value.yLabels.forEach((e,o)=>{o<b.value.yLabels.length-1&&d.rect(i.value,[{x:l.value.left,y:e.y},{x:l.value.right,y:e.y},{x:l.value.right,y:b.value.yLabels[o+1].y},{x:l.value.left,y:b.value.yLabels[o+1].y}],{fillColor:o%2===0?"transparent":n.setOpacity(t.value.style.chart.grid.x.horizontalLines.color,t.value.style.chart.grid.x.horizontalLines.opacity),strokeColor:"transparent"})}):b.value.yLabels.forEach(e=>{d.line(i.value,[{x:l.value.left,y:e.y},{x:l.value.right,y:e.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})),t.value.style.chart.grid.y.showAxis&&d.line(i.value,[{x:l.value.left,y:l.value.top},{x:l.value.left,y:l.value.bottom}],{color:t.value.style.chart.grid.y.axisColor,lineWidth:t.value.style.chart.grid.y.axisThickness}),t.value.style.chart.grid.x.showAxis&&d.line(i.value,[{x:l.value.left,y:l.value.bottom},{x:l.value.right,y:l.value.bottom}],{color:t.value.style.chart.grid.x.axisColor,lineWidth:t.value.style.chart.grid.x.axisThickness}),t.value.style.chart.grid.zeroLine.show&&d.line(i.value,[{x:l.value.left,y:b.value.zero},{x:l.value.right,y:b.value.zero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]}),t.value.style.chart.grid.y.axisLabels.show&&b.value.yLabels.forEach((e,o)=>{d.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.value,n.dataLabel({p:t.value.style.chart.grid.y.axisLabels.prefix||"",v:e.value,s:t.value.style.chart.grid.y.axisLabels.suffix||"",r:t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:e,seriesIndex:o}),e.x+t.value.style.chart.grid.y.axisLabels.offsetX,e.y,{align:"right",font:`${Math.round(p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.axisLabels.color})})}t.value.style.chart.grid.y.axisName&&d.text(i.value,t.value.style.chart.grid.y.axisName,p.value-p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio*1.2,l.value.bottom-l.value.height/2,{font:`${Math.round(p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center",rotation:90}),t.value.style.chart.grid.x.axisName&&d.text(i.value,t.value.style.chart.grid.x.axisName,p.value/2,z.value,{font:`${Math.round(p.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center"})}function _e(e){for(let o=0;o<e.coordinatesLine.length;o+=1){const r=(f.value===o?p.value/150:t.value.style.chart.line.plots.show?p.value/200:0)*t.value.style.chart.line.plots.radiusRatio;d.circle(i.value,{x:e.coordinatesLine[o].x,y:e.coordinatesLine[o].y},r,{color:t.value.style.chart.backgroundColor,fillStyle:e.color,strokeColor:"transparent"})}}function He(e){for(let o=0;o<e.coordinatesLine.length;o+=1)d.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[o].value,n.dataLabel({p:e.prefix||"",v:e.coordinatesLine[o].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[o],seriesIndex:o}),e.coordinatesLine[o].x,e.coordinatesLine[o].y+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(p.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})}function Ve(){for(let e=u.value.start;e<u.value.end;e+=1)(u.value.end-u.value.start<t.value.style.chart.grid.y.timeLabels.modulo||u.value.end-u.value.start>=t.value.style.chart.grid.y.timeLabels.modulo&&(e%Math.floor((u.value.end-u.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0||e===f.value+u.value.start))&&d.text(i.value,t.value.style.chart.grid.y.timeLabels.values[e]||e+1,l.value.left+l.value.slot*(e-u.value.start)+l.value.slot/2,l.value.bottom+p.value/t.value.style.chart.grid.y.timeLabels.offsetY,{align:t.value.style.chart.grid.y.timeLabels.rotation===0?"center":t.value.style.chart.grid.y.timeLabels.rotation>0?"left":"right",font:`${Math.round(p.value/40*t.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:n.setOpacity(t.value.style.chart.grid.y.timeLabels.color,f.value!==null?f.value+u.value.start===e?100:20:100),rotation:t.value.style.chart.grid.y.timeLabels.rotation})}function be(){d.line(i.value,[{x:l.value.left+l.value.slot*f.value+l.value.slot/2,y:l.value.top},{x:l.value.left+l.value.slot*f.value+l.value.slot/2,y:l.value.bottom}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2,linceCap:"round"})}function We(){x.value.forEach((e,o)=>{for(let r=0;r<e.coordinatesLine.length;r+=1)d.rect(i.value,[{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o)),y:s.value.stacked?e.localZero:b.value.zero},{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o))+l.value.slot*.8/(s.value.stacked?1:x.value.length),y:s.value.stacked?e.localZero:b.value.zero},{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o))+l.value.slot*.8/(s.value.stacked?1:x.value.length),y:e.coordinatesLine[r].y},{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o)),y:e.coordinatesLine[r].y}],{strokeColor:t.value.style.chart.backgroundColor,gradient:{type:"linear",start:{x:e.coordinatesLine[r].x,y:e.coordinatesLine[r].y},end:{x:e.coordinatesLine[r].x,y:s.value.stacked?e.localZero:b.value.zero},stops:[{offset:0,color:e.color},{offset:1,color:n.lightenHexColor(e.color,.5)}]}}),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&d.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[r].value,n.dataLabel({p:e.prefix||"",v:e.coordinatesLine[r].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[r],seriesIndex:r}),l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o))+l.value.slot*.4/(s.value.stacked?1:x.value.length),(e.coordinatesLine[r].value<0?s.value.stacked?e.localZero:b.value.zero:e.coordinatesLine[r].y)+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(p.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})})}function qe(e){e.useArea?s.value.stacked?d.polygon(i.value,[{x:e.coordinatesLine[0].x,y:e.localZero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:e.localZero}],{fillColor:n.setOpacity(e.color,t.value.style.chart.area.opacity),strokeColor:"transparent"}):d.polygon(i.value,[{x:e.coordinatesLine[0].x,y:b.value.zero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:b.value.zero}],{fillColor:n.setOpacity(e.color,t.value.style.chart.area.opacity),strokeColor:"transparent"}):d.line(i.value,e.coordinatesLine,{color:e.color,lineWidth:3})}function Ye(){y.value.forEach((e,o)=>{d.line(i.value,[{x:l.value.left,y:l.value.bottom-e.yOffset},{x:l.value.right,y:l.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.x.horizontalLines.color,lineWidth:1})})}function j(){Ae(),R.value?(w.value&&f.value!==null&&t.value.style.chart.selector.show&&be(),We(),s.value.stacked&&t.value.style.chart.grid.x.showAxis&&Ye(),Fe.value.forEach(e=>{(e.type==="line"||!e.type)&&qe(e),w.value&&(_e(e),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&He(e))}),X.value=d.cloneCanvas(C.value)):(X.value&&(i.value.clearRect(0,0,1e4,1e4),i.value.drawImage(X.value,0,0)),w.value&&f.value!==null&&t.value.style.chart.selector.show&&be(),w.value&&f.value!==null&&y.value.forEach(e=>{if(e.type==="line"||!e.type||e.type==="plot"){if(!e.coordinatesLine[f.value])return;e.coordinatesLine[f.value].x!==void 0&&e.coordinatesLine[f.value].y!==void 0&&d.circle(i.value,{x:e.coordinatesLine[f.value].x,y:e.coordinatesLine[f.value].y},p.value/150*t.value.style.chart.line.plots.radiusRatio,{color:t.value.style.chart.backgroundColor,fillStyle:e.color,strokeColor:"transparent"})}})),t.value.style.chart.grid.y.timeLabels.show&&Ve(),R.value=!1}const H=d.debounce(()=>{w.value=!0,De()},$.value>200?10:1,!w.value);function Ue(e){const{left:o}=C.value.getBoundingClientRect(),r=e.clientX-o;if(r*2<l.value.left||r*2>l.value.right){A.value=!1,f.value=null;return}const v=r*2-l.value.left;if(f.value=Math.floor(v/l.value.slot),A.value=!0,!w.value)return;let h="";const g=t.value.style.chart.tooltip.customFormat;n.isFunction(g)&&n.functionReturnsString(()=>g({seriesIndex:f.value,datapoint:y.value.map(c=>({shape:c.shape||null,name:c.name,color:c.color,type:c.type||"line",value:c.series.find((m,k)=>k===f.value)})),series:y.value,config:t.value}))?_.value=g({seriesIndex:f.value,datapoint:y.value.map(c=>({shape:c.shape||null,name:c.name,color:c.color,type:c.type||"line",value:c.series.find((m,k)=>k===f.value)})),series:y.value,config:t.value}):(t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[f.value]&&(h+=`<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; width:100%">${t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[f.value]}</div>`),h+=Ee.value.join(""),_.value=h),w.value=!1}a.watch(()=>f.value,e=>{H()}),a.watch(()=>u.value,e=>{R.value=!0,j()},{deep:!0}),a.watch(()=>s.value.showDataLabels,e=>{R.value=!0,j()}),a.watch(()=>s.value.stacked,e=>{R.value=!0,w.value=!0,H()});function Xe(){A.value=!1,f.value=null,_.value=""}const V=a.ref(null),W=a.ref(null);a.onMounted(()=>{xe()});function xe(){if(n.objectIsEmpty(M.dataset)?n.error({componentName:"VueUiXyCanvas",type:"dataset"}):C.value&&(i.value=C.value.getContext("2d",{willReadFrequently:!0})),t.value.responsive){const e=d.throttle(()=>{const{width:o,height:r}=d.useResponsive({chart:B.value,title:t.value.style.chart.title.text?le.value:null,legend:t.value.style.chart.legend.show?oe.value:null,slicer:t.value.style.chart.zoom.show&&$.value>1?re.value:null,source:ue.value});ve.value=`${o} / ${r}`});V.value=new ResizeObserver(e),V.value.observe(B.value.parentNode)}W.value=new ResizeObserver(e=>{for(const o of e)o.contentBoxSize&&I.value&&(R.value=!0,H())}),W.value.observe(I.value)}a.onBeforeUnmount(()=>{W.value&&W.value.disconnect(),V.value&&V.value.disconnect()});function ke(e){Oe("selectLegend",y.value.find(o=>o.absoluteIndex===e)),L.value.includes(e)?L.value=L.value.filter(o=>o!==e):L.value.push(e),R.value=!0,H()}const Le=a.computed(()=>N.value.map((e,o)=>({...e,name:e.name,color:n.convertColorToHex(e.color)||pe.value[o]||n.palette[o]||n.palette[o%n.palette.length],shape:e.shape||"circle",prefix:e.prefix||"",suffix:e.suffix||"",rounding:e.rounding||0})).map(e=>({...e,opacity:L.value.includes(e.absoluteIndex)?.5:1,segregate:()=>ke(e.absoluteIndex),isSegregated:L.value.includes(e.absoluteIndex)}))),Ze=a.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),q=a.computed(()=>{const e=[""].concat(y.value.map(h=>h.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');let o=[];for(let h=0;h<$.value;h+=1){const g=y.value.map(c=>c.series[h]??0).reduce((c,m)=>c+m,0);o.push([t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[h]??h+1].concat(y.value.map(c=>(c.series[h]??0).toFixed(t.value.table.rounding))).concat((g??0).toFixed(t.value.table.rounding)))}const r={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},v=[t.value.table.columnNames.period].concat(y.value.map(h=>h.name)).concat(t.value.table.columnNames.total);return{head:e,body:o.slice(0,u.value.end-u.value.start),config:r,colNames:v}}),Ce=a.computed(()=>{if(y.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const e=y.value.map(r=>({label:r.name,color:r.color,type:r.type})),o=[];for(let r=u.value.start;r<u.value.end;r+=1){const v=[t.value.style.chart.grid.y.timeLabels.values[r]||r+1];y.value.forEach(h=>{v.push(Number((h.series[r]||0).toFixed(t.value.table.rounding)))}),o.push(v)}return{head:e,body:o}});function we(){const e=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=["",...Ce.value.head.map(g=>g.label)],r=Ce.value.body,v=e.concat([o]).concat(r),h=n.createCsvContent(v);n.downloadCsv({csvContent:h,title:t.value.style.chart.title.text||"vue-ui-xy-canvas"})}function Ge(){return y.value}function Se(){s.value.showTable=!s.value.showTable}function ze(){s.value.showDataLabels=!s.value.showDataLabels}function $e(){s.value.stacked=!s.value.stacked}function Te(){s.value.showTooltip=!s.value.showTooltip}const Y=a.ref(!1);function J(){Y.value=!Y.value}return Re({getData:Ge,generateCsv:we,generatePdf:fe,generateImage:ye,toggleTable:Se,toggleLabels:ze,toggleStack:$e,toggleTooltip:Te,toggleAnnotator:J}),(e,o)=>(a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(`width:100%; position:relative; ${t.value.responsive?"height: 100%":""}`),ref_key:"xy",ref:B,id:`xy_canvas_${U.value}`,class:a.normalizeClass(`vue-ui-donut ${Z.value?"vue-data-ui-wrapper-fullscreen":""}`)},[t.value.style.chart.title.text?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:le,style:a.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};`)},[(a.openBlock(),a.createBlock(Qe._sfc_main,{key:`title_${ne.value}`,config:{title:{cy:"xy-canvas-title",...t.value.style.chart.title},subtitle:{cy:"xy-canvas-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):a.createCommentVNode("",!0),t.value.userOptions.show&&G.value?(a.openBlock(),a.createBlock(Pe.UserOptions,{ref:"details",key:`user_option_${ae.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:a.unref(de),isImaging:a.unref(he),uid:U.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasLabel:t.value.userOptions.buttons.labels,hasStack:Q.dataset.length>1&&t.value.userOptions.buttons.stack,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasTable:u.value.end-u.value.start<200&&t.value.userOptions.buttons.table,isFullscreen:Z.value,isTooltip:s.value.showTooltip,isStacked:s.value.stacked,titles:{...t.value.userOptions.buttonTitles},chartElement:B.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:Y.value,onToggleFullscreen:Be,onGeneratePdf:a.unref(fe),onGenerateCsv:we,onGenerateImage:a.unref(ye),onToggleTable:Se,onToggleLabels:ze,onToggleStack:$e,onToggleTooltip:Te,onToggleAnnotator:J},a.createSlots({_:2},[e.$slots.optionTooltip?{name:"optionTooltip",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,e.$slots.optionPdf?{name:"optionPdf",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,e.$slots.optionCsv?{name:"optionCsv",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,e.$slots.optionImg?{name:"optionImg",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,e.$slots.optionTable?{name:"optionTable",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,e.$slots.optionLabels?{name:"optionLabels",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,e.$slots.optionStack?{name:"optionStack",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionStack",{},void 0,!0)]),key:"6"}:void 0,e.$slots.optionFullscreen?{name:"optionFullscreen",fn:a.withCtx(({toggleFullscreen:r,isFullscreen:v})=>[a.renderSlot(e.$slots,"optionFullscreen",a.normalizeProps(a.guardReactiveProps({toggleFullscreen:r,isFullscreen:v})),void 0,!0)]),key:"7"}:void 0,e.$slots.optionAnnotator?{name:"optionAnnotator",fn:a.withCtx(({toggleAnnotator:r,isAnnotator:v})=>[a.renderSlot(e.$slots,"optionAnnotator",a.normalizeProps(a.guardReactiveProps({toggleAnnotator:r,isAnnotator:v})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasLabel","hasStack","hasFullscreen","hasTable","isFullscreen","isTooltip","isStacked","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"vue-ui-xy-canvas",style:a.normalizeStyle(`position: relative; aspect-ratio: ${ve.value}`),ref_key:"container",ref:I},[G.value?(a.openBlock(),a.createElementBlock("canvas",{key:0,ref_key:"canvas",ref:C,style:{width:"100%",height:"100%"},onMousemove:o[0]||(o[0]=r=>Ue(r)),onMouseleave:Xe},null,544)):(a.openBlock(),a.createBlock(lt.default,{key:1,config:{type:"line",style:{backgroundColor:t.value.style.chart.backgroundColor,line:{axis:{color:"#CCCCCC"},path:{color:"#CCCCCC",strokeWidth:.5}}}}},null,8,["config"])),a.createVNode(Je._sfc_main,{show:s.value.showTooltip&&A.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:C.value,content:_.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,isCustom:a.unref(n.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":a.withCtx(()=>[a.renderSlot(e.$slots,"tooltip-before",a.normalizeProps(a.guardReactiveProps({...ee.value})),void 0,!0)]),"tooltip-after":a.withCtx(()=>[a.renderSlot(e.$slots,"tooltip-after",a.normalizeProps(a.guardReactiveProps({...ee.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","position","offsetY","parent","content","backgroundOpacity","isCustom"])],4),a.createElementVNode("div",{ref_key:"chartSlicer",ref:re,style:a.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&$.value>1?(a.openBlock(),a.createBlock(et.Slicer,{key:`slicer_${te.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.grid.y.timeLabels.values[u.value.start]?t.value.style.chart.grid.y.timeLabels.values[u.value.start]:"",labelRight:t.value.style.chart.grid.y.timeLabels.values[u.value.end-1]?t.value.style.chart.grid.y.timeLabels.values[u.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:$.value,min:0,valueStart:u.value.start,valueEnd:u.value.end,start:u.value.start,"onUpdate:start":o[1]||(o[1]=r=>u.value.start=r),end:u.value.end,"onUpdate:end":o[2]||(o[2]=r=>u.value.end=r),onReset:me},{"reset-action":a.withCtx(({reset:r})=>[a.renderSlot(e.$slots,"reset-action",a.normalizeProps(a.guardReactiveProps({reset:r})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"])):a.createCommentVNode("",!0)],4),a.createElementVNode("div",{ref_key:"chartLegend",ref:oe},[t.value.style.chart.legend.show&&G.value?(a.openBlock(),a.createBlock(Ke.Legend,{legendSet:Le.value,config:Ze.value,key:`legend_${ie.value}`,onClickMarker:o[3]||(o[3]=({i:r})=>ke(r))},{item:a.withCtx(({legend:r,index:v})=>[a.createElementVNode("div",{onClick:h=>r.segregate(),style:a.normalizeStyle(`opacity:${L.value.includes(v)?.5:1}`)},a.toDisplayString(r.name),13,nt)]),_:1},8,["legendSet","config"])):a.renderSlot(e.$slots,"legend",{key:1,legend:Le.value},void 0,!0)],512),e.$slots.watermark?(a.openBlock(),a.createElementBlock("div",st,[a.renderSlot(e.$slots,"watermark",a.normalizeProps(a.guardReactiveProps({isPrinting:a.unref(de)||a.unref(he)})),void 0,!0)])):a.createCommentVNode("",!0),e.$slots.source?(a.openBlock(),a.createElementBlock("div",{key:3,ref_key:"source",ref:ue,dir:"auto"},[a.renderSlot(e.$slots,"source",{},void 0,!0)],512)):a.createCommentVNode("",!0),u.value.end-u.value.start<200?(a.openBlock(),a.createBlock(tt.default,{key:4,hideDetails:"",config:{open:s.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:a.withCtx(()=>[(a.openBlock(),a.createBlock(at.DataTable,{key:`table_${se.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[4]||(o[4]=r=>s.value.showTable=!1)},{th:a.withCtx(({th:r})=>[a.createElementVNode("div",{innerHTML:r},null,8,it)]),td:a.withCtx(({td:r})=>[a.createTextVNode(a.toDisplayString(r),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):a.createCommentVNode("",!0),t.value.userOptions.buttons.annotator&&y.value.length?(a.openBlock(),a.createBlock(ot.PenAndPaper,{key:5,parent:B.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:Y.value,onClose:J},null,8,["parent","backgroundColor","color","active"])):a.createCommentVNode("",!0)],14,ut))}},vt=rt._export_sfc(ct,[["__scopeId","data-v-433caf88"]]);exports.default=vt;