There are many examples of updating Google Gauge dynamically using
javascript, but I want to do it at certain times using a call
(function?) from PHP.

Here is my code:

<html>
<head>
<title>Google Gauge Dynamic Update using PHP</title>
<script type='text/javascript' src='https://www.google.com/jsapi'></
script>
<script type='text/javascript'>
  google.load('visualization', '1', {packages:['gauge']});
  google.setOnLoadCallback(drawChart);
  function drawChart() {
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'Label');
    data.addColumn('number', 'Value');
    data.addRows([
      ['Processing', 0]
    ]);

    var options = {
      width: 400, height: 220,
      greenFrom: 66, greenTo: 100,
      yellowFrom:33, yellowTo: 66,
      redFrom:0, redTo:33,
      minorTicks: 5
    };

    var chart = new
google.visualization.Gauge(document.getElementById('chart_div'));
    chart.draw(data, options);

    google.visualization.events.addListener(gauge, 'select',
function() {

    }
  }
</script>
</head>
<body>

<div id='chart_div'></div>

<?php
sleep(2);
// Update the graph to 10%
// Somehow update the gauge to 10%

sleep(5);
// Update the graph to 30%
// Somehow update the gauge to 30%
// Etc...
?>

</body>
</html>


How do I call the listener from PHP? I need a code example. I know
where all the Google Chart Documentation is.

Thanks

Best regards

Andre

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-chart-api?hl=en.

Reply via email to