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

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -