Step 3: Draw canvas
The third step: drawing our canvas. We create our wrapper & bounds, then shift them to respect our margins.
Let's make some SVG elements! This step will look exactly like our line chart code. First, we find an existing DOM element (
#wrapper), and append an
Then we use
attr to set the size of the
<svg> to our
dimensions.height. Note that these sizes are the size of the "outside" of our plot. Everything we draw next will be within this