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 <Double>] -Chart <ExcelChart> [-DisplayEquation] [-DisplayRSquared] [-Forward <Double>] [-Intercept <Double>] [-LineColor <String>] [-LineWidthPoints <Double>] [-Order <Int32>] [-Period <Int32>] -SeriesIndex <Int32> -Type <String> [<CommonParameters>]#Parameter set:
IndexParameters
- 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 in hex format.
- LineWidthPoints Double
- Trendline line width in points.
- Order Int32
- Polynomial order.
- Period Int32
- Moving-average period.
- SeriesIndex Int32
- Zero-based series index.
- Type String
- Trendline type.
Outputs
OfficeIMO.Excel.ExcelChart
Set-OfficeExcelChartTrendline [-Backward <Double>] -Chart <ExcelChart> [-DisplayEquation] [-DisplayRSquared] [-Forward <Double>] [-IgnoreCase <Boolean>] [-Intercept <Double>] [-LineColor <String>] [-LineWidthPoints <Double>] [-Order <Int32>] [-Period <Int32>] -SeriesName <String> -Type <String> [<CommonParameters>]#Parameter set:
NameParameters
- 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.
- IgnoreCase Boolean
- Ignore case when matching series name.
- Intercept Double
- Trendline intercept.
- LineColor String
- Trendline line color in hex format.
- LineWidthPoints Double
- Trendline line width in points.
- Order Int32
- Polynomial order.
- Period Int32
- Moving-average period.
- SeriesName String
- Series name.
- Type String
- Trendline type.
Outputs
OfficeIMO.Excel.ExcelChart