SeriesCollection

SeriesCollection class

Encapsulates a collection of Series objects.

class SeriesCollection;

Methods

MethodDescription
get(number)Gets the Series element at the specified index.
getCategoryData()Gets or sets the range of category Axis values. It can be a range of cells (such as, “d1:e10”), or a sequence of values (such as,"{2,6,8,10}").
setCategoryData(string)Gets or sets the range of category Axis values. It can be a range of cells (such as, “d1:e10”), or a sequence of values (such as,"{2,6,8,10}").
getSecondCategoryData()Gets or sets the range of second category Axis values. It can be a range of cells (such as, “d1:e10”), or a sequence of values (such as,"{2,6,8,10}"). Only effects when some ASerieses plot on the second axis.
setSecondCategoryData(string)Gets or sets the range of second category Axis values. It can be a range of cells (such as, “d1:e10”), or a sequence of values (such as,"{2,6,8,10}"). Only effects when some ASerieses plot on the second axis.
isColorVaried()Represents if the color of points is varied.
setIsColorVaried(boolean)Represents if the color of points is varied.
getSeriesByOrder(number)Gets the Series element by order.
removeAt(number)Remove at a series at the specific index.
changeSeriesOrder(number, number)Directly changes the orders of the two series.
swapSeries(number, number)Directly changes the orders of the two series.
setSeriesNames(number, string, boolean)Sets the name of all the serieses in the chart.
addR1C1(string, boolean)Adds the Series collection to a chart.
add(string, boolean)Adds the Series collection to a chart.
add(string, boolean, boolean)Adds the Series collection to a chart.
clear()Clears the collection
getCount()Gets the number of elements contained in.

get(number)

Gets the Series element at the specified index.

get(index: number) : Series;

Parameters:

ParameterTypeDescription
indexnumberThe zero based index of the element.

Returns

The element at the specified index.

getCategoryData()

Gets or sets the range of category Axis values. It can be a range of cells (such as, “d1:e10”), or a sequence of values (such as,"{2,6,8,10}").

getCategoryData() : string;

setCategoryData(string)

Gets or sets the range of category Axis values. It can be a range of cells (such as, “d1:e10”), or a sequence of values (such as,"{2,6,8,10}").

setCategoryData(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

getSecondCategoryData()

Gets or sets the range of second category Axis values. It can be a range of cells (such as, “d1:e10”), or a sequence of values (such as,"{2,6,8,10}"). Only effects when some ASerieses plot on the second axis.

getSecondCategoryData() : string;

setSecondCategoryData(string)

Gets or sets the range of second category Axis values. It can be a range of cells (such as, “d1:e10”), or a sequence of values (such as,"{2,6,8,10}"). Only effects when some ASerieses plot on the second axis.

setSecondCategoryData(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

isColorVaried()

Represents if the color of points is varied.

isColorVaried() : boolean;

setIsColorVaried(boolean)

Represents if the color of points is varied.

setIsColorVaried(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getSeriesByOrder(number)

Gets the Series element by order.

getSeriesByOrder(order: number) : Series;

Parameters:

ParameterTypeDescription
ordernumberThe order of series

Returns

The element series

removeAt(number)

Remove at a series at the specific index.

removeAt(index: number) : void;

Parameters:

ParameterTypeDescription
indexnumberThe index.

changeSeriesOrder(number, number)

Directly changes the orders of the two series.

changeSeriesOrder(sourceIndex: number, destIndex: number) : void;

Parameters:

ParameterTypeDescription
sourceIndexnumberThe current index
destIndexnumberThe dest index

Remarks

NOTE: This method is now obsolete. Instead, please use SeriesCollection.SwapSeries method. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

swapSeries(number, number)

Directly changes the orders of the two series.

swapSeries(sourceIndex: number, destIndex: number) : void;

Parameters:

ParameterTypeDescription
sourceIndexnumberThe current index
destIndexnumberThe dest index

setSeriesNames(number, string, boolean)

Sets the name of all the serieses in the chart.

setSeriesNames(startIndex: number, area: string, isVertical: boolean) : void;

Parameters:

ParameterTypeDescription
startIndexnumberThe index of the first series which you want to set the name.
areastringSpecifies the area for the series name.
isVerticalboolean>Specifies whether to plot the series from a range of cell values by row or by column.

Remarks


If the start index is larger than the count of the serieses, it will return and do nothing.

If set data on contiguous cells, use colon to seperate them.For example, $C$2:$C$5.

If set data on contiguous cells, use comma to seperate them.For example, ($C$2,$D$5).

addR1C1(string, boolean)

Adds the Series collection to a chart.

addR1C1(area: string, isVertical: boolean) : number;

Parameters:

ParameterTypeDescription
areastringSpecifies values from which to plot the data series
isVerticalbooleanSpecifies whether to plot the series from a range of cell values by row or by column.

Returns

Return the first index of the added ASeries in the NSeries.

Remarks


If set data on contiguous cells, use colon to seperate them.For example, R[1]C[1]:R[3]C[2].

If set data on contiguous cells, use comma to seperate them.For example,(R[1]C[1],R[3]C[2]).

add(string, boolean)

Adds the Series collection to a chart.

add(area: string, isVertical: boolean) : number;

Parameters:

ParameterTypeDescription
areastringSpecifies values from which to plot the data series
isVerticalbooleanSpecifies whether to plot the series from a range of cell values by row or by column.

Returns

Return the first index of the added ASeries in the NSeries.

Remarks


If set data on contiguous cells, use colon to seperate them.For example, $C$2:$C$5.

If set data on non contiguous cells, use comma to seperate them.For example: ($C$2,$D$5).

add(string, boolean, boolean)

Adds the Series collection to a chart.

add(area: string, isVertical: boolean, checkLabels: boolean) : number;

Parameters:

ParameterTypeDescription
areastringSpecifies values from which to plot the data series
isVerticalbooleanSpecifies whether to plot the series from a range of cell values by row or by column.
checkLabelsbooleanIndicates whether the range contains series’s name

Returns

Return the first index of the added ASeries in the NSeries.

Remarks


If set data on contiguous cells, use colon to seperate them.For example, $C$2:$C$5.

If set data on non contiguous cells, use comma to seperate them.For example, ($C$2,$D$5).

clear()

Clears the collection

clear() : void;

getCount()

Gets the number of elements contained in.

getCount() : number;