title: Text on vertical bars not showing using d3.js
body: <p>I am trying to generate bar chart using d3.js.But my code is not showing the text i have appended on rect.I call a function that displays the the bar chart.My code is as follows
  my code:</p>
  
  <pre><code>function renderChartVertical(data)
  {
      var margin = {top: 20, right: 20, bottom: 150, left: 100},
      width = 600 - margin.left - margin.right,
      height =400 - margin.top - margin.bottom;
  
  
  var x = d3.scale.ordinal().rangeRoundBands([0, width], .05);
  
  var y = d3.scale.linear().range([height, 0]);
  
  var xAxis = d3.svg.axis()
      .scale(x)
      .orient("bottom");
  
  
  var yAxis = d3.svg.axis()
      .scale(y)
      .orient("left")
      .ticks(10);
  
  var tip = d3.tip()
  .attr('class', 'd3-tip')
  .offset([-10, 0])
  .html(function(d) {
    return "&lt;strong&gt;Value:&lt;/strong&gt; &lt;span style='color:blue'&gt;" + d.value + "&lt;/span&gt;";
  });
  
  var svg = d3.select("#chart").append("svg")
      .attr("width", width + margin.left + margin.right)
      .attr("height", height + margin.top + margin.bottom)
    .append("g")
      .attr("transform", 
            "translate(" + margin.left + "," + margin.top + ")");
  svg.call(tip);
    x.domain(data.map(function(d) { return d.key; }));
    y.domain([0, d3.max(data, function(d) { return d.value; })]);
  
    svg.append("g")
         .attr("class", "barsLables")
        .attr("transform", "translate(0," + height + ")")
        .call(xAxis)
      .selectAll("text")
        .style("text-anchor", "end")
        .attr("dx", "-.5em")
        .attr("dy", "0.1em")
        .attr("transform", "rotate(-45)" );
  
    svg.append("g")
        .attr("class", "gridLineLabels")
        .call(yAxis)
      .append("text")
        .attr("transform", "rotate(-90)")
        .attr("y", 6)
        .attr("dy", ".71em")
        .style("text-anchor", "end")
        .text("Value ($)");
  
    svg.selectAll("bar")
        .data(data)
      .enter().append("rect")
      .attr("class", "bars")
        .attr("x", function(d) { return x(d.key); })
        .attr("width", x.rangeBand())
        .attr("y", function(d) { return y(d.value); })    
        .attr("height", function(d) { return height - y(d.value); })
        .on('mouseover', tip.show)
        .on('mouseout', tip.hide);
  
    svg.selectAll("rect")
  .append("text")
  .attr("class", "below")
  //.attr("x", 12)
  //.attr("dy", "1.2em")
  .attr("text-anchor", "end")
  .text(function(d) { return d.value; });
  
  //  svg.selectAll("bar")
  //  
  //  .attr("height", 0)
  //  .transition()
  //  .delay(100000000) ;     
  }
  </code></pre>
  
  <p>The text on vertical bars is not showing.plz guide</p>