10-29-2012 05:14 AM
In Measurement Studio WF there is engineering formatter:
NationalInstruments.UI.FormatString fs = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Engineering, "S2");
Is there similar formatter in WPF? I've found only standard formatters like
var fs = new GeneralValueFormatter("0.###");
Solved! Go to Solution.
10-29-2012 05:41 AM - edited 10-29-2012 05:44 AM
Hi Eugenem
The closest thing I can find is the EngineeringFormatInfo class, although it's not a WPF element.
I don't believe there is currently a WPF string formatting class or namespace which is part of the Measurement Studio package.
Kind Regards
10-29-2012 05:55 AM
thanks!
this one is good for manual formatting
how do I apply it to graph axis?
now I use
ax.MajorDivisions.LabelPresenter = new GeneralValueFormatter( config.format );
10-29-2012 07:36 AM - edited 10-29-2012 07:37 AM
Hi Again
I've taken another look and in WPF the graph formatting is done using XAML, unfortunately the only formatting options for the axis numeric that I can see are DateTime, Double, Int32 or PrecisionDateTime. i.e. the attached picture.
I think the answer to your original question is no for the moment.
Kind Regards
10-29-2012 09:36 AM
As Chris mentioned, the WPF controls do not currently support engineering format values. However, implementing a custom formatter using the EngineeringFormatInfo
class is fairly trivial, and does not involve creating a new axis type.
See the attached file for an example implementation. You can use it in your code like so:
ax.MajorDivisions.LabelPresenter = new EngineeringValueFormatter( "S2" );
10-29-2012 09:44 AM
Thanks, did it this way.