Series.ApplyDataLabels method (PowerPoint)
Applies data labels to a series.
Syntax
expression.ApplyDataLabels (Type
, LegendKey
, AutoText
, HasLeaderLines
, ShowSeriesName
, ShowCategoryName
, ShowValue
, ShowPercentage
, ShowBubbleSize
, Separator
)
expression A variable that represents a Series object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Type | Optional | XlDataLabelsType | The type of data label to apply. |
LegendKey | Optional | Variant | True to show the legend key next to the point. The default is False. |
AutoText | Optional | Variant | True if the object automatically generates appropriate text based on content. |
HasLeaderLines | Optional | Variant | For the Chart and Series objects, True if the series has leader lines. |
ShowSeriesName | Optional | Variant | True to enable the series name for the data label; otherwise, False. |
ShowCategoryName | Optional | Variant | True to enable the category name for the data label; otherwise, False. |
ShowValue | Optional | Variant | True to enable the value for the data label; otherwise, False. |
ShowPercentage | Optional | Variant | True to enable the percentage for the data label; otherwise, False. |
ShowBubbleSize | Optional | Variant | True to enable the bubble size for the data label; otherwise, False. |
Separator | Optional | Variant | The separator for the data label. |
Remarks
The Type parameter can be one of the following xlDataLabelsType constants:
xlDataLabelsShowBubbleSizes The bubble size for the data label.
xlDataLabelsShowLabelAndPercent The percentage of the total, and the category for the point. Available only for pie charts and doughnut charts.
xlDataLabelsShowPercent The percentage of the total. Available only for pie charts and doughnut charts.
xlDataLabelsShowLabel The category for the point.
xlDataLabelsShowNone No data labels.
xlDataLabelsShowValue (Default) The value for the point (assumed if this argument is not specified).
Example
Note
Although the following code applies to Microsoft Word, you can readily modify it to apply to PowerPoint.
The following example applies category labels to series one of the first chart in the active document.
With ActiveDocument.InlineShapes(1)
If .HasChart Then
.Chart.SeriesCollection(1). _
ApplyDataLabels Type:=xlDataLabelsShowLabel
End If
End With
See also
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.