[]
Sheets.DataCharts.DataChartManager
• new DataChartManager()
Represents a datachart manager that managers all datacharts in a sheet.
▸ 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);
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. |
The datachart that has been added to the sheet.
▸ 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())
}
get all data charts.
▸ clear(): void
remove all data charts.
void
▸ 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");
});
Name | Type | Description |
---|---|---|
name |
string |
data chart name. |
get a data charts by name.
▸ 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();
});
Name | Type | Description |
---|---|---|
name |
string |
data chart name. |
void
▸ 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);
Name | Type | Description |
---|---|---|
name |
string |
The name of the chart. |
zIndex? |
number |
The z-index of the chart. |
any
If the parameter 'zIndex' is null or undefined,it will return the z-index of the chart with the indicate name.