ChartCollection

ChartCollection class

Encapsulates a collection of Chart objects.

class ChartCollection;

Methods

MethodDescription
get(number)Gets the Chart element at the specified index.
addFloatingChart(ChartType, number, number, number, number)Adds a chart to the collection.
add(ChartType, number, number, number, number)Adds a chart to the collection.
add(number[], string, boolean, number, number, number, number)Adds a chart with preset template.
add(ChartType, string, boolean, number, number, number, number)Adds a chart to the collection.
removeAt(number)Remove a chart at the specific index.
clear()Clear all charts.
getCount()Gets the number of elements contained in.

get(number)

Gets the Chart element at the specified index.

get(index: number) : Chart;

Parameters:

ParameterTypeDescription
indexnumberThe zero based index of the element.

Returns

The element at the specified index.

addFloatingChart(ChartType, number, number, number, number)

Adds a chart to the collection.

addFloatingChart(type: ChartType, left: number, top: number, width: number, height: number) : number;

Parameters:

ParameterTypeDescription
typeChartTypeChart type
leftnumberThe x offset to corner
topnumberThe y offset to corner
widthnumberThe chart width
heightnumberThe chart height

Returns

Chart object index.

add(ChartType, number, number, number, number)

Adds a chart to the collection.

add(type: ChartType, upperLeftRow: number, upperLeftColumn: number, lowerRightRow: number, lowerRightColumn: number) : number;

Parameters:

ParameterTypeDescription
typeChartTypeChart type
upperLeftRownumberUpper left row index.
upperLeftColumnnumberUpper left column index.
lowerRightRownumberLower right row index
lowerRightColumnnumberLower right column index

Returns

Chart object index.

add(number[], string, boolean, number, number, number, number)

Adds a chart with preset template.

add(data: number[], dataRange: string, isVertical: boolean, topRow: number, leftColumn: number, rightRow: number, bottomColumn: number) : number;

Parameters:

ParameterTypeDescription
datanumber[]The data of chart template file(.crtx).
dataRangestringSpecifies the data range of the chart
isVerticalbooleanSpecifies whether to plot the series from a range of cell values by row or by column.
topRownumberUpper left row index.
leftColumnnumberUpper left column index.
rightRownumberLower right row index
bottomColumnnumberLower right column index

Returns

Chart object index.

add(ChartType, string, boolean, number, number, number, number)

Adds a chart to the collection.

add(type: ChartType, dataRange: string, isVertical: boolean, topRow: number, leftColumn: number, rightRow: number, bottomColumn: number) : number;

Parameters:

ParameterTypeDescription
typeChartTypeChart type
dataRangestringSpecifies the data range of the chart
isVerticalbooleanSpecifies whether to plot the series from a range of cell values by row or by column.
topRownumberUpper left row index.
leftColumnnumberUpper left column index.
rightRownumberLower right row index
bottomColumnnumberLower right column index

Returns

Chart object index.

removeAt(number)

Remove a chart at the specific index.

removeAt(index: number) : void;

Parameters:

ParameterTypeDescription
indexnumberThe chart index.

clear()

Clear all charts.

clear() : void;

getCount()

Gets the number of elements contained in.

getCount() : number;