title: appending d3.js canvas to div
body: <p>I'm attempting to add a legend to a graph, and I want to append it to my chart div. Right now I'm using the following code, which appends the legend to the "body". I would like to instead append it to my "chart" div, so that I can create a footer after my legend. Right now the HTML page is processed first, and then my d3 javascript file gets run and therefore the legend gets placed below my footer. Thank you in advance.</p>
  
  <pre><code> // Create the svg drawing canvas...
        var canvas = d3.select("body")
          .append("svg:svg")
            .attr("width", 300)//canvasWidth)
            .attr("height", 300);//canvasHeight);
  </code></pre>