Change cx, cy and circle circle raphael.js

1

I used the raphael library to create a certain graphic. I want to change your position and your radius. How can I do this?

Example jsfiddle: link

    
asked by anonymous 22.04.2015 / 11:09

1 answer

1

In the following expression X controls the position of the center and Y the radius of the arc:

x1 = parseInt(Math.round(X + Y * Math.cos(Math.PI * startAngle / 180)));

The same values should be used in this expression: Ex for x = 200 and Y = 195

var d = "M200,200  L" + x1 + "," + y1 + "  A195,195 0 " + ((endAngle - startAngle > 180) ? 1 : 0) + ",1 " + x2 + "," + y2 + " 
    
22.04.2015 / 11:37