Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

Stars 1,019
Forks 115
Open issues 54
PowerShell Gallery downloads 7,576,901
Release v1.41.0
Language: PowerShell Updated: 2026-10-03
Command

New-ChartBarOptions

Module PSWriteHTML

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>]
#
Parameter set: All Parameter Sets

Description

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

Authored help example

EXAMPLE 1

New-ChartBarOptions -Type 'barStacked' -DataLabelsEnabled $true -DataLabelsOffsetX -6 -DataLabelsFontSize '12px' -DataLabelsColor 'black' -Patterned -Distributed

Creates 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 -Vertical

Creates options for a regular bar chart with data labels disabled, gradient colors, and vertical bars.

Parameters

-DataLabelsColor String optionalposition: 4
The color of the data labels.
-DataLabelsEnabled Boolean optionalposition: 1
Indicates whether data labels are enabled. Default is $true.
-DataLabelsFontSize String optionalposition: 3
The font size of the data labels. Default is '12px'.
-DataLabelsOffsetX Int32 optionalposition: 2
The horizontal offset of the data labels. Default is -6.
-Distributed SwitchParameter optional
Indicates whether the bars are distributed.
-Gradient SwitchParameter optionalaliases: GradientColors
Indicates whether gradient colors are used.
-Patterned SwitchParameter optionalaliases: PatternedColors
Indicates whether patterned colors are used.
-Type Object optionalposition: 0
The type of the bar chart. Accepted values are 'bar', 'barStacked', 'barStacked100Percent'. Default is 'bar'.
Possible values: bar, barStacked, barStacked100Percent
-Vertical SwitchParameter optional
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.