WelcomeForumsCommunityZoom In and Zoom Out

Wijmo Team Member
waqar posted on July 3, 2012 at 7:08 am link

I am using different wijmo chart , i want to zoom in and zoom out the chart area how can i do it..

Wijmo Team Member
abdiasm posted on July 3, 2012 at 1:30 pm link

wijmo chart does not have inbuilt support for zoom in and zoom out as yet. You can use the following workaround to zoom in and zoom out with the help of two buttons. You’ll have to wrap a container div around the wijmo chart.



$(document).ready(function() {
          var currZoom = $(“#wijbarchart”).css(“zoom”);
            if (currZoom == ‘normal’) currZoom = 1;

            $(“#btnZoomIn”).click(function () {
                currZoom *= 1.2;
                $(“#wijbarchart”).css(“zoom”, currZoom);
                $(“#wijbarchart”).css(“-moz-transform”, “Scale(” + currZoom + “)”);
                $(“#wijbarchart”).css(“-moz-transform-origin”, “0 0″);
            });

            $(“#btnZoomOut”).click(function () {
                //prevent user from zooming out too much
                if (currZoom > 0.4) {
                    currZoom *= 0.8;
                    $(“#wijbarchart”).css(“zoom”, currZoom);
                    $(“#wijbarchart”).css(“-moz-transform”, “Scale(” + currZoom + “)”);
                    $(“#wijbarchart”).css(“-moz-transform-origin”, “0 0″);
                }
            });
});

Have a look at the attached sample.

Regards

Answer
Wijmo Team Member
vjpgo posted on November 6, 2012 at 1:38 am link

Anything new on real zoom methods in 2.2.2?

Answer
Wijmo Team Member
Richa posted on November 6, 2012 at 6:54 am link

Hello vjpgo,

Zooming in chart can only be done through the code given above. Let me know if this doesnt work for you.

Thanks,
Richa

Answer

Tagged: 

This topic has 4 voices, contains 3 replies, and was last updated by  Richa 194 days ago.

You must be logged in to reply to this topic.