Cmdlet
Add-OfficeExcelReportChart
Adds a chart of a report table, using a dashboard preset or chart type.
Syntax
Add-OfficeExcelReportChart
[-Category <String>]
[-Height <OfficeLength>]
[-PassThru]
[-Preset <Comparison| Trend| Contribution| CompactComparison>]
[-Table <String>]
[-Title <String>]
[-Type <OfficeChartType>]
[-Value <String[]>]
[-Width <OfficeLength>]
[<CommonParameters>]#Parameter set:
DefaultExamples
Chart the table above
New-OfficeExcel -Path .\Reports\Regions.xlsx {
ExcelReportSheet 'Summary' {
ExcelReportTable (Import-OfficeCsv -Path .\Data\Region-Revenue.csv) 'Revenue by region'
ExcelReportChart -Category Region -Value Revenue
}
}Charts the previous report table and places the chart beside it.
Show a trend with a dashboard preset
New-OfficeExcel -Path .\Reports\Helpdesk-Review.xlsx {
ExcelReportSheet 'Trend' {
ExcelReportTitle 'Helpdesk trend' 'Last 12 weeks'
ExcelReportTable (Import-OfficeCsv -Path .\Data\Ticket-Trend.csv) 'Tickets per week'
ExcelReportChart -Preset Trend -Category Week -Value Opened, Closed -Title 'Opened and closed tickets'
}
}Adds a weekly ticket table and charts opened against closed tickets with the trend preset.
Parameters
- -Category String
- Category column; defaults to the first table column.
- -Height OfficeLength
- Chart height; defaults to 360 pixels. Bare numbers mean points.
- -PassThru SwitchParameter
- Emits the native result after the operation.
- -Preset ExcelDashboardChartPreset
- Dashboard appearance preset from the native Excel chart owner.
- Possible values:
Comparison,Trend,Contribution,CompactComparison - -Table String
- Native Excel table used to resolve the source range or header.
- -Title String
- Chart title.
- -Type OfficeChartType
- Shared chart family. Bubble requires the separate native bubble-data contract.
- Possible values:
ColumnClustered,Column,ColumnStacked,ColumnStacked100,BarClustered,Bar,BarStacked,BarStacked100,Line,LineStacked,LineStacked100,Area,AreaStacked,AreaStacked100,Scatter,Radar,Pie,Doughnut,Bubble,Column3DClustered,Column3DStacked,Column3DStacked100,Bar3DClustered,Bar3DStacked,Bar3DStacked100,Line3D,Area3D,Area3DStacked,Area3DStacked100,Pie3D,PieOfPie,BarOfPie,Stock,Surface,SurfaceWireframe,SurfaceContour,Funnel,Waterfall,BoxWhisker,Treemap,SurfaceContourWireframe,Sunburst - -Value String[]
- Value or values consumed by the selected operation.
- -Width OfficeLength
- Chart width; defaults to 640 pixels. Bare numbers mean points.
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.