xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8">
<title>Loading CSV Data with D3</title>
<script type="text/javascript" src="https://d3js.org/d3.v3.js"></script>
</head>
<body>
<svg width="500" height="300">
<line x1="0" y1="0" x2="0" y2="60" stroke="black" stroke-width="80" />
<line x1="40" y1="60" x2="276" y2="60" stroke="gray" stroke-width="1" />
<rect x="40" y="61" width="100" height="100" fill="yellow" />
<circle cx="40" cy="60" r="25" fill="orange" />
<text x="60" y="40" fill="red" font-size="36" font-weight="bold" font-family="Minion">My First SVG</text>
</svg>
<script type="text/javascript">
//Load in contents of CSV file
d3.csv("WEFGenderGap_selected.csv", function(data) {
//changed csv file above to direct to my file
//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