xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<title>Road Traffic Accidents in Minsk</title>
<script type="text/javascript" src="https://d3js.org/d3.v3.js"></script>
</head>
<body>
<h2>Road Traffic Accidents<br />
in Minsk (3/1/2013-3/19/2015)</h2>
<script type="text/javascript">
var dataset;
var svg = d3.select("body")
.append("svg")
.attr({
width: 900,
height: 5480
});
//Load in contents of CSV file
d3.csv("data-gaiminsk.csv", function(data) {
dataset = data;
//data.sort(function(a, b) {
// return d3.descending(+a.numRTA, +b.numRTA);
//});
// all RTA
svg.selectAll("rect")
.data(data)
.enter()
.append("rect")
.attr({
x: 0,
y: function(d, i) {
return i * 5;
},
width: function(d) {
return d.numRTA * 3;
},
height: 4,
class: "rta",
fill: "Silver"
})
.append("title")
.text(function(d) {
return "There were " + d.numRTA + " acccidents at " + d.date;
});
});
</script>
</body>
</html>
Modified http://d3js.org/d3.v3.js to a secure url
https://d3js.org/d3.v3.js