OfficeIMO

API Reference

Command

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

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 <Nullable`1>] -Chart <ExcelChart> [-Color <String>] [-FontName <String>] [-FontSizePoints <Nullable`1>] [-Hide] [-Italic <Nullable`1>] [-Overlay <Boolean>] [-Position <Bottom|Left|Right|Top|TopRight>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Bold Nullable`1 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 in hex format.
FontName String optionalposition: namedpipeline: False
Optional legend font name.
FontSizePoints Nullable`1 optionalposition: namedpipeline: False
Optional legend font size in points.
Hide SwitchParameter optionalposition: namedpipeline: False
Hide the legend instead of positioning it.
Italic Nullable`1 optionalposition: namedpipeline: False
Optional italic setting for legend text.
Overlay Boolean optionalposition: namedpipeline: False
Overlay the legend on the chart area.
Position String optionalposition: namedpipeline: Falsevalues: 5
Legend position.
Possible values: Bottom, Left, Right, Top, TopRight

Outputs

OfficeIMO.Excel.ExcelChart