<canvas width="960" height="500"></canvas>
<script src="d3.min.js"></script>
var canvas = document.querySelector("canvas"),
context = canvas.getContext("2d");
var margin = {top: 30, right: 30, bottom: 30, left: 30},
width = canvas.width - margin.left - margin.right,
height = canvas.height - margin.top - margin.bottom,
var color = d3.scale.category10()
var line = d3.shape.line()
context.translate(margin.left, margin.top);
context.moveTo(0.5, height + 0.5);
context.lineTo(0.5, 0.5);
context.moveTo(0.5, height + 0.5);
context.lineTo(width + 0.5, height + 0.5);
points.forEach(function(d) {
context.moveTo(d[0] + radius, d[1]);
context.arc(d[0], d[1], radius, 0, 2 * Math.PI, true);
color.domain().forEach(function(i) {
var parts = i.split(":"), name = parts[0], value = +parts[1];
line.interpolate(name, value)(points);
context.strokeStyle = color(i);