[]
        
(Showing Draft Content)

GC.Spread.Sheets.Charts.SeriesCollection

Class: SeriesCollection

Sheets.Charts.SeriesCollection

Table of contents

Constructors

Methods

Constructors

constructor

new SeriesCollection()

Represents the series manager that managers all series in a chart.

Methods

add

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"
});

Parameters

Name Type Description
series ISeries | ISeries[] The series of the chart.

Returns

void


get

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);

Parameters

Name Type
index? number

Returns

any

The series of the chart.


remove

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);

Parameters

Name Type Description
index number The index of the series.

Returns

void


set

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);

Parameters

Name Type Description
index number The index of the series.
series ISeries The series of the chart.

Returns

void