Project

ImagePlayground

Automate image processing, codes, metadata, charts, topology, and visual stories from PowerShell.

Stars 100
Forks 7
Total downloads 712,347
Release ImagePlayground-PowerShellModule.v3.2.7
Language: C# Updated: 2026-08-25

API Reference

Command

New-ImageChart

Namespace ImagePlayground
Inputs
ChartForgeX.Core.Chart System.Object[]

Creates an image chart from definitions.

Remarks

Use this cmdlet to render one or more chart definitions into a final image file.

Examples

Authored help example

Create a simple bar chart and save it

PS>


New-ImageChart -ChartsDefinition {
                New-ImageChartBar -Name 'Q1' -Value 12,18,25 -Color CornflowerBlue
                New-ImageChartBar -Name 'Q2' -Value 14,20,28 -Color Orange
            } -FilePath chart.png -XTitle 'Month' -YTitle 'Revenue'
        

Builds chart definitions inside a script block and renders them into a PNG file.

Create a line chart with annotations and preview it

PS>


$defs = @(
                New-ImageChartLine -Name 'CPU' -Value 35,42,58,61,49 -Color LimeGreen -Smooth
            )
            $ann = @(
                New-ImageChartAnnotation -X 3 -Y 61 -Text 'Peak' -Arrow
            )
            New-ImageChart -Definition $defs -Annotation $ann -FilePath cpu-usage.png -Theme Dark -ShowGrid -Show
        

Renders a themed line chart and overlays an annotation highlighting the peak value.

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.

Syntax

New-ImageChart [-Annotation <Object[]>] [-AnnotationsDefinition <ScriptBlock>] [-Background <ChartColor>] -ChartsDefinition <ScriptBlock> -FilePath <String> [-Height <Int32>] [-Options <ChartRenderOptions>] [-Show] [-ShowGrid] [-Theme <Default>] [-Width <Int32>] [-XTitle <String>] [-YTitle <String>] [<CommonParameters>]
#
Parameter set: ScriptBlock

Parameters

Annotation Object[] optionalposition: namedpipeline: False
Annotations for the chart.
AnnotationsDefinition ScriptBlock optionalposition: namedpipeline: False
ScriptBlock producing annotations.
Background ChartColor optionalposition: namedpipeline: False
Chart background color.
ChartsDefinition ScriptBlock requiredposition: 0pipeline: False
ScriptBlock producing chart definitions.
FilePath String requiredposition: namedpipeline: False
The image format is inferred from the file extension.
Height Int32 optionalposition: namedpipeline: False
Height of the chart.
Options ChartRenderOptions optionalposition: namedpipeline: False
Renderer options created by New-ImageChartOptions.
Show SwitchParameter optionalposition: namedpipeline: False
Open the image after creation.
ShowGrid SwitchParameter optionalposition: namedpipeline: False
Display grid lines.
Theme ChartTheme optionalposition: namedpipeline: Falsevalues: 14
Chart theme.
Possible values: Default, Dark, Light, Colorblind, Aurora, Editorial, Candy, PeopleInfographic, Terminal, TransparentOverlayDark, Minimal, DashboardLight, SaasDashboardLight, RestaurantDashboardLight
Width Int32 optionalposition: namedpipeline: False
Width of the chart.
XTitle String optionalposition: namedpipeline: False
X axis title.
YTitle String optionalposition: namedpipeline: False
Y axis title.
New-ImageChart [-Annotation <Object[]>] [-AnnotationsDefinition <ScriptBlock>] [-Background <ChartColor>] -ChartScript <ScriptBlock> -FilePath <String> [-Height <Int32>] [-Options <ChartRenderOptions>] [-Show] [-ShowGrid] [-Theme <Default>] [-Width <Int32>] [-XTitle <String>] [-YTitle <String>] [<CommonParameters>]
#
Parameter set: ChartScript

Parameters

