UDChartJS not reacting to OnClick

Hi,

We recently moved from 2.12.2 to 3.3.5. On the new version, the UDChartJS components don’t seem to be responding to being clicked. I have a chart that shows a bar graph of alerts over the last 48 hours, and you would click on a bar to bring up a modal of that hour’s alerts in a table.

I can include my code if you need me to, but I created a blank UDPage with nothing on it but the OnClick example code from the documentation:

And this is not producing a UDToast when clicked either. Is there something I need to enable or include in PSU 3+ for charts to have OnClick functionality, or is this possibly a bug?

Product: PowerShell Universal
Version: 3.3.5
Powershell (dashboard environment's version): 7.2.1

Edit: Just for reference, this is the blank page code that is not eresponding to OnClick events:

New-UDPage -Role 'XXX' -Name 'Demo' -Content {
    $Data = Get-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10 

    $Options = @{
        Type = 'bar'
        Data = $Data
        DataProperty = 'CPU'
        LabelProperty = "ProcessName"
        OnClick = { 
            Show-UDToast -Message $Bodyr
            }
    }

    New-UDChartJS @Options
}

Looks like that documentation is incorrect…

OnClick = { 
            Show-UDToast -Message $Bodyr
            }

Should be…

OnClick = { 
            Show-UDToast -Message $Body
            }

But regardless of that, I can reproduce it for myself on 3.3.4. Looks like 3.3.0 changelog included

  • Updated to ChartJS v3.9.1
1 Like

Hey @adam any ideas?

Just want to add in that I’m also having this problem.

Nivo Charts work as expected as a temporary workaround for me.

Any updates on this one?