Table of contents
TOC
Collapse the table of content
Expand the table of content

Chart.ApplyDataLabels Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Applies data labels to all the series in a chart.

Syntax

expression. ApplyDataLabels(Type,IMsoLegendKey,AutoText,HasLeaderLines,ShowSeriesName,ShowCategoryName,ShowValue,ShowPercentage,ShowBubbleSize,Separator)

expression A variable that represents a Chart object.

Parameters

NameRequired/OptionalData typeDescription
TypeOptionalOffice.XlDataLabelsTypeThe type of data label to apply. The default value is xlDataLabelsShowValue.
IMsoLegendKeyOptionalVariantTrue to show the legend key next to the point. The default value is False.
AutoTextOptionalVariantTrue if the object automatically generates appropriate text based on content.
HasLeaderLinesOptionalVariantTrue if the series has leader lines.
ShowSeriesNameOptionalVariantTrue to enable the series name for the data label. False to disable the series name.
ShowCategoryNameOptionalVariantTrue to enable the category name for the data label. False to disable the category name.
ShowValueOptionalVariantTrue 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.
ShowPercentageOptionalVariantTrue to enable the percentage for the data label. False to disable the percentage.
ShowBubbleSizeOptionalVariantTrue to enable the bubble size for the data label. False to disable the bubble size.
SeparatorOptionalVariantThe separator for the data label.

Return value

Nothing

Example

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

See also

Other resources

Chart Object

© 2018 Microsoft