API Reference
Command
New-ImageChart
Creates an image chart from definitions.
Remarks
Use this cmdlet to render one or more chart definitions into a final image file.
Examples
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:
ScriptBlockParameters
- Annotation Object[]
- Annotations for the chart.
- AnnotationsDefinition ScriptBlock
- ScriptBlock producing annotations.
- Background ChartColor
- Chart background color.
- ChartsDefinition ScriptBlock
- ScriptBlock producing chart definitions.
- FilePath String
- The image format is inferred from the file extension.
- Height Int32
- Height of the chart.
- Options ChartRenderOptions
- Renderer options created by New-ImageChartOptions.
- Show SwitchParameter
- Open the image after creation.
- ShowGrid SwitchParameter
- Display grid lines.
- Theme ChartTheme
- Chart theme.
- Possible values:
Default,Dark,Light,Colorblind,Aurora,Editorial,Candy,PeopleInfographic,Terminal,TransparentOverlayDark,Minimal,DashboardLight,SaasDashboardLight,RestaurantDashboardLight - Width Int32
- Width of the chart.
- XTitle String
- X axis title.
- YTitle String
- 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:
ChartScriptParameters
- Annotation Object[]
- Annotations for the chart.
- AnnotationsDefinition ScriptBlock
- ScriptBlock producing annotations.
- Background ChartColor
- Chart background color.
- ChartScript ScriptBlock
- The script block receives the chart as its first argument and can mutate it directly or return a replacement chart.
- FilePath String
- The image format is inferred from the file extension.
- Height Int32
- Height of the chart.
- Options ChartRenderOptions
- Renderer options created by New-ImageChartOptions.
- Show SwitchParameter
- Open the image after creation.
- ShowGrid SwitchParameter
- Display grid lines.
- Theme ChartTheme
- Chart theme.
- Possible values:
Default,Dark,Light,Colorblind,Aurora,Editorial,Candy,PeopleInfographic,Terminal,TransparentOverlayDark,Minimal,DashboardLight,SaasDashboardLight,RestaurantDashboardLight - Width Int32
- Width of the chart.
- XTitle String
- X axis title.
- YTitle String
- 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:
ChartParameters
- Annotation Object[]
- Annotations for the chart.
- AnnotationsDefinition ScriptBlock
- ScriptBlock producing annotations.
- Background ChartColor
- Chart background color.
- Chart Chart
- ChartForgeX chart object to render.
- FilePath String
- The image format is inferred from the file extension.
- Height Int32
- Height of the chart.
- Options ChartRenderOptions
- Renderer options created by New-ImageChartOptions.
- Show SwitchParameter
- Open the image after creation.
- ShowGrid SwitchParameter
- Display grid lines.
- Theme ChartTheme
- Chart theme.
- Possible values:
Default,Dark,Light,Colorblind,Aurora,Editorial,Candy,PeopleInfographic,Terminal,TransparentOverlayDark,Minimal,DashboardLight,SaasDashboardLight,RestaurantDashboardLight - Width Int32
- Width of the chart.
- XTitle String
- X axis title.
- YTitle String
- 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:
DefinitionParameters
- Annotation Object[]
- Annotations for the chart.
- AnnotationsDefinition ScriptBlock
- ScriptBlock producing annotations.
- Background ChartColor
- Chart background color.
- Definition Object[]
- Chart definitions provided directly.
- FilePath String
- The image format is inferred from the file extension.
- Height Int32
- Height of the chart.
- Options ChartRenderOptions
- Renderer options created by New-ImageChartOptions.
- Show SwitchParameter
- Open the image after creation.
- ShowGrid SwitchParameter
- Display grid lines.
- Theme ChartTheme
- Chart theme.
- Possible values:
Default,Dark,Light,Colorblind,Aurora,Editorial,Candy,PeopleInfographic,Terminal,TransparentOverlayDark,Minimal,DashboardLight,SaasDashboardLight,RestaurantDashboardLight - Width Int32
- Width of the chart.
- XTitle String
- X axis title.
- YTitle String
- Y axis title.