IsDisplayingRSquared Property

Microsoft Office Web Components Visual Basic

True if the R-squared value for the trendline for the specified series is displayed on the chart (in the same data label as the equation). Setting this property to True automatically turns on data labels. The default value is True. Read/write Boolean.

expression.IsDisplayingRSquared

expression    Required. An expression that returns a ChTrendline object.

Example

This example adds a trendline to the specified series. Only the trendline equation is displayed.

Sub AddTrendLine()
    Dim trndline
    
    ' Add a trendline to the first series in the first chart in ChartSpace1.
    Set trndline = ChartSpace1.Charts(0).SeriesCollection(0).Trendlines.Add
    
    ' Set the font of the trendline to bold.
    trndline.DataLabel.Font.Bold = True
    
    ' Do not display the R-Squared value with the trendline.
    trndline.IsDisplayingRSquared = False
    
    ' Display the equation for the trendline.
    trndline.IsDisplayingEquation = True
End Sub