Change Cx, Cy and Circle ray Raphael.js

Asked

Viewed 26 times

1

I used the Raphael library to create a certain chart. I want to change its position and its radius. How can I do this?

Example jsfiddle: http://jsfiddle.net/tttxfvcu/6/

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 + " 

Browser other questions tagged

You are not signed in. Login or sign up in order to post.