TrendLine object
Returns the calculated goodness of fit (R-squared) value for the selected z layer (1 by default).
Expression.GetRSquared([optional] Number z)
This example shows how to return the goodness of fit value from trend lines 2, and write it to the Console window:
Console.Write(ActiveDocument.Sections["Chart6"].TrendLines[2].GetRSquared())