Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficeExcelChartSeries

Aliases: ExcelChartSeries
Module
PSWriteOffice
Aliases
ExcelChartSeries
Inputs
OfficeIMO.Excel.ExcelChart

Styles a chart series or one of its data points.

Syntax

Set-OfficeExcelChartSeries
[-Chart] <ExcelChart>
[-FillColor <OfficeColor>]
-Index <Int32>
[-LineColor <OfficeColor>]
[-LineWidth <OfficeLength>]
[-MarkerFillColor <OfficeColor>]
[-MarkerLineColor <OfficeColor>]
[-MarkerLineWidth <OfficeLength>]
[-MarkerSize <Int32>]
[-MarkerStyle <OfficeChartMarkerShape>]
[-PassThru]
[-Point <UInt32>]
[<CommonParameters>]
#
Parameter set: Index
Set-OfficeExcelChartSeries
[-CaseSensitive]
[-Chart] <ExcelChart>
[-FillColor <OfficeColor>]
[-LineColor <OfficeColor>]
[-LineWidth <OfficeLength>]
[-MarkerFillColor <OfficeColor>]
[-MarkerLineColor <OfficeColor>]
[-MarkerLineWidth <OfficeLength>]
[-MarkerSize <Int32>]
[-MarkerStyle <OfficeChartMarkerShape>]
-Name <String>
[-PassThru]
[-Point <UInt32>]
[<CommonParameters>]
#
Parameter set: Name

Examples

Colour a series

New-OfficeExcel -Path .\Reports\Helpdesk-Trend.xlsx {
    ExcelSheet 'Trend' {
        ExcelChart -InputObject (Import-OfficeCsv -Path .\Data\Ticket-Trend.csv) -Category Week -Value Opened, Closed -Type Line -Address A1 -PassThru | ExcelChartSeries -Index 2 -LineColor Success
    }
}

Draws the second series, Closed, in the theme's success colour.

Highlight one bar

New-OfficeExcel -Path .\Reports\Regions.xlsx {
    ExcelSheet 'Summary' {
        $chart = ExcelChart -InputObject (Import-OfficeCsv -Path .\Data\Region-Revenue.csv) -Category Region -Value Revenue -Address A1 -Type Column -PassThru
        ExcelChartSeries -Chart $chart -Name Revenue -Point 3 -FillColor Danger
    }
}

Colours the bar of the region that missed its target in the danger colour and leaves the others on the theme palette.

Parameters

-Chart ExcelChart requiredposition: 0pipeline: True (ByValue)
Chart to update.
-FillColor OfficeColor optional
Series fill color. Named colors and hexadecimal values are accepted.
-Index Int32 requiredsets: Index
One-based index identifying the target item.
-LineColor OfficeColor optional
Series line color. Named colors and hexadecimal values are accepted.
-LineWidth OfficeLength optional
Physical line width; numbers are interpreted as points.
-MarkerFillColor OfficeColor optional
Marker fill color. Named colors and hexadecimal values are accepted.
-MarkerLineColor OfficeColor optional
Marker line color. Named colors and hexadecimal values are accepted.
-MarkerLineWidth OfficeLength optional
Physical width of the marker outline; omission preserves the existing width.
-MarkerSize Int32 optional
Marker size.
-MarkerStyle OfficeChartMarkerShape optional
Marker style name.
Possible values: Auto, Circle, Dash, Diamond, Dot, Picture, Plus, Square, Star, Triangle, X
-PassThru SwitchParameter optional
Emits the native result after the operation.
-Point UInt32 optional
One-based point index within the selected chart series.
-CaseSensitive SwitchParameter optionalsets: Name
Matches names and text using ordinal case sensitivity. Omission ignores case.
-Name String requiredsets: Name
Named range name.

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.