Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var bardata = [20,52,36, 5, 45, 12,43,21,63,24,7,31,18];
- var height = 200,
- width = 600,
- barWidth = 20,
- barOffset = 5;
- d3.select('#chart').append('svg')
- .attr('width', width)
- .attr('height', height)
- .style('background', 'beige')
- .selectAll('rect').data(bardata)
- .enter().append('rect')
- .style('fill', '#C61C6F')
- .attr('width', barWidth)
- .attr('height',function(d) {return d;})
- .attr('x', function(d,i) {
- return i * (barWidth + barOffset);
- })
- .attr('y', function(d){ return height - d;})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement