Search code examples
raphaelgraphael

Adding labels for graphael bar charts?


I am using graphael to draw barcharts for my data, and couldn't figure out how to give the bar charts a label.

var r = Raphael(element);
r.hbarchart(10, 20, 500, 220, barData, {colors:colors, type:'square'}).hover(fin, fout);

Solution

  • Call label on your chart object.

      var barChart = r.g.barchart(0, 0, 200, 200, [3,2,1]);
      barChart.label(['a','b','c']);