d3.js - Resizing choropleth datamaps into container in datamaps -
i trying create dashbord , have used choropleth datamap got here.
my problem when try resize datamap graph fit container,it not getting scaled properly.
so how scale map,to container of
width=100% , height = 450px.
hope can me out here
use d3 size of container:
var containerw = d3.select(".containerclass").style("width'); var containerh = d3.select(".containerclass").style("height');
now use values on svg:
var map = d3.select('.containerclass').append("svg").attr('class','map'); map.style('width',parseint(containerw) + 'px').style('height',parseint(containerh) + 'px');
Comments
Post a Comment