title: how do i format the value shown in a d3 graph
body: <p>I am trying to change the formatting on the value shown on top of the bar graph in a nvd3 discrete bar graph. I believe I am doing something wrong, I have no idea.</p>
  
  <p>Here is the js fiddle for the graph
  <a href="http://jsfiddle.net/looneydoodle/PdpRq/" rel="noreferrer">http://jsfiddle.net/looneydoodle/PdpRq/</a></p>
  
  <p>Here is the code </p>
  
  <pre><code>var basicformat = d3.format(',f');
  d3graph.selectAll('g.nv-bar text').each(function(d,i){
    this.text(basicformat(this.value));
  });
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Figured out how to do it, although it might be a bad way to do it. 
  Here is the updated fiddle: <a href="http://jsfiddle.net/looneydoodle/PdpRq/2/" rel="noreferrer">http://jsfiddle.net/looneydoodle/PdpRq/2/</a></p>