Accepted answer

The problem is the svg.selectAll("path") to update the area. This also selects the paths created by the axis components, which don't have any data bound to them. Therefore, the area generator returns an empty path, which causes the error message you're seeing.

To fix, simply include the class you have assigned in the selector: svg.selectAll("path.area"). Complete demo here.

More Query from same tag