Cmdlet
Add-OfficeExcelChart
Adds a chart to the current worksheet using a range or table.
Syntax
Add-OfficeExcelChart
-Column <Int32>
[-HasHeaders <Boolean>]
[-HeightPixels <Int32>]
[-IncludeCachedData <Boolean>]
[-PassThru]
[-Range] <String>
-Row <Int32>
[-Title <String>]
[-Type <ExcelChartType>]
[-WidthPixels <Int32>]
[<CommonParameters>]#Parameter set:
ContextRangeAdd-OfficeExcelChart
-Column <Int32>
-Document <ExcelDocument>
[-HasHeaders <Boolean>]
[-HeightPixels <Int32>]
[-IncludeCachedData <Boolean>]
[-PassThru]
[-Range] <String>
-Row <Int32>
[-Sheet <String>]
[-SheetIndex <Int32>]
[-Title <String>]
[-Type <ExcelChartType>]
[-WidthPixels <Int32>]
[<CommonParameters>]#Parameter set:
DocumentRangeAdd-OfficeExcelChart
-Column <Int32>
-Document <ExcelDocument>
[-HeightPixels <Int32>]
[-IncludeCachedData <Boolean>]
[-PassThru]
-Row <Int32>
[-Sheet <String>]
[-SheetIndex <Int32>]
[-TableName] <String>
[-Title <String>]
[-Type <ExcelChartType>]
[-WidthPixels <Int32>]
[<CommonParameters>]#Parameter set:
DocumentTableAdd-OfficeExcelChart
-Column <Int32>
[-HeightPixels <Int32>]
[-IncludeCachedData <Boolean>]
[-PassThru]
-Row <Int32>
[-TableName] <String>
[-Title <String>]
[-Type <ExcelChartType>]
[-WidthPixels <Int32>]
[<CommonParameters>]#Parameter set:
ContextTableExamples
Add a chart from a range.
ExcelSheet 'Data' { Add-OfficeExcelChart -Range 'A1:D10' -Row 2 -Column 6 -Type Line -Title 'Trend' }Creates a line chart from A1:D10 and places it at F2.
Add a chart from a table.
ExcelSheet 'Data' { Add-OfficeExcelChart -TableName 'Sales' -Row 2 -Column 6 -Type ColumnClustered }Creates a chart from the Sales table.
Parameters
- -Column Int32
- Top-left column (1-based) where the chart should be placed.
- -HasHeaders Boolean
- Whether the range includes headers.
- -HeightPixels Int32
- Chart height in pixels.
- -IncludeCachedData Boolean
- Include cached data in the chart for portability.
- -PassThru SwitchParameter
- Emit the created chart.
- -Range String
- A1 range containing chart data.
- -Row Int32
- Top-left row (1-based) where the chart should be placed.
- -Title String
- Chart title.
- -Type ExcelChartType
- Chart type.
- Possible values:
ColumnClustered,ColumnStacked,ColumnStacked100,Column3DClustered,Column3DStacked,Column3DStacked100,BarClustered,BarStacked,BarStacked100,Bar3DClustered,Bar3DStacked,Bar3DStacked100,Line,LineStacked,LineStacked100,Line3D,Area,AreaStacked,AreaStacked100,Area3D,Area3DStacked,Area3DStacked100,Pie,Pie3D,PieOfPie,BarOfPie,Doughnut,Scatter,Bubble,Radar,Stock,Surface,SurfaceWireframe,SurfaceContour,SurfaceContourWireframe - -WidthPixels Int32
- Chart width in pixels.
- -Document ExcelDocument
- Workbook to operate on outside the DSL context.
- -Sheet String
- Worksheet name when using Document.
- -SheetIndex Int32
- Worksheet index (0-based) when using Document.
- -TableName String
- Table name containing chart data.
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.