This is a migrated thread and some comments may be shown as answers.

Vue Chart Unzoom

2 Answers 62 Views
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 20 Nov 2019, 12:05 PM

Hi there,

zooming and panning is a cool feature. But since not every mouse has a wheel, I wanted to add a button (or any trigger) to unzoom the chart once it is zoomed in, without the need of the mouse wheel.

On my chart:

<kendo-chart ref="chart"></kendo-chart>

  I tried to use the ref

  this.$refs.chart

to find out, which function calls I could use to unzoom (or reset zoom), but could not find or guess which one to call. There are many properties and functions, but nothing that seems to be related to the desired function. The API does not give me a hint or I missed the point.

How can I programmatically reset a zoomed chart?

Thank you for any hint

2 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 22 Nov 2019, 11:10 AM

Hello Oliver,

The chart does not have API methods dedicated to zooming in/out, but you can achieve a similar effect by setting the categoryAxis.min and categoryAxis.max values. Here's an example, which demonstrates setting these options in the click handlers of two buttons: https://stackblitz.com/edit/9gy71t?file=index.js

Regards,
Ivan Danchev
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Oliver
Top achievements
Rank 1
answered on 22 Nov 2019, 11:51 AM

Hi Ivan,

thanks a lot.That was exactly what I needed. Worked like a charm.

 

Best regards

Oliver

 

 

Asked by
Oliver
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Oliver
Top achievements
Rank 1
Share this question
or