Skip to content

Instantly share code, notes, and snippets.

@yonester
Last active March 7, 2016 03:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save yonester/6472779 to your computer and use it in GitHub Desktop.
7th Grade Graphs with D3
license: gpl-3.0
<style>
line {
stroke: black;
}
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var w = 500,
h = 500,
n = 65,
s = h / n;
d3.select("body").append("svg")
.attr("width", w)
.attr("height", h)
.selectAll("line")
.data(d3.range(n)).enter()
.append("line")
.attr("x1", 0)
.attr("y1", function(d) { return d * s; })
.attr("x2", function(d) { return d * s; })
.attr("y2", h);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment