I’m running version 2.6.2 and attempting to generate a multi line graph using a PSCustomObject. Have a CSV somewhat working but has issues when new data points are discover on later dates.
The input object: $devices
Device Date Type Value
------ ---- ---- -----
TTENG-0303 05/18/2020 SUB_PCT 143
TTENG-0293 05/18/2020 SUB_PCT 134
TTENG-0710 05/18/2020 SUB_PCT 145
Here is the code:
$Charts1 = New-UDDashboard -Title "Charts multiple data points" -Content {
New-UdChart -Title "Subscription Alerts" -Type Line -Endpoint {
$colorIdx = -1;
$devices = Get-AlertFiles;
$devices | Out-UDChartData -LabelProperty 'Date' -Dataset @(
$colorIdx++;
$colors = '#2E2EFE', '#642EFE', '#FE2EF7', '#FF0040', '#FE642E', '#F7FE2E', '#2EFE2E', '#2EFEC8', '#9A2EFE', '#FE2E9A', '#8A4B08', '#868A08', '#5FB404', '#088A85', '#086A87', '#084B8A', '#5F04B4';
ForEach-Object -InputObject $devices {
[string]$value = $_.Value; [string]$label = $_.Device
New-UDLineChartDataset -DataProperty $value -Label $label -BorderColor $colors[$colorIdx] -BorderWidth 2 -Fill $false;
}
)
}
}
Start-UDDashboard -Dashboard $Charts1 -Port 10009 -AutoReload
Graph that I’m hoping to generate from a PSCustomObject but having difficulties. This graph was generated from the almost working CSV version.
Maybe I’ve been working too hard on this and my brain has turned to mush.
Thanks for any insights.