Accepted answer

This is happening because domain was not set -

d3.scale.category10() not behaving as expected

has the answer


I have set up a minimal fiddle to show you the proper way to set up the line function. I also changed the color scheme to category(10) to show more contrasting colors (you can still use category20 and see a difference in colors though). Here is the FIDDLE.

var lineFunction = d3.svg.line()
        .x(function (d) {
        return d.x;
        .y(function (d) {
        return d.y;

Related Query