Please refer to think plunk: http://plnkr.co/edit/2lvNHxvLEsNpVqNqmDUX?p=preview
I was trying to draw a circle using D3JS using javascript. My script.js file has the circle defined.
d3.select("body")
.append("svg")
.attr("width",50)
.attr("height",50)
.append("circle")
.attr("cx",25)
.attr("cy",25)
.attr("r",25)
.style("fill","purple");
But it doesn't show up in the html after the D3 circle header. Could someone tell me what I am doing wrong?
<!DOCTYPE html>
<html>
<head>
<script data-require="d3@*" data-semver="3.5.3" src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
<title>D3JS Demo - Drawing Shapes</title>
</head>
<body>
<h3>SVG Bar</h3>
<svg>
<rect width="50" height="200" style="fill:blue"></rect>
</svg>
<h3>D3 Bar</h3>
<script>
d3.select("body")
.append("svg")
.append("rect")
.attr("widt ah",50)
.attr("height",200)
.style("fill","blue");
</script>
<h3>SVG Circle</h3>
<svg width="50" height="50">
<circle cx="25" cy="25" r="25" style="fill:blue"></circle>
</svg>
<h3>D3 Circle</h3>
</body>
</html>