A common pattern to make a chart responsive:
widthwith this piece of code:
First of all, make sure you understood how this basic area chart is built with d3.js. The following example just uses the concept described above to make it responsive. Try to change the window size!
The most common way to add responsiveness in d3.js is to use an event listener. Here is the basic idea:
Using the bootstrap grid as a workaround for responsiveness