[]
Sheets.Charts.SeriesCollection
• new SeriesCollection()
Represents the series manager that managers all series in a chart.
▸ add(series
): void
Adds a new series to series collection.
example
// This example shows how to add a new series.
var dataRange = "A1:D4";
var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange);
chart.series.add({
chartType: GC.Spread.Sheets.Charts.ChartType.columnClustered,
axisGroup: GC.Spread.Sheets.Charts.AxisGroup.primary,
backColor: {
color: "lightblue",
width: 2
},
xValues: "A2:A4",
yValues: "B2:B4"
});
Name | Type | Description |
---|---|---|
series |
ISeries | ISeries [] |
The series of the chart. |
void
▸ get(index?
): any
Gets all series or a specified series from series collection.
example
// This example shows how to get a series.
var dataRange = "A1:D4";
var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange);
var series1 = chart.series().get(0);
Name | Type |
---|---|
index? |
number |
any
The series of the chart.
▸ remove(index
): void
Removes a specified series from series collection.
example
// This example shows how to remove a specified series.
var dataRange = "A1:D4";
var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange);
chart.series.remove(0);
Name | Type | Description |
---|---|---|
index |
number |
The index of the series. |
void
▸ set(index
, series
): void
Updates the specified series's property.
example
// This example shows how to update the property of a series.
var dataRange = "A1:D4";
var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange);
var series1 = chart.series().get(0);
series1.backColor = "red";
chart.series().set(0, series1);
Name | Type | Description |
---|---|---|
index |
number |
The index of the series. |
series |
ISeries |
The series of the chart. |
void