ApplyDataLabels Method

See Also         Example         Applies To

Applies data labels to a point, a series, or all the series in a chart.

Syntax

expression.ApplyDataLabels(Type, LegendKey, AutoText, HasLeaderLines)

expression   Required. An expression that returns a Chart, Point, or Series object.

Type   Optional Variant. The data label type. Can be one of the following XlDataLabelsType constants.

Constant Description
xlDataLabelsShowNone No data labels.
xlDataLabelsShowValue Value for the point (assumed if this argument isn’t specified).
xlDataLabelsShowPercent Percentage of the total. Available only for pie charts and doughnut charts.
xlDataLabelsShowLabel Category for the point. This is the default value.
xlDataLabelsShowLabelAndPercent Percentage of the total, and category for the point. Available only for pie charts and doughnut charts.

LegendKey   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. For the Chart and Series objects, True if the series has leader lines.