title: How to make a chart in D3 work in node.js
body: <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
   &lt;script type="text/javascript" src="d3/d3.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;script type="text/javascript"&gt;
      var dataA=[10,20];
      d3.select("body").style("background-color", "green");
  
      var canvas = d3.select("body")
                     .append("svg")
                     .attr("width",500)
                     .attr("height",500);
  
      var bars = canvas.selectAll("rect")
                       .data(dataA)
                       .enter()
                       .append("rect")
                       .attr("width",function (d){ return d*5;})
                       .attr("height",10)
                       .attr("y",function(d,i){ return i*20;});
  
  &lt;/script&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>
  This is the code I used for drawing a bar char in d3. how can I use node.js to do the same chart?</p>