var canvas =d3.select('body').append('svg').attr('width',500).attr('height',500);//线条数据var data = [ {x:10,y:100}, {x:60,y:200}, {x:100,y:400},];// 创建线条 - 将数据转化为线条var line =d3.svg.line().x(function(d){returnd.x}).y(function(d){returnd.y});// 添加路径canvas.append('g').selectAll('path').attr('transform','translate(100,100)').data([data]).enter().append('path').attr('d',line).attr('fill','none').attr('stroke','blue')