Trendlines Property

Microsoft Office Web Components Visual Basic

collection for the specified series. Note that a series can have only one trendline.

expression.Trendlines

expression    Required. An expression that returns a ChSeries object.

Remarks

For information about returning a single member of a collection, see Returning an Object from a Collection .

Example

This example adds a trendline to the specified series and then hides the trendline’s R-squared value.

Sub AddTrendline()

   Dim serSeries1

   ' Set a variable to the first series in the first chart of Chartspace1.
   Set serSeries1 = ChartSpace1.Charts(0).SeriesCollection(0)

   ' Add a trendline to the series.
   serSeries1.Trendlines.Add

   ' Hide the R Squared value for the trendline.
   serSeries1.Trendlines(0).IsDisplayingRSquared = False

End Sub