score:1

Accepted answer

You are treating your single path like it's two separate elements. It's just one element and your area call (and style) is overriding your line call (and style). If you want to style them different, plot a line and an area.

svg.append("path")
 .datum(data)
 .attr("class", "area")
 .attr("d", area);

svg.append("path")
 .datum(data)
 .attr("class", "line")
 .attr("d", line);

Updated fiddle.


Related Query

More Query from same tag