OfficeIMO

API Reference

Command

Add-OfficeExcelChart

Namespace PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Object

Adds a chart to the current worksheet using a range or table.

Remarks

Adds a chart to the current worksheet using a range or table.

Examples

Add a chart from a range.


PS>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.


PS>ExcelSheet 'Data' { Add-OfficeExcelChart -TableName 'Sales' -Row 2 -Column 6 -Type ColumnClustered }
        

Creates a chart from the Sales table.

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

Add-OfficeExcelChart -Column <Int32> [-HasHeaders <Boolean>] [-HeightPixels <Int32>] [-IncludeCachedData <Boolean>] [-PassThru] -Range <String> -Row <Int32> [-Title <String>] [-Type <ColumnClustered>] [-WidthPixels <Int32>] [<CommonParameters>]
#
Parameter set: ContextRange

Parameters

Column Int32 requiredposition: namedpipeline: False
Top-left column (1-based) where the chart should be placed.
HasHeaders Boolean optionalposition: namedpipeline: False
Whether the range includes headers.
HeightPixels Int32 optionalposition: namedpipeline: False
Chart height in pixels.
IncludeCachedData Boolean optionalposition: namedpipeline: False
Include cached data in the chart for portability.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the created chart.
Range String requiredposition: 0pipeline: False
A1 range containing chart data.
Row Int32 requiredposition: namedpipeline: False
Top-left row (1-based) where the chart should be placed.
Title String optionalposition: namedpipeline: False
Chart title.
Type ExcelChartType optionalposition: namedpipeline: Falsevalues: 10
Chart type.
Possible values: ColumnClustered, ColumnStacked, BarClustered, BarStacked, Line, Area, Pie, Doughnut, Scatter, Bubble
WidthPixels Int32 optionalposition: namedpipeline: False
Chart width in pixels.

Outputs

System.Object

Add-OfficeExcelChart -Column <Int32> -Document <ExcelDocument> [-HasHeaders <Boolean>] [-HeightPixels <Int32>] [-IncludeCachedData <Boolean>] [-PassThru] -Range <String> -Row <Int32> [-Sheet <String>] [-SheetIndex <Nullable`1>] [-Title <String>] [-Type <ColumnClustered>] [-WidthPixels <Int32>] [<CommonParameters>]
#
Parameter set: DocumentRange

Parameters

Column Int32 requiredposition: namedpipeline: False
Top-left column (1-based) where the chart should be placed.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
HasHeaders Boolean optionalposition: namedpipeline: False
Whether the range includes headers.
HeightPixels Int32 optionalposition: namedpipeline: False
Chart height in pixels.
IncludeCachedData Boolean optionalposition: namedpipeline: False
Include cached data in the chart for portability.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the created chart.
Range String requiredposition: 0pipeline: False
A1 range containing chart data.
Row Int32 requiredposition: namedpipeline: False
Top-left row (1-based) where the chart should be placed.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using Document.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using Document.
Title String optionalposition: namedpipeline: False
Chart title.
Type ExcelChartType optionalposition: namedpipeline: Falsevalues: 10
Chart type.
Possible values: ColumnClustered, ColumnStacked, BarClustered, BarStacked, Line, Area, Pie, Doughnut, Scatter, Bubble
WidthPixels Int32 optionalposition: namedpipeline: False
Chart width in pixels.

Outputs

System.Object

Add-OfficeExcelChart -Column <Int32> -Document <ExcelDocument> [-HeightPixels <Int32>] [-IncludeCachedData <Boolean>] [-PassThru] -Row <Int32> [-Sheet <String>] [-SheetIndex <Nullable`1>] -TableName <String> [-Title <String>] [-Type <ColumnClustered>] [-WidthPixels <Int32>] [<CommonParameters>]
#
Parameter set: DocumentTable

Parameters

Column Int32 requiredposition: namedpipeline: False
Top-left column (1-based) where the chart should be placed.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
HeightPixels Int32 optionalposition: namedpipeline: False
Chart height in pixels.
IncludeCachedData Boolean optionalposition: namedpipeline: False
Include cached data in the chart for portability.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the created chart.
Row Int32 requiredposition: namedpipeline: False
Top-left row (1-based) where the chart should be placed.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using Document.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using Document.
TableName String requiredposition: 0pipeline: False
Table name containing chart data.
Title String optionalposition: namedpipeline: False
Chart title.
Type ExcelChartType optionalposition: namedpipeline: Falsevalues: 10
Chart type.
Possible values: ColumnClustered, ColumnStacked, BarClustered, BarStacked, Line, Area, Pie, Doughnut, Scatter, Bubble
WidthPixels Int32 optionalposition: namedpipeline: False
Chart width in pixels.

Outputs

System.Object

Add-OfficeExcelChart -Column <Int32> [-HeightPixels <Int32>] [-IncludeCachedData <Boolean>] [-PassThru] -Row <Int32> -TableName <String> [-Title <String>] [-Type <ColumnClustered>] [-WidthPixels <Int32>] [<CommonParameters>]
#
Parameter set: ContextTable

Parameters

Column Int32 requiredposition: namedpipeline: False
Top-left column (1-based) where the chart should be placed.
HeightPixels Int32 optionalposition: namedpipeline: False
Chart height in pixels.
IncludeCachedData Boolean optionalposition: namedpipeline: False
Include cached data in the chart for portability.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the created chart.
Row Int32 requiredposition: namedpipeline: False
Top-left row (1-based) where the chart should be placed.
TableName String requiredposition: 0pipeline: False
Table name containing chart data.
Title String optionalposition: namedpipeline: False
Chart title.
Type ExcelChartType optionalposition: namedpipeline: Falsevalues: 10
Chart type.
Possible values: ColumnClustered, ColumnStacked, BarClustered, BarStacked, Line, Area, Pie, Doughnut, Scatter, Bubble
WidthPixels Int32 optionalposition: namedpipeline: False
Chart width in pixels.

Outputs

System.Object