- 20 Sep 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
New-Chart
- Updated on 20 Sep 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Creates a chart PNG file based on the input data
Description
Creates a chart PNG file based on the input data. ONLY WORKS IN MS WINDOWS
Syntax
New-Chart
  -InputData  <PSObject>
  -TimeObjectName  <String>
  -BarNames  <String[]>
  -BarColours  <String[]>
  -Interval  <Int32>
  -ChartName  <String>
  -ChartType  <String>
Examples
Example 1
$Data = Get-NectarSessionCount -TimePeriod LAST WEEK
New-Chart -InputData $Data -BarNames Good,Average,Poor -BarColors Green,Yellow,Red
Creates a bar chart using a variable from a previous command
Example 2
New-Chart -InputData (Get-NectarSessionCount -TimePeriod LAST WEEK) -BarNames Good,Average,Poor -BarColors Green,Yellow,Red
Same results as previous example, but shown as full command written within the New-Chart command
Parameters
-InputData <PSObject>
 The data source to use for the chart. Can be either a variable or a command enclosed in brackets
| Parameter | Value | 
|---|---|
| Required | true | 
| Position | 1 | 
| Required | true | 
| Default Value | None | 
| Accept pipeline input? | false | 
| Accept wildcard characters? | false | 
-TimeObjectName <String>
 The name of the data column to use for the time (x-axis)
| Parameter | Value | 
|---|---|
| Required | true | 
| Position | 2 | 
| Required | true | 
| Default Value | None | 
| Accept pipeline input? | false | 
| Accept wildcard characters? | false | 
-BarNames <String[]>
 The names of the bars to display separated by commas. Must match up with the names of the desired column in the input data
| Parameter | Value | 
|---|---|
| Required | true | 
| Position | 3 | 
| Required | true | 
| Default Value | None | 
| Accept pipeline input? | false | 
| Accept wildcard characters? | false | 
-BarColours <String[]>
 The colours of the bars to display separated by commas. Colours will be matched up with the BarNames by position.
| Parameter | Value | 
|---|---|
| Required | false | 
| Position | 4 | 
| Required | false | 
| Default Value | None | 
| Accept pipeline input? | false | 
| Accept wildcard characters? | false | 
-Interval <Int32>
 The interval between numbers to show on the axis. Defaults to auto.
| Parameter | Value | 
|---|---|
| Required | false | 
| Position | 5 | 
| Required | false | 
| Default Value | 0 | 
| Accept pipeline input? | false | 
| Accept wildcard characters? | false | 
-ChartName <String>
 The name to use for the chart header and the filename. Defaults to the type of chart being generated.
| Parameter | Value | 
|---|---|
| Required | false | 
| Position | 6 | 
| Required | false | 
| Default Value | None | 
| Accept pipeline input? | false | 
| Accept wildcard characters? | false | 
-ChartType <String>
 The chart type to display. Defaults to StackedColumn.
| Parameter | Value | 
|---|---|
| Required | false | 
| Position | 7 | 
| Required | false | 
| Default Value | StackedColumn | 
| Accept pipeline input? | false | 
| Accept wildcard characters? | false | 
