I am trying to use d3.js to draw line chart.
var lineChart = lineChart()
Uncaught TypeError: lineChart is not a function
You are shadowing you function.
This happens when you declare another variable/function with the same name of an upper one. What you should do is to give another name to the second one declaration just like @andlrc says in his comment.
var lineChartResult = lineChart()...
You can learn more about shadowing in here: Setting & Shadowing Properties