I’m starting to dabble into charts now, and I’m having a hard time understanding how to get New-UDChart and Out-UDChartData to do what I want.
This is an example of what my data looks like.
$data = @(
[pscustomobject]@{
Service = 'Exchange'
Size = 124
}
[pscustomobject]@{
Service = 'SharePoint'
Size = 650
}
[pscustomobject]@{
Service = 'OneDrive'
Size = 81
}
)
Here is how it’s being presented to New-UDChart
New-UDLayout -Columns 2 -Content {
# Bar Chart
New-UDChart -Type Bar -Endpoint {
$Data|Out-UDChartData -DataProperty 'Size' -LabelProperty 'Service'
} -Height '500px' -Width '100%'
# Pie Chart
New-UDChart -Type Doughnut -Endpoint {
$Data|Out-UDChartData -DataProperty 'size' -LabelProperty 'service'
} -Height '500px' -Width '100%' `
}
This is what it looks like,
I am good with the layout for the most part, but want to assign colors to each of the services manually.
Also for the bar graph I’d like the legend to be, like the Doughnut chart, but it’s not that important if it ends up making it more complicated.
I’ve been racking my head for the last 2 days, reading the docs, forums etc. I’m sure I’m just missing something simple.
Any help would be appreciated.