Chart.ChartWizard method (Project)

您所在的位置:网站首页 手机按键精灵怎么写脚本 Chart.ChartWizard method (Project)

Chart.ChartWizard method (Project)

#Chart.ChartWizard method (Project) | 来源: 网络整理| 查看: 265

Chart.ChartWizard method (Project) Article 01/22/2022

Modifies the properties and formatting of a chart.

Syntax

expression. ChartWizard (varSource, varGallery, varFormat, varPlotBy, varCategoryLabels, varSeriesLabels, varHasLegend, varTitle, varCategoryTitle, varValueTitle, varExtraTitle)

expression A variable that represents a Chart object.

Parameters Name Required/Optional Data type Description varSource Optional Variant The source data for a new chart. If the varSource argument is omitted, Project edits the active report or the selected chart on the active report. varGallery Optional Variant One of the constants of the Office.XlChartType enumeration, which specifies the chart type. varFormat Optional Variant The option number for the built-in autoformats. Can be a number from 1 through 10, depending on the gallery type. If the varFormat argument is omitted, Project chooses a default value based on the gallery type and data source. varPlotBy Optional Variant Specifies whether the data for each series is in rows or columns. Can be one of the following Office.XlRowCol constants: xlRows or xlColumns. varCategoryLabels Optional Variant An integer that specifies the number of rows or columns within the source range that contain category labels. Values can be from 0 (zero) through one less than the maximum number of the corresponding categories or series. varSeriesLabels Optional Variant An integer that specifies the number of rows or columns within the source range that contain series labels. Values can be from 0 (zero) through one less than the maximum number of the corresponding categories or series. varHasLegend Optional Variant Set True to include a legend. varTitle Optional Variant The chart title. varCategoryTitle Optional Variant The category axis title. varValueTitle Optional Variant The value axis title. varExtraTitle Optional Variant The series axis title for 3D charts or the second value axis title for 2D charts. varSource Optional Variant varGallery Optional Variant varFormat Optional Variant varPlotBy Optional Variant varCategoryLabels Optional Variant varSeriesLabels Optional Variant varHasLegend Optional Variant varTitle Optional Variant varCategoryTitle Optional Variant varValueTitle Optional Variant varExtraTitle Optional Variant Return value

Nothing

Remarks

Use the ChartWizard method to quickly format a chart without setting all the individual properties. This method is noninteractive, and it changes only the specified properties. TheAutoFormat method can do the same job as a call to ChartWizard that uses only the varGallery and varFormat parameters.

If the Source parameter is omitted and the selection isn't an embedded chart on the active report, or the active report does not contain a chart, the ChartWizard method fails and an error occurs.

Example

The following example reformats the chart on the active report as a line chart, adds a legend, and adds category and value axis titles.

Sub TestChartWizard() Dim chartShape As Shape Dim reportName As String reportName = "Simple scalar chart" Set chartShape = ActiveProject.Reports(reportName).Shapes(1) chartShape.Chart.ChartWizard varGallery:=xlLine, varHasLegend:=True, varCategoryTitle:="Task", varValueTitle:="Hours" End Sub See also

Chart Object AutoFormat Method

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3