title: How to add data labels to dimple.js bar charts?
body: <p>I am trying to add data lables to each bar in the dimple bar chart. I want to add the same as shown in this example.<a href="http://dimplejs.org/advanced_examples_viewer.html?id=advanced_custom_styling" rel="nofollow">http://dimplejs.org/advanced_examples_viewer.html?id=advanced_custom_styling</a>. But I want to add the number on top of each bar in the chart. My code is as below. I am not sure how to capture the 'rect' shape and append a text to it.Please advise.</p>
  
  <pre><code>&lt;div id="test" class="column"&gt;        
      &lt;script type="text/javascript"&gt;
          var svg = dimple.newSvg("#test", 590, 335);            
          var data = [
              {"Month": "2014-01-10", "Color": "Yellow", "Percentage": 20},
              {"Month": "2014-02-10", "Color": "Yellow", "Percentage": 32},
              {"Month": "2014-03-10", "Color": "Yellow", "Percentage": 20},
              {"Month": "2014-04-10", "Color": "Yellow", "Percentage": 32},
              {"Month": "2014-01-10", "Color": "Red", "Percentage": 10},
              {"Month": "2014-02-10", "Color": "Red", "Percentage": 25},
              {"Month": "2014-03-10", "Color": "Red", "Percentage": 15},
              {"Month": "2014-04-10", "Color": "Red", "Percentage": 30}
              ];
          var chart = new dimple.chart(svg, data);            
          chart.setBounds(80, 30, 340, 200);
          var x = chart.addCategoryAxis("x", ["Month", "Color"]);
          var y1 = chart.addMeasureAxis("y", "Percentage");
          var bars = chart.addSeries("Color", dimple.plot.bar, [x, y1]);
          bars.barGap = 0.5;
          chart.addLegend(50, 10, 510, 20, "right");            
          chart.draw();
          svg.append("text")
                  .attr("x", chart._xPixels() + chart._widthPixels() / 2)
                  .attr("y", chart._yPixels() - 10)
                  .style("text-anchor", "middle")
                  .style("font-family", "sans-serif")
                  .style("font-size", "75%")
                  .text("Sample Text")
      &lt;/script&gt;
  </code></pre>
  
  <p></p>