Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Set-OfficeExcelChartDataLabels

Module
PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelChart
Outputs
OfficeIMO.Excel.ExcelChart

Configures data labels and optional styling for an Excel chart.

Syntax

Set-OfficeExcelChartDataLabels
[-Bold <Boolean>]
-Chart <ExcelChart>
[-Color <String>]
[-FillColor <String>]
[-FontName <String>]
[-FontSizePoints <Double>]
[-Italic <Boolean>]
[-LineColor <String>]
[-LineWidthPoints <Double>]
[-NoFill]
[-NoLine]
[-NumberFormat <String>]
[-PassThru]
[-Position <OfficeChartDataLabelPosition>]
[-ShowCategoryName <Boolean>]
[-ShowLegendKey <Boolean>]
[-ShowPercent <Boolean>]
[-ShowSeriesName <Boolean>]
[-ShowValue <Boolean>]
[-SourceLinked <Boolean>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Add outside-end value labels.

$chart | Set-OfficeExcelChartDataLabels -ShowValue $true -Position OutsideEnd

Adds value labels to the chart and returns the chart for further formatting.

Parameters

-Bold Boolean optional
Optional bold setting for label text.
-Chart ExcelChart requiredpipeline: True (ByValue)
Chart to update.
-Color String optional
Optional label text color. Named colors and hexadecimal values are accepted.
-FillColor String optional
Optional label fill color. Named colors and hexadecimal values are accepted.
-FontName String optional
Optional label font name.
-FontSizePoints Double optional
Optional label font size in points.
-Italic Boolean optional
Optional italic setting for label text.
-LineColor String optional
Optional label line color. Named colors and hexadecimal values are accepted.
-LineWidthPoints Double optional
Optional label border width in points.
-NoFill SwitchParameter optional
Remove label fill.
-NoLine SwitchParameter optional
Remove label border.
-NumberFormat String optional
Optional number format code.
-PassThru SwitchParameter optional
Emit the object created or changed by the command.
-Position OfficeChartDataLabelPosition optional
Optional data label position.
Possible values: BestFit, Bottom, Center, InsideBase, InsideEnd, Left, OutsideEnd, Right, Top
-ShowCategoryName Boolean optional
Show category names in labels.
-ShowLegendKey Boolean optional
Show legend keys in labels.
-ShowPercent Boolean optional
Show percentages in labels.
-ShowSeriesName Boolean optional
Show series names in labels.
-ShowValue Boolean optional
Show values in labels.
-SourceLinked Boolean optional
Keep number formatting linked to the source cells.

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.