I’m trying to fill a portion of a circle with a colour. For example, having a circle with 2/3 red and 1/3 empty.
The Raphael JS documentation doesn’t help much. What is the best way to approach this?
Some examples can be seen at below picture:

var paper = new Raphael(document.getElementById('shape_container'), 400, 100);
var circle = paper.circle(50, 50, 30);
circle.attr (
{
fill: '#F00'
}
);
With the code above, I can draw a circle with full of red..
I could not find any way for how to fill 2/3 red..
Welcome, Alperen. I believe what you actually want is an arc path rather than a circle. Take a look at this:
The geometry in the arcpath function is reasonably straightforward (though I had to look up the reference for large-sweep-flag, which was decidedly non-obvious). I’m sure this could be optimized substantially, but it’s a functional first step.