Chartjs-Unable to draw a scatter chart with vue-charts

1👍

The problem is with extra datasets params xAxisID and yAxisID.

it seems they’re not set correctly, so when vue-charts tries getting references to those DOM elements, it gets undefined, thus the error.

You should either remove those params, or add those elements (via options or manually)

Here is a working version of the app

PS: also, if you need to get a random number from the interval [-100, 100], you should use Math.round(Math.random() * 200) - 100.
In your version, it always returns either 1, or 0 (because Math.random takes no parameters and always returns a value between 1 and 0)

Leave a comment