Hola, necesito saber como imprimir varios gráficos y sus tablas en una 
misma página, tengo el siguiente código que funciona bien pero solo para 
uno.

<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart","table"]});
    google.setOnLoadCallback(drawTable);
    function drawTable() {
        var data = google.visualization.arrayToDataTable([
        <?php print* $veccadena[2]*;?>
        ]);
        var opciones = {
          legend: {position:'right'},
          backgroundColor: 'none',
          hAxis: {title: 'Nro de habitantes', titleTextStyle: {color: 
'blue'}},
          vAxis: {title: 'Municipios', titleTextStyle: {color: 'blue'}, 
textStyle:{fontSize: 10}},
          bar: { groupWidth: '80%' },
        isStacked: true
        };

        var table = new 
google.visualization.Table(document.getElementById('table_div'));
        var formatter = new google.visualization.NumberFormat(
{negativeColor: 'red', negativeParens: true, fractionDigits:0});
formatter.format(data, 1); // Apply formatter to second column

        table.draw(data, {showRowNumber: true, width:'100%', 
allowHtml:true});
 var chart = new 
google.visualization.BarChart(document.getElementById('grafico_div'));
  chart.draw(data, opciones);
    }
    $(window).resize(function(){
  drawTable();
});
</script>

y llamo a este gráfico y su tabla con:
<div id="grafico_div"></div>
<div id="table_div"></div>

Ahora, las cadenas de datos ya las tengo armadas y guardadas en un array de 
php llamado $veccadena[], cada posición del array tiene una cadena 
diferente, lo que necesito es generar un grafico con su tabla por cada una 
de los valores del array.

-- 
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to