vue3-apexcharts icon indicating copy to clipboard operation
vue3-apexcharts copied to clipboard

How to access functions like zoomX?

Open Lawouach opened this issue 3 years ago • 5 comments

Hey all,

I've spent the last few hours trying to programatically call zoomX on a chart and I claim defeat :)

I've got an async mounted() hook so I am assuming it's fair that the DOM isn't ready yet. But then I use a sync updated() hook and all I can get access to it always a Proxy.

this.$ref.myChart

is always a proxy and from there I have no idea what to do right.

this.$ref.myChart.chart

remains undefined.

I even tried a composition API approach but with the same result. How do I get access to functions like zoomX? :D

Lawouach avatar May 21 '22 20:05 Lawouach

I noticed https://github.com/apexcharts/vue3-apexcharts/issues/11 as well but that didn't help me :(

Lawouach avatar May 21 '22 20:05 Lawouach

the correct syntax would be:

this.$refs.chartRef.chart.zoomX

note that you used 'ref' and not 'refs'

GabrielAziz avatar Jun 02 '22 12:06 GabrielAziz

Oh my, could this be that simple?! Thank you I'll try :)

Lawouach avatar Jun 02 '22 12:06 Lawouach

It worked?

GabrielAziz avatar Jun 02 '22 17:06 GabrielAziz

and how to get the same result with compo API

Yan-Coquoz avatar Mar 13 '24 12:03 Yan-Coquoz