Home > Article > Web Front-end > javaScript vector chart library-gRaphael uses a few lines of code to achieve beautiful bar charts/pie charts/point charts/curve charts_javascript skills
gRaphael is a Javascript library dedicated to helping developers draw various beautiful charts in web pages, based on the powerful Raphael vector graphics library. You only need to write a few simple lines of code to create beautiful bar charts, pie charts, dot plots, and curve charts.
gRaphael uses SVG W3C recommended standards and VML as the basis for creating graphics. It is a cross-browser vector graphics library. Currently supported browsers include: Firefox 3.0, Safari 3.0 , Chrome 5.0, Opera 9.5 and Internet Explorer 6.0.
Usage : Introduce raphael.js, g.raphael.js files into the page, and introduce g.line.js (curve chart), g.bar.js (bar chart) as needed ), g.dot.js (dot chart) and g.pie.js (pie chart) files, and then use the provided methods to create the beautiful charts you want. Here are two simple examples.
Create a static pie chartOnly two lines of code are needed, sample code:
Source code download
Create interactive pie chart
Combining hover and click events and animation methods, you can create beautiful interactive pie charts. Sample code:
Source code download
gRaphael official website address: http://g.raphaeljs.com/
gRaphael English reference document: http://g.raphaeljs.com/reference.html
Raphael official website address: http://raphaeljs.com
Raphael English reference document: http://raphaeljs.com/reference.html
Raphael Chinese help documentation: http://julying.com/lab/raphael-js/docs/
Raphael Tutorial for beginners: An Introduction to the Raphael JS Library