<style>@import 'https://fonts.googleapis.com/css?family=Monoton';
font-size:120%; text-shadow:3px 3px 3px slategray;}
.line1 {fill:none; stroke:slategray; stroke-width:6;}
.line2 {fill:none; stroke:
</style><svg id='svg002'><script>
var n=20,m=35,margin={top:m,right:m,bottom:m,left:m},
width=650-margin.left-margin.right,
height=350-margin.top-margin.bottom,
tr='translate('+margin.left+','+margin.top+')';
var xScale=d3.scaleLinear().domain([0,n-1]).range([0,width]),
yScale=d3.scaleLinear().domain([0,n]).range([height,0]);
var line=d3.line().curve(d3.curveMonotoneX)
.x(function(d,i) {return xScale(i);})
.y(function(d) {return yScale(d.y);});
var data=d3.range(n).map(function(d) {
return {'y':d3.randomUniform(n)()}})
var svg=d3.select('#svg002')
.attr('width',width+margin.left+margin.right)
.attr('height',height+margin.top+margin.bottom)
.append('g').attr('transform',tr);
svg.append('g').attr('class','x axis')
.call(d3.axisBottom(xScale))
.attr('transform','translate(0,'+height+')');
svg.append('g').attr('class','y axis')
.call(d3.axisLeft(yScale));
svg.append('path').datum(data)
.attr('class','line1').attr('d',line);
svg.append('path').datum(data)
.attr('class','line2').attr('d',line);
svg.selectAll('.dot').data(data).enter()
.append('circle').attr('class','dot').attr('r',3)
.attr('cx',function(d,i) {return xScale(i)})
.attr('cy',function(d) {return yScale(d.y)});
svg.append('text').attr('x',.4*width)
.text('D3 & Google Fonts');