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");
Comments
Post a Comment