Skip to content

Instantly share code, notes, and snippets.

@andrewxhill
Created February 6, 2012 08:40
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 andrewxhill/1750808 to your computer and use it in GitHub Desktop.
Save andrewxhill/1750808 to your computer and use it in GitHub Desktop.
function drawVisualization() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'country');
data.addColumn('number', '2005');
data.addColumn('number', '2010');
data.addRow(["Andorra", 34.04255319, 34.04255319]);
data.addRow(["Belarus", 41.59148055, 42.55004437]);
data.addRow(["Comoros", 2.688172043, 1.612903226]);
data.addRow(["Gabon", 85.38052548, 85.38052548]);
data.addRow(["Italy", 29.77833685, 31.10423608]);
// Create and draw the visualization.
new google.visualization.LineChart(document.getElementById('visualization')).
draw(data, {curveType: "function",
width: 500, height: 400,
vAxis: {maxValue: 100}}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment