[]
        
(Showing Draft Content)

GC.Spread.Sheets.DataCharts.DataChartManager

Class: DataChartManager

Sheets.DataCharts.DataChartManager

Table of contents

Constructors

Methods

Constructors

constructor

new DataChartManager()

Represents a datachart manager that managers all datacharts in a sheet.

Methods

add

add(name, x, y, width, height, type): DataChart

Adds a datachart to the sheet.

example

//This example shows how to add a datachart.
var datachart = activeSheet.datacharts.add('datachart1', 250, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column);

Parameters

Name Type Description
name string The name of the datachart that will be added to the sheet.
x number The x location of the datachart.
y number The y location of the datachart.
width number The width of the datachart.
height number The height of the datachart.
type DataChartType The type of the datachart.

Returns

DataChart

The datachart that has been added to the sheet.


all

all(): DataChart[]

get all data charts.

example

activeSheet.datacharts.add('DataChart1', 0, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column);
activeSheet.datacharts.add('DataChart2', 500, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.pie);
var dataCharts = activeSheet.datacharts.all();
for (var i = 0; i < dataCharts.length; i++) {
    alert("Name of dataChart " + i + " is:  " + dataCharts[i].name())
}

Returns

DataChart[]

get all data charts.


clear

clear(): void

remove all data charts.

Returns

void


get

get(name): DataChart

get a data charts by name.

example

activeSheet.datacharts.add('DataChart1', 0, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column);
//button
$("#button1").click(function () {
 var dataChart = activeSheet.datacharts.get("DataChart1");
});

Parameters

Name Type Description
name string data chart name.

Returns

DataChart

get a data charts by name.


remove

remove(name): void

remove a data charts by name.

example

activeSheet.datacharts.add('DataChart1', 0, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column);
//button
$("#button1").click(function () {
     activeSheet.resumePaint();
     activeSheet.datacharts.remove("DataChart1");
     activeSheet.repaint();
});

Parameters

Name Type Description
name string data chart name.

Returns

void


zIndex

zIndex(name, zIndex?): any

Gets or sets the z-index of chart.

example

activeSheet.datacharts.add('DataChart1', 200, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column);
activeSheet.datacharts.add('DataChart2', 0, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.pie);
activeSheet.datacharts.zIndex('DataChart1', 897);
activeSheet.datacharts.zIndex('DataChart2', 890);

Parameters

Name Type Description
name string The name of the chart.
zIndex? number The z-index of the chart.

Returns

any

If the parameter 'zIndex' is null or undefined,it will return the z-index of the chart with the indicate name.