The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Margins

Margins

1:39
This lesson will show you how to add margins to your D3 charts to give them the elbow room they deserve.
Watch this lesson now
Avatar
egghead.io

This lesson will show you how to add margins to your D3 charts to give them the elbow room they deserve.

Avatar
Trey

Hi Ben,

I'm not sure if I fully understand how the margins are being set. I understand the object where we are defining all the margins, but I'm having trouble wrapping my mind around why we subtract it from the #chartArea width and height and then add it back in for the SVG width and height. I also don't really understand the "transform" using margin.left + margin.top. Any further explanation would be wonderful.

Thanks

In reply to egghead.io
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?