共用方式為


Chart.ApplyCustomType 方法 (專案)

對圖表套用自訂圖表類型。

語法

expressionApplyCustomType (圖表類型,類型名稱)

expression 代表 Chart 物件的變數。

參數

名稱 必要/選用 資料類型 描述
ChartType 必要 Office.XlChartType 圖表的類型。
TypeName 選用 Variant 圖表類型的名稱。
ChartType 必要 XL圖表類型
TypeName 選用 Variant

傳回值

Nothing

範例

以下範例將圖表類型改為叢集三維長條圖。

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 支援與意見反應