{
const svg = d3
.create('svg')
.attr('width', 120)
.attr('height', 150);
const data = [20, 30, 100, 50];
svg
.selectAll('rect')
.data(data)
.join('rect')
.attr('fill', 'steelblue')
.attr('width', 25)
.attr('height', d => d)
.attr('transform', (d, i) => 'translate(' + i * 30 + ',' + (130 - d) + ')');
svg
.append('text')
.attr('transform', 'translate(60, 150)')
.attr('text-anchor', 'middle')
.text('A bar chart');
return svg.node();
}