I am looking to "perform a loop" in Google Charts Javascript in the arrayToDataTable. Can anyone suggest how to do this ? Also it it ok to use a php variable in the dataset like this ?
<script>
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Month', 'Movie'],
['1', <?php echo $Total[0]; ?>],
['2', <?php echo $Total[1]; ?>],
['3', <?php echo $Total[2]; ?>],
['4', <?php echo $Total[3]; ?>],
['5', <?php echo $Total[4]; ?>],
['6', <?php echo $Total[5]; ?>],
['7', <?php echo $Total[6]; ?>],
['8', <?php echo $Total[7]; ?>],
['9', <?php echo $Total[8]; ?>],
['10', <?php echo $Total[9]; ?>],
['11', <?php echo $Total[10]; ?>],
['12', <?php echo $Total[11]; ?>],
['13', <?php echo $Total[12]; ?>],
['14', <?php echo $Total[13]; ?>],
['15', <?php echo $Total[14]; ?>],
['16', <?php echo $Total[15]; ?>],
['17', <?php echo $Total[16]; ?>],
['18', <?php echo $Total[17]; ?>],
['19', <?php echo $Total[18]; ?>],
['20', <?php echo $Total[19]; ?>],
['21', <?php echo $Total[20]; ?>],
['22', <?php echo $Total[21]; ?>],
['23', <?php echo $Total[22]; ?>],
['24', <?php echo $Total[23]; ?>],
['25', <?php echo $Total[24]; ?>]
]);
... etc...
</script>