Cmdlet
Set-OfficeExcelChart
Applies a built-in style and color preset to a chart.
Syntax
Set-OfficeExcelChart
[-Chart] <ExcelChart>
[-ColorStyle <Int32>]
[-PassThru]
[-Style <Int32>]
[<CommonParameters>]#Parameter set:
DefaultExamples
Apply a chart style
New-OfficeExcel -Path .\Reports\Regions.xlsx {
ExcelSheet 'Summary' {
ExcelTable (Import-OfficeCsv -Path .\Data\Region-Revenue.csv) -Name RegionSummary
ExcelChart -Table RegionSummary -Address F2 -Type Column -PassThru | Set-OfficeExcelChart -Style 3
}
}Applies built-in chart style 3 to a chart returned by ExcelChart.
Give a dashboard chart a monochrome palette
New-OfficeExcel -Path .\Reports\Operations.xlsx {
ExcelSheet 'Dashboard' {
$chart = ExcelChart -InputObject (Import-OfficeCsv -Path .\Data\Site-Uptime.csv) -Category Site -Value Uptime -Address A1 -Type Column -PassThru
Set-OfficeExcelChart -Chart $chart -Style 6 -ColorStyle 14
}
}Uses a built-in style and colour preset for a chart that sits on a branded dashboard.
Parameters
- -Chart ExcelChart
- Chart to update.
- -ColorStyle Int32
- Built-in chart color-style identifier.
- -PassThru SwitchParameter
- Emits the native result after the operation.
- -Style Int32
- Built-in chart style identifier.
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.