Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Autoscale After Zoom Pan and Axis Range Change

Solved!
Go to solution

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. 

0 Kudos
Message 1 of 3
(4,881 Views)
Solution
Accepted by topic author justwakingup

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
Message 2 of 3
(4,872 Views)

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

0 Kudos
Message 3 of 3
(4,863 Views)