Created
October 10, 2012 23:21
-
-
Save anonymous/3869184 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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