DataLabels 集合對(duì)象

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

Chart

parchildSeriesCollection (Series)

spaceparmultDataLabels (DataLabel)

spaceparmultPoints (Point)

spaceparlowerparchildDataLabel

spaceparchildTrendlines (Trendline)

spacespaceparchildDataLabel

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

Datalabels 集合用法

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

With myChart.SeriesCollection(1)

    .HasDataLabels = True

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

End With

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

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