-
<static> fromField(field, startIndex)
-
Creates data series from TA Field.
Parameters:
Name |
Type |
Description |
field |
TASdk.Field
|
The TA Field with values. |
startIndex |
number
|
The starting index of valid values. |
Returns:
-
Type
-
StockChartX.DataSeries
-
add(value)
-
Adds new value or an array of values into the data series.
Parameters:
Name |
Type |
Description |
value |
Date
|
number
|
Array.<Date>
|
Array.<number>
|
The new value or array of values. |
Example
dataSeries.add(1.0);
-
ceilIndex(searchValue)
-
Gets index of the value that is greater or equal to searchValue. Data series must contain sorted values.
Usually this method is applied to date data series.
Parameters:
Name |
Type |
Description |
searchValue |
Number
|
Date
|
The value to search. |
Returns:
-
Type
-
number
-
clear()
-
Clears all values.
-
floorIndex(searchValue)
-
Gets index of the value that is less or equal to searchValue. Data series must contain sorted values.
Usually this method is applied to date data series.
Parameters:
Name |
Type |
Description |
searchValue |
Number
|
Date
|
The value to search. |
Returns:
-
Type
-
number
-
fromField(field, startIndex)
-
Loads values from a given field.
Parameters:
Name |
Type |
Description |
field |
TASdk.Field
|
The field. |
startIndex |
Number
|
The starting index. |
-
leftNearestVisibleValueIndex(index)
-
Returns index of nearest visible value from the left.
Parameters:
Name |
Type |
Description |
index |
Number
|
The starting index. |
Returns:
-
Type
-
number
-
minMaxValues(startIndex, count)
-
Returns minimum and maximum values in a given range.
Parameters:
Name |
Type |
Argument |
Default |
Description |
startIndex |
Number
|
<optional>
|
0
|
The starting index of the range to search. |
count |
Number
|
<optional>
|
|
The length of the range to search. Iterates through all values after startIndex if omitted. |
Returns:
An object that contains min and max values.
-
Type
-
Object
Example
var values1 = dataSeries.minMaxValues();
var values2 = dataSeries.minMaxValues(1, 5);
-
rightNearestVisibleValueIndex(index)
-
Returns index of nearest visible value from the right.
Parameters:
Name |
Type |
Description |
index |
Number
|
The starting index. |
Returns:
-
Type
-
number
-
toField(name)
-
Creates TASDK.Field with values.
Parameters:
Name |
Type |
Description |
name |
String
|
The field name. |
Returns:
-
Type
-
TASdk.Field
-
trim(maxLength)
-
Trims values to a given maximum length (by removing old values).
Parameters:
Name |
Type |
Description |
maxLength |
|
|
Returns:
The number of removed values.
-
Type
-
number
-
updateLast(value)
-
Updates last value.
Parameters:
Name |
Type |
Description |
value |
Date
|
number
|
The new value. |
-
valueAtIndex(index, value)
-
Gets/Sets value at a given index.
Parameters:
Name |
Type |
Argument |
Description |
index |
Number
|
|
The index of value. |
value |
Date
|
number
|
<optional>
|
The new value to set. |
Returns:
Value at a given index.
-
Type
-
Date
|
number
Example
dataSeries.valueAtIndex(3, 10); // Sets value 10 at index 3