Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Vertical zoom resets to ZoomToFit

Solved!
Go to solution

I work with MS2015 and WPH Graph. If I do horizontal zoom and then I want to do vertical zoom, the vertical zoom resets the zoom to be ZoomToFit.

For example the x axis range is between 0-10 and the y axis range is between 10 - 20, I want to do horizontal zoom to see only range 3-4 and in that range to do zoom on y axis to see range 12-13, how can I do this?

0 Kudos
Message 1 of 6
(4,117 Views)

I do all the zooms via GraphInteractionPalette

0 Kudos
Message 2 of 6
(4,112 Views)
Solution
Accepted by topic author Dudiamar

Based on the described behavior, I take it you are using either FitVisibleLoosely or FitVisibleExactly for one or both adjusters on your axes? When you do a pan or zoom in a single dimension (horizontal or vertical), the WPF and Windows Forms graphs will automatically adjust the other dimension to match the new visible range when using "fit visible".


To avoid this behavior, you will need to change your adjusters to a non-"fit visible" value while you are interacting with the graph. You can do this manually (e.g. if interaction happens only after data acquisition has completed), or automatically (e.g. using a converter bound to DefaultInteraction to change the Adjuster).

~ Paul H
0 Kudos
Message 3 of 6
(4,104 Views)

I indeed used "FitVisibleExactly" adjuster for x axis.

I changed it to "FitExactly" and it fixed the behavior.

The truth is that I don't really see a difference now in the way that the graph displays the samples (comparing to "FitVisibleExactly") , what do I miss here?

 

0 Kudos
Message 4 of 6
(4,088 Views)

The only difference between the two categories of adjusters is that "fit" always looks at all the data, while "fit visible" will look only at the data in the range of the other axis.

 

For example, for a simple data set "0, 1, 2, 3, 4, 5" (with a data range of [0,5] on both axes):

  • If your vertical axis used "fit visible" and you changed your horizontal range to [2,4], the vertical adjuster would use just the data points "2, 3, 4" to adjust its range (to [2,4] in this trivial example).
  • If you used a "fit" adjuster, that adjuster would still use all six data points "0, 1, 2, 3, 4, 5" to update the range (which would stay at [0,5] in this case).

The "Fit Adjuster Comparison" example installed with Measurement Studio also demonstrates this difference.

~ Paul H
0 Kudos
Message 5 of 6
(4,079 Views)

Thanks Paul for your help!

0 Kudos
Message 6 of 6
(4,073 Views)