[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IShapes.AddChart

AddChart Method

AddChart(ChartType, double, double, double, double)

在活动工作表的指定位置创建图表。

Declaration
IShape AddChart(ChartType chartType, double left, double top, double width, double height)
Parameters
Type Name Description
ChartType chartType

图表类型。

double left

对象左侧到工作表列A左侧(在图表上则是图表区域左侧)的距离,以点为单位。

double top

形状范围内最顶部形状的顶部边缘到工作表顶部边缘的距离,以点为单位。

double width

对象的宽度,以点为单位。

double height

对象的高度,以点为单位。

Returns
Type Description
IShape

返回IShape 对象。

AddChart(ChartType, IRange)

在当前工作表的指定范围内创建图表。
目标范围的工作表和被添加形状的工作表必须是同一工作表。

Declaration
IShape AddChart(ChartType chartType, IRange targetRange)
Parameters
Type Name Description
ChartType chartType

图表类型。

IRange targetRange

当前工作表的目标范围。

Returns
Type Description
IShape

返回IShape 对象。

AddChart(string, ChartType, double, double, double, double)

在活动工作表的指定位置创建图表。

Declaration
IShape AddChart(string name, ChartType chartType, double left, double top, double width, double height)
Parameters
Type Name Description
string name

图表名称。

ChartType chartType

图表类型。

double left

对象左侧到工作表列A左侧(在图表上则是图表区域左侧)的距离,以点为单位。

double top

形状范围内最顶部形状的顶部边缘到工作表顶部边缘的距离,以点为单位。

double width

对象的宽度,以点为单位。

double height

对象的高度,以点为单位。

Returns
Type Description
IShape

返回IShape 对象。

AddChart(string, ChartType, IRange)

在当前工作表的指定范围内创建图表。
目标范围的目标工作表和被添加形状的工作表必须是同一工作表。

Declaration
IShape AddChart(string name, ChartType chartType, IRange targetRange)
Parameters
Type Name Description
string name

图表名称。

ChartType chartType

图表类型。

IRange targetRange

当前工作表的目标范围。

Returns
Type Description
IShape

返回IShape 对象。