Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nullable UDChartData value #1331

Open
augiaugi opened this issue Nov 23, 2019 · 0 comments
Open

nullable UDChartData value #1331

augiaugi opened this issue Nov 23, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@augiaugi
Copy link
Contributor

Describe the Issue

a nullable chart data is breaking the graph line and is not showing any values

To Reproduce

see the screenshot and code

Expected behavior

image
image

Screenshots

image
image

Script Sample

$Data = 1..10 |%{
    $Item = [PSCustomObject]@{
        Timestamp = (Get-Date).AddSeconds($_).ToString('yyyy.MM.dd HH:mm:ss.fff')
        Value = (Get-Random -Minimum 1 -Maximum 100)
        Value2 = $null
    }

    if($_ -in @(1,10))
    {
        $Item.Value2 =  (Get-Random -Minimum 1 -Maximum 100)
    }

    $Item
}

New-UDCard -Content {
    New-UDRow -Endpoint {
        New-UDColumn -LargeSize 6 -Content {
            New-UDTable -Title 'Data' -Headers @("Timestamp", "Value", "Value2") -Endpoint {
                $Data | %{Out-UDTableData -Data $_ -Property @("Timestamp", "Value", "Value2")}
            }        
        }
        New-UDColumn -LargeSize 6 -Content {
            New-UDChart -Title "Graph" -Type Line -Endpoint {
                $Data |  Out-UDChartData -LabelProperty "Timestamp" -Dataset @(
                    New-UdChartDataset -DataProperty "Value" -Label "Value" -BackgroundColor "#80962F23" -HoverBackgroundColor "#80962F23" 
                    New-UdChartDataset -DataProperty "Value2" -Label "Value2" -BackgroundColor "#8014558C" -HoverBackgroundColor "#8014558C"
                )
            } -Options @{elements = @{point = @{radius = 0}}; scales = @{yAxes = @(@{ticks = @{beginAtZero = $true}})}}
        }
    }
}

$Data2 = 1..10 |%{
    $Item = [PSCustomObject]@{
        Timestamp = (Get-Date).AddSeconds($_).ToString('yyyy.MM.dd HH:mm:ss.fff')
        Value = (Get-Random -Minimum 1 -Maximum 100)
        Value2 = $null
    }

    if($_ -in @(1,10))
    {
        $Item.Value = $null
        $Item.Value2 =  (Get-Random -Minimum 1 -Maximum 100)
    }

    $Item
}

New-UDCard -Content {
    New-UDRow -Endpoint {
        New-UDColumn -LargeSize 6 -Content {
            New-UDTable -Title 'Data' -Headers @("Timestamp", "Value", "Value2") -Endpoint {
                $Data2 | %{Out-UDTableData -Data $_ -Property @("Timestamp", "Value", "Value2")}
            }        
        }
        New-UDColumn -LargeSize 6 -Content {
            New-UDChart -Title "Graph" -Type Line -Endpoint {
                $Data2 |  Out-UDChartData -LabelProperty "Timestamp" -Dataset @(
                    New-UdChartDataset -DataProperty "Value" -Label "Value" -BackgroundColor "#80962F23" -HoverBackgroundColor "#80962F23" 
                    New-UdChartDataset -DataProperty "Value2" -Label "Value2" -BackgroundColor "#8014558C" -HoverBackgroundColor "#8014558C"
                )
            } -Options @{elements = @{point = @{radius = 0}}; scales = @{yAxes = @(@{ticks = @{beginAtZero = $true}})}}
        }
    }
}

Version Information

  • Operating System: Windows 10
  • PowerShell Version: 5.1.17763.771
  • Universal Dashboard Version: 2.7.0
  • UD Hosting Method: Powershell
@augiaugi augiaugi added the bug Something isn't working label Nov 23, 2019
@adamdriscoll adamdriscoll assigned AlonGvili and unassigned mattselle Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@mattselle @augiaugi @AlonGvili and others