Simple pie chart loaded by CSV

Hello,
I’m new to UD and have been scouring the forums looking for a way to import a csv file into a dashboard. It’ll be a pie chart on drive space.

Here’s the current code I’ve been working with but it doesn’t come back with anything:

Get-UdDashboard | Stop-UdDashboard

Start-UdDashboard -Content {
New-UdDashboard -Title “Isilon Storage” -Theme $theme -Content {
New-UdColumn { -Size 10 -Content {
New-UdChart -Title “Isilon Storage Archive” -Type Pie -Endpoint {
$csv = import-csv c:\Scipts\isilon.csv
$csv | Select-Object “Used”,“Free” | Out-UDChartData -LabelProperty “Isilon” -Dataset @(
New-UDChartDataset -DataProperty “Used” -Label “Used” -BackgroundColor “blue”
New-UDChartDataset -DataProperty “Free” -Label “Free” -BackgroundColor “green”

        )
    	   }   
       }
    }		
     }

} -Port 1000

The CSV file contains this:
Used,Free
1005,728

Any help would be appreciated.

Ok. I’m able to get some output now. It’s a bit odd though. It shows up as a blue circle (the used value) and the middle of that circle is a green circle (the free value).
Not exactly a pie chart…
Here’s the current code.

New-UdChart -Title “Isilon Storage Archive” -Type Pie -Endpoint {
$csv = Import-csv C:\Scripts\isilon.csv
$csv | Out-UDChartData -Dataset @(
New-UDChartDataset -DataProperty ‘Used’ -Label “Used” -BackgroundColor “blue”
New-UDChartDataset -DataProperty ‘Free’ -Label “Free” -BackgroundColor “green”
)
}
}
} -Port 1000

Welcome @otherb0t to the world of UD forums…sorry no-one has got back to you on this post yet…are you still looking for some assistance on this issue?

I figured it out.
New-UdChart -Title “Storage Archive” -Type Bar -Endpoint {
$csv = Import-csv C:\Scripts\isilon.csv
$csv | Out-UDChartData -Dataset @(
New-UDChartDataset -DataProperty “Used” -Label “Used” -BackgroundColor “gray”
New-UDChartDataset -DataProperty “Free” -Label “Free” -BackgroundColor “green”
)
} -Labels @(“Space”) -Options @{
scales = @{
xAxes = @(
@{
stacked = $true
}
)
yAxes = @(
@{
stacked = $true
}
)
}

2 Likes