Annotation Object[] optionalposition: namedpipeline: False
Annotations for the chart.
AnnotationsDefinition ScriptBlock optionalposition: namedpipeline: False
ScriptBlock producing annotations.
Background ChartColor optionalposition: namedpipeline: False
Chart background color.
ChartScript ScriptBlock requiredposition: namedpipeline: False
The script block receives the chart as its first argument and can mutate it directly or return a replacement chart.
FilePath String requiredposition: namedpipeline: False
The image format is inferred from the file extension.
Height Int32 optionalposition: namedpipeline: False
Height of the chart.
Options ChartRenderOptions optionalposition: namedpipeline: False
Renderer options created by New-ImageChartOptions.
Show SwitchParameter optionalposition: namedpipeline: False
Open the image after creation.
ShowGrid SwitchParameter optionalposition: namedpipeline: False
Display grid lines.
Theme ChartTheme optionalposition: namedpipeline: Falsevalues: 14
Chart theme.
Possible values: Default, Dark, Light, Colorblind, Aurora, Editorial, Candy, PeopleInfographic, Terminal, TransparentOverlayDark, Minimal, DashboardLight, SaasDashboardLight, RestaurantDashboardLight
Width Int32 optionalposition: namedpipeline: False
Width of the chart.
XTitle String optionalposition: namedpipeline: False
X axis title.
YTitle String optionalposition: namedpipeline: False
Y axis title.
New-ImageChart [-Annotation <Object[]>] [-AnnotationsDefinition <ScriptBlock>] [-Background <ChartColor>] -Chart <Chart> -FilePath <String> [-Height <Int32>] [-Options <ChartRenderOptions>] [-Show] [-ShowGrid] [-Theme <Default>] [-Width <Int32>] [-XTitle <String>] [-YTitle <String>] [<CommonParameters>]
#
Parameter set: Chart

Parameters

Annotation Object[] optionalposition: namedpipeline: False
Annotations for the chart.
AnnotationsDefinition ScriptBlock optionalposition: namedpipeline: False
ScriptBlock producing annotations.
Background ChartColor optionalposition: namedpipeline: False
Chart background color.
Chart Chart requiredposition: namedpipeline: True (ByValue)
ChartForgeX chart object to render.
FilePath String requiredposition: namedpipeline: False
The image format is inferred from the file extension.
Height Int32 optionalposition: namedpipeline: False
Height of the chart.
Options ChartRenderOptions optionalposition: namedpipeline: False
Renderer options created by New-ImageChartOptions.
Show SwitchParameter optionalposition: namedpipeline: False
Open the image after creation.
ShowGrid SwitchParameter optionalposition: namedpipeline: False
Display grid lines.
Theme ChartTheme optionalposition: namedpipeline: Falsevalues: 14
Chart theme.
Possible values: Default, Dark, Light, Colorblind, Aurora, Editorial, Candy, PeopleInfographic, Terminal, TransparentOverlayDark, Minimal, DashboardLight, SaasDashboardLight, RestaurantDashboardLight
Width Int32 optionalposition: namedpipeline: False
Width of the chart.
XTitle String optionalposition: namedpipeline: False
X axis title.
YTitle String optionalposition: namedpipeline: False
Y axis title.
New-ImageChart [-Annotation <Object[]>] [-AnnotationsDefinition <ScriptBlock>] [-Background <ChartColor>] -Definition <Object[]> -FilePath <String> [-Height <Int32>] [-Options <ChartRenderOptions>] [-Show] [-ShowGrid] [-Theme <Default>] [-Width <Int32>] [-XTitle <String>] [-YTitle <String>] [<CommonParameters>]
#
Parameter set: Definition

Parameters

Annotation Object[] optionalposition: namedpipeline: False
Annotations for the chart.
AnnotationsDefinition ScriptBlock optionalposition: namedpipeline: False
ScriptBlock producing annotations.
Background ChartColor optionalposition: namedpipeline: False
Chart background color.
Definition Object[] requiredposition: namedpipeline: True (ByValue)
Chart definitions provided directly.
FilePath String requiredposition: namedpipeline: False
The image format is inferred from the file extension.
Height Int32 optionalposition: namedpipeline: False
Height of the chart.
Options ChartRenderOptions optionalposition: namedpipeline: False
Renderer options created by New-ImageChartOptions.
Show SwitchParameter optionalposition: namedpipeline: False
Open the image after creation.
ShowGrid SwitchParameter optionalposition: namedpipeline: False
Display grid lines.
Theme ChartTheme optionalposition: namedpipeline: Falsevalues: 14
Chart theme.
Possible values: Default, Dark, Light, Colorblind, Aurora, Editorial, Candy, PeopleInfographic, Terminal, TransparentOverlayDark, Minimal, DashboardLight, SaasDashboardLight, RestaurantDashboardLight
Width Int32 optionalposition: namedpipeline: False
Width of the chart.
XTitle String optionalposition: namedpipeline: False
X axis title.
YTitle String optionalposition: namedpipeline: False
Y axis title.