i have a issue with google charts I want to have ColumnChart when have multiple (more than one) types of data, and change it to PieChart when have only one value This is my code:
this is how i get the data:
var <?php echo $divName;?>_data = new google.visualization.DataTable();
how I(now) set the PieChart:
var <?php echo $divName;?>_chart = new google.visualization.PieChart(document.getElementById('<?php echo $divName;?>'));
and for ColumnChart:
var <?php echo $divName;?>_chart = new google.visualization.ColumnChart(document.getElementById('<?php echo $divName;?>'));
and the echo the chart
<?php echo $divName;?>_chart.draw(<?php echo $divName;?>_data
I know it should be a simple if (<?php echo $divName;?>_chart) < 2types then draw PieChart but i don't know how to get the information about how many types have the DataTable
Can someone help me? I'll be very grateful