title | ms.service | ms.assetid | ms.date | ms.localizationpriority |
---|---|---|---|---|
Chart.ApplyDataLabels method (Project) |
project-server |
cda031a4-ed86-1ec8-583d-44767785e3a1 |
06/08/2017 |
medium |
Applies data labels to all the series in a chart.
expression.ApplyDataLabels (Type, IMsoLegendKey, AutoText, HasLeaderLines, ShowSeriesName, ShowCategoryName, ShowValue, ShowPercentage, ShowBubbleSize, Separator)
expression A variable that represents a Chart object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Type | Optional | Office.XlDataLabelsType | The type of data label to apply. The default value is xlDataLabelsShowValue. |
IMsoLegendKey | Optional | Variant | True to show the legend key next to the point. The default value is False. |
AutoText | Optional | Variant | True if the object automatically generates appropriate text based on content. |
HasLeaderLines | Optional | Variant | True if the series has leader lines. |
ShowSeriesName | Optional | Variant | True to enable the series name for the data label. False to disable the series name. |
ShowCategoryName | Optional | Variant | True to enable the category name for the data label. False to disable the category name. |
ShowValue | Optional | Variant | True to enable the value for the data label. False to disable the value.If the Type parameter is not specified, ShowValue is assumed to be True. |
ShowPercentage | Optional | Variant | True to enable the percentage for the data label. False to disable the percentage. |
ShowBubbleSize | Optional | Variant | True to enable the bubble size for the data label. False to disable the bubble size. |
Separator | Optional | Variant | The separator for the data label. |
Nothing
The following example applies data labels to each data point.
Sub SetDataLabels()
Dim chartShape As Shape
Dim reportName As String
reportName = "Simple scalar chart"
Set chartShape = ActiveProject.Reports(reportName).Shapes(1)
chartShape.Chart.ApplyDataLabels
End Sub
[!includeSupport and feedback]