Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Mark Axis

Solved!
Go to solution

Hi,Capture.PNG

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? 

 

 

 

0 Kudos
Message 1 of 4
(2,756 Views)

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>
~ Paul H
0 Kudos
Message 2 of 4
(2,723 Views)

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:

Capture.PNG

0 Kudos
Message 3 of 4
(2,718 Views)
Solution
Accepted by topic author hodaya273

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.)

 

~ Paul H
0 Kudos
Message 4 of 4
(2,714 Views)