Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save etagwerker/457519 to your computer and use it in GitHub Desktop.
Save etagwerker/457519 to your computer and use it in GitHub Desktop.
window.onload = function () {
var raphael = Raphael("holder");
raphael.g.txtattr.font = "12px 'Trebuchet MS','Trebuchet','Verdana','sans-serif'";
raphael.g.text(210, 20, "User Activity").attr({"font-size": 16});
var pie = raphael.g.piechart(260, 180, 90, [55, 20, 13], {legend: ["Active", "Inactive", "Recently Inactive"], legendpos: "west", href: ["http://google.com", "http://etagwerker.com", "http://github.com"]});
pie.hover(function () {
this.sector.stop();
this.sector.scale(1.1, 1.1, this.cx, this.cy);
if (this.label) {
this.label[0].stop();
this.label[0].scale(1.5);
this.label[1].attr({"font-weight": 800});
}
}, function () {
this.sector.animate({scale: [1, 1, this.cx, this.cy]}, 500, "bounce");
if (this.label) {
this.label[0].animate({scale: 1}, 500, "bounce");
this.label[1].attr({"font-weight": 400});
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment