Attempting to create a line chart, but facing an error with Google Charts when trying to add a row of data:
Error: Every row given must be either null or an array. @ ...corechart.I.js:162
Below are sample columns I attempted to use. Columns are set up successfully and the graph is displayed blank until I attempt to input any rows.
var data = new google.visualization.DataTable();
data.addColumn('number', 'timestamp');
data.addColumn('number', 'JPY');
data.addColumn('number', 'EUR');
data.addColumn('number', 'SEK');
data.addColumn('number', 'HKD');
data.addColumn('number', 'CHF');
//All good so far
No matter how I try to pass an array using addRows(), the error persists. Similar queries on this issue didn't solve it due to code syntax errors or different approaches used in passing the code. Here's a simplified test case that still doesn't work.
data.addRows([1,2,3,4,5,6]); //Disrupts the chart
I also attempted:
var myrow = new Array(1,2,3,4,5,6);
data.addRows(myrow);
I've tried multiple arrays at once as well because most examples show passing multiple rows.
data.addRows([1,2,3,4,5,6],
[7,8,9,10,11,12]);
Still encountering failures.