10-22-2015 03:07 PM
Start with example program PlotRenderer. I used VS2010.
Add Cursor To graph:
<ni:Graph.Children>
<ni:MultiPlotCursor ValuePresenter="Group: 0;0.00" Label="multiPlotCursor1" />
</ni:Graph.Children>
the Y axis data displays 2 Digits after the decimal point but they are always .00
Solved! Go to Solution.
10-23-2015 10:51 AM
I was able to reproduce the issue in the PlotRenderers example you mentioned. This appears to be a problem with our native value formatting implementation, and I have created a task to fix this in our next release.
As a workaround, you can use a custom formatter to display the original value, instead of the incorrectly converted value:
Code
public class DoubleFormatter : GeneralValueFormatter {
public DoubleFormatter( ) : base( "0.00" ) { }
protected override string FormatCore<TData>( TData value, ValuePresenterArgs args ) {
object originalValue;
string result =
args.Data.TryGetValue( "Original Value", out originalValue )
? base.FormatCore( (double)originalValue, args )
: base.FormatCore( value, args );
return result;
}
}
XAML
<ni:MultiPlotCursor.ValuePresenter>
<ni:ValueFormatterGroup>
<ni:ValueFormatterGroup.DefaultFormatter>
<local:DoubleFormatter />
</ni:ValueFormatterGroup.DefaultFormatter>
<ni:GeneralValueFormatter Format="0" />
</ni:ValueFormatterGroup>
</ni:MultiPlotCursor.ValuePresenter>
07-08-2019 04:24 PM
Just wanted to let you know this issue was fixed in the Measurement Studio 2019 release.