Cmdlet
Set-OfficeExcelChartLegend
Configures legend visibility and styling for an Excel chart.
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 SetsExamples
Move the legend to the right.
$chart | Set-OfficeExcelChartLegend -Position RightShows the legend on the right side of the chart and returns the chart for chaining.
Parameters
- -Bold Boolean
- Optional bold setting for legend text.
- -Chart ExcelChart
- Chart to update.
- -Color String
- Optional legend text color. Named colors and hexadecimal values are accepted.
- -FontName String
- Optional legend font name.
- -FontSizePoints Double
- Optional legend font size in points.
- -Hide SwitchParameter
- Hide the legend instead of positioning it.
- -Italic Boolean
- Optional italic setting for legend text.
- -Overlay Boolean
- Overlay the legend on the chart area.
- -PassThru SwitchParameter
- Emit the object created or changed by the command.
- -Position OfficeChartLegendPosition
- Legend position.
- Possible values:
Bottom,TopRight,Left,Right,Top
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.