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

Zoom in Chart => control of zoom behavior

7 Answers 562 Views
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 03 Aug 2020, 01:52 PM

Hi,

using the zoom function in a chart is working very nice. Today I got a request from one of my customers.

Situation:

Consider a standard chart with time periods on the x-axis, The most recent period is to the right. If you look at the chart with all periods visible and you zoom in, the chart zooms into the center of the chart. So the most recent period drops out to the right and the older periods to the left. 

 

Question:

Is it possible to stick the most recent period to the right, even if you zoom in? Currently it zooms into the center. The requested behaviour would be: Keep the right border and zoom in/out to the left side. So regardless of the zoom level, the most recent period is allways visible.

 

 

Best regards

Oliver

 

7 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 05 Aug 2020, 11:13 AM

Hello Oliver,

Thank you for sharing this use-case with us.

By design, the Chart zoom feature performs zooming into the center of the currently visible range. Here useful comes the pan feature which allows the user to navigate through the zoomed Chart.

Still, if changing this behavior is important for the project I could suggest submitting a feature request in our Feedback portal. In most cases, requests that gain lots of popularity are included in the RoadMap for future implementation.

Regards,
Nikolay
Progress Telerik

0
Oliver
Top achievements
Rank 1
answered on 05 Aug 2020, 11:41 AM

Hi Nikolay,

 

thank you very much for your reply. 

I'm aware of the pan feature and already showed it to my customer. Just wanted to make sure I didn't miss some kind of property I could use. I'll give it a push to the feedback portal.

 

Thanks a lot

Oliver

0
Nikolay
Telerik team
answered on 07 Aug 2020, 08:33 AM

Hello Oliver,

You are most welcome and I am sorry I did not help much.

After further thinking about this feature, I found another possibility of the Chart that might satisfy your project. It is possible to implement a slider that will give the option to control the zooming. Please check the following Dojo demo:

Regards,
Nikolay
Progress Telerik

0
Oliver
Top achievements
Rank 1
answered on 09 Aug 2020, 08:07 AM

Hi Nikolay,

 

thank you very much for your example. Implementing a zoom slider might do the trick as a workaround. I'll give it a try, but still a corresponding chart property would be appreciated.

Any annotations about adapting your example to Vue? Not asking for a Vue example, just asking for anything to consider in addition, when using with Vue.

 

Best regards

Oliver

 

Best regards

Oliver

 

0
Nikolay
Telerik team
answered on 11 Aug 2020, 02:12 PM

Hi Oliver,

There is nothing specific you need for implementing the slider. Simply declare the zoom event and follow the provided example.

<kendo-chart :title-text="'Kendo Chart Example'"
                 :series="series"
                 :category-axis-categories="categories"
                 v-on:zoom="onZoom">
    </kendo-chart>
...
new Vue({
    el: '#vueapp',
    methods: {
        onZoom: function(ev) {
            //the handler
        },

Regards,
Nikolay
Progress Telerik

0
Oliver
Top achievements
Rank 1
answered on 11 Aug 2020, 03:15 PM

Hi Nikolay,

thank you very much :-)

Best regards

Oliver

0
Nikolay
Telerik team
answered on 13 Aug 2020, 01:57 PM

Hi Oliver,

You are most welcome.

This thread will be closed now. Please submit a new one if anything new arises.

Regards,
Nikolay
Progress Telerik

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