<html>
<head>
<title>D3 Charts</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.js" charset="utf-8"></script>
</body>
</html>
body {
padding-top: 10px;
padding-left: 10px;
}
.bar {
display: inline-block;
width: 20px;
height: 75px;
margin-right: 2px;
background-color: #00ACF5;
}
var dataset = [ 1, 2, 3, 4, 5, 8 ];
d3.select('body').selectAll('div')
.data(dataset)
.enter()
.append('div')
.attr('class', 'bar')
.style('height', function (d) {
return d * 20 + 'px';
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.