Spread.Sheets Documentation
add Method
GC.Spread.Sheets.Charts Namespace > ChartCollection type : add Method
The name of the chart that will be added to the sheet.
The type of the chart.
The x location of the chart.
The y location of the chart.
The width of the chart.
The height of the chart.
The formula string of data range for the chart.
The orientation of data for series.
Adds a chart to the sheet.
Syntax
var instance = new GC.Spread.Sheets.Charts.ChartCollection(sheet);
var value; // Type: Chart
value = instance.add(name, chartType, x, y, width, height, dataRange, dataOrientation);
function add( 
   name : string,
   chartType : ChartType,
   x : number,
   y : number,
   width : number,
   height : number,
   dataRange : undefined,
   dataOrientation : undefined
) : Chart;

Parameters

name
The name of the chart that will be added to the sheet.
chartType
The type of the chart.
x
The x location of the chart.
y
The y location of the chart.
width
The width of the chart.
height
The height of the chart.
dataRange
The formula string of data range for the chart.
dataOrientation
The orientation of data for series.
Example
//This example shows how to add a chart.
var dataRange = "A1:D4";
var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange);
See Also

Reference

ChartCollection type