New-Chart
    • 20 Sep 2023
    • 1 Minute to read
    • Contributors
    • Dark
      Light
    • PDF

    New-Chart

    • Dark
      Light
    • PDF

    Article Summary

    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

    ParameterValue
    Requiredtrue
    Position1
    Requiredtrue
    Default ValueNone
    Accept pipeline input?false
    Accept wildcard characters?false

    -TimeObjectName <String>
    The name of the data column to use for the time (x-axis)

    ParameterValue
    Requiredtrue
    Position2
    Requiredtrue
    Default ValueNone
    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

    ParameterValue
    Requiredtrue
    Position3
    Requiredtrue
    Default ValueNone
    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.

    ParameterValue
    Requiredfalse
    Position4
    Requiredfalse
    Default ValueNone
    Accept pipeline input?false
    Accept wildcard characters?false

    -Interval <Int32>
    The interval between numbers to show on the axis. Defaults to auto.

    ParameterValue
    Requiredfalse
    Position5
    Requiredfalse
    Default Value0
    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.

    ParameterValue
    Requiredfalse
    Position6
    Requiredfalse
    Default ValueNone
    Accept pipeline input?false
    Accept wildcard characters?false

    -ChartType <String>
    The chart type to display. Defaults to StackedColumn.

    ParameterValue
    Requiredfalse
    Position7
    Requiredfalse
    Default ValueStackedColumn
    Accept pipeline input?false
    Accept wildcard characters?false

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.
    ESC

    Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses