Skip to content

Instantly share code, notes, and snippets.

@itiswicked
Created September 19, 2017 23:19
Show Gist options
  • Save itiswicked/632766efcad0bd802b454bf7705af6a6 to your computer and use it in GitHub Desktop.
Save itiswicked/632766efcad0bd802b454bf7705af6a6 to your computer and use it in GitHub Desktop.
fresh block
license: mit
var rectWidth = 100;
var height = 300;
var data = [100, 250, 175, 200, 120];
let svg = d3.select('svg')
.selectAll('rect')
.data(data)
.enter()
.append('rect')
// .attr('x', (d, i) => {
// // console.log(d);
// // console.log(i);
// // console.log(i * rectWidth);
// return i * rectWidth;
// })
// .attr('y', d => {
// console.log(height - d);
// return height - d;
// })
// .attr('width', rectWidth)
// .attr('height', d => d)
// .attr('fill', 'blue')
// .attr('stroke', '#fff');
console.log(svg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment