|
The Trend .NET(2.0) do not
support directly read data from hard disk
file, because we don't know your file format.
You can read data by your self and use the
cstAddXY or cstAddXYArray method to add
the data to the control, but Trend.NET 3.0 provide the module, please see the example.
C#
//Read the
last record for x axis and set the value
to XMax
......
//Read the first record for x axis and
set the value to XMin
......
Trend2.XMax = [last record];
Trend2.XMin = [first record];
Trend2.cstSetXDisplay(Trend2.XMin, Trend2.XMax);
double[,] XY = new double[2,RecordNum-1];
//two dimensions array, 0 dimension
is for x value, 1 dimension is for y
value
for (i = 0; i <= RecordNum-1; i++)
{
//XValue = ......
XY[0, i] = XValue;
//YValue = ......
XY[1, i] = YValue;
}
Trend2.cstAddXYArray(0, ref XY); //0
is the index of Vars
//that is say, for 1st line(Var 0),
the control will link RecordNum-1 XY
data points
//if there is more vars,continue to
add data
......
Trend2.cstRedrawDynamic();
VB.NET
'Read the
last record for x axis and set the value
to XMax
......
'Read the first record for x axis and
set the value to XMin
......
Trend2.XMax = [last record]
Trend2.XMin = [first record]
Trend2.cstSetXDisplay(Trend2.XMin, Trend2.XMax)
Dim XY(1, RecordNum-1) As Double 'two
dimensions array, 0 dimension is for
x value, 1 dimension is for y value
For i = 0 To 99
'XValue = ......
XY(0, i) = XValue
'YValue = ......
XY(1, i) = YValue
Next
Trend2.cstAddXYArray(0, XY) '0 is the
index of Vars
'that is say, for 1st line(Var 0), the
control will link RecordNum-1 XY data
points
'if there is more vars,continue to add
data
......
Trend2.cstRedrawDynamic()
Back to Top |