다음을 통해 공유


Trendlines.Add Method

Creates a new trendline.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
Function Add ( _
    Type As XlTrendlineType, _
    Order As Object, _
    Period As Object, _
    Forward As Object, _
    Backward As Object, _
    Intercept As Object, _
    DisplayEquation As Object, _
    DisplayRSquared As Object, _
    Name As Object _
) As Trendline
'Usage
Dim instance As Trendlines
Dim Type As XlTrendlineType
Dim Order As Object
Dim Period As Object
Dim Forward As Object
Dim Backward As Object
Dim Intercept As Object
Dim DisplayEquation As Object
Dim DisplayRSquared As Object
Dim Name As Object
Dim returnValue As Trendline

returnValue = instance.Add(Type, Order, _
    Period, Forward, Backward, Intercept, _
    DisplayEquation, DisplayRSquared, _
    Name)
Trendline Add(
    XlTrendlineType Type,
    Object Order,
    Object Period,
    Object Forward,
    Object Backward,
    Object Intercept,
    Object DisplayEquation,
    Object DisplayRSquared,
    Object Name
)

Parameters

  • Order
    Type: System.Object
    The trendline order. Required if Type is set to xlPolynomial. If specified, the value must be an integer from 2 through 6.
  • Period
    Type: System.Object
    The trendline period. Required if Type is set to xlMovingAvg. If specified, the value must be an integer greater than 1 and less than the number of data points in the series to which you are adding a trendline.
  • Forward
    Type: System.Object
    The number of periods (or units on a scatter chart) that the trendline extends forward.
  • Backward
    Type: System.Object
    The number of periods (or units on a scatter chart) that the trendline extends backward.
  • Intercept
    Type: System.Object
    The trendline intercept. If specified, the value must be a double-precision floating-point number. If omitted, the intercept is automatically set by the regression, and the InterceptIsAuto property of the resulting Trendline object is set to true.
    Note: This parameter is applicable only if Type is set to xlExponential, xlLinear, or xlPolynomial.
  • DisplayEquation
    Type: System.Object
    true to display the equation of the trendline on the chart (in the same data label as the R-squared value). The default is false.
  • DisplayRSquared
    Type: System.Object
    true to display the R-squared value of the trendline on the chart (in the same data label as the equation). The default is false.
  • Name
    Type: System.Object
    The name of the trendline. If omitted, Microsoft PowerPoint generates a name, and the NameIsAuto property of the resulting Trendline object is set to true.

Return Value

Type: Microsoft.Office.Interop.PowerPoint.Trendline

See Also

Reference

Trendlines Interface

Trendlines Members

Microsoft.Office.Interop.PowerPoint Namespace