Cmdlet
Set-OfficeExcelChartTrendline
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:
IndexSet-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:
NameExamples
Add a polynomial trendline.
$chart | Set-OfficeExcelChartTrendline -SeriesIndex 0 -Type Polynomial -Order 2 -DisplayEquation -DisplayRSquaredAdds a polynomial trendline to the first series.
Parameters
- -Backward Double
- Backward forecast units.
- -Chart ExcelChart
- Chart to update.
- -DisplayEquation SwitchParameter
- Display the trendline equation.
- -DisplayRSquared SwitchParameter
- Display the R-squared value.
- -Forward Double
- Forward forecast units.
- -Intercept Double
- Trendline intercept.
- -LineColor String
- Trendline line color. Named colors and hexadecimal values are accepted.
- -LineWidthPoints Double
- Trendline line width in points.
- -Order Int32
- Polynomial order.
- -PassThru SwitchParameter
- Emit the object created or changed by the command.
- -Period Int32
- Moving-average period.
- -SeriesIndex Int32
- Zero-based series index.
- -Type OfficeChartTrendlineType
- Trendline type.
- Possible values:
Exponential,Linear,Logarithmic,MovingAverage,Polynomial,Power - -IgnoreCase Boolean
- Ignore case when matching series name.
- -SeriesName String
- 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.