javascript - Changing Raphael arc starting position -
I am trying to draw a percentage of a circle clockwise to use the Raphael javascript library, while the initial position Specifying the
Right now I have been able to start it clockwise by clockwise clockwise and using the code below at 6 o'clock position, but I want to start drawing at 4 o'clock position (or I specify the ideal In any case).
var zodiac = 75; Var archtype = rafael ("canvas", 500, 500); Archtype.customAttributes.arc = function (xloc, yloc, value, total, R) {var alpha = 360 / total * value, a = (-90 - alpha) * Math.PI / 180, x = xloc - R * Math .cos (a), y = yloc - R * Math.sin (a), path; Console.log ('x -' + x); Console.log ('y -' + y); If (total == value) {path = [["m", xlok, yolok-r], ["a", r, r, 0, 1, 1, xlok-0.01, yolok-r]]; } Other {path = [["m", xlok, yolok + r], ["a", r, r, 0, + (alpha> 180), 0, x, y]]; } Return {path: path}; }; Var my_arc = archtype.path (). Ether ({"stroke": "# 00a5ff", "stroke-width": 14, arc: [90, 90, 0, 100, 80]}); My_arc.animate ({Arc: [90, 90, zodiac, 100, 80]}, 1500); I'm just using the Raphael library and really appreciate any help.
thanks
simply found the .rotate function . The following code will rotate circle-45 degrees which will start at 4 o'clock position. I think you will need to use the transform function in Raphael v2. my_arc.rotate (-45, 90, 90) Value ({Arc: [90, 90, zodiac, 100, 80]}, 1500);
Comments
Post a Comment