Skip to content

Instantly share code, notes, and snippets.

View saurabh7705's full-sized avatar

Saurabh Maheshwari saurabh7705

View GitHub Profile
// Creates canvas 640 × 480 at 10, 50
var r = Raphael(10, 50, 640, 480); //OR
var r=Raphael(“holder”); //holder is name of div
var chart=r.g.barchart(x, y, width, height, values, opts);
//opts stands for options such as: type (round, square, soft, sharp), stacked (true, false), gutter etc.
@saurabh7705
saurabh7705 / gist:1958539
Created March 2, 2012 13:58
Bar Chart using Raphael
y=[1,5,23,4,5,8,9,14,24,36,31,2,22,24,24,15,4,4,8,12];
fin = function () {
this.flag = r.g.popup(this.bar.x, this.bar.y, this.bar.value || "0").insertBefore(this);
},
fout = function () {
this.flag.animate({opacity: 0}, 300, function () {
this.remove();
});