I have built a bordered and striped oval in CSS, and I would like to do something similar with SVG. I'm completely new to SVG, and I've tried using Raphael. This is as far as I got (see fiddle here):
var paper = Raphael(150, 150, 320, 320);
var oval = paper.rect(0, 0, 100, 50, 25);
oval.attr('fill', 'crimson');
oval.attr('stroke', 'transparent');
How can I do stripes with SVG, in a similar vein to the CSS?
Raphael doesn't appear to support patterns but it does support linear gradients as a value for the fill attribute:
So using the linear gradient format described in the Raphael documentation, we could create a striped gradient. It would probably make sense to create a function that generates the striped gradient string for you.
See: http://jsfiddle.net/p4Qgw/
You can use the fill attribute or the <filter> elements within your <ellipse> element.
The following link has examples of both of these:
http://srufaculty.sru.edu/david.dailey/svg/newstuff/filtermatrixPattern1.svg
The explanation of filters is here:
http://srufaculty.sru.edu/david.dailey/svg/SVGOpen2010/Filters2.htm