MENU
.net Powerful JavaScript charts
About
RGraph is a JavaScript charts library based on HTML5 SVG and canvas. RGraph is mature (over 18 years old) and has a wealth of features making it an ideal choice to use for showing charts on your website.

More »

 

Version 7.20
Version 7.20 (released in June 2026) is the latest version of RGraph and the major change in this version is an update to the default values of properties making for better looking charts without having to set any properties. Read more about this and other changes in the changelog.

Download »

 

Download
Get the latest version of RGraph (version 7.20, 9th June 2026) from the download page. You can read the changelog here. There's also older versions available, minified files and links to cdnjs.com hosted libraries.

Download »

 

Latest forum posts
These are the latest support forum posts that have been posted or updated.


12th June, Marco
Should I use SVG or canvas for the charts on my website?
9th June, Richard
New version of RGraph: version 7.20
3rd June, Patrick
Question about installing RGraph
1st June, Ouja
How do I add a click event to a bar in my Bar chart?
8th May, Anthony Kuma
Does the SVG Line chart have outofbounds functionality?


Support forum »

 

License
RGraph can be used for free under the GPL or if that doesn't suit your situation there's an inexpensive (£129) commercial license available.

More »

Creating charts asynchronously

Asynchronous processing can speed up the display of your charts, because the browser gets to your code, sets it going and then continues on rendering the page. Particularly if you have a weighty page, it can make quite a difference. The RGraph.async function itself is very simple, but because it can make a significant difference to the speed of your page, it's documented here. There's an example of it below. One thing to remember is to ensure your canvas tag is defined first before you call the function that creates the chart.

Although asynchronous processing can speed up your pages, it can also give the appearance of slower pages due to partial rendering, (ie your pages render a bit at a time). You therefore will need to experiment to get the best result for you.


<!-- Include the library files -->
<script src="RGraph.common.js"></script>
<script src="RGraph.line.js"></script>

<!-- Define the canvas tag -->
<canvas id="cvs" width="300" height="100">[No canvas support]</canvas>

<!-- Create the chart -->
<script>
    function createLineChart ()
    {
        var line = new RGraph.Line({
            id: 'cvs',
            data: [1,2,4,2,1,3,5,6,6,5,3,5],
            options: {
                title: 'Sales for Acme Inc.',
                titleSize: 16,
                xaxisLabels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
                marginInner: 10,
                linewidth: 5,
                textSize: 14
            }
        }).draw();
    }

    RGraph.async(createLineChart);
</script>

Things to remember

See also

You might also be interested in the alternative, DOMContentLoaded event.