Skip to content

Instantly share code, notes, and snippets.

@dreid
Created October 20, 2011 17:06
Show Gist options
  • Save dreid/1301681 to your computer and use it in GitHub Desktop.
Save dreid/1301681 to your computer and use it in GitHub Desktop.
Percentage of startups I've asked for pie.
<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() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'didpie');
data.addColumn('number', 'percentage');
data.addRows(2);
data.setValue(0, 0, "Brought me pie");
data.setValue(0, 1, 100);
data.setValue(1, 0, "Didn't bring me pie");
data.setValue(1, 1, 0);
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, {width: 450, height: 300, title: 'Startups asked for Pie'});
}
</script>
</head>
<body>
<div id="chart_div"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment