Chart.ApplyCustomType 方法 (Project)

将自定义图表类型应用于图表。

语法

expressionApplyCustomType (ChartType,TypeName)

expression:一个表示 Chart 对象的变量。

参数

名称 必需/可选 数据类型 说明
ChartType 必需 Office.XlChartType 图表类型。
TypeName 可选 Variant 图表类型的名称。
ChartType 必需 XLCHARTTYPE
TypeName 可选 Variant

返回值

Nothing

示例

以下示例将图表类型更改为簇状 3D 条形图。

Sub SetChartType()
    Dim chartShape As Shape
    Dim reportName As String
    
    reportName = "Simple scalar chart"
    Set chartShape = ActiveProject.Reports(reportName).Shapes(1)
    
    Debug.Print "Chart type before: " & chartShape.Chart.ChartType
    chartShape.Chart.ApplyCustomType (xl3DBarClustered)
    Debug.Print "Chart type after: " & chartShape.Chart.ChartType
End Sub

另请参阅

Chart 对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。