Represents a collection of chart series.
Property | Type | Description |
---|---|---|
count | int | Returns the number of series in the collection. Read-only. |
items | ChartSeries[] | A collection of chartSeries objects. Read-only. |
None
Method | Return Type | Description |
---|---|---|
getItemAt(index: number) | ChartSeries | Retrieves a series based on its position in the collection |
load(param: object) | void | Fills the proxy object created in JavaScript layer with property and object values specified in the parameter. |
Retrieves a series based on its position in the collection
chartSeriesCollectionObject.getItemAt(index);
Parameter | Type | Description |
---|---|---|
index | number | Index value of the object to be retrieved. Zero-indexed. |
Get the name of the first series in the series collection.
var ctx = new Excel.RequestContext();
var seriesCollection = ctx.workbook.worksheets.getItem("Sheet1").charts.getItem("Chart1").series;
ctx.load(seriesCollection);
ctx.executeAsync().then(function () {
Console.log(seriesCollection.items[0].name);
});
Fills the proxy object created in JavaScript layer with property and object values specified in the parameter.
object.load(param);
Parameter | Type | Description |
---|---|---|
param | object | Optional. Accepts parameter and relationship names as delimited string or an array. Or, provide loadOption object. |
void
Getting the names of series in the series collection.
var ctx = new Excel.RequestContext();
var seriesCollection = ctx.workbook.worksheets.getItem("Sheet1").charts.getItem("Chart1").series;
ctx.load(seriesCollection);
ctx.executeAsync().then(function () {
for (var i = 0; i < seriesCollection.items.length; i++)
{
Console.log(seriesCollection.items[i].name);
}
});
Get the number of chart series in collection.
var ctx = new Excel.RequestContext();
var seriesCollection = ctx.workbook.worksheets.getItem("Sheet1").charts.getItem("Chart1").series;
ctx.load(seriesCollection);
ctx.executeAsync().then(function () {
Console.log("series: Count= " + seriesCollection.count);
});