title: Bar chart show values on top
body: <p>I am using mbostock's <a href="http://bl.ocks.org/mbostock/3885304" rel="nofollow">bar chart</a>. The code is nearly the same. Instead of letter and frequency, I have name and value respectively. I want to display the value of each data on the bar. I tried adding this at the end.</p>
  
  <pre><code>svg.selectAll(".bar").append("text")
                       .attr("x", height/2)
                       .attr("y", function(d) { return y(d.value) - 3; })
                       .text(function(d) { return d.value; });
  </code></pre>
  
  <p>But that doesn't seem to work at all. So what have I messed up?</p>