score:44

Accepted answer

the problem is that you're using the same selector, svg.selectall(".dot"), for each dataset .data(tsv1) and .data(tsv2).

d3 thinks that the 2nd set is supposed to replace the first. you can fix it by assigning a unique class to each type of dot.

    svg.selectall(".blue.dot")// select specifically blue dots
        .data(tsv1)
        .enter().append("circle")
        .attr("class", "blue dot")// assign two classes
        ...

    svg.selectall(".orange.dot")
        .data(tsv2)
        .enter().append("circle")
        .attr("class", "orange dot")
        ...

Related Query

More Query from same tag