Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Set-OfficeExcelChartLegend

Namespace PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelChart
Outputs
OfficeIMO.Excel.ExcelChart

Configures legend visibility and styling for an Excel chart.

Remarks

Configures legend visibility and styling for an Excel chart.

Examples

Authored help example

Move the legend to the right.

PS>


$chart | Set-OfficeExcelChartLegend -Position Right
        

Shows the legend on the right side of the chart and returns the chart for chaining.

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

Set-OfficeExcelChartLegend [-Bold <Boolean>] -Chart <ExcelChart> [-Color <String>] [-FontName <String>] [-FontSizePoints <Double>] [-Hide] [-Italic <Boolean>] [-Overlay <Boolean>] [-PassThru] [-Position <Bottom|TopRight|Left|Right|Top>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Bold Boolean optionalposition: namedpipeline: False
Optional bold setting for legend text.
Chart ExcelChart requiredposition: namedpipeline: True (ByValue)
Chart to update.
Color String optionalposition: namedpipeline: False
Optional legend text color. Named colors and hexadecimal values are accepted.
FontName String optionalposition: namedpipeline: False
Optional legend font name.
FontSizePoints Double optionalposition: namedpipeline: False
Optional legend font size in points.
Hide SwitchParameter optionalposition: namedpipeline: False
Hide the legend instead of positioning it.
Italic Boolean optionalposition: namedpipeline: False
Optional italic setting for legend text.
Overlay Boolean optionalposition: namedpipeline: False
Overlay the legend on the chart area.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
Position OfficeChartLegendPosition optionalposition: namedpipeline: Falsevalues: 5
Legend position.
Possible values: Bottom, TopRight, Left, Right, Top

Outputs

OfficeIMO.Excel.ExcelChart