title: d3 add text to circle
body: <p>I am trying to add some text into circle. I have been following example from <a href="http://mbostock.github.com/d3/tutorial/circle.html" rel="noreferrer">a mbostock tutorial</a>, but wasn't able to get the right output.</p>
  
  <p>The code snippet is:</p>
  
  <pre><code>var data;
  var code;
  
  d3.json("/json/trace.json", function(json) {
    data = json;
    console.log(data);
    // get code for visualization
    code = data["code"];
    alert(code);
    var mainSVG = d3
      .select("#viz")
      .append("svg")
      .attr("width", 900)
      .attr("height", 900);
    mainSVG
      .append("circle")
      .style("stroke", "gray")
      .style("fill", "white")
      .attr("r", 100)
      .attr("cx", 300)
      .attr("cy", 300);
    circle = mainSVG.selectAll("circle").data([code]);
  });
  </code></pre>
  
  <p>Any suggestions how to get this work?</p>