New-ConsoleChartSeries
Creates one series of a line or scatter chart: a name, values and an optional tone.
Syntax
New-ConsoleChartSeries [-Name] <Object> [-Tone <ThemeToken>] [[-Value] <Double[]>] [<CommonParameters>]#All Parameter SetsDescription
Creates one series of a line or scatter chart: a name, values and an optional tone.
Use it inside the script block of New-ConsoleLineChart. Values come from -Value or from the pipeline, oldest first, and are spaced evenly. -Tone takes a theme role (Accent, Accent2, Pass, Fail, Warn, Series1 to Series6); without it the chart picks the next series colour, and a series named with a status word (failed, passed, warnings) takes that status colour. To add a series to a chart made earlier, pipe the chart to Add-ConsoleItem; in a running dashboard, append values with Add-ConsoleValue -Key.
Examples
EXAMPLE 1
$completed = foreach ($i in 0..47) { 20 + 9 * [math]::Sin($i / 7) + $i % 3 }
$failed = foreach ($i in 0..47) { 3 + 2 * [math]::Cos($i / 5) }
New-ConsoleLineChart -Height 7 {
New-ConsoleChartSeries 'completed' -Value $completed -Tone Accent
New-ConsoleChartSeries 'failed' -Value $failed -Tone Fail
} | Write-ConsoleWidgetTwo series computed in the script
EXAMPLE 2
New-ConsoleLineChart -Scatter -Unit 'ms' {
Get-Content latency.txt | New-ConsoleChartSeries 'latency'
} | Write-ConsoleWidgetValues from the pipeline
Parameters
- -Name Object
- The series name, shown in the legend (rich text from New-ConsoleText keeps its colours).
- -Tone ThemeToken
- The colour as a theme role: Accent, Accent2, Pass, Fail, Warn, Info, Muted or Series1 to Series6.
- 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 - -Value Double[]
- The values, oldest first (pipeline input works too).
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.