New-UDNivoChart - No lines in my line chart

Hello - “Borrowed” the following code for a Nivo line chart from the documentation:

$Data = 1…10 | ForEach-Object {

    @{
        id = "Line$_"
        data = @(
            $item = Get-Random -Max 500 
            [PSCustomObject]@{
                x = "Test$item"
                y = $item
            }
        )
    }
}

New-UDNivoChart -Line -Data $Data -Height 500 -Width 1000 -LineWidth 1

Chart displays as points with no lines between the points. Is there a missing parameter?

Thanks in advance! Using Universal 1.3.0

1 Like

I can confirm I’m also seeing this behaviour, I’m on UA 1.5.12, UD 3.3.0, Charts 1.3.2.

I’ll fix the documentation. It’s creating a data set for each point so it’s not connecting the dots :wink:

Try formatting your data like this.

    [array]$Data = [PSCustomObject]@{
        id = "DataSet"
        data = (1..20 | ForEach-Object {
            $item = Get-Random -Max 500 
            [PSCustomObject]@{
                x = "Test$item"
                y = $item
            }
        })
    }
    New-UDNivoChart -Line -Data $Data -Height 500 -Width 1000 -LineWidth 1
1 Like

I knew I should have grabbed a copy of my dashboard before leaving for work!

Makes sense, will give it another try tonight :smiley: