Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

WPF TankDouble Range Management Studio 2013

When setting the range on the TankDouble from 1E-2 to 1E-10 the default range shows up with an unusual range:

 

ni tankdouble range.png

 

What do I need to change to get the major and minor ticks to show up in a more readable way? Do I need to create my own Scale or Style? 

 

Thanks!!!

 

 

0 Kudos
Message 1 of 4
(5,738 Views)

All you need to change is the LabelPresenter on the MajorDivisions of the numeric scale. For example, the presenter can accept any of the Standard Numeric Format Strings:


    <ni:TankDouble Range="1E-10, 0.01, System.Double">
        <ni:TankDouble.Scale>
            <ni:NumericScale>
                <ni:NumericScale.MajorDivisions>
                    <ni:RangeLabeledDivisions LabelPresenter="G" />
                </ni:NumericScale.MajorDivisions>
            </ni:NumericScale>
        </ni:TankDouble.Scale>
    </ni:TankDouble>

~ Paul H
Message 2 of 4
(5,723 Views)

Hi Paul,

 

Thank you for your response! Sorry for the late reply on my part, as I was pulled off to work on something else. When I plug in the xaml you provided I see the following tank:

 

 

nierror.png

 

 

The numbers are still making the jump from 0.002 to 1E-10 in a very small portion of the graph. I'm not sure if this is a defect or something I need to change? Do I need to set the scale to logarithmic or something like that? did you try inputting your xaml into VS 2010 and checking the bahavior of the graph? This is an image of the graph while invoking the executable and not an image from the VS XAML editor. (Both are showing similar results though).

 

Thanks again,

Mike

0 Kudos
Message 3 of 4
(5,622 Views)

Yes, when I set the format to G, I saw tick labels 1E-10, 0.001, 0.002, ..., 0.01. If you don't like the different formatting for the near-zero minimum value, you could use a different Standard Numeric Format String like E0 (1E-010, 1E-003, ..., 1E-002). Or you could use a Custom Numeric Format String like 0.########## (0.0000000001, 0.001, ..., 0.01). Or if none of the built-in .NET format options work for you, you can derive from one of the value presenter base classes and override FormatCore or VisualizeCore to display whatever you want.

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