score:2

Accepted answer
function draw_line(c, data){
                    console.log(c);  
                    var lineGen = d3.svg.line()
                        .x(function(d) {
                            return xScale(d.date);
                        })
                        .y(function(d) {
                            console.log(d[c]);
                            return yScale(d[c]);
                        })
                        .interpolate("basis");
                    lineGen(data); // this line should be return
                }; 

change it to

return lineGen(data); 

Related Query