ApplyDataLabels Method

ApplyDataLabels method as it applies to the Chart object.

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

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

expression Required. An expression that returns a Chart object.

TypeOptional
Variant
. The data label type.

XlDataLabelsType can be one of these XlDataLabelsType constants.

xlDataLabelsShowBubbleSizes The bubble size for the data label.

xlDataLabelsShowLabel. Category for the point.

xlDataLabelsShowLabelAndPercent. Percentage of the total, and category for the point. Available only for pie charts and doughnut charts.

xlDataLabelsShowNone. No data labels.

xlDataLabelsShowPercent. Percentage of the total. Available only for pie charts and doughnut charts.

xlDataLabelsShowValue default. Value for the point.

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.

HasLeaderLinesOptional Variant. True if the series has leader lines.

ApplyDataLabels method as it applies to the Point and Series objects.

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

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

expression Required. An expression that returns one of the above objects.

TypeOptional
XlDataLabelsType
. The data label type.

XlDataLabelsType can be one of these XlDataLabelsType constants.

xlDataLabelsShowBubbleSizes The bubble size for the data label.

xlDataLabelsShowLabel. Category for the point.

xlDataLabelsShowLabelAndPercent. Percentage of the total, and category for the point. Available only for pie charts and doughnut charts.

xlDataLabelsShowNone. No data labels.

xlDataLabelsShowPercent. Percentage of the total. Available only for pie charts and doughnut charts.

xlDataLabelsShowValue default. Value for the point.

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.

HasLeaderLinesOptional Variant. True if the series has leader lines.

ShowSeriesNameOptional Variant. The series name for the data label.

ShowCategoryNameOptional Variant. The category name for the data label.

ShowValueOptional Variant. The value for the data label.

ShowPercentageOptional Variant. The percentage for the data label.

ShowBubbleSizeOptional Variant. The bubble size for the data label.

SeparatorOptional Variant. The separator for the data label.

Example

ApplyDataLabels method as it applies to the Series object.

This example applies category labels to series one.

myChart.SeriesCollection(1). _ 
 ApplyDataLabels Type:=xlDataLabelsShowLabel