Raphael is a Javascript library that is used to draw vector graphics in a Web page. It uses SVG recommended standards and VML as the basis for creating graphics, you can easily create a variety of complex columns, pie charts, graphs, and other graphs by using JavaScript to manipulate the DOM, as well as drawing arbitrary shapes, which can be used for complex operations such as cutting and rotating graphics or images.
Raphaël is a cross-browser vector graphics library that currently supports browsers such as Firefox 3.0+,safari 3.0+,chrome 5.0+,opera 9.5+ and Internet Explorer 6.0+.
How to use it?
Introduce the Raphael.js file to the page, and then you can draw any vector graphic:
Copy Code code as follows:
Create a canvas with a width of 320 and a height of 200 in the coordinates (10,50)
var paper = Raphael (10, 50, 320, 200);
Draw a circle with a radius of 10 in coordinates (x = 40)
var circle = paper.circle (50, 40, 10);
Fill the drawn circle with red (#f00)
Circle.attr ("Fill", "#f00");
Sets the color of the brush (stroke) to white
Circle.attr ("Stroke", "#fff");