11-18-2015 03:18 AM
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.
11-18-2015 01:32 PM
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.
11-18-2015 11:40 PM
thanks! worked great!