new Series(oGraph)
The Series object holds a collection of Serie type (serie of the control). Use the Series/GetSeries() method to access the control's series collection.
Parameters:
| Name | Type | Description |
|---|---|---|
oGraph |
Graph | Indicates an object of Graph type that owns the collection |
Methods
Add(oSerieOptsopt) → {Serie}
The Add() method creates and adds a new serie into the control. Use the Add() method of the Serie object to a new child-serie into the control.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
oSerieOpts |
object |
<optional> |
Specifies the options to create the new serie as an object of SerieOptions type. If the oSerieOpts parameter is a string or a number, it is considered as the 'data' option of the new serie. |
Returns:
Returns the newly created serie, as an object of Serie type
- Type
- Serie
Example
oGraph.Serie.Add("10,20,30,40") {Serie}, adds a a new serie with the specified data
oGraph.Serie.Add({data: "1,2,3"}) {Serie}, adds a new serie with the specified data
Add
Clear()
The Clear() method removes all series of the control and inits the control's scroll-bars
GetCount() → {number}
The GetCount() method returns the number of series within the collection
Returns:
Returns the number of series within the collection
- Type
- number
Example
The following statements are equivalents:
oGraph.Series.GetCount(), counts the series within the control
oGraph.Series.Count, counts the series within the control
where oGraph is an object of Graph type
GetCount
Item(id) → {null|Serie}
The Item() method gets the serie giving its index, identifier/key or reference. The Serie(id) method returns the serie based on its index or identifier/key (equivalent of this method). The ItemByPos(pos) method gets the serie giving its position (0-based) within the collection.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
any | The id parameter could be any of the following:
|
Returns:
Returns null if the serie is not found, or an object of Serie type, if the series collection contains the giving id.
- Type
- null | Serie
Example
oGraph.Serie.Item(0) {Serie}, gets the first serie within the collection
oGraph.Serie.Item("MySerie") {Serie}, gets the serie with the identifier/key "MySerie"
oGraph.Serie.Item(oGraph.Serie.Count - 1) {Serie}, gets the last serie within the collection as they were added
Item
ItemByPos(pos) → {null|Serie}
The ItemByPos() method gets the serie giving its position (0-based) within the collection. The Item(id) method gets the serie giving its index, identifier/key or reference. The Serie(id) method returns the serie based on its index or identifier/key.
Parameters:
| Name | Type | Description |
|---|---|---|
pos |
number | Specifies the zero-based position of the serie within the collection |
- Since:
- 4.9
Returns:
Returns null if the serie is not found, or an object of Serie type, if the series collection contains the giving position.
- Type
- null | Serie
Example
oGraph.Serie.ItemByPos(0) {Serie}, gets the first serie within the collection as they are displayed
oGraph.Serie.ItemByPos(oGraph.Serie.Count - 1) {Serie}, gets the last serie within the collection as they are displayed
ItemByPos
Remove(id)
The Remove() method removes a serie from the collection.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
any | The id parameter could be any of the following:
|
RemoveRange(range)
The RemoveRange() method removes multiple-series at once
Parameters:
| Name | Type | Description |
|---|---|---|
range |
any | Indicates a serie, an array [{Serie}], or an exontrol.Arr([{Serie}]) |