代表指定圖表中的趨勢線。趨勢線顯示數(shù)據(jù)系列中數(shù)據(jù)的趨勢,或者說發(fā)展方向。Trendline 對象是 Trendlines 集合的成員。Trendlines 集合包含單個數(shù)據(jù)系列中所有的 Trendline 對象。
可用 Trendlines(index)(其中 index 為趨勢線編號)返回單個 Trendline 對象。下例更改圖表中第一個數(shù)據(jù)系列的趨勢線類型。 如果該系列沒有趨勢線,本示例將無效。
myChart.SeriesCollection(1).Trendlines(1).Type = xlMovingAvg
趨勢線編號指出趨勢線添加到數(shù)據(jù)系列中的順序。Trendlines(1) 為第一個添加到數(shù)據(jù)系列中的趨勢線,而 Trendlines(Trendlines.Count) 為最后一個。