Código Javascript:
Ver original
var i=0; for (i=0;i<=3;i++){ var gauge i; var gaugeData i; var gaugeOptions i; function drawGauge i() { gaugeData i = new google.visualization.DataTable(); gaugeData i.addColumn('number', "Critic"); gaugeData i.addRows(2); gaugeData i.setCell(0, 0, 0); gauge i = new google.visualization.Gauge(document.getElementById('gauge'+i)); gaugeOptions i = { min: 0, max: 365, }; gauge i.draw(gaugeData i, gaugeOptions i); } google.setOnLoadCallback(drawGauge i); $(document).ready(function() { $('#reloj_check, #reloj_combo').bind("change",function(){ var check=document.getElementById('reloj_check').value; /*if (check == 'on'){ check=1; }else{ check=0; }*/ var combo=document.getElementById('reloj_combo').value; sUrl ="query_ajax.php?reloj_check="+check+"&"+"reloj_combo="+combo; $.ajax({ url:sUrl, type:"get", dataType:"json", success:function(datos){ gaugeData i.setValue(0, 0, parseFloat(datos[i].prom )); //promedio gaugeOptions i = {min: parseInt(datos[i].min), max: parseInt(datos[i].max) }; gauge i.draw(gaugeData i, gaugeOptions i); } }); }); }); }