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

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -