Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficeExcelChartTrendline

Aliases: ExcelChartTrendline
Module PSWriteOffice
Aliases
ExcelChartTrendline
Inputs
OfficeIMO.Excel.ExcelChart
Outputs
OfficeIMO.Excel.ExcelChart

Adds or replaces an Excel chart series trendline.

Syntax

Set-OfficeExcelChartTrendline [-Backward <Double>] -Chart <ExcelChart> [-DisplayEquation] [-DisplayRSquared] [-Forward <Double>] [-Intercept <Double>] [-LineColor <String>] [-LineWidthPoints <Double>] [-Order <Int32>] [-PassThru] [-Period <Int32>] -SeriesIndex <Int32> -Type <OfficeChartTrendlineType> [<CommonParameters>]
#
Parameter set: Index
Set-OfficeExcelChartTrendline [-Backward <Double>] -Chart <ExcelChart> [-DisplayEquation] [-DisplayRSquared] [-Forward <Double>] [-IgnoreCase <Boolean>] [-Intercept <Double>] [-LineColor <String>] [-LineWidthPoints <Double>] [-Order <Int32>] [-PassThru] [-Period <Int32>] -SeriesName <String> -Type <OfficeChartTrendlineType> [<CommonParameters>]
#
Parameter set: Name

Examples

Authored help example

Add a polynomial trendline.

$chart | Set-OfficeExcelChartTrendline -SeriesIndex 0 -Type Polynomial -Order 2 -DisplayEquation -DisplayRSquared

Adds a polynomial trendline to the first series.

Parameters

-Backward Double optional
Backward forecast units.
-Chart ExcelChart requiredpipeline: True (ByValue)
Chart to update.
-DisplayEquation SwitchParameter optional
Display the trendline equation.
-DisplayRSquared SwitchParameter optional
Display the R-squared value.
-Forward Double optional
Forward forecast units.
-Intercept Double optional
Trendline intercept.
-LineColor String optional
Trendline line color. Named colors and hexadecimal values are accepted.
-LineWidthPoints Double optional
Trendline line width in points.
-Order Int32 optional
Polynomial order.
-PassThru SwitchParameter optional
Emit the object created or changed by the command.
-Period Int32 optional
Moving-average period.
-SeriesIndex Int32 requiredsets: Index
Zero-based series index.
-Type OfficeChartTrendlineType required
Trendline type.
Possible values: Exponential, Linear, Logarithmic, MovingAverage, Polynomial, Power
-IgnoreCase Boolean optionalsets: Name
Ignore case when matching series name.
-SeriesName String requiredsets: Name
Series name.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.