public
anonymous / gist:3869184
Created

  • Download Gist
gistfile1.phtml
HTML+PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<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>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.