- 18 Sep 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
New-StackedBarChart
- Updated on 18 Sep 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Creates a stacked bar chart PNG file based on the input data
Description
Creates a stacked bar chart PNG file based on the input data. ONLY WORKS IN MS WINDOWS
Syntax
New-StackedBarChart
-InputData <PSObject>
-TimeObjectName <String>
-BarNames <String[]>
-BarColours <String[]>
-Interval <Int32>
-ChartName <String>
Examples
Example 1
$Data = Get-NectarSessionCount -TimePeriod LAST WEEK
New-StackedBarChart -InputData $Data -BarNames Good,Average,Poor -BarColors Green,Yellow,Red
Creates a bar chart using a variable from a previous command
Example 2
New-StackedBarChart -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-StackedBarChart 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 'Chart'
Parameter | Value |
---|---|
Required | false |
Position | 6 |
Required | false |
Default Value | Chart |
Accept pipeline input? | false |
Accept wildcard characters? | false |