score:0

Accepted answer

Thanks to @leMoisela for pointing me in the right direction. I fixed my issue nicely using JS to redraw the graph on resize:

http://jsfiddle.net/46PfK/4/

window.onresize = function(e){
    draw_graph();
};

score:0

There's a good example on resizing with D3 https://blog.safaribooksonline.com/2014/02/17/building-responsible-visualizations-d3-js/

After you update your scales, only thing left to resize your circles would be something like this:

/* Force D3 to recalculate and update the points */
svg.selectAll('circle')
    .attr('cx', function (d) { return xScale(d.x); })
    .attr('cy', function (d) { return yScale(d.y); })
    .attr('r', 4); 

Related Query

More Query from same tag