DataLabels 集合對象

此頁沒有內(nèi)容條目
內(nèi)容

Chart

parchildSeriesCollection (Series)

spaceparmultDataLabels (DataLabel)

spaceparmultPoints (Point)

spaceparlowerparchildDataLabel

spaceparchildTrendlines (Trendline)

spacespaceparchildDataLabel

指定數(shù)據(jù)系列中所有 DataLabel 對象的集合。每個 DataLabel 對象代表一個數(shù)據(jù)點或趨勢線的數(shù)據(jù)標(biāo)簽。對于沒有可定義數(shù)據(jù)點的數(shù)據(jù)系列(例如面積圖數(shù)據(jù)系列),DataLabels 集合包含單個數(shù)據(jù)標(biāo)簽。

Datalabels 集合用法

使用 DataLabels 方法可返回 DataLabels 集合。下例設(shè)置圖表上第一個數(shù)據(jù)系列中的數(shù)據(jù)標(biāo)簽的數(shù)字格式。

With myChart.SeriesCollection(1)

    .HasDataLabels = True

    .DataLabels.NumberFormat = "##.##"

End With

使用 DataLabels(index)(其中 index 為數(shù)據(jù)標(biāo)簽的索引號)可返回單個 DataLabel 對象。下例設(shè)置圖表上第一個數(shù)據(jù)系列中的第五個數(shù)據(jù)標(biāo)簽的數(shù)字格式。

myChart.SeriesCollection(1).DataLabels(5).NumberFormat = "0.000"