title: Adding text to rect not working
body: <p>I am trying to add text to rect but it doesn't seem to be working, This is what I am trying,</p>
  
  <pre><code>var width = 600,
  height = 600;
  var margin = {top: -5, right: -5, bottom: -5, left: -5};
  
  var zoom = d3.behavior.zoom()
      .scaleExtent([1, 15])
      .on("zoom", zoomed);
  
  var svgContainer = d3.select("body").append("svg")
                                      .attr("width", width)
                                      .attr("height", height)
                                      .style("background-color", "black")
                                      .append("g")
                                      .attr("transform", "translate(" + margin.left + "," + margin.right + ")")
                                      .call(zoom);
  
  var zoomed = function () {
      svgContainer.attr("transform", "translate("+ d3.event.translate + ")scale(" + d3.event.scale + ")");
  };
  
  var zoom = d3.behavior.zoom()
  .scaleExtent([1, 8])
  .on("zoom", zoomed)
  .size([width, height]);
  
  svgContainer.call(zoom);
  
  var rectangle1 = svgContainer.append("rect")
                              .attr("x", 0)
                              .attr("y", 0)
                              .attr("width", 100)
                              .attr("height", 100)
                              .attr("fill", "red")
                              .append("text")
                              .text("Hahaha");
  </code></pre>
  
  <p>Here's is fiddle for it - <a href="http://jsfiddle.net/nhe613kt/60/" rel="nofollow">http://jsfiddle.net/nhe613kt/60/</a></p>