Skip to content

Instantly share code, notes, and snippets.

@rubysolo
Last active December 17, 2015 03:28
Show Gist options
  • Save rubysolo/5543306 to your computer and use it in GitHub Desktop.
Save rubysolo/5543306 to your computer and use it in GitHub Desktop.
<html>
<body>
<script type="text/javascript" src="http://raw.github.com/mbostock/d3/v2.10.3/d3.v2.min.js"></script>
<script type="text/javascript">
var svg = d3.select('body').append('svg')
.attr('width', '100%')
.attr('height', '100%')
.attr('viewBox', '0 0 280 200');
var data = [[5, 15],
[20, 47],
[40, 70],
[60, 90],
[90, 120],
[170, 160],
[210, 170],
[260, 172]];
line = d3.svg.line()
.x(function(d) { return d[0] })
.y(function(d) { return d[1] })
.interpolate('basis');
path = svg.append('path')
.attr('d', line(data))
.attr('fill', 'none')
.attr('stroke', 'black')
.attr('stroke-width', 2);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment