Project

ImagePlayground

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

Stars 101
Forks 7
Total downloads 711,982
Release ImagePlayground-PowerShellModule.v3.2.7
Language: C# Updated: 2026-10-26
Command

New-ImageChart

Module
ImagePlayground
Inputs
ChartForgeX.Core.Chart System.Object[]
Outputs
ChartForgeX.Core.Chart

Creates an image chart from definitions.

Syntax

New-ImageChart
[-Annotation <Object[]>]
[-AnnotationsDefinition <ScriptBlock>]
[-Background <ChartColor>]
[-ChartsDefinition] <ScriptBlock>
[-Dpi <Double>]
-FilePath <String>
[-Height <Int32>]
[-Options <ChartRenderOptions>]
[-PassThru]
[-Show]
[-ShowGrid]
[-Theme <ChartTheme>]
[-Watermark <VisualWatermark[]>]
[-Width <Int32>]
[-XTitle <String>]
[-YTitle <String>]
[<CommonParameters>]
#
Parameter set: ScriptBlock
New-ImageChart
[-Annotation <Object[]>]
[-AnnotationsDefinition <ScriptBlock>]
[-Background <ChartColor>]
-ChartScript <ScriptBlock>
[-Dpi <Double>]
-FilePath <String>
[-Height <Int32>]
[-Options <ChartRenderOptions>]
[-PassThru]
[-Show]
[-ShowGrid]
[-Theme <ChartTheme>]
[-Watermark <VisualWatermark[]>]
[-Width <Int32>]
[-XTitle <String>]
[-YTitle <String>]
[<CommonParameters>]
#
Parameter set: ChartScript
New-ImageChart
[-Annotation <Object[]>]
[-AnnotationsDefinition <ScriptBlock>]
[-Background <ChartColor>]
-Chart <Chart>
[-Dpi <Double>]
-FilePath <String>
[-Height <Int32>]
[-Options <ChartRenderOptions>]
[-PassThru]
[-Show]
[-ShowGrid]
[-Theme <ChartTheme>]
[-Watermark <VisualWatermark[]>]
[-Width <Int32>]
[-XTitle <String>]
[-YTitle <String>]
[<CommonParameters>]
#
Parameter set: Chart
New-ImageChart
[-Annotation <Object[]>]
[-AnnotationsDefinition <ScriptBlock>]
[-Background <ChartColor>]
-Definition <Object[]>
[-Dpi <Double>]
-FilePath <String>
[-Height <Int32>]
[-Options <ChartRenderOptions>]
[-PassThru]
[-Show]
[-ShowGrid]
[-Theme <ChartTheme>]
[-Watermark <VisualWatermark[]>]
[-Width <Int32>]
[-XTitle <String>]
[-YTitle <String>]
[<CommonParameters>]
#
Parameter set: Definition

Description

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

Examples

Create a simple bar chart and save it

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

$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.

Parameters

-Annotation Object[] optional
Annotations for the chart.
-AnnotationsDefinition ScriptBlock optional
ScriptBlock producing annotations.
-Background ChartColor optional
Chart background color.
-ChartsDefinition ScriptBlock requiredposition: 0sets: ScriptBlock
ScriptBlock producing chart definitions.
-Dpi Double optional
PNG physical resolution metadata in dots per inch.
-FilePath String required
The image format is inferred from the file extension.
-Height Int32 optional
Height of the chart.
-Options ChartRenderOptions optional
Renderer options created by New-ImageChartOptions.
-PassThru SwitchParameter optional
Write the ChartForgeX chart to the pipeline after rendering.
-Show SwitchParameter optional
Open the image after creation.
-ShowGrid SwitchParameter optional
Display grid lines.
-Theme ChartTheme optional
Chart theme.
Possible values: Default, Dark, Light, Colorblind, Aurora, Editorial, Candy, PeopleInfographic, Terminal, TransparentOverlayDark, Minimal, DashboardLight, SaasDashboardLight, RestaurantDashboardLight
-Watermark VisualWatermark[] optional
Watermarks applied to static SVG, HTML, or PNG output.
-Width Int32 optional
Width of the chart.
-XTitle String optional
X axis title.
-YTitle String optional
Y axis title.
-ChartScript ScriptBlock requiredsets: ChartScript
The script block receives the chart as its first argument and can mutate it directly or return a replacement chart.
-Chart Chart requiredpipeline: True (ByValue)sets: Chart
ChartForgeX chart object to render.
-Definition Object[] requiredpipeline: True (ByValue)sets: Definition
Chart definitions provided directly.

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.