Rahael pie slice representation with gradient

Just playing with Rahael :)

HTML

<div id="bg">
    <div id="paper"></div>
</div>

CSS

#bg
{
    background-image: -moz-linear-gradient(bottom, #000 0%, #5d5d5d 100%);
	background-image: -o-linear-gradient(bottom, #000 0%, #5d5d5d 100%);
	background-image: -webkit-linear-gradient(bottom, #000 0%, #5d5d5d 100%);
	background-image: linear-gradient(bottom, #000 0%, #5d5d5d 100%);
}
#paper
{
    padding : 30px;
}

JavaScript

Raphael.fn.pie = function (cx, cy, r, a1, a2) {
    var d, flag = (a2 - a1) > 180;
    
    a1 = (a1 % 360) * Math.PI / 180;
    a2 = (a2 % 360) * Math.PI / 180;
    
    d = ["M", cx, cy, "l", r * Math.cos(a1), r * Math.sin(a1), "A", r, r, "0", +flag, "1", cx + r * Math.cos(a2), cy + r * Math.sin(a2), "z"];
    
    return this.path(d.join(' '));
};
maxValue= 5;
actualValue= 4.3;
slice = (360/maxValue)*actualValue;
paper = Raphael("paper", 300, 300);
pies  = paper.set();

pies.push(paper.pie(150, 150, 140, 0, slice).attr({fill:'80-#ffce00-#ff0000',opacity:0.9,stroke: "#a50000",
    "stroke-width": 2}));