Chartjs-Chart.js returns a console error and does not display the chart when using variables as data input

0👍

I was not creating the var properly. I created the var as:

var xAxis = "";
var yAxis = "";

And manually added the []. So I changed this to:

var xAxis = [];
var yAxis = [];

And just added the elements:

xAxis[i] = "'" + this.pedetDate + "'";
yAxis[i] = this.pedetResult;

Leave a comment