The reason is because you are repeating the same row over and over on the same x1 / x2 / y1 / y2 for the dataset.
This will make your curve line:
var svg = d3.select('svg');
var dataSet = [10,20,30,20,30,20,30,20,30,20,30,20,30,20,30,20,30];
var myLine = svg.selectAll('line')
.data(dataSet)
.enter()
.append('line')
.style("stroke", "blue")
.attr('x1', function(d) { return 100; })
.attr('y1', function(d) { return 200; })
.attr('x2', function(d) { return 300; })
.attr('y2', function(d) { return 40; });
Working example here
Now the curvature will go because you make one line on x1 / x2 / y1 / y2
var svg = d3.select('svg');
var dataSet = [10];
var myLine = svg.selectAll('line')
.data(dataSet)
.enter()
.append('line')
.style("stroke", "blue")
.attr('x1', function(d) { return 100; })
.attr('y1', function(d) { return 200; })
.attr('x2', function(d) { return 300; })
.attr('y2', function(d) { return 40; });
Working example here
In short, you should not draw the same line again and again ...
Hope this helps!