Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Google charts on SharePoint - Add Row not accepting array format

$
0
0

i would like to pass the array dataResult as rows for use by the chart. but i keep getting errors "Every row given must be either null or an array". The AddRow() function does not accept my arrays Any idea how i should be passing the array

var dataResult1 = [{ region: "Africa", fruit: "Orange", user: "Gary" }, { region: "Africa", fruit: "Apple", user: "Steve" }, { region: "Europe", fruit: "Orange", user: "John" }, { region: "Europe", fruit: "Apple", user: "bob" }, { region: "Asia", fruit: "Orange", user: "Ian" }, { region: "Asia", fruit: "Apple", user: "Angelo" }, { region: "Africa", fruit: "Orange", user: "Gary" }],

var dataTab = new google.visualization.DataTable();

dataTab.addColumn('string', 'region'); // Implicit domain label col.
dataTab.addColumn('number', 'fruit'); // Implicit series 1 data col.
dataTab.addColumn('number', 'user'); // Implicit series 1 data col.

dataTab.addRows(dataResult1);



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>