Skip to content

Instantly share code, notes, and snippets.

@philippeantoine
Created October 6, 2010 11:30
Show Gist options
  • Save philippeantoine/613210 to your computer and use it in GitHub Desktop.
Save philippeantoine/613210 to your computer and use it in GitHub Desktop.
fullthrottle
<!DOCTYPE html><html>
<head><meta charset="utf-8"/><style>#viz{width:200px;height:100px;}</style></head>
<body><div id="viz"></div>
<input type="range" oninput="drawVisualization()">
<script src="http://www.google.com/jsapi"></script>
<script>
google.load('visualization', '1', {packages: ['gauge']});
function drawVisualization() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Label');
data.addColumn('number', 'Value');
data.addRows(1);
data.setValue(0, 0, '');
data.setValue(0, 1, parseInt(document.getElementsByTagName('input')[0].value));
new google.visualization.Gauge(document.getElementById('viz')).
draw(data);
}</script></body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment