score:0

Accepted answer

you will have to add the axis using d3.scale function. see this plnkr for working example.

  //add x and y axis
  var x = d3.scale.linear()
    .range([0, 950]);

  var y = d3.scale.linear()
    .range([200, 0]);

  var xaxis = d3.svg.axis()
    .scale(x)
    .orient("bottom");

  var yaxis = d3.svg.axis()
    .scale(y)
    .orient("left");

  x.domain([0, 950]);

  y.domain([0, 7]);

  svg.append("g")
    .attr("class", "x axis")
    .attr("transform", "translate(20,250)")
    .call(xaxis);

  svg.append("g")
    .attr("class", "y axis")
    .attr("transform", "translate(20,30)")
    .call(yaxis);

Related Query