Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Binding ranges of two vertical AxisDouble

Hi.

 

I must be missing something.

 

I have two vertical AxisDouble, and I plot one plot on each of them.

 

I'd like to make sure these two share the same "viewing space", or in other words - I'd like the plot in AxisDouble #2 "sit" exactly on AxisDouble #1.

 

I've set

 

<ni:AxisDouble x:Name "Number2" ..... Location="None" InteractionMode=None" Range={Binding ElementName=Number1, Path=Range, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
<ni:AxisDouble x:Name "Number1" ..... InteractionMode=None" Adjuster="FitExactly"/>

The plots work great, except the plot on Number2 is presented on its own range, not like the one of Number1.

I am suspecting this has to do something with the default Adjuster on Number2, that may be screwing up the binding results and overriding the range.

 

Help please.

 

0 Kudos
Message 1 of 3
(3,778 Views)

You are correct that the default adjuster is preventing the ranges from staying synchronized: you can have the axis adjust to the data of associated plots, or you can manually assign a specific range (i.e. through a one-way binding), but doing both will cause conflict.


To resolve this with your current setup, you should set the Adjuster to None on the second axis. The first axis will adjust to the range of the first plot, and the second plot will be shown against that same range.


Alternatively, if your goal was just to have the range displayed on both sides of the graph, you could use a single axis with Location set to NearAndFar. By default, this will use the data from both plots to adjust the axis range. If you want only the first plot to update the range, you can set AdjustVerticalScale on the second plot to false to prevent this.

~ Paul H
Message 2 of 3
(3,767 Views)

thanks! worked great!

0 Kudos
Message 3 of 3
(3,753 Views)