Skip to content

Instantly share code, notes, and snippets.

@matt-oxley
Created April 7, 2019 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matt-oxley/ddb46e0d6f0e2dfa9d8a6feb518d263e to your computer and use it in GitHub Desktop.
Save matt-oxley/ddb46e0d6f0e2dfa9d8a6feb518d263e to your computer and use it in GitHub Desktop.
const bars = svg
 .selectAll("rect")
 .data(data)
 .join("rect")
 .attr("height", d => yScale(d))
 .attr("width", barWidth)
 .attr("x", (d, i) => i * barWidth)
 .attr("y", d => height - yScale(d))
 .attr("stroke", "white")
 .attr("fill", "steelblue");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment