score:18

Accepted answer

change your marker creation to the following:

svg.append("svg:defs").append("svg:marker")
    .attr("id", "triangle")
    .attr("refx", 15)
    .attr("refy", -1.5)
    .attr("markerwidth", 6)
    .attr("markerheight", 6)
    .attr("orient", "auto")
    .append("path")
    .attr("d", "m 0 -5 10 10")
    .style("stroke", "black");

once you do this, you'll see a line being drawn. you may want to use fill instead of stroke if you want a filled in arrow, which you can get by using the following code:

svg.append("svg:defs").append("svg:marker")
    .attr("id", "triangle")
    .attr("refx", 6)
    .attr("refy", 6)
    .attr("markerwidth", 30)
    .attr("markerheight", 30)
    .attr("orient", "auto")
    .append("path")
    .attr("d", "m 0 0 12 6 0 12 3 6")
    .style("fill", "black");

Related Query