Add left/right margins to the width, top/bottom margins to the height

I had mixed the margins and the dimensions.
Render charts on a canvas