Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (56 sloc) 1.01 KB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> March 31 - Example version 1</Title>
<script type="text/javascript" src="http://testingthenews.com/LearningD3/d3/d3.v2.js"></script>
</head>
<body>
<script type="text/javascript">
var dataset = [
[20, 2.5],
[62, 1.9],
[1, 1.7],
[41, 0.7],
[2, 0.6],
[2, 0.5],
[0, 0.5],
[48, 0.5],
[1, 0.4],
[8, 0.4],
[15, 0.4],
[6, 0.4],
[6, 0.4],
[3, 0.4],
[2, 0.3],
[6, 0.3],
[11, 0.3],
[7, 0.3],
[8, 0.3],
[4, 0.3],
[2, 0.3],
[2, 0.2],
[15, 0.2],
[5, 0.2],
[5, 0.2],
];
var w = 700;
var h = 500;
var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);
svg.selectAll("circle")
.data(dataset)
.enter()
.append("circle")
.attr("cx", function(d){
return d[0];
})
.attr("cy", function(d) {
return d[1];
})
.attr("r", 5);
</script>
</body>
</html>