Raphael: A Javascript library used to draw vector images on webpages _ jquery-js tutorial

Source: Internet
Author: User
Tags vector graphics library
Raphael is a Javascript library used to draw vector images on webpages. It uses SVGW3C recommendation standards and VML as the basis for creating images, you can use JavaScript to operate DOM to easily create various complex bar charts, pie charts, graphs, and other charts. Next, let's take a look at these charts. RaphaelIs a Javascript library used to draw vector images on a webpage. It uses the SVG W3C recommendation standard and VML as the basis for creating graphics. You can use JavaScript to operate DOM to easily create various complex charts, such as bar charts, pie charts, and curves, you can also draw images of any shape and perform complex operations such as cropping and rotating charts or images.

Rapha rjlIs a cross-browser vector graphics library. Currently, the supported browsers include 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 draw any vector image:

The Code is as follows:


// Create a canvas with a width of 320 and a height of 200 in coordinates ()
Var paper = Raphael (10, 50,320,200 );
// Draw a circle with a radius of 10 in the coordinate (x = 50, y = 40)
Var circle = paper. circle (50, 40, 10 );
// Fill the drawn circle with red (# f00)
Circle. attr ("fill", "# f00 ");
// Set the color of the brush to white
Circle. attr ("stroke", "# fff ");

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.