Fast Food Chain Popularity in 2010

<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’, 32395.4],
[‘Subway’, 10633],
[‘Starbucks’, 7955],
[‘Burger King’, 8433],
[‘Wendys’, 7943],
[‘Taco Bell’, 6900],
[‘Pizza Hut’, 5400],
[‘Dundin Donuts’, 5420],
[‘KFC’, 4700],
]);

// Set chart options
var options = {‘title’:’Fast Food Chain Popularity in 2010′,
‘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 2010

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