Apologies I will show you what I want to do and then you'll let me know if
this is possible. You see the multiple instances of each chart above, what
I want to do is place that into a loop so that I can pull php variable data
and place it in assigned place holders eg.
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new Array();
var chart = new Array();
<?php echo $mycount2 =1; ?>;
for ( var i = 1; i = <?php echo $mycount; ?>; i++) {
var data[i] = google.visualization.arrayToDataTable(<?php echo
${"mychartdatax".$mycount2} ?>);
var options = {
colors: ['#FFA500'],
legend: {position:'none'},
};
var chart[i] = new
google.visualization.ColumnChart(document.getElementById('chart_div'+i));
chart[i].draw(data[i], options);
<?php echo $mycount2 =$mycount2+1; ?>;
}
}
php mycount stores the number of charts to be generated
php mycount2 sets a variable as a counter to 1
php mychartdatax (looks for an appended number after it I can generate each
of these and the data is stored properly so no error there)
php mycount2 one is added to further the loop on the next instance
chart_div+i is correctly named in php to be chart_div1 chart_div2 etc.
Is this possible? Please shed some light I will put up anything else you
require but I think this should let you know what I am attempting to do.
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/89fcdeba-36af-4260-9298-810954fabc0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.