Question

I'm having trouble drawing a smooth curve through a series of close points using Raphael.js. I've tried all of the curve types except for elliptical and they come out with "bumpy" curves.

see this url showing the image: http://neu14.com/demographics/curve.png

The path: "M 0,0 S 1,5 1,10 S 1,15 1,20 S 1,25 1,30 S 1,35 1,40 S 2,45 2,50 S 3,55 3,60 S 4,65 5,70 S 6,75 6,80 S 7,85 8,90 S 9,95 10,100 S 11,105 12,110 S 14,115 15,120 S 16,125 17,130 S 19,135 20,140 S 23,145 26,150 S 29,155 31,160 S 35,165 38,170 S 41,175 44,180 S 49,185 53,190 S 62,195 71,200H 0 V 0 Z"

And the code: shape = paper.path(path); shape.attr({fill:"#09f"});

Lastly, I did try this solution, but it was not an improvement: smooth svg path connection

Any ideas?

Thanks!

Was it helpful?

Solution

Maybe this can help? DEMO

var r = new Raphael(10,10, 500, 500);
var p = r.path("M100,300 L100,100 C100,100 250,100 250,300z");
p.attr({fill: 'yellow', stroke:"red"});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top