xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8">
<title>Excercise module 2</title>
<script type="text/javascript" src="https://d3js.org/d3.v3.js"></script>
</head>
<body>
<svg width="410" height="410">
</svg>
<script type="text/javascript">
function drawFigure() {
var fig = d3.select("svg");
fig.append("circle")
.attr("cx",205).attr("cy",205).attr("r",200)
.attr("stroke","black").attr("stroke-width",3).attr("fill","white");
fig.append("ellipse").attr("cx",100).attr("cy",200).attr("rx",40).attr("ry",80)
.attr("stroke","black").attr("stroke-width",3).attr("fill","yellow");
fig.append("ellipse").attr("cx",300).attr("cy",200).attr("rx",40).attr("ry",80)
.attr("stroke","black").attr("stroke-width",3).attr("fill","yellow");
fig.append("circle")
.attr("cx",100).attr("cy",220).attr("r",20)
.attr("stroke","black").attr("stroke-width",3).attr("fill","white");
fig.append("circle")
.attr("cx",300).attr("cy",220).attr("r",20)
.attr("stroke","black").attr("stroke-width",3).attr("fill","white");
}
//Load in contents of CSV file
d3.csv("Number of Cash for Care recipients by year and sex.csv", function(data) {
drawFigure();
console.log(data);
});
</script>
</body>
</html>
Modified http://d3js.org/d3.v3.js to a secure url
https://d3js.org/d3.v3.js