09-16-2013 06:46 PM
When setting the range on the TankDouble from 1E-2 to 1E-10 the default range shows up with an unusual range:
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!!!
09-17-2013 11:21 AM
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>
10-14-2013 04:52 PM
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:
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
10-15-2013 11:13 AM
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.