xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8">
<title>#KnightD3 - Exercise Module 2: Loading CSV Data with D3</title>
<script type="text/javascript" src="https://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
background-color: orange;
font-family: tahoma, helvetica;
color: white;
padding: 20px;
}
svg {
background-color: orange;
}
div {
text-align: center;
}
h1 {
text-align: center;
}
p {
text-align: center;
}
p.italic {
font-style: italic;
font-size: 6;
}
</style>
</head>
<body>
<h1>Facebook Government Report</h1>
<p>Sharing information about the requests Facebook receives from governments around the world</P>
<svg width="100%" height="200">
<circle cx="300" cy="100" r="50" fill="yellow" />
<circle cx="500" cy="100" r="100" fill="red" />
<text x="300" y="100" font-family="sans-serif" font-size="20px" fill="black">2013</text>
<text x="500" y="100" font-family="sans-serif" font-size="20px" fill="white">2014</text>
<p> <em>A comparison between 2013 and 2014</em></p>
</svg>
<p></p>
<script type="text/javascript">
//Load in contents of CSV file
d3.csv("Facebook-Government-Report-2013-2014.csv", function(data) {
//Now CSV contents have been transformed into
//an array of JSON objects.
//Log 'data' to the console, for verification.
console.log(data);
});
</script>
</body>
</html>
Modified http://d3js.org/d3.v3.js to a secure url
https://d3js.org/d3.v3.js