Skip to content

Instantly share code, notes, and snippets.

Created October 10, 2012 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3869184 to your computer and use it in GitHub Desktop.
Save anonymous/3869184 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
data.addColumn('number','Age');
data.addColumn('number','Weight');
data.addColumn({type:'string', role:'tooltip'});
var data = google.visualization.arrayToDataTable([
[ -10, 12,'bob'],
[ 4, 5.5,'sally'],
[ 11, 14,'marco'],
[ 4, 5,'elaine'],
[ 3, 3.5,'jillian'],
[ 6.5, 7,'maurice']
]);
var options = {
title: 'Age vs. Weight comparison',
hAxis: {title: 'Age', minValue: -11, maxValue: 15},
vAxis: {title: 'Weight', minValue: 0, maxValue: 15},
};
var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment