Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/08/2013, 19:27
Avatar de richicasas
richicasas
 
Fecha de Ingreso: abril-2007
Ubicación: Colombia
Mensajes: 692
Antigüedad: 17 años, 1 mes
Puntos: 13
Respuesta: consultar mysql en arregle de javascript

Sin mirar muy a fondo, podrias intentar algo asi:


Código Javascript:
Ver original
  1. <script type="text/javascript" src="https://www.google.com/jsapi"></script>
  2.     <script type="text/javascript">
  3.       google.load("visualization", "1", {packages:["corechart"]});
  4.       google.setOnLoadCallback(drawChart);
  5.       function drawChart() {
  6.         var data = google.visualization.arrayToDataTable([
  7.           ['Year', 'Sales', 'Expenses'],
  8.           <?php foreach($array as $item):
  9.             echo "['".$item->year."',  ".$item->sale.",  ".$item->expenses."]";
  10.            endforeach;?>
  11.           ['2004',  1000,      400],
  12.           ['2005',  1170,      460],
  13.           ['2006',  660,       1120],
  14.           ['2007',  1030,      540]
  15.         ]);
  16.  
  17.         var options = {
  18.           title: 'Indicadores de Gestion',
  19.           hAxis: {title: 'Year', titleTextStyle: {color: 'red'}}
  20.         };
  21.  
  22.         var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
  23.         chart.draw(data, options);
  24.       }
  25.     </script>
__________________
Juguetes Sexuales