Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Graphing Data with more than 5 decimal spaces

I am graphing data to Measurement Studio.  Here is a  pseudo snippet.
 
I have two arrays, oPlot.Data, and oPlot.Traces[ICTR].Data .  Each is an array of doubles with 160 elements. 

For example, 

oPlot.Data[0] = 8.9950000000005321

oPlot.Data[1] = 8.9950001600005329

When I graph the data, my X axis only displays increments of 8.995.  Only 3 decimal places.  I wish to display more decimal places and having difficulty figuring this out.

Some settings I have set:

// Here I set the range

oXRange = new NationalInstruments.UI.Range(8.9949999999999999, 8.9951111111111111);

xAxis1.Range = oXRange;

// here I attempt to mess with some formatting

System.Globalization.NumberFormatInfo oFormat = new System.Globalization.NumberFormatInfo();

oFormat.NumberDecimalDigits = 16;

xAxis1.EditRangeNumericFormatMode = NationalInstruments.UI.NumericFormatMode.CreateSimpleDoubleMode(16, oFormat);

 

xAxis1.AutoSpacing = false;

xAxis1.Mode = NationalInstruments.UI.AxisMode.Fixed;

yAxis1.AutoSpacing = false;

yAxis1.Mode = NationalInstruments.UI.AxisMode.Fixed;

//This is my actual call to graph the data, gphResults is my measurement studio graph.

gphResults.PlotXY(oPlot.Data, oPlot.Traces[iCTR].Data);
 
 
An advice would be great, thank you
 
Matt

Message Edited by Toedwy on 02-16-2006 09:57 AM

The Only Easy Day Was Yesterday.
0 Kudos
Message 1 of 2
(2,962 Views)

Matt,

It seems you looked around all over the API for a way to get all the decimal places you were looking for.  Fortunately, defining the format of the Y Axis label is a lot easier than what you tried to do.  The Y Axis contains a Major Divisions collection which includes the LabelFormat property.  By using this property you can get way more than 3 decimals.  I tested it with the 16 decimals places you were looking for (by the way, that is one accurate instrument!).  This is an example that shows how you can define the format of Y Axis label.

targetAxis.MajorDivisions.LabelFormat = New FormatString("F16", FormatStringMode.Numeric)

 

Regards,

Santiago D

0 Kudos
Message 2 of 2
(2,928 Views)