# New-ChartBarOptions

Creates options for a bar chart with customizable parameters.

Project

PSWriteHTML

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

[View on GitHub](https://github.com/EvotecIT/PSWriteHTML) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteHTML/releases/tag/v1.41.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteHTML/1.40.0)

Stars **1,025**

Forks **114**

Open issues 

PowerShell Gallery downloads **7,576,901**

Release **v1.45.0**

Language: PowerShell Updated: 2026-11-19

Command 

**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>]
```

[#](#method-new-chartbaroptions-string-boolean-string-int32-switchparameter-switchparameter-switchparameter-object-switchparameter)

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

### Example 1

```powershell
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

```powershell
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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:A9693D0541D3791EEC56948693963316FEDF12AD333019C717FEB6BC05F7CB35 -->
