LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically change zoom on a graph?

Solved!
Go to solution

I'm looking to add a few buttons and/or hotkeys to a graph control that would allow you to zoom in or out a specific amount, or would zoom to fit horizontally or vertically, but I can't find any way to change the zoom on a graph programatically (in LabWindows/CVI 9.0) - the only zooming functions/attributes I find are about auto-scaling and such. Does anyone know what kind of functions I would use if I wanted to programatically change the current display on a graph control?

0 Kudos
Message 1 of 4
(5,409 Views)
Solution
Accepted by PaulGanssle

Hi,

 

you can achieve zooming by setting the scaling mode to manual. For example,

SetAxisScalingMode ( panel, PANEL_GRAPH, VAL_BOTTOM_XAXIS, VAL_MANUAL, zoom_x_min, zoom_x_max );

will adjust the x-axis to the range given by zoom_x_min and zoom_x_max. The same is true for the vertical axis.

 

Message 2 of 4
(5,403 Views)

That worked perfectly. Thanks!

0 Kudos
Message 3 of 4
(5,390 Views)

You're welcome! :smileyhappy:

0 Kudos
Message 4 of 4
(5,375 Views)