On Saturday, 20 July 2019 15:40:54 UTC+5, Ahmed Mohamed wrote:
>
>
> $(document).ready(function() {
>
>
> var optcounts1 = <?php echo json_encode($optcountss); ?>;
> var options1 = <?php echo json_encode($optionss); ?>;
>
>
> google.charts.load('current', {'packages':['corechart']});
>
>
> google.charts.setOnLoadCallback(drawChart);
>
>
>
> function drawChart() {
> var j = <?php echo $i ?>;
>
> for(var x=1; x<=j;x++) {
> var p = x-1;
> // Create the data table.
> var data = new google.visualization.DataTable();
> data.addColumn('string', 'Topping');
> data.addColumn('number', 'Slices');
>
>
> console.log(options1[p]);
>
>
> var m = 'chart_div'+x;
>
> data.addRows(options1[p]);
>
>
> var options = {'title':'mi',
> 'width':400,
> 'height':300};
>
>
> var chart = new
> google.visualization.PieChart(document.getElementById(m));
> chart.draw(data, options);
>
> }
>
> }
>
> });
>
>
> And this my error:
>
Uncaught (in promise) Error: Argument given to addRows must be either a
number or an array
at gvjs_R.gvjs_.eq (jsapi_compiled_default_module.js:142)
at drawChart (resultreprt.php?frmid=1:1137)
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/50880219-75f8-49f5-a346-03063a328609%40googlegroups.com.