Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I apply an axis scale mode immediately

Hi,
 
I use NI waveform graph version 8.1.
In an graph filled with data I want to change the y-axis mode from e.g. AxisMode.Fixed to AxisMode.Loose, so that the graph immediately re-scales the y-axis (auto scale). Unfortunately the graph control doesn't apply the new axis mode, so that I have to scan the data for min/max and set the axis range apporpriately. Is there a way to enfore the 'rescaling' to the new axis mode?
 
Cheers Andy
0 Kudos
Message 1 of 4
(3,299 Views)

There is an example installed with Measurement Studio, that shows how this is done:

.../National Instruments/MeasurementStudioVS2005/DotNET/Examples/UI/Windows Forms/Graph/Axes

0 Kudos
Message 2 of 4
(3,288 Views)

Thanks for this info.

This kind of auto scale is applied on the entire data plotted in the graph. Unfortunately my problem is a different one: The data has already been zoomed at the x-axis (via XAxis.Range = new Range(…);, so that only a part of the originally plotted data is visible in the plot area. In this case the YAxis.Mode = AxisMode.Loose doesn’t re-scale the axis.

I’m afraid I have to loop over the data range to find the y-limits and implement my own auto-scale function. Or is there another way?

Cheers Andy

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

In my test, I was able to get the graph to auto scale based on the data. Here is what I did:

  1. Plotted some data with y-axis set to Fixed, such that some of the data will be outside the y-axis range.
  2. Zoomed into the data a few times.
  3. Changed y-axis Mode to AutoScaleLoose.

I was able to get the y-axis to auto scale after step 3. Please could you post a sample of your application that reproduces this behavior?

Abhishek Ghuwalewala | Measurement Studio | National Instruments
0 Kudos
Message 4 of 4
(3,275 Views)