New-ChartBarOptions
Creates options for a bar chart with customizable parameters.
Syntax
New-ChartBarOptions [[-DataLabelsColor] <String>] [[-DataLabelsEnabled] <Boolean>] [[-DataLabelsFontSize] <String>] [[-DataLabelsOffsetX] <Int32>] [-Distributed] [-Gradient] [-Patterned] [[-Type] <bar|barStacked|barStacked100Percent>] [-Vertical] [<CommonParameters>]#All Parameter SetsDescription
This function creates options for a bar chart with the provided parameters. It allows customization of the bar type, data labels, colors, patterns, gradients, and distribution.
Examples
EXAMPLE 1
New-ChartBarOptions -Type 'barStacked' -DataLabelsEnabled $true -DataLabelsOffsetX -6 -DataLabelsFontSize '12px' -DataLabelsColor 'black' -Patterned -DistributedCreates options for a stacked bar chart with data labels enabled, offset of -6, font size '12px', black data labels, patterned colors, and distributed bars.
EXAMPLE 2
New-ChartBarOptions -Type 'bar' -DataLabelsEnabled $false -Gradient -VerticalCreates options for a regular bar chart with data labels disabled, gradient colors, and vertical bars.
Parameters
- -DataLabelsColor String
- The color of the data labels.
- -DataLabelsEnabled Boolean
- Indicates whether data labels are enabled. Default is $true.
- -DataLabelsFontSize String
- The font size of the data labels. Default is '12px'.
- -DataLabelsOffsetX Int32
- The horizontal offset of the data labels. Default is -6.
- -Distributed SwitchParameter
- Indicates whether the bars are distributed.
- -Gradient SwitchParameter
- Indicates whether gradient colors are used.
- -Patterned SwitchParameter
- Indicates whether patterned colors are used.
- -Type Object
- The type of the bar chart. Accepted values are 'bar', 'barStacked', 'barStacked100Percent'. Default is 'bar'.
- Possible values:
bar,barStacked,barStacked100Percent - -Vertical SwitchParameter
- Indicates whether the bars are vertical.
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.