Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Zoom In / Zoom out is not working

$
0
0

@sangeetaarora21 wrote:

Hi Walter,

I am trying for zoom in and zoom out functionality but this is not working.

I created two buttons "+" and "-" for ZoomIn and ZoomOut.

var zoomInButtonClickCount = 1; // number of zooms
var scaleLevelChange = 0.25; // percent zoom

$("#zoomIn").click(function(){
	if(myDiagram.commandHandler.canIncreaseZoom())
	{
		scaleLevel = scaleLevelChange * zoomInButtonClickCount;
		// Set scale level to number of times button clicked
		myDiagram.commandHandler.increaseZoom(scaleLevel);
		// Scale the diagram
		myDiagram.scale = scaleLevel;
	}
});

It goes inside the condition and calculating the scale too but not able to set the scale level.

Can you please guide where I am wrong?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles