jquery - d3.js - response layout on `height` change `svg` content still stable (not resize) -


i trying make d3.js responsive layout. find demo responsive approach. in demo, width resize works. when re-size height svg children not responsive.

what wrong here?

code :

var chart = $("#chart"),     aspect = chart.width() / chart.height(),     container = chart.parent(); $(window).on("resize", function() {     var targetwidth = container.width();     chart.attr("width", targetwidth);     chart.attr("height", math.round(targetwidth / aspect)); }).trigger("resize"); 

jsfiddle


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -