Skip to content

Instantly share code, notes, and snippets.

@pnc89
Created November 7, 2014 21:44
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 pnc89/dfd7581ec6d825c25ecd to your computer and use it in GitHub Desktop.
Save pnc89/dfd7581ec6d825c25ecd to your computer and use it in GitHub Desktop.
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Standing');
data.addColumn('number', 'Students');
data.addRows([
["Graduate Interdisciplinary Programs", "24"],
]);
// Set chart options
var options = {'title':'Student Enrollment by College',
'width':400,
'height':300};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script><script src="https://www.google.com/uds/?file=visualization&amp;v=1.0&amp;packages=corechart" type="text/javascript"></script><link href="https://www.google.com/uds/api/visualization/1.0/c9097717526543127df14ac5b7413d43/ui+en.css" type="text/css" rel="stylesheet"><script src="https://www.google.com/uds/api/visualization/1.0/c9097717526543127df14ac5b7413d43/format+en,default+en,ui+en,corechart+en.I.js" type="text/javascript"></script>
<!--Div that will hold the pie chart-->
<div id="chart_div"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment