NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
justwakingup
Posts: 16
0 Kudos
Accepted Solution

Autoscale After Zoom Pan and Axis Range Change

I am trying to link the x axes of many ScatterGraphs together and was wondering how to revert the graphs back to their original plotted view after a user has performed many zoom, pan and axis range chages.  Basically how do you perform an autoscale on an axis without having to undo each operation individually.  In the older activex graphing controls there was an AutoScaleNow function that performed this operation. 

 

Also, how do you undo a range change that was performed through code?  If you interactively change a range it appears that SHIFT-RIGHT CLICK will undo the operation.  If the range change event is captured and applied to the other graphs it cannot be undone. 

Active Participant
D_Biel
Posts: 639

Re: Autoscale After Zoom Pan and Axis Range Change

Use ScatterGraph.ResetZoomPan( ) to undo all of the zoom, pan, and range change operations in a scattergraph. This will undo range changes made in the UI, but not range changes made through code. For range changes in code, you will have to handle the undo operations yourself. You could store the initial ranges and revert back to those when necessary. Or you can force a re-AutoScale by changing the axis scale mode as shown below:

 

scatterGraph1.XAxes[0].Mode = NationalInstruments.UI.AxisMode.Fixed;
scatterGraph1.XAxes[0].Mode = NationalInstruments.UI.AxisMode.AutoScaleLoose;
scatterGraph1.YAxes[0].Mode = NationalInstruments.UI.AxisMode.Fixed;
scatterGraph1.YAxes[0].Mode = NationalInstruments.UI.AxisMode.AutoScaleLoose;

 

National Instruments
Product Support Engineer
Member
justwakingup
Posts: 16
0 Kudos

Re: Autoscale After Zoom Pan and Axis Range Change

Thanks for your help.  I was able to revert the chart back to the original scaling with this method.

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page