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 »

 

SQLite Editor for PHP
The SQLite Editor for PHP software is a tool which will help you and/or your users administer and maintain your SQLite databases. Built as a tool that you can easily provide to your users, there's no danger of them damaging your database.

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.


23rd June, Richard
The SQLite Editor for PHP admin tool is now available for you to download

16th June, Rachel
I have a question about the 3D Bar chart

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

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 »

How to use the dollar syntax for events

A guide that shows you how to use the new dollar syntax for events.

The dollar syntax in RGraph makes it a breeze for you to add event listeners to your charts. Previously you would add an event listener with the on function and then check the index and dataset properties of the shape array to verify which shape had been clicked or hovered over. With the dollar syntax though, you can add event listeners to specific shapes (bars/points/segments etc) by using the syntax shown below. Keep in mind though that, as with arrays, the numbering begins at zero.

The initial chart

Here is the plain Bar chart before the event listeners have been added:

<script>
    bar = new RGraph.Bar({
        id: 'cvs',
        data: [13,12,16,15,12,11,21],
        options: {
            xaxisLabels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
            textSize: 14
        }
    }).draw();
</script>

The chart with the click event added

Here is the Bar chart with the click event added. Note the mouse pointer doesn't change as there hasn't been a mousemove listener added yet.

<script>
    bar = new RGraph.Bar({
        id: 'cvs',
        data: [13,12,16,15,12,11,21],
        options: {
            xaxisLabels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
        }
    }).draw();
    
    bar.$3.onclick = function (e, shape)
    {
        alert('The second Bar charts event listener');
    }
</script>

The chart with the mousemove event added

And here is the Bar chart with the mousemove event listener added. This changes the cursor to the hand when the relevant bar is hovered over. The pointer is automatically changed back for you when the mouse is moved away from the bar.

<script>
    bar = new RGraph.Bar({
        id: 'cvs',
        data: [13,12,16,15,12,11,21],
        options: {
            xaxisLabels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
            textSize: 14
        }
    }).draw();


    bar.$3.onclick = function (e, shape)
    {
        alert('In the third bar charts event listener');
    }
    
    bar.$3.onmousemove = function (e, shape)
    {
        return true;
    }
</script>