Cmdlet
New-ConsoleChart
Creates one numeric chart representation from records or samples.
Syntax
New-ConsoleChart
[-Capacity <Int32>]
[-Content <ScriptBlock>]
[-CountColumn <ColumnFormat>]
[-Critical <Double>]
[-Edges <Double[]>]
[-Height <Int32>]
[[-InputObject] <PSObject>]
[-Label <Object>]
[-LabelColumn <ColumnFormat>]
[-Maximum <Double>]
[-MaxLegendColumns <Int32>]
[-Minimum <Double>]
[-NoLatest]
[-NoLegend]
[-NoValues]
[-PercentColumn <ColumnFormat>]
[-Role <ThemeToken>]
[-Series <Object[]>]
[-Shape <Block| Line>]
[-Signed]
-Type <ChartType>
[-Unit <String>]
[-ValueColumn <ColumnFormat>]
[-Values <Double[]>]
[-Warning <Double>]
[[-WidgetId] <String>]
[<CommonParameters>]#Parameter set:
All Parameter SetsDescription
Type selects Bar, Stacked, Line, Scatter, Histogram or Sparkline. The shared C# Chart factory rejects options that do not apply to the selected kind. InputObject accepts ordinary records; Content emits the same records. Use Update-Console for live changes.
Examples
Example 1
[pscustomobject] @{ Label = 'Cloudflare'; Value = 12 } | New-ConsoleChart -Type Bar -Unit ' ms' | Show-ConsoleShow resolver latency
Parameters
- -Capacity Int32
- Retained Line, Scatter or Sparkline samples; omitted uses the selected kind default.
- -Content ScriptBlock
- A script block emitting the same records accepted by InputObject.
- -CountColumn ColumnFormat
- Stacked count-column settings.
- -Critical Double
- The critical threshold for Bar.
- -Edges Double[]
- Strictly ascending Histogram bucket edges.
- -Height Int32
- Plot rows; omitted uses the selected kind default.
- -InputObject PSObject
- Records, numeric samples or a dictionary of labels to values/series.
- -Label Object
- The sparkline label.
- -LabelColumn ColumnFormat
- Stacked legend-label settings.
- -Maximum Double
- The upper numeric limit.
- -MaxLegendColumns Int32
- Maximum Stacked legend columns; zero fits the available width.
- -Minimum Double
- The lower numeric limit.
- -NoLatest SwitchParameter
- Hides the latest Sparkline value.
- -NoLegend SwitchParameter
- Hides the Stacked-chart legend.
- -NoValues SwitchParameter
- Hides Bar-chart numeric value labels.
- -PercentColumn ColumnFormat
- Stacked percent-column settings.
- -Role ThemeToken
- The chart theme role.
- Possible values:
Text,Muted,Subtle,Accent,Accent2,Pass,Fail,Warn,Info,Skip,Running,Pending,Border,Title,Header,Highlight,Surface,SurfaceAccent,Series1,Series2,Series3,Series4,Series5,Series6,Focus - -Series Object[]
- Initial Line/Scatter series names, or records with Key, Label, Role and Values.
- -Shape BarShape
- The bar shape, Block by default.
- Possible values:
Block,Line - -Signed SwitchParameter
- Shows signed Bar values on both sides of zero.
- -Type ChartType
- The numeric chart kind: Bar, Stacked, Line, Scatter, Histogram or Sparkline.
- Possible values:
Bar,Stacked,Line,Scatter,Histogram,Sparkline - -Unit String
- The unit on numeric labels.
- -ValueColumn ColumnFormat
- Bar numeric-column settings.
- -Values Double[]
- Initial numeric samples for Histogram or Sparkline.
- -Warning Double
- The warning threshold for Bar.
- -WidgetId String
- The live identifier; omitted uses the selected kind default.
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.