chart overflowing container

I am reproducing the following graphic https://observablehq.com/@d3/hierarchical-bar-chart. I want to show it in a popup using ajax call, when calling it it is shown but it overflows the container div, I have tried to assign the width attribute without success

Do you mind sharing your code?