API Reference
Cmdlet
Set-OfficeExcelChartTrendline
Adds or replaces an Excel chart series trendline.
Remarks
Adds or replaces an Excel chart series trendline.
Examples
Add a polynomial trendline.
PS>
$chart | Set-OfficeExcelChartTrendline -SeriesIndex 0 -Type Polynomial -Order 2 -DisplayEquation -DisplayRSquared
Adds a polynomial trendline to the first series.
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.
Syntax
Set-OfficeExcelChartTrendline [-Backward <Nullable`1>] -Chart <ExcelChart> [-DisplayEquation] [-DisplayRSquared] [-Forward <Nullable`1>] [-Intercept <Nullable`1>] [-LineColor <String>] [-LineWidthPoints <Nullable`1>] [-Order <Nullable`1>] [-Period <Nullable`1>] -SeriesIndex <Int32> -Type <String> [<CommonParameters>]#Parameter set:
IndexParameters
- Backward Nullable`1
- Backward forecast units.
- Chart ExcelChart
- Chart to update.
- DisplayEquation SwitchParameter
- Display the trendline equation.
- DisplayRSquared SwitchParameter
- Display the R-squared value.
- Forward Nullable`1
- Forward forecast units.
- Intercept Nullable`1
- Trendline intercept.
- LineColor String
- Trendline line color in hex format.
- LineWidthPoints Nullable`1
- Trendline line width in points.
- Order Nullable`1
- Polynomial order.
- Period Nullable`1
- Moving-average period.
- SeriesIndex Int32
- Zero-based series index.
- Type String
- Trendline type.
Outputs
OfficeIMO.Excel.ExcelChart
Set-OfficeExcelChartTrendline [-Backward <Nullable`1>] -Chart <ExcelChart> [-DisplayEquation] [-DisplayRSquared] [-Forward <Nullable`1>] [-IgnoreCase <Boolean>] [-Intercept <Nullable`1>] [-LineColor <String>] [-LineWidthPoints <Nullable`1>] [-Order <Nullable`1>] [-Period <Nullable`1>] -SeriesName <String> -Type <String> [<CommonParameters>]#Parameter set:
NameParameters
- Backward Nullable`1
- Backward forecast units.
- Chart ExcelChart
- Chart to update.
- DisplayEquation SwitchParameter
- Display the trendline equation.
- DisplayRSquared SwitchParameter
- Display the R-squared value.
- Forward Nullable`1
- Forward forecast units.
- IgnoreCase Boolean
- Ignore case when matching series name.
- Intercept Nullable`1
- Trendline intercept.
- LineColor String
- Trendline line color in hex format.
- LineWidthPoints Nullable`1
- Trendline line width in points.
- Order Nullable`1
- Polynomial order.
- Period Nullable`1
- Moving-average period.
- SeriesName String
- Series name.
- Type String
- Trendline type.
Outputs
OfficeIMO.Excel.ExcelChart