We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Is it possible to limit zoom level for chart?

Thread ID:

Created:

Updated:

Platform:

Replies:

123554 Mar 30,2016 08:30 AM Mar 31,2016 08:19 AM ASP.NET MVC 1
loading
Tags: Chart
Yauhen Filipskikh
Asked On March 30, 2016 08:30 AM

Hello,

In old version (Classic) there was some limit in zooming. I think based on data resolution level. In new version I could zoom to any level,
even without good connection lines and without axis labels on this level.

Is it possible to somehow reproduce old behavior and limit available zoom level? In old version it shows ""XZoomFactor or YZoomFactor is not inside the limit of zooming"

Sanjith Kesavan [Syncfusion]
Replied On March 31, 2016 08:19 AM

Hi Yauhen,

Thanks for contacting Syncfusion support. We have analyzed your query. For limiting zooming action we have written following code in preRender and zoomed event.
[JS]

function prerender(args) {

            pxZoomfactor = args.model.primaryXAxis.zoomFactor;

            pyZoomfactor = args.model.primaryYAxis.zoomFactor;

            pxzoomposition = args.model.primaryXAxis.zoomPosition;

            pyzoompostion = args.model.primaryYAxis.zoomPosition;
    }

function zoomed(args) {

        if (args.model.primaryXAxis.zoomFactor == pxZoomfactor && args.model.primaryXAxis.zoomPosition == pxzoomposition) {

            isZoomed = true;

            $("#annotation_Container_annotation_0").fadeIn(3000);

            setTimeout(function () {

                $("#annotation_Container_annotation_0").css("display", "none");

                isZoomed = false;

                ;

            }, 3000);

        }


    }


In “preRender” event, we have simply get the zoomposition and zoomfactor for both of the axis. In “zoomed” event, we have compared the zoomfactor and zoomposition with previous zoomfactor and zoomposition stored in the prerender event. If these are same, then zoomfactor of the chart is getting lesser than 0.001. In this case we have displayed the text “Minimum zooming value reached” inside the chart using annotation. Please find the below screenshots.
While running the sample

First time zooming the chart

Second time zooming the chart.


In the below link, we have attached the sample for your reference.
Sample link: http://www.syncfusion.com/downloads/support/forum/123554/ze/Zooming-1270615698

Please let us know if you have any concern.

Regards,
Sanjith.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;