10-29-2017 05:56 AM
Hi,
I want cursor (or annotation or something else) that mark the area marked in yellow.
I mean,The triangle will be on the scale (axis double) and not within the plot area, is there something similar?
Solved! Go to Solution.
10-30-2017 10:13 AM
You can use a CustomDivision in the axis to mark the designated area. It is not clear from the screenshot what type of cursor you are using, but as a concrete example you could bind the Value of the custom division to the AxisValue of a multi-plot cursor this way:
<ni:AxisDouble.CustomDivisions>
<ni:CustomDivision Value="{Binding ElementName=multiPlotCursor, Path=AxisValue}"
LabelVisibility="Collapsed"
TickMark="InwardTriangle"
TickSize="10,20"
/>
</ni:AxisDouble.CustomDivisions>
10-31-2017 03:25 AM
Thanks.
That's exactly what I needed (by the way, I use a regular Cursor).
I have another question, can I make a triangle appear opposite the axis without creating another axis?
For example, I would like the triangle of the Y axis to appear opposite the axis, in the marked area:
10-31-2017 10:10 AM
The simplest way to accomplish this would be to set the Location of the axis to NearAndFar, to have the axis (and the custom division) appear on both sides of the plot area.
Of course, this will duplicate all the divisions, not just the custom one. To show the custom division on its own, you could create a separate axis with all but the custom divisions disabled, and bound to the range of the visible axis. Assuming you named the visible axis "horizontalAxis", the XAML would look like this:
<ni:AxisDouble Orientation="Horizontal"
Location="Far"
MajorDivisions="{x:Null}"
MinorDivisions="{x:Null}"
MajorGridLines="{x:Null}"
Range="{Binding ElementName=horizontalAxis, Path=Range, Mode=OneWay}"
>
<ni:AxisDouble.CustomDivisions>
<ni:CustomDivision Value="{Binding ElementName=cursor, Path=Value[0]}"
LabelVisibility="Collapsed"
TickMark="InwardTriangle"
TickSize="10,10"
/>
</ni:AxisDouble.CustomDivisions>
</ni:AxisDouble>
(Note that you can use the same divisions object in both axes in code; it is just awkward to accomplish the same thing using XAML only.)