|
Add plot data.
Syntax 1
AddData(
penNo,
xData,
yData
)
Parameters
penNo
|
|
Type:
|
Number
|
|
Pen number (1~).
|
xData
|
|
Type:
|
Number
|
|
X coordinate data. See below for details.
|
yData
|
|
Type:
|
Number
|
|
Y coordinate data. See below for details.
|
Return Value
|
|
Type:
|
Boolean
|
|
FALSE - Failure. TRUE - Success.
|
Example
Here's the simplest example: add a point at (50,100) to pen1.
|
this.AddData(1, 50, 100);
|
You can also make xData and yData into one-dimensional arrays to add large amounts of data at once.
|
// 1000 X coordinate data in x, 1000 Y coordinate data in y
var x[1000];
var y1[1000];
var y2[1000];
var y3[1000];
…
this.AddData(1, x, y1); // Pen 1
this.AddData(2, x, y2); // Pen 2
this.AddData(3, x, y3); // Pen 3
|
|
Syntax 2
AddData(
penNo,
xData,
xIndex,
yData,
yIndex
)
Parameters
penNo
|
|
Type:
|
Number
|
|
Pen number (1~).
|
xData
|
|
Type:
|
Number
|
|
X coordinate data. See below.
|
xIndex
|
|
Type:
|
Number
|
|
The index of the xData array, see below.
|
yData
|
|
Type:
|
Number
|
|
Y coordinate data. See below.
|
yIndex
|
|
Type:
|
Number
|
|
The index of the yData array, see below.
|
Return Value
|
|
Type:
|
Boolean
|
|
FALSE - Failure. TRUE - Success.
|
Example
If your data is stored in a table (two-dimensional array) like the one below, you can use this function to process it quickly.
|
// Data with 10 columns and 1000 rows. Each column stores 1000 pieces of data for each pen.
var a[10, 1000];
…
this.AddData(1, a, 0, a, 1); // Pen 1
this.AddData(2, a, 0, a, 2); // Pen 2
this.AddData(3, a, 0, a, 3); // Pen 3
|
|
reference
AddData
GetDataCount
ClearData
SetXRange
GetXRange
SetProbePos
GetProbePos
GetProbeValueX
GetPointValueX
ResetMouseZoom
|