I have the following array of arrays in JS:
var data = [
['Year', 'Sales'],
['2014', 1000],
['2015', 1170],
];
How to build this array in PHP that after use in JS. I tried:
$data[] = [2014 => 1000];
echo json_encode($data);
I dont know what I do wring, I get this:
And it is not reproduced in Google Map Bar.
Default array:
var data = google.visualization.arrayToDataTable([
['Year', 'Sales'],
['2014', 1000],
['2015', 1170]
]);
Insted this array I put own:
var data = google.visualization.arrayToDataTable(model);
