A
A
Artem2022-02-26 18:51:24
JavaScript
Artem, 2022-02-26 18:51:24

What is the correct way to write chart.zoomx in apexcharts?

I do that the button would bring closer to a certain area of ​​​​dates in the charts.
I found an example in the dock with a similar thing that I need

chart.zoomX(
            new Date('28 Jan 2013').getTime(),
            new Date('27 Feb 2013').getTime()
          )

and it seems that there is, but I write it in vue and it gives an error,
chart is not defined
I encountered something similar, but it was in axios and it was just decided to remove the call to the function, but it doesn’t work like that, who knows how to remake it for vue?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2022-02-27
@Artey

<button @click="onClick">click me</button>
<apexchart
  ref="chart"
  ...

methods: {
  onClick() {
    this.$refs.chart.zoomX(...);
  },
  ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question