Cmdlet
Set-OfficeExcelChartSeries
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:
IndexSet-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:
NameExamples
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
- Chart to update.
- -FillColor OfficeColor
- Series fill color. Named colors and hexadecimal values are accepted.
- -Index Int32
- One-based index identifying the target item.
- -LineColor OfficeColor
- Series line color. Named colors and hexadecimal values are accepted.
- -LineWidth OfficeLength
- Physical line width; numbers are interpreted as points.
- -MarkerFillColor OfficeColor
- Marker fill color. Named colors and hexadecimal values are accepted.
- -MarkerLineColor OfficeColor
- Marker line color. Named colors and hexadecimal values are accepted.
- -MarkerLineWidth OfficeLength
- Physical width of the marker outline; omission preserves the existing width.
- -MarkerSize Int32
- Marker size.
- -MarkerStyle OfficeChartMarkerShape
- Marker style name.
- Possible values:
Auto,Circle,Dash,Diamond,Dot,Picture,Plus,Square,Star,Triangle,X - -PassThru SwitchParameter
- Emits the native result after the operation.
- -Point UInt32
- One-based point index within the selected chart series.
- -CaseSensitive SwitchParameter
- Matches names and text using ordinal case sensitivity. Omission ignores case.
- -Name String
- 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.