Project

PSWriteHTML

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

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

New-HTMLChart

Module
PSWriteHTML

Creates a new HTML chart with customizable settings.

Syntax

New-HTMLChart
[[-ChartSettings] <ScriptBlock>]
[-Gradient]
[[-Group] <String>]
[[-Height] <Object>]
[[-Id] <String>]
[-Patterned]
[[-SubTitle] <String>]
[[-SubTitleAlignment] <center|left|right>]
[[-SubTitleColor] <String>]
[[-SubTitleFloating] <Nullable`1>]
[[-SubTitleFontFamily] <String>]
[[-SubTitleFontSize] <Object>]
[[-SubTitleFontWeight] <String>]
[[-SubTitleMargin] <Nullable`1>]
[[-SubTitleOffsetX] <Nullable`1>]
[[-SubTitleOffsetY] <Nullable`1>]
[[-Title] <String>]
[[-TitleAlignment] <center|left|right>]
[[-TitleColor] <String>]
[[-TitleFloating] <Nullable`1>]
[[-TitleFontFamily] <String>]
[[-TitleFontSize] <Object>]
[[-TitleFontWeight] <String>]
[[-TitleMargin] <Nullable`1>]
[[-TitleOffsetX] <Nullable`1>]
[[-TitleOffsetY] <Nullable`1>]
[[-Width] <Object>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

This function creates a new HTML chart with customizable settings such as title, subtitle, dimensions, colors, and more.

Examples

Example 1

New-HTMLChart -Title "Sales Data" -ChartSettings {
    // Chart configuration settings here
}

Creates a new HTML chart with the title "Sales Data" and custom chart settings.

Example 2

New-HTMLChart -Title "Sales Data" -SubTitle "Quarterly Sales" -Height 400 -Width 600 -Gradient -Id "SalesChart"

Creates a new HTML chart with the title "Sales Data", subtitle "Quarterly Sales", height of 400, width of 600, gradient colors, and specified ID.

Parameters

-ChartSettings ScriptBlock optionalposition: 0
Specifies the settings for the chart. This should be a ScriptBlock containing the chart configuration.
-Gradient SwitchParameter optionalaliases: GradientColors
Indicates whether to use gradient colors in the chart.
-Group String optionalposition: 24
Specifies the group to which the chart belongs.
-Height Object optionalposition: 21
Specifies the height of the chart. Default is 350.
-Id String optionalposition: 23
Specifies the ID of the chart. If not provided, a random ID will be generated.
-Patterned SwitchParameter optionalaliases: PatternedColors
Indicates whether to use patterned colors in the chart.
-SubTitle String optionalposition: 11
Specifies the subtitle of the chart.
-SubTitleAlignment String optionalposition: 12
Specifies the alignment of the chart subtitle. Valid values are 'center', 'left', or 'right'.
Possible values: center, left, right
-SubTitleColor String optionalposition: 20
Specifies the color of the chart subtitle.
-SubTitleFloating Nullable<T> optionalposition: 16
Specifies whether the chart subtitle should float.
-SubTitleFontFamily String optionalposition: 19
Specifies the font family of the chart subtitle.
-SubTitleFontSize Object optionalposition: 17
Specifies the font size of the chart subtitle.
-SubTitleFontWeight String optionalposition: 18
Specifies the font weight of the chart subtitle. Valid values are 'normal', 'bold', 'bolder', 'lighter', or numeric values from '100' to '900'.
Possible values: normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900
-SubTitleMargin Nullable<T> optionalposition: 13
Specifies the margin of the chart subtitle.
-SubTitleOffsetX Nullable<T> optionalposition: 14
Specifies the horizontal offset of the chart subtitle.
-SubTitleOffsetY Nullable<T> optionalposition: 15
Specifies the vertical offset of the chart subtitle.
-Title String optionalposition: 1
Specifies the title of the chart.
-TitleAlignment String optionalposition: 2
Specifies the alignment of the chart title. Valid values are 'center', 'left', or 'right'.
Possible values: center, left, right
-TitleColor String optionalposition: 10
Specifies the color of the chart title.
-TitleFloating Nullable<T> optionalposition: 6
Specifies whether the chart title should float.
-TitleFontFamily String optionalposition: 9
Specifies the font family of the chart title.
-TitleFontSize Object optionalposition: 7
Specifies the font size of the chart title.
-TitleFontWeight String optionalposition: 8
Specifies the font weight of the chart title. Valid values are 'normal', 'bold', 'bolder', 'lighter', or numeric values from '100' to '900'.
Possible values: normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900
-TitleMargin Nullable<T> optionalposition: 3
Specifies the margin of the chart title.
-TitleOffsetX Nullable<T> optionalposition: 4
Specifies the horizontal offset of the chart title.
-TitleOffsetY Nullable<T> optionalposition: 5
Specifies the vertical offset of the chart title.
-Width Object optionalposition: 22
Specifies the width of the chart.

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.