I am having real trouble updating a gauge from a button click event
and text value.  I have looked at all of the online help, and docs and
tried to modify the Temp up and down to accomplish the event.
I am a PE teacher and would like to use this to show my students how
close to 60 minutes of activity they have gotten as a class during PE.
Here is my code so far:

<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
    <title></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(1);
                    data.setValue(0, 0, 'Minutes');
                    data.setValue(0, 1, 18);
////                    draw Chart
                    var chart = new
google.visualization.Gauge(document.getElementById('chart_div'));
                    var options = { width: 300, height: 200, redFrom:
0, redTo: 30, yellowFrom: 30, yellowTo: 45, greenFrom: 45, greenTo:
60, minorTicks: 5, max: 60 };
                    chart.draw(data, options);
                }
                function setTime() {

                    var dir =
document.getElementById("gaugeForm").gaugeText.value;
                    data.setValue(0, 0, gaugeData.getValue(0, 0) +
dir);


                    chart.draw(data, options);
                    }
              </script>
</head>
<body>
    <div id='chart_div'></div>
    <br />
    <br />
    <form id="gaugeForm" >
    <input type="text" id="gaugeText" />
    <button id="guageBut" value="Activity Time"  onclick=
"setTime()">Activity Time</button>
    </form>
</body>
</html>-->

Thanks for your help. T

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization 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-visualization-api?hl=en.

Reply via email to