score:2

Accepted answer

There're two small problems with your code. First, the range of a scale needs to be specified as a two-element array, i.e. instead of

.range(0, width)

do

.range([0, width])

Secondly, you need to pass the data in as a one-element array (as there's only a single line), i.e.

svg.append("path")
   .data([data])

Complete jsfiddle here.


Related Query

More Query from same tag