Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficeExcelReportChart

Aliases: ExcelReportChart
Module
PSWriteOffice
Aliases
ExcelReportChart
Inputs
None

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: Default

Examples

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 optional
Category column; defaults to the first table column.
-Height OfficeLength optional
Chart height; defaults to 360 pixels. Bare numbers mean points.
-PassThru SwitchParameter optional
Emits the native result after the operation.
-Preset ExcelDashboardChartPreset optional
Dashboard appearance preset from the native Excel chart owner.
Possible values: Comparison, Trend, Contribution, CompactComparison
-Table String optional
Native Excel table used to resolve the source range or header.
-Title String optional
Chart title.
-Type OfficeChartType optional
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[] optional
Value or values consumed by the selected operation.
-Width OfficeLength optional
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.