Name

chart.ApplyDataLabels([Type], [LegendKey], [AutoText], [HasLeaderLines], [ShowSeriesName], [ShowCategoryName], [ShowValues], [ShowPercentage], [ShowBubbleSize], [Separator])

Synopsis

Applies data labels to all of the series on the chart.

Argument

Settings

Type

An xlDataLabelsType constant specifying the type of labels to display. Can be one of the following:

xlDataLabelsShowBubbleSizes
xlDataLabelsShowLabelAndPercent
xlDataLabelsShowPercent
xlDataLabelsShowLabel
xlDataLabelsShowNone
xlDataLabelsShowValue (default)

Not all Type settings are valid for all types of charts. xlDataLabelsShowPercent and xlDataLabelsShowLabelAndPercent apply to only pie and doughnut chart types.

Set Type to xlDataLabelsShowNone to remove all data labels from a chart.

LegendKey

True displays the legend key next to the point; False omits the key. Default is False.

AutoText

True automatically generates an appropriate data label based on the type of chart and whether axis titles are included; False uses the Show argument settings to determine the label content. Default is True

HasLeaderLines

True displays leader lines for each series; False omits leader lines. Default is False.

ShowSeriesName

True adds the series name to each label; False omits it.

ShowCategoryName

True adds the category axis value to each label; False omits it.

ShowValues

True adds the value of each point to the data label; False omits it.

ShowPercentage

For pie and doughnut charts, True adds the percentage ...

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.