Fast Food Chain Popularity in 2009

<html>
<head>
<!–Load the AJAX API–>
https://www.gstatic.com/charts/loader.js

// Load the Visualization API and the corechart package.
google.charts.load(‘current’, {‘packages’:[‘corechart’]});

// Set a callback to run when the Google Visualization API is loaded.
google.charts.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’, ‘Franchise’);
data.addColumn(‘number’, ‘Revenue’);
data.addRows([
[‘McDonalds’, 31032.6],
[‘Subway’, 9999.3],
[‘Starbucks’, 7415],
[‘Burger King’, 8799],
[‘Wendys’, 8023],
[‘Taco Bell’, 6800],
[‘Pizza Hut’, 5000],
[‘Dundin Donuts’, 5176],
[‘KFC’, 4900],
]);

// Set chart options
var options = {‘title’:’Fast Food Chain Popularity in 2009′,
‘width’:800,
‘height’:600};

// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById(‘chart_div’));
chart.draw(data, options);
}

</head>

<body>
<!–Div that will hold the pie chart–>

</body>
</html>

Advertisements

One thought on “Fast Food Chain Popularity in 2009

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s