DataLabels 对象 (Excel)DataLabels object (Excel)

由指定系列中所有 DataLabel 对象组成的集合。A collection of all the DataLabel objects for the specified series.


数据标签 的每个对象表示一个点或趋势线的数据标签。Each DataLabel object represents a data label for a point or trendline. 对于没有可定义点 (如区域系列), 数据标签 集合包含单个数据标签。For a series without definable points (such as an area series), the DataLabels collection contains a single data label.


使用Series对象的**DataLabels** 方法可返回DataLabels集合。Use the DataLabels method of the Series object to return the DataLabels collection. 下例设置第一个图表的第一个数据系列中数据标签的数字格式。The following example sets the number format for data labels on series one on chart sheet one.

With Charts(1).SeriesCollection(1) 
 .HasDataLabels = True 
 .DataLabels.NumberFormat = "##.##" 
End With

使用DataLabels (索引), 其中_索引_是数据标签索引号, 返回单个DataLabel对象。Use DataLabels (index), where index is the data-label index number, to return a single DataLabel object. 下例设置第一个工作表第一个内嵌图表的第一个序列中第五个数据标签的数字格式。The following example sets the number format for the fifth data label in series one in embedded chart one on worksheet one.

Worksheets(1).ChartObjects(1).Chart _ 
 .SeriesCollection(1).DataLabels(5).NumberFormat = "0.000"



另请参阅See also

支持和反馈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.