ApplyDataLabels Method

Applies To

Chart Object, Point Object, Series Object.

Description

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

Syntax

object.ApplyDataLabels(type, legendKey)

object

Required. The Chart, Point, or Series object.

type

Optional. The type of data label, as shown in the following table.

Value

Meaning

xlNone

No data labels.

xlShowValue

Value for the point (assumed if this argument is not specified).

xlShowPercent

Percentage of the total. Only available for pie and doughnut charts.

xlShowLabel

Category for the point.

xlShowLabelAndPercent

Percentage of the total and category for the point. Only available for pie and doughnut charts.


legendKey

Optional. If True, Microsoft Excel shows the legend key next to the point.

See Also

DataLabel Property, HasDataLabel Property, HasDataLabels Property.

Example

This example applies category labels to series one in Chart1.


Charts("Chart1").SeriesCollection(1).ApplyDataLabels type:=xlShowLabel