ApplyDataLabels 方法 (Excel)Point.ApplyDataLabels method (Excel)

对数据点应用数据标签。Applies data labels to a point.

语法Syntax

表达式ApplyDataLabels(TypeLegendKey自动图文集HasLeaderLinesShowSeriesNameShowCategoryNameShowValueShowPercentageShowBubbleSize分隔符)expression.ApplyDataLabels (Type, LegendKey, AutoText, HasLeaderLines, ShowSeriesName, ShowCategoryName, ShowValue, ShowPercentage, ShowBubbleSize, Separator)

_表达式_一个代表**Point** 对象的变量。expression A variable that represents a Point object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
TypeType 可选Optional XlDataLabelsTypeXlDataLabelsType 要应用的数据标签的类型。The type of data label to apply.
LegendKeyLegendKey 可选Optional VariantVariant True 显示图例项标示点旁。True to show the legend key next to the point. 默认值为 FalseThe default value is False.
AutoTextAutoText 可选Optional VariantVariant 如此 如果对象自动生成合适的文字内容。True if the object automatically generates appropriate text based on content.
HasLeaderLinesHasLeaderLines 可选Optional VariantVariant 对于 图表系列 对象, 如此 如果数据系列有引导线。For the Chart and Series objects, True if the series has leader lines.
ShowSeriesNameShowSeriesName 可选Optional VariantVariant 传递布尔值以启用或禁用数据标签的系列名称。Pass a Boolean value to enable or disable the series name for the data label.
ShowCategoryNameShowCategoryName 可选Optional VariantVariant 传递布尔值以启用或禁用数据标签的类别名称。Pass a Boolean value to enable or disable the category name for the data label.
ShowValueShowValue 可选Optional VariantVariant 传递布尔值以启用或禁用数据标签的值。Pass a Boolean value to enable or disable the value for the data label.
ShowPercentageShowPercentage 可选Optional VariantVariant 传递布尔值以启用或禁用数据标签的百分比。Pass a Boolean value to enable or disable the percentage for the data label.
ShowBubbleSizeShowBubbleSize 可选Optional VariantVariant 传递布尔值以启用或禁用数据标签的气泡大小。Pass a Boolean value to enable or disable the bubble size for the data label.
SeparatorSeparator 可选Optional VariantVariant 数据标签的分隔符。The separator for the data label.

示例Example

本示例对 Chart1 上的第一个数据系列应用分类标签。This example applies category labels to series one on Chart1.

Charts("Chart1").SeriesCollection(1). _ 
 ApplyDataLabels Type:=xlDataLabelsShowLabel

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.