vue-data-ui 2.6.5 → 2.6.7
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.
- package/dist/{Arrow-DfGZcZu4.js → Arrow-BxUmDF04.js} +1 -1
- package/dist/{Arrow-CyeGXbbD.cjs → Arrow-PPbxds1Q.cjs} +1 -1
- package/dist/{BaseIcon-B5DvqSYe.cjs → BaseIcon-BmVwfJg2.cjs} +1 -1
- package/dist/{BaseIcon-BzuvxztF.js → BaseIcon-CDx9pxUG.js} +1 -1
- package/dist/{DataTable-zpYtivMM.cjs → DataTable-Cv_TVAas.cjs} +1 -1
- package/dist/{DataTable-BCCBpyhr.js → DataTable-TjJIVFlL.js} +2 -2
- package/dist/{Legend-CJkkmRNE.cjs → Legend-DunrYGuw.cjs} +1 -1
- package/dist/{Legend-CyJrN721.js → Legend-NKGwxkI7.js} +2 -2
- package/dist/{PackageVersion-Dv25_ZxF.cjs → PackageVersion-DJKkRuOD.cjs} +1 -1
- package/dist/{PackageVersion-PZr4BkQ5.js → PackageVersion-QRvxRYPv.js} +1 -1
- package/dist/{PenAndPaper-Cniu2YEX.js → PenAndPaper-CxC1lWGK.js} +3 -3
- package/dist/{PenAndPaper-Cx3_Liuv.cjs → PenAndPaper-MTTJ3Gd9.cjs} +1 -1
- package/dist/{Shape-BXTmpde5.js → Shape-58uyOuYc.js} +26 -23
- package/dist/Shape-D_1vUjCL.cjs +1 -0
- package/dist/{Slicer-DzKrIvL0.cjs → Slicer-BGEieXKn.cjs} +1 -1
- package/dist/{Slicer-D3tEQT9Z.js → Slicer-C7ormJRw.js} +2 -2
- package/dist/{Title-CXBc1TH6.js → Title-BI8etrRU.js} +1 -1
- package/dist/{Title-DdUtciJN.cjs → Title-Dk92HYMu.cjs} +1 -1
- package/dist/Tooltip-ClMeqejQ.cjs +1 -0
- package/dist/{Tooltip-C9lPh5bN.js → Tooltip-Cxc8c50d.js} +23 -20
- package/dist/{index-DLCyjPV0.js → index-9EeNZMz1.js} +6 -1
- package/dist/index-DEnRHTzk.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +89 -62
- package/dist/types/vue-data-ui.d.ts +89 -62
- package/dist/useChartAccessibility-BWojgys7.js +13 -0
- package/dist/useChartAccessibility-Cm7nkzTG.cjs +1 -0
- package/dist/{useNestedProp-BdTohsDJ.cjs → useNestedProp-BNT60LxO.cjs} +1 -1
- package/dist/{useNestedProp-q86V3_LA.js → useNestedProp-df_bKQEI.js} +1 -1
- package/dist/{usePrinter-CPqTP09H.cjs → usePrinter-dyVny55M.cjs} +1 -1
- package/dist/{usePrinter-CpHZjw3G.js → usePrinter-ngrh00Ym.js} +1 -1
- package/dist/{vue-data-ui-CR9Dof80.cjs → vue-data-ui-BYX-I7HQ.cjs} +1 -1
- package/dist/{vue-data-ui-CzqznXmA.js → vue-data-ui-CDD7JcMs.js} +61 -61
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-DvHdA_uo.js → vue-ui-3d-bar-BArLjlrc.js} +171 -168
- package/dist/vue-ui-3d-bar-DegdXf_S.cjs +19 -0
- package/dist/{vue-ui-accordion-FM16tlk7.cjs → vue-ui-accordion-D2qxHGzp.cjs} +1 -1
- package/dist/{vue-ui-accordion-DR2qjfsa.js → vue-ui-accordion-Qo8JxnIN.js} +3 -3
- package/dist/{vue-ui-age-pyramid-BoXxK9_W.js → vue-ui-age-pyramid-Biz02m7c.js} +85 -82
- package/dist/vue-ui-age-pyramid-kpaaJ2Gx.cjs +1 -0
- package/dist/{vue-ui-annotator-5tI8NuFh.cjs → vue-ui-annotator-By6XNYm0.cjs} +1 -1
- package/dist/{vue-ui-annotator-D4kCCpAK.js → vue-ui-annotator-MXs48Lua.js} +1 -1
- package/dist/{vue-ui-bullet-X3Xa_OZ6.js → vue-ui-bullet-CtBs_r3I.js} +92 -89
- package/dist/vue-ui-bullet-Dkz6vX0T.cjs +34 -0
- package/dist/vue-ui-candlestick-DiEUIuW8.cjs +2 -0
- package/dist/{vue-ui-candlestick-BTW5toA5.js → vue-ui-candlestick-gPztmuJE.js} +155 -152
- package/dist/{vue-ui-carousel-table-Cmnwv9Y3.cjs → vue-ui-carousel-table-CYeXP21y.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-D7s_SrJR.js → vue-ui-carousel-table-D9ckYNKZ.js} +4 -4
- package/dist/{vue-ui-chestnut-DN9EZShg.js → vue-ui-chestnut-DWjn-jcN.js} +186 -183
- package/dist/vue-ui-chestnut-oZtRERnV.cjs +6 -0
- package/dist/{vue-ui-circle-pack-ts3rurGX.js → vue-ui-circle-pack-Bz5yVvAM.js} +99 -96
- package/dist/vue-ui-circle-pack-DCJ6N00S.cjs +1 -0
- package/dist/{vue-ui-cursor-SW96fYT3.js → vue-ui-cursor-BrrVDy1u.js} +2 -2
- package/dist/{vue-ui-cursor-CpWkrHpR.cjs → vue-ui-cursor-DZhRygRy.cjs} +1 -1
- package/dist/{vue-ui-dashboard-BZcfgajg.js → vue-ui-dashboard-DEmGN8Js.js} +2 -2
- package/dist/{vue-ui-dashboard-Buh9xBz-.cjs → vue-ui-dashboard-o8Ju_cXW.cjs} +1 -1
- package/dist/{vue-ui-digits-rB78vJRR.cjs → vue-ui-digits-CgyYdrQ5.cjs} +1 -1
- package/dist/{vue-ui-digits-C00yOT24.js → vue-ui-digits-DbOrROu7.js} +2 -2
- package/dist/vue-ui-donut-9pWaRwf3.cjs +1 -0
- package/dist/{vue-ui-donut-BkGR2Q-_.js → vue-ui-donut-CP5uWglM.js} +158 -156
- package/dist/{vue-ui-donut-evolution-B7WrjiTO.js → vue-ui-donut-evolution-BAMD1wQ5.js} +133 -131
- package/dist/vue-ui-donut-evolution-Ci_gIrkO.cjs +1 -0
- package/dist/{vue-ui-dumbbell-gQadUH53.js → vue-ui-dumbbell-CFYd-Ypn.js} +125 -122
- package/dist/vue-ui-dumbbell-DUNYoZxT.cjs +9 -0
- package/dist/{vue-ui-flow-CqSTZbgP.js → vue-ui-flow-CdvGWFzv.js} +96 -93
- package/dist/vue-ui-flow-W89ofPB-.cjs +1 -0
- package/dist/{vue-ui-funnel-Jr9TMTsq.js → vue-ui-funnel-DYutKyoz.js} +88 -85
- package/dist/vue-ui-funnel-RvdVrhFu.cjs +1 -0
- package/dist/{vue-ui-galaxy-BrQ10tPo.js → vue-ui-galaxy-BCBRlYS1.js} +123 -120
- package/dist/vue-ui-galaxy-Djdx-ca8.cjs +1 -0
- package/dist/{vue-ui-gauge-DOMio6Mv.js → vue-ui-gauge-BNAAZt4F.js} +86 -83
- package/dist/vue-ui-gauge-BVVmf09x.cjs +1 -0
- package/dist/{vue-ui-gizmo-SKS1idHb.js → vue-ui-gizmo-BFQ_KgLX.js} +3 -3
- package/dist/{vue-ui-gizmo-C3NimqVM.cjs → vue-ui-gizmo-Ceh0oFY3.cjs} +1 -1
- package/dist/vue-ui-heatmap-CiZpI-tA.cjs +1 -0
- package/dist/{vue-ui-heatmap-l4vCjb6f.js → vue-ui-heatmap-Ct3qaBv7.js} +109 -106
- package/dist/vue-ui-history-plot-Ci8Y2EFg.cjs +1 -0
- package/dist/{vue-ui-history-plot-B05tJML1.js → vue-ui-history-plot-shn74MJ6.js} +130 -127
- package/dist/{vue-ui-kpi-DF4U5E1w.js → vue-ui-kpi-B_pV-2JJ.js} +3 -3
- package/dist/{vue-ui-kpi-DQJr571M.cjs → vue-ui-kpi-DfYrbxlX.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-BMARnOW4.js → vue-ui-mini-loader-BFnWQs5p.js} +2 -2
- package/dist/{vue-ui-mini-loader-BZkVKkqn.cjs → vue-ui-mini-loader-LIqf62jk.cjs} +1 -1
- package/dist/vue-ui-molecule-D8YuYTKv.cjs +1 -0
- package/dist/{vue-ui-molecule-C1ycekVJ.js → vue-ui-molecule-DNz1m8XZ.js} +147 -144
- package/dist/{vue-ui-mood-radar-_Kd-Lhpm.js → vue-ui-mood-radar-DiYB_zhM.js} +97 -94
- package/dist/vue-ui-mood-radar-uvH7qUHy.cjs +1 -0
- package/dist/{vue-ui-nested-donuts-DIwRSn-O.js → vue-ui-nested-donuts-9hn-g4ir.js} +99 -96
- package/dist/vue-ui-nested-donuts-C7ikDjp7.cjs +17 -0
- package/dist/vue-ui-onion-5Rqvd4Fw.cjs +5 -0
- package/dist/{vue-ui-onion-Dqb0gwGl.js → vue-ui-onion-DCWfNTNu.js} +105 -102
- package/dist/{vue-ui-parallel-coordinate-plot-De-tYNNy.js → vue-ui-parallel-coordinate-plot-CaPFL9_1.js} +97 -94
- package/dist/vue-ui-parallel-coordinate-plot-tlgTbaNX.cjs +8 -0
- package/dist/vue-ui-quadrant-B0Sw5NGo.cjs +1 -0
- package/dist/{vue-ui-quadrant-BQ5maxJq.js → vue-ui-quadrant-BoQZ375K.js} +155 -153
- package/dist/vue-ui-quick-chart-D3zV1d7t.cjs +15 -0
- package/dist/{vue-ui-quick-chart-DF_510YT.js → vue-ui-quick-chart-vfMN8F1q.js} +164 -161
- package/dist/{vue-ui-radar-DDHd0AYs.js → vue-ui-radar-CAuu6wkh.js} +129 -127
- package/dist/vue-ui-radar-CNMJCAwo.cjs +1 -0
- package/dist/{vue-ui-rating-Chi3OOtp.js → vue-ui-rating-Bm0HZ3du.js} +2 -2
- package/dist/{vue-ui-rating-D9kQcY2a.cjs → vue-ui-rating-dsRDRL98.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-CV1xQOok.js → vue-ui-relation-circle-5OZMN9jR.js} +127 -124
- package/dist/vue-ui-relation-circle-iD7BufNH.cjs +1 -0
- package/dist/{vue-ui-rings-D2ezwyae.js → vue-ui-rings-COefBaQT.js} +114 -112
- package/dist/vue-ui-rings-DC4WG4sK.cjs +2 -0
- package/dist/vue-ui-scatter-5ny76dmi.cjs +1 -0
- package/dist/{vue-ui-scatter-BxbUYPk1.js → vue-ui-scatter-DhO83TZZ.js} +157 -154
- package/dist/{vue-ui-screenshot-Bc7Lv1i8.cjs → vue-ui-screenshot-DABH_phE.cjs} +1 -1
- package/dist/{vue-ui-screenshot-cxDgcXJB.js → vue-ui-screenshot-brillPo5.js} +1 -1
- package/dist/{vue-ui-skeleton-D6ojufhb.js → vue-ui-skeleton-BmJiYGtE.js} +3 -3
- package/dist/{vue-ui-skeleton-DvdPnQbR.cjs → vue-ui-skeleton-_DN0U6W6.cjs} +1 -1
- package/dist/{vue-ui-smiley-DEJ6S-We.cjs → vue-ui-smiley-CW6714mb.cjs} +1 -1
- package/dist/{vue-ui-smiley-9nGRDSn7.js → vue-ui-smiley-D9NRimij.js} +2 -2
- package/dist/{vue-ui-spark-trend-DiNeAGXR.js → vue-ui-spark-trend-BKZj03CQ.js} +5 -5
- package/dist/{vue-ui-spark-trend-BosbwgVe.cjs → vue-ui-spark-trend-expbkxgR.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-DNf_Majv.js → vue-ui-sparkbar-CYRORE5i.js} +4 -4
- package/dist/{vue-ui-sparkbar-DGFKrcg0.cjs → vue-ui-sparkbar-Cr9FtevP.cjs} +1 -1
- package/dist/vue-ui-sparkgauge-BHXFhvTv.cjs +1 -0
- package/dist/{vue-ui-sparkgauge-D89HjxSK.js → vue-ui-sparkgauge-JV4tYB7P.js} +56 -53
- package/dist/{vue-ui-sparkhistogram-CU1_P6AJ.js → vue-ui-sparkhistogram-DKINHX2q.js} +93 -90
- package/dist/vue-ui-sparkhistogram-T4a3DDck.cjs +1 -0
- package/dist/{vue-ui-sparkline-C2McLmh5.js → vue-ui-sparkline-CbRTHtig.js} +109 -106
- package/dist/vue-ui-sparkline-Dc6Sf3n8.cjs +1 -0
- package/dist/{vue-ui-sparkstackbar-Cu4aG9PB.js → vue-ui-sparkstackbar-6u9-2nG4.js} +59 -56
- package/dist/vue-ui-sparkstackbar-CV5SkdsP.cjs +1 -0
- package/dist/{vue-ui-stackbar-6m5CpvNM.js → vue-ui-stackbar-CUppObfj.js} +136 -133
- package/dist/vue-ui-stackbar-CXB-nd71.cjs +6 -0
- package/dist/vue-ui-strip-plot-6IXF_U6-.cjs +1 -0
- package/dist/{vue-ui-strip-plot-DlZ2Eez4.js → vue-ui-strip-plot-doaNZAW4.js} +127 -124
- package/dist/{vue-ui-table-U0_3I0fu.js → vue-ui-table-CZsNuDR5.js} +1 -1
- package/dist/{vue-ui-table-BjhcV9qB.cjs → vue-ui-table-S66UCskD.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-Bfqytiv5.cjs → vue-ui-table-heatmap-BU9UU15H.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-BrGkCaOG.js → vue-ui-table-heatmap-CjohHqDV.js} +4 -4
- package/dist/{vue-ui-table-sparkline-CXlnp8E3.cjs → vue-ui-table-sparkline-CHFFTD0a.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-C1wNBDqO.js → vue-ui-table-sparkline-ab2rwdKB.js} +5 -5
- package/dist/{vue-ui-thermometer-Bx2abW1B.js → vue-ui-thermometer-C72mHwUi.js} +84 -81
- package/dist/vue-ui-thermometer-Ccd6RGh8.cjs +1 -0
- package/dist/vue-ui-timer-C8Fn2B0b.cjs +64 -0
- package/dist/{vue-ui-timer-3UkgrtEj.js → vue-ui-timer-D-LNi6lz.js} +183 -180
- package/dist/{vue-ui-tiremarks-C_xuD4De.js → vue-ui-tiremarks-Bo8EWsJ8.js} +59 -56
- package/dist/vue-ui-tiremarks-SOzvMOz4.cjs +1 -0
- package/dist/vue-ui-treemap-BqTTQrVh.cjs +1 -0
- package/dist/{vue-ui-treemap-BjDSR72h.js → vue-ui-treemap-uj94elVB.js} +123 -120
- package/dist/{vue-ui-vertical-bar-DUhOoSNl.js → vue-ui-vertical-bar-BUTOw-DK.js} +108 -106
- package/dist/vue-ui-vertical-bar-C4Sxun4Q.cjs +4 -0
- package/dist/{vue-ui-waffle-Dpox5n5s.js → vue-ui-waffle-CTWA1frT.js} +107 -104
- package/dist/vue-ui-waffle-DYWGRKdT.cjs +1 -0
- package/dist/vue-ui-wheel-8K72ZKda.js +330 -0
- package/dist/vue-ui-wheel-Cz5-0klT.cjs +1 -0
- package/dist/{vue-ui-word-cloud-u5S86-Ft.js → vue-ui-word-cloud-CSwBPDB8.js} +97 -94
- package/dist/vue-ui-word-cloud-D39riLZb.cjs +1 -0
- package/dist/vue-ui-xy-BbWXjajH.cjs +3 -0
- package/dist/{vue-ui-xy-0nBQDwL2.js → vue-ui-xy-DpDKutd7.js} +65 -58
- package/dist/{vue-ui-xy-canvas-yQlThVu7.cjs → vue-ui-xy-canvas-BCj0SCqe.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-DI7LiD4U.js → vue-ui-xy-canvas-BQm9gah4.js} +82 -81
- package/package.json +1 -1
- package/dist/Shape-GAZUIBfN.cjs +0 -1
- package/dist/Tooltip-BlGVq6xj.cjs +0 -1
- package/dist/index-DSGAenF3.cjs +0 -9
- package/dist/vue-ui-3d-bar-vvpkf_bv.cjs +0 -19
- package/dist/vue-ui-age-pyramid-CMMnrI3R.cjs +0 -1
- package/dist/vue-ui-bullet-nXPlud-q.cjs +0 -34
- package/dist/vue-ui-candlestick-B6T0LhEG.cjs +0 -2
- package/dist/vue-ui-chestnut-D8Gq_i77.cjs +0 -6
- package/dist/vue-ui-circle-pack-DCz3OWlu.cjs +0 -1
- package/dist/vue-ui-donut-BpgK-I9o.cjs +0 -1
- package/dist/vue-ui-donut-evolution-BVJCDPQ2.cjs +0 -1
- package/dist/vue-ui-dumbbell-DRcemHVG.cjs +0 -9
- package/dist/vue-ui-flow-DdQsK5DR.cjs +0 -1
- package/dist/vue-ui-funnel-Bq4yoTfd.cjs +0 -1
- package/dist/vue-ui-galaxy-ia1UNlpc.cjs +0 -1
- package/dist/vue-ui-gauge-C3FbYOSi.cjs +0 -1
- package/dist/vue-ui-heatmap-BCau2Z3U.cjs +0 -1
- package/dist/vue-ui-history-plot-DL7VjOd0.cjs +0 -1
- package/dist/vue-ui-molecule-B5XDGmLx.cjs +0 -1
- package/dist/vue-ui-mood-radar-DyMCJKFb.cjs +0 -1
- package/dist/vue-ui-nested-donuts-B4Am-r6T.cjs +0 -17
- package/dist/vue-ui-onion-YeBdJrdx.cjs +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-CoecETlm.cjs +0 -8
- package/dist/vue-ui-quadrant-Btzq3qNJ.cjs +0 -1
- package/dist/vue-ui-quick-chart-5cWjffLJ.cjs +0 -15
- package/dist/vue-ui-radar-t22bqFiQ.cjs +0 -1
- package/dist/vue-ui-relation-circle-CWgGPxDJ.cjs +0 -1
- package/dist/vue-ui-rings-CiLJkRwa.cjs +0 -2
- package/dist/vue-ui-scatter-B24gGA8q.cjs +0 -1
- package/dist/vue-ui-sparkgauge-DwK7dzdJ.cjs +0 -1
- package/dist/vue-ui-sparkhistogram-DKoI6_TT.cjs +0 -1
- package/dist/vue-ui-sparkline-Bp7GMRrA.cjs +0 -1
- package/dist/vue-ui-sparkstackbar-Dayxdcr7.cjs +0 -1
- package/dist/vue-ui-stackbar-C21xTVy9.cjs +0 -6
- package/dist/vue-ui-strip-plot-DAo8FMup.cjs +0 -1
- package/dist/vue-ui-thermometer-CBdAwYdC.cjs +0 -1
- package/dist/vue-ui-timer-CRDQbqJ_.cjs +0 -64
- package/dist/vue-ui-tiremarks-C78mfaBr.cjs +0 -1
- package/dist/vue-ui-treemap-CP__1pdb.cjs +0 -1
- package/dist/vue-ui-vertical-bar-DTB8r4LH.cjs +0 -4
- package/dist/vue-ui-waffle-CrVyCF7k.cjs +0 -1
- package/dist/vue-ui-wheel-DV2zgr4d.cjs +0 -1
- package/dist/vue-ui-wheel-ykD8OULJ.js +0 -319
- package/dist/vue-ui-word-cloud-DBkAo2uX.cjs +0 -1
- package/dist/vue-ui-xy-mEVVQr_U.cjs +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),n=require("./index-DEnRHTzk.cjs"),c=require("./useResponsive-YQYQrAZ_.cjs"),it=require("./Tooltip-ClMeqejQ.cjs"),ct=require("./Legend-DunrYGuw.cjs"),vt=require("./Title-Dk92HYMu.cjs"),dt=require("./Slicer-BGEieXKn.cjs"),Ne=require("./usePrinter-dyVny55M.cjs"),ht=require("./vue-ui-accordion-D2qxHGzp.cjs"),yt=require("./DataTable-Cv_TVAas.cjs"),ft=require("./vue-ui-skeleton-_DN0U6W6.cjs"),De=require("./useNestedProp-BNT60LxO.cjs"),gt=require("./PenAndPaper-MTTJ3Gd9.cjs"),pt=require("./useUserOptionState-BgepsfED.cjs"),mt=require("./useChartAccessibility-Cm7nkzTG.cjs"),bt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xt=["id"],Lt=["onClick"],kt={key:2,class:"vue-data-ui-watermark"},Ct=["innerHTML"],wt={__name:"vue-ui-xy-canvas",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(ue,{expose:Be,emit:Fe}){const{vue_ui_xy_canvas:Ae}=n.useConfig(),m=ue,J=l.ref(n.createUid()),B=l.ref(null),F=l.ref(null),i=l.ref(null),g=l.ref(1),T=l.ref(1),U=l.ref(!1),h=l.ref(null),_=l.ref(""),ne=l.ref(null),C=l.ref([]),R=l.ref(1),I=l.ref(!0),E=l.ref(!0),K=l.ref(null),se=l.ref(0),ie=l.ref(0),q=l.ref(!1),ce=l.ref(null),ve=l.ref(null),de=l.ref(null),he=l.ref(null),Q=l.ref(0),ee=l.ref(0),te=l.ref(0),S=l.ref(null),le=l.computed(()=>!!m.dataset&&m.dataset.length),He=Fe,Ve=l.useSlots();l.onMounted(()=>{Ve["chart-background"]&&console.warn("VueUiXyCanvas does not support the #chart-background slot.")});const t=l.computed({get:()=>ge(),set:e=>e}),{userOptionsVisible:ae,setUserOptionsVisibility:ye,keepUserOptionState:fe}=pt.useUserOptionState({config:t.value}),{svgRef:z}=mt.useChartAccessibility({config:t.value.style.chart.title});function ge(){const e=De.useNestedProp({userConfig:m.config,defaultConfig:Ae});let o={};return e.theme?o={...De.useNestedProp({userConfig:n.themes.vue_ui_xy_canvas[e.theme]||m.config,defaultConfig:e}),customPalette:n.themePalettes[e.theme]||n.palette}:o=e,m.config&&n.hasDeepProperty(m.config,"style.chart.scale.min")?o.style.chart.scale.min=m.config.style.chart.scale.min:o.style.chart.scale.min=null,m.config&&n.hasDeepProperty(m.config,"style.chart.scale.max")?o.style.chart.scale.max=m.config.style.chart.scale.max:o.style.chart.scale.max=null,m.config&&n.hasDeepProperty(m.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=m.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,m.config&&n.hasDeepProperty(m.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=m.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}l.watch(()=>m.config,e=>{t.value=ge(),ae.value=!t.value.userOptions.showOnChartHover,oe(),Q.value+=1,ee.value+=1,te.value+=1,s.value.showTable=t.value.table.show,s.value.showDataLabels=t.value.style.chart.dataLabels.show,s.value.stacked=t.value.style.chart.stacked,s.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),l.watch(()=>m.dataset,()=>{oe(),Q.value+=1,ee.value+=1,te.value+=1},{deep:!0});const pe=l.ref(t.value.style.chart.aspectRatio),{isPrinting:me,isImaging:be,generatePdf:xe,generateImage:Le}=Ne.usePrinter({elementId:`xy_canvas_${J.value}`,fileName:t.value.style.chart.title.text||"vue-ui-xy-canvas"}),s=l.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 Ye(e){q.value=e,ie.value+=1}const ke=l.computed(()=>n.convertCustomPalette(t.value.customPalette)),w=l.computed(()=>N.value?Math.max(...N.value.filter((e,o)=>!C.value.includes(e.absoluteIndex)).map(e=>e.series.length)):0),a=l.computed(()=>{const e=g.value-g.value*(t.value.style.chart.paddingProportions.left+t.value.style.chart.paddingProportions.right);return{canvasWidth:g.value,canvasHeight:T.value,left:g.value*t.value.style.chart.paddingProportions.left,top:T.value*t.value.style.chart.paddingProportions.top,right:g.value-g.value*t.value.style.chart.paddingProportions.right,bottom:T.value-T.value*t.value.style.chart.paddingProportions.bottom,width:e,height:T.value-T.value*(t.value.style.chart.paddingProportions.top+t.value.style.chart.paddingProportions.bottom),slot:e/(u.value.end-u.value.start)}});function Ce(e,o){return e/o}function Ue({hasAutoScale:e,series:o,min:r,max:v,scale:y,yOffset:L,individualHeight:d,stackIndex:p=null}){return o.map((P,k)=>{const M=y.min<0?Math.abs(y.min):0,O=Ce(P+M,M+y.max);let V,Y;e&&(V=y.min,Y=Ce(P-V,y.max-V));let $=0;return p===null?$=a.value.bottom-a.value.height*(e?Y:O):$=a.value.bottom-L-d*(e?Y:O),{x:a.value.left+a.value.slot*k+a.value.slot/2,y:$,value:P}})}const b=l.computed(()=>{const e=t.value.style.chart.scale.min!==null?t.value.style.chart.scale.min:Math.min(...N.value.filter((d,p)=>!C.value.includes(d.absoluteIndex)).flatMap(d=>d.series.slice(u.value.start,u.value.end))),o=t.value.style.chart.scale.max!==null?t.value.style.chart.scale.max:Math.max(...N.value.filter((d,p)=>!C.value.includes(d.absoluteIndex)).flatMap(d=>d.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,y=a.value.bottom-a.value.height*(v/(r.max+v)),L=r.ticks.map(d=>({y:a.value.bottom-a.value.height*((d+v)/(r.max+v)),x:a.value.left-8,value:d}));return{absoluteMin:v,max:o,min:e,scale:r,yLabels:L,zero:y}}),_e=l.computed(()=>f.value.map(e=>`
|
|
2
2
|
<div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
|
|
3
3
|
<svg viewBox="0 0 10 10" height="12" width="12">
|
|
4
4
|
<circle cx="5" cy="5" r="5" fill="${e.color}"/>
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
<span>${e.name?e.name+": ":""}</span>
|
|
7
7
|
<span>${n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.series[h.value],n.dataLabel({p:e.prefix||"",v:e.series[h.value],s:e.suffix||"",r:e.rounding||0}),{datapoint:e,seriesIndex:h.value})}</span>
|
|
8
8
|
</div>
|
|
9
|
-
`)),N=l.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||ke.value[o]||n.palette[o]||n.palette[o%n.palette.length])})));l.watch(w,e=>{e&&we()});const y=l.computed(()=>n.assignStackRatios(N.value.filter((e,o)=>!C.value.includes(e.absoluteIndex))).map((e,o)=>({...e,series:e.series.slice(u.value.start,u.value.end)})).map((e,o)=>{let r=[null,void 0].includes(e.scaleMin)?Math.min(...e.series)||0:e.scaleMin,v=[null,void 0].includes(e.scaleMax)?Math.max(...e.series)||1:e.scaleMax;r===v&&(r=r>=0?v-1:r,v=v>=0?v:r+1),e.series.filter($=>![null,void 0].includes($)).map($=>($-r)/(v-r));const f={valueMin:r,valueMax:v},L=e.scaleSteps||t.value.style.chart.scale.ticks;let d;e.autoScaling?d=n.calculateNiceScale(f.valueMin,f.valueMax,L):d=n.calculateNiceScale(f.valueMin<0?f.valueMin:0,f.valueMax<=0?0:f.valueMax,L);const p=s.value.stacked?a.value.height*(1-e.cumulatedStackRatio):0,P=s.value.stacked?a.value.height/t.value.style.chart.stackGap:0,k=s.value.stacked?a.value.height*e.stackRatio-P:a.value.height,M=d.min<0?Math.abs(d.min):0;let O;e.autoScaling&&s.value.stacked&&v<=0?O=a.value.bottom-p-k:O=a.value.bottom-p-k*(M/(d.max+M));const V=d.ticks.map(($,st)=>({y:a.value.bottom-p-k*(st/(d.ticks.length-1)),x:a.value.left-8,value:$})),Y=Ue({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?d:b.value.scale,yOffset:p,individualHeight:k,stackIndex:s.value.stacked?o:null});return{...e,coordinatesLine:Y,min:r,max:v,localScale:d,localZero:O,localMin:M,localYLabels:V,yOffset:p,individualHeight:k}})),u=l.ref({start:0,end:w.value});function we(){Se()}const D=l.ref(null);async function Se(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&D.value?(t.value.style.chart.zoom.startIndex!==null&&(await l.nextTick(),await l.nextTick(),D.value&&D.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await l.nextTick(),await l.nextTick(),D.value&&D.value.setEndValue(qe(t.value.style.chart.zoom.endIndex+1)))):(u.value={start:0,end:w.value},se.value+=1)}function qe(e){const o=w.value;return e>o?o:e<0||t.value.style.chart.zoom.startIndex!==null&&e<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:e}const We=l.computed(()=>y.value.filter(e=>["line","plot",void 0].includes(e.type))),x=l.computed(()=>y.value.filter(e=>e.type==="bar"));function Xe(){if(!S.value)return;const e=F.value.offsetWidth,o=F.value.offsetHeight;S.value.width=e*R.value*2,S.value.height=o*R.value*2,g.value=e*R.value*2,T.value=o*R.value*2,i.value.scale(R.value,R.value),A()}function Ze(){if(i.value.clearRect(0,0,1e4,1e4),i.value.fillStyle=t.value.style.chart.backgroundColor,i.value.fillRect(0,0,a.value.canvasWidth,a.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)c.line(i.value,[{x:a.value.left+a.value.slot*o,y:a.value.bottom-e.yOffset-e.individualHeight},{x:a.value.left+a.value.slot*o,y:a.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}):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=u.value.start;o<u.value.end;o+=1)o%Math.floor((u.value.end-u.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0&&c.line(i.value,[{x:a.value.left+a.value.slot*(o-u.value.start)+a.value.slot/2,y:a.value.bottom-e.yOffset-e.individualHeight},{x:a.value.left+a.value.slot*(o-u.value.start)+a.value.slot/2,y:a.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&&c.rect(i.value,[{x:a.value.left,y:o.y},{x:a.value.right,y:o.y},{x:a.value.right,y:e.localYLabels[r+1].y},{x:a.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=>{c.line(i.value,[{x:a.value.left,y:o.y},{x:a.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=>{c.line(i.value,[{x:a.value.left,y:e.localZero},{x:a.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=>{c.line(i.value,[{x:a.value.left,y:a.value.bottom-e.yOffset},{x:a.value.left,y:a.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),c.line(i.value,[{x:a.value.right,y:a.value.bottom-e.yOffset},{x:a.value.right,y:a.value.bottom-e.yOffset-e.individualHeight}],{color:e.color})}),y.value.forEach(e=>{c.text(i.value,e.name,g.value/35,a.value.bottom-e.yOffset-e.individualHeight/2,{align:"center",rotation:-90,color:e.color,font:`${Math.round(g.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)c.line(i.value,[{x:a.value.left+a.value.slot*e,y:a.value.top},{x:a.value.left+a.value.slot*e,y:a.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});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=u.value.start;e<u.value.end;e+=1)e%Math.floor((u.value.end-u.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0&&c.line(i.value,[{x:a.value.left+a.value.slot*(e-u.value.start)+a.value.slot/2,y:a.value.top},{x:a.value.left+a.value.slot*(e-u.value.start)+a.value.slot/2,y:a.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&&c.rect(i.value,[{x:a.value.left,y:e.y},{x:a.value.right,y:e.y},{x:a.value.right,y:b.value.yLabels[o+1].y},{x:a.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=>{c.line(i.value,[{x:a.value.left,y:e.y},{x:a.value.right,y:e.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})),t.value.style.chart.grid.y.showAxis&&c.line(i.value,[{x:a.value.left,y:a.value.top},{x:a.value.left,y:a.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&&c.line(i.value,[{x:a.value.left,y:a.value.bottom},{x:a.value.right,y:a.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&&c.line(i.value,[{x:a.value.left,y:b.value.zero},{x:a.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.axisName&&c.text(i.value,t.value.style.chart.grid.y.axisName,g.value-g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio*1.2,a.value.bottom-a.value.height/2,{font:`${Math.round(g.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&&c.text(i.value,t.value.style.chart.grid.x.axisName,g.value/2,T.value,{font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center"})}function Ge(e){for(let o=0;o<e.coordinatesLine.length;o+=1){const r=(h.value===o?g.value/150:t.value.style.chart.line.plots.show?g.value/200:0)*t.value.style.chart.line.plots.radiusRatio;c.circle(i.value,{x:e.coordinatesLine[o].x,y:e.coordinatesLine[o].y},r,{color:t.value.style.chart.backgroundColor,fillStyle:e.color})}}function je(){y.value.forEach(e=>{e.showYMarker&&H(e)&&c.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,H(e).value,n.dataLabel({p:e.prefix||t.value.style.chart.grid.y.axisLabels.prefix||"",v:H(e).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:H(e),seriesIndex:null}),a.value.left-8+t.value.style.chart.grid.y.axisLabels.offsetX,H(e).y,{align:"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color})})}function Je(){t.value.style.chart.grid.y.axisLabels.show&&(s.value.stacked?y.value.forEach(e=>{e.localYLabels.forEach((o,r)=>{c.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(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color,globalAlpha:e.showYMarker&&![null,void 0].includes(h.value)?.2:1})})}):b.value.yLabels.forEach((e,o)=>{c.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(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.axisLabels.color,globalAlpha:y.value.some(r=>r.showYMarker)&&![null,void 0].includes(h.value)?.2:1})}))}function Ke(e){for(let o=0;o<e.coordinatesLine.length;o+=1)c.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(g.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(){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===h.value+u.value.start&&t.value.style.chart.grid.y.timeLabels.showMarker))&&c.text(i.value,t.value.style.chart.grid.y.timeLabels.values[e]||e+1,a.value.left+a.value.slot*(e-u.value.start)+a.value.slot/2,a.value.bottom+g.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(g.value/40*t.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.timeLabels.showMarker?n.setOpacity(t.value.style.chart.grid.y.timeLabels.color,h.value!==null?h.value+u.value.start===e?100:20:100):t.value.style.chart.grid.y.timeLabels.color,rotation:t.value.style.chart.grid.y.timeLabels.rotation})}function ze(){c.line(i.value,[{x:a.value.left+a.value.slot*h.value+a.value.slot/2,y:a.value.top},{x:a.value.left+a.value.slot*h.value+a.value.slot/2,y:a.value.bottom}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2})}function et(){z.value&&c.line(i.value,[{x:a.value.left,y:z.value},{x:a.value.right,y:z.value}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2})}function tt(){x.value.forEach((e,o)=>{for(let r=0;r<e.coordinatesLine.length;r+=1)c.rect(i.value,[{x:a.value.left+a.value.slot*r+a.value.slot/10+(s.value.stacked?0:a.value.slot/x.value.length*o-(o===0?0:a.value.slot/(5*x.value.length)*o)),y:s.value.stacked?e.localZero:b.value.zero},{x:a.value.left+a.value.slot*r+a.value.slot/10+(s.value.stacked?0:a.value.slot/x.value.length*o-(o===0?0:a.value.slot/(5*x.value.length)*o))+a.value.slot*.8/(s.value.stacked?1:x.value.length),y:s.value.stacked?e.localZero:b.value.zero},{x:a.value.left+a.value.slot*r+a.value.slot/10+(s.value.stacked?0:a.value.slot/x.value.length*o-(o===0?0:a.value.slot/(5*x.value.length)*o))+a.value.slot*.8/(s.value.stacked?1:x.value.length),y:e.coordinatesLine[r].y},{x:a.value.left+a.value.slot*r+a.value.slot/10+(s.value.stacked?0:a.value.slot/x.value.length*o-(o===0?0:a.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)&&c.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}),a.value.left+a.value.slot*r+a.value.slot/10+(s.value.stacked?0:a.value.slot/x.value.length*o-(o===0?0:a.value.slot/(5*x.value.length)*o))+a.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(g.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 lt(e){e.useArea?s.value.stacked?c.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"}):c.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"}):c.line(i.value,e.coordinatesLine,{color:e.color,lineWidth:3})}function at(){y.value.forEach((e,o)=>{c.line(i.value,[{x:a.value.left,y:a.value.bottom-e.yOffset},{x:a.value.right,y:a.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.x.horizontalLines.color,lineWidth:1})})}function A(){Ze(),I.value?(h.value!==null&&t.value.style.chart.selector.show&&ze(),tt(),s.value.stacked&&t.value.style.chart.grid.x.showAxis&&at(),We.value.forEach(e=>{(e.type==="line"||!e.type)&<(e),E.value&&(Ge(e),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&Ke(e))}),K.value=c.cloneCanvas(S.value)):(K.value&&(i.value.clearRect(0,0,1e4,1e4),i.value.drawImage(K.value,0,0)),h.value!==null&&t.value.style.chart.selector.show&&ze(),h.value!==null&&y.value.forEach(e=>{if(e.type==="line"||!e.type||e.type==="plot"){if(!e.coordinatesLine[h.value])return;e.coordinatesLine[h.value].x!==void 0&&e.coordinatesLine[h.value].y!==void 0&&c.circle(i.value,{x:e.coordinatesLine[h.value].x,y:e.coordinatesLine[h.value].y},g.value/150*t.value.style.chart.line.plots.radiusRatio,{color:t.value.style.chart.backgroundColor,fillStyle:e.color})}})),t.value.style.chart.grid.y.timeLabels.show&&Qe(),t.value.style.chart.selector.show&&t.value.style.chart.selector.showHorizontalSelector&&et(),Je(),je(),I.value=!1}const W=c.debounce(()=>{E.value=!0,Xe()},w.value>200?10:1,!E.value);function H(e){if([null,void 0].includes(h.value)||!e.coordinatesLine[h.value])return!1;const{y:o,value:r}=e.coordinatesLine[h.value];return{y:o,value:r}}function ot(e){const{left:o,top:r}=S.value.getBoundingClientRect(),v=e.clientX-o;if(z.value=(e.clientY-r)*2,(z.value<a.value.top||z.value>a.value.bottom)&&(z.value=null),v*2<a.value.left||v*2>a.value.right){U.value=!1,h.value=null;return}const f=v*2-a.value.left;if(h.value=Math.floor(f/a.value.slot),U.value=!0,!E.value)return;let L="";const d=t.value.style.chart.tooltip.customFormat;n.isFunction(d)&&n.functionReturnsString(()=>d({seriesIndex:h.value,datapoint:y.value.map(p=>({shape:p.shape||null,name:p.name,color:p.color,type:p.type||"line",value:p.series.find((P,k)=>k===h.value)})),series:y.value,config:t.value}))?_.value=d({seriesIndex:h.value,datapoint:y.value.map(p=>({shape:p.shape||null,name:p.name,color:p.color,type:p.type||"line",value:p.series.find((P,k)=>k===h.value)})),series:y.value,config:t.value}):(t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[h.value]&&(L+=`<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)[h.value]}</div>`),L+=_e.value.join(""),_.value=L),E.value=!1}l.watch(()=>h.value,e=>{W()}),l.watch(()=>u.value,e=>{I.value=!0,A()},{deep:!0}),l.watch(()=>s.value.showDataLabels,e=>{I.value=!0,A()}),l.watch(()=>z.value,e=>{e&&A()}),l.watch(()=>s.value.stacked,e=>{I.value=!0,E.value=!0,W()});function rt(){U.value=!1,h.value=null,_.value="",z.value=null,A()}const X=l.ref(null),Z=l.ref(null);l.onMounted(()=>{oe()});function oe(){if(n.objectIsEmpty(m.dataset)?n.error({componentName:"VueUiXyCanvas",type:"dataset"}):S.value&&(i.value=S.value.getContext("2d",{willReadFrequently:!0})),t.value.responsive){const e=c.throttle(()=>{const{width:o,height:r}=c.useResponsive({chart:B.value,title:t.value.style.chart.title.text?ce.value:null,legend:t.value.style.chart.legend.show?ve.value:null,slicer:t.value.style.chart.zoom.show&&w.value>1?de.value:null,source:he.value});requestAnimationFrame(()=>{pe.value=`${o} / ${r}`})});X.value=new ResizeObserver(e),X.value.observe(B.value.parentNode)}Z.value=new ResizeObserver(e=>{for(const o of e)o.contentBoxSize&&F.value&&(I.value=!0,W())}),Z.value.observe(F.value),Se()}l.onBeforeUnmount(()=>{Z.value&&Z.value.disconnect(),X.value&&X.value.disconnect()});function $e(e){He("selectLegend",y.value.find(o=>o.absoluteIndex===e)),C.value.includes(e)?C.value=C.value.filter(o=>o!==e):C.value.push(e),I.value=!0,W()}const Te=l.computed(()=>N.value.map((e,o)=>({...e,name:e.name,color:n.convertColorToHex(e.color)||ke.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:C.value.includes(e.absoluteIndex)?.5:1,segregate:()=>$e(e.absoluteIndex),isSegregated:C.value.includes(e.absoluteIndex)}))),ut=l.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":""})),G=l.computed(()=>{const e=[""].concat(y.value.map(f=>f.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 f=0;f<w.value;f+=1){const L=y.value.map(d=>d.series[f]??0).reduce((d,p)=>d+p,0);o.push([t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[f]??f+1].concat(y.value.map(d=>(d.series[f]??0).toFixed(t.value.table.rounding))).concat((L??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(f=>f.name)).concat(t.value.table.columnNames.total);return{head:e,body:o.slice(0,u.value.end-u.value.start),config:r,colNames:v}}),Me=l.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(f=>{v.push(Number((f.series[r]||0).toFixed(t.value.table.rounding)))}),o.push(v)}return{head:e,body:o}});function Ie(){const e=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=["",...Me.value.head.map(L=>L.label)],r=Me.value.body,v=e.concat([o]).concat(r),f=n.createCsvContent(v);n.downloadCsv({csvContent:f,title:t.value.style.chart.title.text||"vue-ui-xy-canvas"})}function nt(){return y.value}function Pe(){s.value.showTable=!s.value.showTable}function Oe(){s.value.showDataLabels=!s.value.showDataLabels}function Re(){s.value.stacked=!s.value.stacked}function Ee(){s.value.showTooltip=!s.value.showTooltip}const j=l.ref(!1);function re(){j.value=!j.value}return Be({getData:nt,generateCsv:Ie,generatePdf:xe,generateImage:Le,toggleTable:Pe,toggleLabels:Oe,toggleStack:Re,toggleTooltip:Ee,toggleAnnotator:re}),(e,o)=>(l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(`width:100%; position:relative; ${t.value.responsive?"height: 100%":""}`),ref_key:"xy",ref:B,id:`xy_canvas_${J.value}`,class:l.normalizeClass(`vue-ui-donut ${q.value?"vue-data-ui-wrapper-fullscreen":""}`),onMouseenter:o[5]||(o[5]=()=>l.unref(fe)(!0)),onMouseleave:o[6]||(o[6]=()=>l.unref(fe)(!1))},[t.value.style.chart.title.text?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:ce,style:l.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};`)},[(l.openBlock(),l.createBlock(vt._sfc_main,{key:`title_${Q.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)):l.createCommentVNode("",!0),t.value.userOptions.show&&le.value&&(l.unref(ye)||l.unref(ae))?(l.openBlock(),l.createBlock(Ne.UserOptions,{ref:"details",key:`user_option_${ie.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:l.unref(me),isImaging:l.unref(be),uid:J.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:ue.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:q.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:j.value,onToggleFullscreen:Ye,onGeneratePdf:l.unref(xe),onGenerateCsv:Ie,onGenerateImage:l.unref(Le),onToggleTable:Pe,onToggleLabels:Oe,onToggleStack:Re,onToggleTooltip:Ee,onToggleAnnotator:re,style:l.normalizeStyle({visibility:l.unref(ye)?l.unref(ae)?"visible":"hidden":"visible"})},l.createSlots({_:2},[e.$slots.optionTooltip?{name:"optionTooltip",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,e.$slots.optionPdf?{name:"optionPdf",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,e.$slots.optionCsv?{name:"optionCsv",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,e.$slots.optionImg?{name:"optionImg",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,e.$slots.optionTable?{name:"optionTable",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,e.$slots.optionLabels?{name:"optionLabels",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,e.$slots.optionStack?{name:"optionStack",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionStack",{},void 0,!0)]),key:"6"}:void 0,e.$slots.optionFullscreen?{name:"optionFullscreen",fn:l.withCtx(({toggleFullscreen:r,isFullscreen:v})=>[l.renderSlot(e.$slots,"optionFullscreen",l.normalizeProps(l.guardReactiveProps({toggleFullscreen:r,isFullscreen:v})),void 0,!0)]),key:"7"}:void 0,e.$slots.optionAnnotator?{name:"optionAnnotator",fn:l.withCtx(({toggleAnnotator:r,isAnnotator:v})=>[l.renderSlot(e.$slots,"optionAnnotator",l.normalizeProps(l.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","style"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"vue-ui-xy-canvas",style:l.normalizeStyle(`position: relative; aspect-ratio: ${pe.value}`),ref_key:"container",ref:F},[le.value?(l.openBlock(),l.createElementBlock("canvas",{key:0,ref_key:"canvas",ref:S,style:{width:"100%",height:"100%"},onMousemove:o[0]||(o[0]=r=>ot(r)),onMouseleave:rt},null,544)):(l.openBlock(),l.createBlock(yt.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"])),l.createVNode(it._sfc_main,{show:s.value.showTooltip&&U.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:S.value,content:_.value,isFullscreen:q.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,isCustom:l.unref(n.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":l.withCtx(()=>[l.renderSlot(e.$slots,"tooltip-before",l.normalizeProps(l.guardReactiveProps({...ne.value})),void 0,!0)]),"tooltip-after":l.withCtx(()=>[l.renderSlot(e.$slots,"tooltip-after",l.normalizeProps(l.guardReactiveProps({...ne.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","position","offsetY","parent","content","isFullscreen","backgroundOpacity","isCustom"])],4),l.createElementVNode("div",{ref_key:"chartSlicer",ref:de,style:l.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&w.value>1?(l.openBlock(),l.createBlock(dt.Slicer,{ref_key:"slicerComponent",ref:D,key:`slicer_${se.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:w.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),refreshStartPoint:t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex:0,refreshEndPoint:t.value.style.chart.zoom.endIndex!==null?t.value.style.chart.zoom.endIndex+1:w.value,enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:we},{"reset-action":l.withCtx(({reset:r})=>[l.renderSlot(e.$slots,"reset-action",l.normalizeProps(l.guardReactiveProps({reset:r})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):l.createCommentVNode("",!0)],4),l.createElementVNode("div",{ref_key:"chartLegend",ref:ve},[t.value.style.chart.legend.show&&le.value?(l.openBlock(),l.createBlock(ct.Legend,{legendSet:Te.value,config:ut.value,key:`legend_${te.value}`,onClickMarker:o[3]||(o[3]=({i:r})=>$e(r))},{item:l.withCtx(({legend:r,index:v})=>[l.createElementVNode("div",{onClick:f=>r.segregate(),style:l.normalizeStyle(`opacity:${C.value.includes(v)?.5:1}`)},l.toDisplayString(r.name),13,xt)]),_:1},8,["legendSet","config"])):l.renderSlot(e.$slots,"legend",{key:1,legend:Te.value},void 0,!0)],512),e.$slots.watermark?(l.openBlock(),l.createElementBlock("div",Lt,[l.renderSlot(e.$slots,"watermark",l.normalizeProps(l.guardReactiveProps({isPrinting:l.unref(me)||l.unref(be)})),void 0,!0)])):l.createCommentVNode("",!0),e.$slots.source?(l.openBlock(),l.createElementBlock("div",{key:3,ref_key:"source",ref:he,dir:"auto"},[l.renderSlot(e.$slots,"source",{},void 0,!0)],512)):l.createCommentVNode("",!0),u.value.end-u.value.start<200?(l.openBlock(),l.createBlock(ht.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:l.withCtx(()=>[(l.openBlock(),l.createBlock(ft.DataTable,{key:`table_${ee.value}`,colNames:G.value.colNames,head:G.value.head,body:G.value.body,config:G.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:l.withCtx(({th:r})=>[l.createElementVNode("div",{innerHTML:r},null,8,kt)]),td:l.withCtx(({td:r})=>[l.createTextVNode(l.toDisplayString(r),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):l.createCommentVNode("",!0),t.value.userOptions.buttons.annotator&&y.value.length?(l.openBlock(),l.createBlock(gt.PenAndPaper,{key:5,parent:B.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:j.value,onClose:re},null,8,["parent","backgroundColor","color","active"])):l.createCommentVNode("",!0)],46,bt))}},wt=mt._export_sfc(Ct,[["__scopeId","data-v-20d8065f"]]);exports.default=wt;
|
|
9
|
+
`)),N=l.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||ke.value[o]||n.palette[o]||n.palette[o%n.palette.length])})));l.watch(w,e=>{e&&we()});const f=l.computed(()=>n.assignStackRatios(N.value.filter((e,o)=>!C.value.includes(e.absoluteIndex))).map((e,o)=>({...e,series:e.series.slice(u.value.start,u.value.end)})).map((e,o)=>{let r=[null,void 0].includes(e.scaleMin)?Math.min(...e.series)||0:e.scaleMin,v=[null,void 0].includes(e.scaleMax)?Math.max(...e.series)||1:e.scaleMax;r===v&&(r=r>=0?v-1:r,v=v>=0?v:r+1),e.series.filter($=>![null,void 0].includes($)).map($=>($-r)/(v-r));const y={valueMin:r,valueMax:v},L=e.scaleSteps||t.value.style.chart.scale.ticks;let d;e.autoScaling?d=n.calculateNiceScale(y.valueMin,y.valueMax,L):d=n.calculateNiceScale(y.valueMin<0?y.valueMin:0,y.valueMax<=0?0:y.valueMax,L);const p=s.value.stacked?a.value.height*(1-e.cumulatedStackRatio):0,P=s.value.stacked?a.value.height/t.value.style.chart.stackGap:0,k=s.value.stacked?a.value.height*e.stackRatio-P:a.value.height,M=d.min<0?Math.abs(d.min):0;let O;e.autoScaling&&s.value.stacked&&v<=0?O=a.value.bottom-p-k:O=a.value.bottom-p-k*(M/(d.max+M));const V=d.ticks.map(($,st)=>({y:a.value.bottom-p-k*(st/(d.ticks.length-1)),x:a.value.left-8,value:$})),Y=Ue({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?d:b.value.scale,yOffset:p,individualHeight:k,stackIndex:s.value.stacked?o:null});return{...e,coordinatesLine:Y,min:r,max:v,localScale:d,localZero:O,localMin:M,localYLabels:V,yOffset:p,individualHeight:k}})),u=l.ref({start:0,end:w.value});function we(){Se()}const D=l.ref(null);async function Se(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&D.value?(t.value.style.chart.zoom.startIndex!==null&&(await l.nextTick(),await l.nextTick(),D.value&&D.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await l.nextTick(),await l.nextTick(),D.value&&D.value.setEndValue(qe(t.value.style.chart.zoom.endIndex+1)))):(u.value={start:0,end:w.value},se.value+=1)}function qe(e){const o=w.value;return e>o?o:e<0||t.value.style.chart.zoom.startIndex!==null&&e<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:e}const We=l.computed(()=>f.value.filter(e=>["line","plot",void 0].includes(e.type))),x=l.computed(()=>f.value.filter(e=>e.type==="bar"));function Xe(){if(!z.value)return;const e=F.value.offsetWidth,o=F.value.offsetHeight;z.value.width=e*R.value*2,z.value.height=o*R.value*2,g.value=e*R.value*2,T.value=o*R.value*2,i.value.scale(R.value,R.value),A()}function Ze(){if(i.value.clearRect(0,0,1e4,1e4),i.value.fillStyle=t.value.style.chart.backgroundColor,i.value.fillRect(0,0,a.value.canvasWidth,a.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?f.value.forEach(e=>{for(let o=0;o<u.value.end-u.value.start+1;o+=1)c.line(i.value,[{x:a.value.left+a.value.slot*o,y:a.value.bottom-e.yOffset-e.individualHeight},{x:a.value.left+a.value.slot*o,y:a.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}):t.value.style.chart.grid.y.verticalLines.show&&u.value.end-u.value.start>=t.value.style.chart.grid.y.verticalLines.hideUnderXLength&&f.value.forEach(e=>{for(let o=u.value.start;o<u.value.end;o+=1)o%Math.floor((u.value.end-u.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0&&c.line(i.value,[{x:a.value.left+a.value.slot*(o-u.value.start)+a.value.slot/2,y:a.value.bottom-e.yOffset-e.individualHeight},{x:a.value.left+a.value.slot*(o-u.value.start)+a.value.slot/2,y:a.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?f.value.forEach(e=>{e.localYLabels.forEach((o,r)=>{r<e.localYLabels.length-1&&c.rect(i.value,[{x:a.value.left,y:o.y},{x:a.value.right,y:o.y},{x:a.value.right,y:e.localYLabels[r+1].y},{x:a.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"})})}):f.value.forEach(e=>{e.localYLabels.slice(u.value.start,u.value.end).forEach(o=>{c.line(i.value,[{x:a.value.left,y:o.y},{x:a.value.right,y:o.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})})),t.value.style.chart.grid.zeroLine.show&&f.value.forEach(e=>{c.line(i.value,[{x:a.value.left,y:e.localZero},{x:a.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&&f.value.forEach(e=>{c.line(i.value,[{x:a.value.left,y:a.value.bottom-e.yOffset},{x:a.value.left,y:a.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),c.line(i.value,[{x:a.value.right,y:a.value.bottom-e.yOffset},{x:a.value.right,y:a.value.bottom-e.yOffset-e.individualHeight}],{color:e.color})}),f.value.forEach(e=>{c.text(i.value,e.name,g.value/35,a.value.bottom-e.yOffset-e.individualHeight/2,{align:"center",rotation:-90,color:e.color,font:`${Math.round(g.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)c.line(i.value,[{x:a.value.left+a.value.slot*e,y:a.value.top},{x:a.value.left+a.value.slot*e,y:a.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});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=u.value.start;e<u.value.end;e+=1)e%Math.floor((u.value.end-u.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0&&c.line(i.value,[{x:a.value.left+a.value.slot*(e-u.value.start)+a.value.slot/2,y:a.value.top},{x:a.value.left+a.value.slot*(e-u.value.start)+a.value.slot/2,y:a.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&&c.rect(i.value,[{x:a.value.left,y:e.y},{x:a.value.right,y:e.y},{x:a.value.right,y:b.value.yLabels[o+1].y},{x:a.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=>{c.line(i.value,[{x:a.value.left,y:e.y},{x:a.value.right,y:e.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})),t.value.style.chart.grid.y.showAxis&&c.line(i.value,[{x:a.value.left,y:a.value.top},{x:a.value.left,y:a.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&&c.line(i.value,[{x:a.value.left,y:a.value.bottom},{x:a.value.right,y:a.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&&c.line(i.value,[{x:a.value.left,y:b.value.zero},{x:a.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.axisName&&c.text(i.value,t.value.style.chart.grid.y.axisName,g.value-g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio*1.2,a.value.bottom-a.value.height/2,{font:`${Math.round(g.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&&c.text(i.value,t.value.style.chart.grid.x.axisName,g.value/2,T.value,{font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center"})}function Ge(e){for(let o=0;o<e.coordinatesLine.length;o+=1){const r=(h.value===o?g.value/150:t.value.style.chart.line.plots.show?g.value/200:0)*t.value.style.chart.line.plots.radiusRatio;c.circle(i.value,{x:e.coordinatesLine[o].x,y:e.coordinatesLine[o].y},r,{color:t.value.style.chart.backgroundColor,fillStyle:e.color})}}function je(){f.value.forEach(e=>{e.showYMarker&&H(e)&&c.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,H(e).value,n.dataLabel({p:e.prefix||t.value.style.chart.grid.y.axisLabels.prefix||"",v:H(e).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:H(e),seriesIndex:null}),a.value.left-8+t.value.style.chart.grid.y.axisLabels.offsetX,H(e).y,{align:"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color})})}function Je(){t.value.style.chart.grid.y.axisLabels.show&&(s.value.stacked?f.value.forEach(e=>{e.localYLabels.forEach((o,r)=>{c.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(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color,globalAlpha:e.showYMarker&&![null,void 0].includes(h.value)?.2:1})})}):b.value.yLabels.forEach((e,o)=>{c.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(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.axisLabels.color,globalAlpha:f.value.some(r=>r.showYMarker)&&![null,void 0].includes(h.value)?.2:1})}))}function Ke(e){for(let o=0;o<e.coordinatesLine.length;o+=1)c.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(g.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(){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===h.value+u.value.start&&t.value.style.chart.grid.y.timeLabels.showMarker))&&c.text(i.value,t.value.style.chart.grid.y.timeLabels.values[e]||e+1,a.value.left+a.value.slot*(e-u.value.start)+a.value.slot/2,a.value.bottom+g.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(g.value/40*t.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.timeLabels.showMarker?n.setOpacity(t.value.style.chart.grid.y.timeLabels.color,h.value!==null?h.value+u.value.start===e?100:20:100):t.value.style.chart.grid.y.timeLabels.color,rotation:t.value.style.chart.grid.y.timeLabels.rotation})}function ze(){c.line(i.value,[{x:a.value.left+a.value.slot*h.value+a.value.slot/2,y:a.value.top},{x:a.value.left+a.value.slot*h.value+a.value.slot/2,y:a.value.bottom}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2})}function et(){S.value&&c.line(i.value,[{x:a.value.left,y:S.value},{x:a.value.right,y:S.value}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2})}function tt(){x.value.forEach((e,o)=>{for(let r=0;r<e.coordinatesLine.length;r+=1)c.rect(i.value,[{x:a.value.left+a.value.slot*r+a.value.slot/10+(s.value.stacked?0:a.value.slot/x.value.length*o-(o===0?0:a.value.slot/(5*x.value.length)*o)),y:s.value.stacked?e.localZero:b.value.zero},{x:a.value.left+a.value.slot*r+a.value.slot/10+(s.value.stacked?0:a.value.slot/x.value.length*o-(o===0?0:a.value.slot/(5*x.value.length)*o))+a.value.slot*.8/(s.value.stacked?1:x.value.length),y:s.value.stacked?e.localZero:b.value.zero},{x:a.value.left+a.value.slot*r+a.value.slot/10+(s.value.stacked?0:a.value.slot/x.value.length*o-(o===0?0:a.value.slot/(5*x.value.length)*o))+a.value.slot*.8/(s.value.stacked?1:x.value.length),y:e.coordinatesLine[r].y},{x:a.value.left+a.value.slot*r+a.value.slot/10+(s.value.stacked?0:a.value.slot/x.value.length*o-(o===0?0:a.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)&&c.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}),a.value.left+a.value.slot*r+a.value.slot/10+(s.value.stacked?0:a.value.slot/x.value.length*o-(o===0?0:a.value.slot/(5*x.value.length)*o))+a.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(g.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 lt(e){e.useArea?s.value.stacked?c.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"}):c.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"}):c.line(i.value,e.coordinatesLine,{color:e.color,lineWidth:3})}function at(){f.value.forEach((e,o)=>{c.line(i.value,[{x:a.value.left,y:a.value.bottom-e.yOffset},{x:a.value.right,y:a.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.x.horizontalLines.color,lineWidth:1})})}function A(){Ze(),I.value?(h.value!==null&&t.value.style.chart.selector.show&&ze(),tt(),s.value.stacked&&t.value.style.chart.grid.x.showAxis&&at(),We.value.forEach(e=>{(e.type==="line"||!e.type)&<(e),E.value&&(Ge(e),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&Ke(e))}),K.value=c.cloneCanvas(z.value)):(K.value&&(i.value.clearRect(0,0,1e4,1e4),i.value.drawImage(K.value,0,0)),h.value!==null&&t.value.style.chart.selector.show&&ze(),h.value!==null&&f.value.forEach(e=>{if(e.type==="line"||!e.type||e.type==="plot"){if(!e.coordinatesLine[h.value])return;e.coordinatesLine[h.value].x!==void 0&&e.coordinatesLine[h.value].y!==void 0&&c.circle(i.value,{x:e.coordinatesLine[h.value].x,y:e.coordinatesLine[h.value].y},g.value/150*t.value.style.chart.line.plots.radiusRatio,{color:t.value.style.chart.backgroundColor,fillStyle:e.color})}})),t.value.style.chart.grid.y.timeLabels.show&&Qe(),t.value.style.chart.selector.show&&t.value.style.chart.selector.showHorizontalSelector&&et(),Je(),je(),I.value=!1}const W=c.debounce(()=>{E.value=!0,Xe()},w.value>200?10:1,!E.value);function H(e){if([null,void 0].includes(h.value)||!e.coordinatesLine[h.value])return!1;const{y:o,value:r}=e.coordinatesLine[h.value];return{y:o,value:r}}function ot(e){const{left:o,top:r}=z.value.getBoundingClientRect(),v=e.clientX-o;if(S.value=(e.clientY-r)*2,(S.value<a.value.top||S.value>a.value.bottom)&&(S.value=null),v*2<a.value.left||v*2>a.value.right){U.value=!1,h.value=null;return}const y=v*2-a.value.left;if(h.value=Math.floor(y/a.value.slot),U.value=!0,!E.value)return;let L="";const d=t.value.style.chart.tooltip.customFormat;n.isFunction(d)&&n.functionReturnsString(()=>d({seriesIndex:h.value,datapoint:f.value.map(p=>({shape:p.shape||null,name:p.name,color:p.color,type:p.type||"line",value:p.series.find((P,k)=>k===h.value)})),series:f.value,config:t.value}))?_.value=d({seriesIndex:h.value,datapoint:f.value.map(p=>({shape:p.shape||null,name:p.name,color:p.color,type:p.type||"line",value:p.series.find((P,k)=>k===h.value)})),series:f.value,config:t.value}):(t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[h.value]&&(L+=`<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)[h.value]}</div>`),L+=_e.value.join(""),_.value=L),E.value=!1}l.watch(()=>h.value,e=>{W()}),l.watch(()=>u.value,e=>{I.value=!0,A()},{deep:!0}),l.watch(()=>s.value.showDataLabels,e=>{I.value=!0,A()}),l.watch(()=>S.value,e=>{e&&A()}),l.watch(()=>s.value.stacked,e=>{I.value=!0,E.value=!0,W()});function rt(){U.value=!1,h.value=null,_.value="",S.value=null,A()}const X=l.ref(null),Z=l.ref(null);l.onMounted(()=>{oe()});function oe(){if(n.objectIsEmpty(m.dataset)?n.error({componentName:"VueUiXyCanvas",type:"dataset"}):z.value&&(i.value=z.value.getContext("2d",{willReadFrequently:!0})),t.value.responsive){const e=c.throttle(()=>{const{width:o,height:r}=c.useResponsive({chart:B.value,title:t.value.style.chart.title.text?ce.value:null,legend:t.value.style.chart.legend.show?ve.value:null,slicer:t.value.style.chart.zoom.show&&w.value>1?de.value:null,source:he.value});requestAnimationFrame(()=>{pe.value=`${o} / ${r}`})});X.value=new ResizeObserver(e),X.value.observe(B.value.parentNode)}Z.value=new ResizeObserver(e=>{for(const o of e)o.contentBoxSize&&F.value&&(I.value=!0,W())}),Z.value.observe(F.value),Se()}l.onBeforeUnmount(()=>{Z.value&&Z.value.disconnect(),X.value&&X.value.disconnect()});function $e(e){He("selectLegend",f.value.find(o=>o.absoluteIndex===e)),C.value.includes(e)?C.value=C.value.filter(o=>o!==e):C.value.push(e),I.value=!0,W()}const Te=l.computed(()=>N.value.map((e,o)=>({...e,name:e.name,color:n.convertColorToHex(e.color)||ke.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:C.value.includes(e.absoluteIndex)?.5:1,segregate:()=>$e(e.absoluteIndex),isSegregated:C.value.includes(e.absoluteIndex)}))),ut=l.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":""})),G=l.computed(()=>{const e=[""].concat(f.value.map(y=>y.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 y=0;y<w.value;y+=1){const L=f.value.map(d=>d.series[y]??0).reduce((d,p)=>d+p,0);o.push([t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[y]??y+1].concat(f.value.map(d=>(d.series[y]??0).toFixed(t.value.table.rounding))).concat((L??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(f.value.map(y=>y.name)).concat(t.value.table.columnNames.total);return{head:e,body:o.slice(0,u.value.end-u.value.start),config:r,colNames:v}}),Me=l.computed(()=>{if(f.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const e=f.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];f.value.forEach(y=>{v.push(Number((y.series[r]||0).toFixed(t.value.table.rounding)))}),o.push(v)}return{head:e,body:o}});function Ie(){const e=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=["",...Me.value.head.map(L=>L.label)],r=Me.value.body,v=e.concat([o]).concat(r),y=n.createCsvContent(v);n.downloadCsv({csvContent:y,title:t.value.style.chart.title.text||"vue-ui-xy-canvas"})}function nt(){return f.value}function Pe(){s.value.showTable=!s.value.showTable}function Oe(){s.value.showDataLabels=!s.value.showDataLabels}function Re(){s.value.stacked=!s.value.stacked}function Ee(){s.value.showTooltip=!s.value.showTooltip}const j=l.ref(!1);function re(){j.value=!j.value}return Be({getData:nt,generateCsv:Ie,generatePdf:xe,generateImage:Le,toggleTable:Pe,toggleLabels:Oe,toggleStack:Re,toggleTooltip:Ee,toggleAnnotator:re}),(e,o)=>(l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(`width:100%; position:relative; ${t.value.responsive?"height: 100%":""}`),ref_key:"xy",ref:B,id:`xy_canvas_${J.value}`,class:l.normalizeClass(`vue-ui-donut ${q.value?"vue-data-ui-wrapper-fullscreen":""}`),onMouseenter:o[5]||(o[5]=()=>l.unref(ye)(!0)),onMouseleave:o[6]||(o[6]=()=>l.unref(ye)(!1))},[t.value.style.chart.title.text?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:ce,style:l.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};`)},[(l.openBlock(),l.createBlock(vt._sfc_main,{key:`title_${Q.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)):l.createCommentVNode("",!0),t.value.userOptions.show&&le.value&&(l.unref(fe)||l.unref(ae))?(l.openBlock(),l.createBlock(Ne.UserOptions,{ref:"details",key:`user_option_${ie.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:l.unref(me),isImaging:l.unref(be),uid:J.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:ue.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:q.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:j.value,onToggleFullscreen:Ye,onGeneratePdf:l.unref(xe),onGenerateCsv:Ie,onGenerateImage:l.unref(Le),onToggleTable:Pe,onToggleLabels:Oe,onToggleStack:Re,onToggleTooltip:Ee,onToggleAnnotator:re,style:l.normalizeStyle({visibility:l.unref(fe)?l.unref(ae)?"visible":"hidden":"visible"})},l.createSlots({_:2},[e.$slots.optionTooltip?{name:"optionTooltip",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,e.$slots.optionPdf?{name:"optionPdf",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,e.$slots.optionCsv?{name:"optionCsv",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,e.$slots.optionImg?{name:"optionImg",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,e.$slots.optionTable?{name:"optionTable",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,e.$slots.optionLabels?{name:"optionLabels",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,e.$slots.optionStack?{name:"optionStack",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionStack",{},void 0,!0)]),key:"6"}:void 0,e.$slots.optionFullscreen?{name:"optionFullscreen",fn:l.withCtx(({toggleFullscreen:r,isFullscreen:v})=>[l.renderSlot(e.$slots,"optionFullscreen",l.normalizeProps(l.guardReactiveProps({toggleFullscreen:r,isFullscreen:v})),void 0,!0)]),key:"7"}:void 0,e.$slots.optionAnnotator?{name:"optionAnnotator",fn:l.withCtx(({toggleAnnotator:r,isAnnotator:v})=>[l.renderSlot(e.$slots,"optionAnnotator",l.normalizeProps(l.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","style"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"vue-ui-xy-canvas",style:l.normalizeStyle(`position: relative; aspect-ratio: ${pe.value}`),ref_key:"container",ref:F},[le.value?(l.openBlock(),l.createElementBlock("canvas",{key:0,ref_key:"canvas",ref:z,style:{width:"100%",height:"100%"},onMousemove:o[0]||(o[0]=r=>ot(r)),onMouseleave:rt},null,544)):(l.openBlock(),l.createBlock(ft.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"])),l.createVNode(it._sfc_main,{show:s.value.showTooltip&&U.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:l.unref(z),content:_.value,isFullscreen:q.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,isCustom:l.unref(n.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":l.withCtx(()=>[l.renderSlot(e.$slots,"tooltip-before",l.normalizeProps(l.guardReactiveProps({...ne.value})),void 0,!0)]),"tooltip-after":l.withCtx(()=>[l.renderSlot(e.$slots,"tooltip-after",l.normalizeProps(l.guardReactiveProps({...ne.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","position","offsetY","parent","content","isFullscreen","backgroundOpacity","isCustom"])],4),l.createElementVNode("div",{ref_key:"chartSlicer",ref:de,style:l.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&w.value>1?(l.openBlock(),l.createBlock(dt.Slicer,{ref_key:"slicerComponent",ref:D,key:`slicer_${se.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:w.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),refreshStartPoint:t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex:0,refreshEndPoint:t.value.style.chart.zoom.endIndex!==null?t.value.style.chart.zoom.endIndex+1:w.value,enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:we},{"reset-action":l.withCtx(({reset:r})=>[l.renderSlot(e.$slots,"reset-action",l.normalizeProps(l.guardReactiveProps({reset:r})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):l.createCommentVNode("",!0)],4),l.createElementVNode("div",{ref_key:"chartLegend",ref:ve},[t.value.style.chart.legend.show&&le.value?(l.openBlock(),l.createBlock(ct.Legend,{legendSet:Te.value,config:ut.value,key:`legend_${te.value}`,onClickMarker:o[3]||(o[3]=({i:r})=>$e(r))},{item:l.withCtx(({legend:r,index:v})=>[l.createElementVNode("div",{onClick:y=>r.segregate(),style:l.normalizeStyle(`opacity:${C.value.includes(v)?.5:1}`)},l.toDisplayString(r.name),13,Lt)]),_:1},8,["legendSet","config"])):l.renderSlot(e.$slots,"legend",{key:1,legend:Te.value},void 0,!0)],512),e.$slots.watermark?(l.openBlock(),l.createElementBlock("div",kt,[l.renderSlot(e.$slots,"watermark",l.normalizeProps(l.guardReactiveProps({isPrinting:l.unref(me)||l.unref(be)})),void 0,!0)])):l.createCommentVNode("",!0),e.$slots.source?(l.openBlock(),l.createElementBlock("div",{key:3,ref_key:"source",ref:he,dir:"auto"},[l.renderSlot(e.$slots,"source",{},void 0,!0)],512)):l.createCommentVNode("",!0),u.value.end-u.value.start<200?(l.openBlock(),l.createBlock(ht.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:l.withCtx(()=>[(l.openBlock(),l.createBlock(yt.DataTable,{key:`table_${ee.value}`,colNames:G.value.colNames,head:G.value.head,body:G.value.body,config:G.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:l.withCtx(({th:r})=>[l.createElementVNode("div",{innerHTML:r},null,8,Ct)]),td:l.withCtx(({td:r})=>[l.createTextVNode(l.toDisplayString(r),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):l.createCommentVNode("",!0),t.value.userOptions.buttons.annotator&&f.value.length?(l.openBlock(),l.createBlock(gt.PenAndPaper,{key:5,parent:B.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:j.value,onClose:re},null,8,["parent","backgroundColor","color","active"])):l.createCommentVNode("",!0)],46,xt))}},St=bt._export_sfc(wt,[["__scopeId","data-v-89446978"]]);exports.default=St;
|