ironmansoftware / universal-dashboard

Build beautiful websites with PowerShell.
https://universaldashboard.io
GNU Lesser General Public License v3.0
449 stars 84 forks source link

New-UDNivoChart pie chart -UseDataColor not working #918

Closed dennisvl92 closed 4 years ago

dennisvl92 commented 5 years ago

i am trying to make a pie chart using the nivo charts and setting the colors with -usedatecolor. When i run the dashboard with version 2.4.1 it wont use the colors from the data. But when i run the same dashboard with version 2.2.0 it works.


Get-Process | Group-Object -Property ProcessName | Sort-Object -Property count -Descending | Select-Object -first 15 | ForEach-Object { $t = @{ id = $_.Name; label = $_.Name; value = $_.count; color = "hsl($(Get-Random -Minimum 1 -Maximum 359), 70%, 50%)" } 
$test += $t
} 

$MyDashboard = New-UDDashboard -Title "Hello, World" -Content {

 New-UDNivoChart -UseDataColor -SortByValue -Id 'pieChart' -Pie -Data $test -Height 400 -Width 600 -MarginBottom 50 -MarginTop 50 -MarginRight 110 -MarginLeft 60 -InnerRadius 0.5 -PadAngle 0.7 -CornerRadius 3

 New-UDNivoChart -UseDataColor -Id 'pieChart' -Pie -Height 600 -Width 600 -Data @(
    @{
        id = 'python'
        label = 'python'
        value = (Get-Random -Maximum 100 -Minimum 10)
        color = "hsl($(Get-Random -Minimum 1 -Maximum 359), 70%, 50%)"
    })

}

Start-UDDashboard -Port 1000 -Dashboard $MyDashboard
adamdriscoll commented 4 years ago

Unfortunately, nivo charts no longer support useDataColor. We have removed this parameter in v3.