01-24-2005 03:02 AM
01-24-2005 11:37 AM
// Configure the X axis to display date/time labels.
xAxis1.MajorDivisions.LabelFormat = new FormatString(FormatStringMode.DateTime, "h:mm");
const int sampleCount = 60;
// Create an array of DateTime values that start at midnight and continues at
// one minute intervals for an hour.
TimeSpan interval = TimeSpan.FromMinutes(1);
DateTime[] times = new DateTime[sampleCount];
times[0] = DateTime.Today;
for (int i = 1; i < sampleCount; ++i)
times[i] = times[i - 1] + interval;
// Convert the array of DateTime values to an array of doubles for the graph.
double[] timeValues = (double[])DataConverter.Convert(times, typeof(double[]));
// Create an array of sample values to plot against the time values.
double[] dataValues = new double[sampleCount];
Random rnd = new Random();
for (int i = 0; i < sampleCount; ++i)
{
dataValues[i] = rnd.NextDouble() * 10;
}
// Plot the sample values against the time values on the ScatterGraph.
scatterGraph1.PlotXY(timeValues, dataValues);
01-24-2005 01:41 PM
@cm2009 wrote:
...any NI MS Manual for C#.NET (I just have the NI MS Manual for VB.NET)???
01-25-2005 08:54 PM
01-26-2005 12:07 AM
// Configure the X axis to display date/time labels.
xAxis1.MajorDivisions.LabelFormat = new FormatString(FormatStringMode.DateTime, "h:mm");
const int sampleCount = 60;
// Specify the start time as midnight today and specify the interval such
// that there is one sample per minute.
DateTime start = DateTime.Today;
TimeSpan interval = TimeSpan.FromMinutes(1);
// Create an array of sample values to plot against the time values.
double[] dataValues = new double[sampleCount];
Random rnd = new Random();
for (int i = 0; i < sampleCount; ++i)
{
dataValues[i] = rnd.NextDouble() * 10;
}
waveformGraph1.PlotY(dataValues, start, interval);
01-26-2005 09:12 AM
@cm2009 wrote:
On the other hand, for the manual, where can I find the “MS .net class library online help” (in fact, I just have the hardcopy of the manual (VB.NET)?
01-28-2005 12:16 AM
01-28-2005 09:51 AM
02-03-2005 12:44 AM
02-04-2005 01:51 PM