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 »

 

SQLiteEditor 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.


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

1st June, Ouja
How do I add a click event to a bar in my Bar chart?

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 »

A Bar chart using AJAX

[No canvas support]

Here is an example of a 3D variation of the Bar chart which is both animated using the grow effect and which is also fetching its data via ajax.

The ajax script is a simple one that just outputs a sequence of random numbers. You can see the script directly by going here.

If you view the ajax script you'll see that it just outputs the numbers and nothing else - so no labels or title. So on the chart, the labels are just hardcoded.

The rest of the configuration is pretty straightforward - and you can see it below.

When the screen is smaller the canvas dimensions are reduced, the marginInner is reduced and the textSize is reduced as well.

This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.dynamic.js"></script>
<script src="RGraph.common.tooltips.js"></script>
<script src="RGraph.bar.js"></script>
Put this where you want the chart to show up:
<div style="float: right">
    <canvas id="cvs" width="600" height="250">[No canvas support]</canvas>
</div>
This is the code that generates the chart - it should be placed AFTER the canvas tag(s):
<script>
    // Use the RGraph.AJAX.getCSV() function to fetch some CSV data from the server.
    // This example fetches the URL https://www.rgraph.net/getdata.html which just
    // outputs a set of CSV values. The second argument is a function which is
    // used as the callback and creates the chart.
    RGraph.AJAX.getCSV('/getdata.html', function (data)
    {
        new RGraph.Bar({
            id: 'cvs',
            
            // Use the CSV data directly in the chart configuration
            data: data,

            options: {
                colors: ['gradient(#080:green)'],
                xaxisLabels: ['John', 'Fred', 'Joe', 'Rich', 'Pete', 'Lilly', 'Fred', 'Joe', 'Rich', 'Pete'],
                marginLeft: 35,
                
                // This sets it so that the bar chart is drawn as a 3D variant
                variant: '3d',

                marginInnerGrouped: true,
                marginBottom: 75,
                
                tooltips: '<span style="font-size: 14pt">Total value:<br /><span style="font-size: 26pt">%{value}%',

                title: 'An animated 3D Bar chart',
                titleColor: '#666',
                titleSize: 16,
                titleOffsety: 5,
                titleSubtitle: 'This chart uses random data',
                titleSubtitleOffsety: -5,
                responsive: [
                    {maxWidth: null,width:600,height:250,options:{marginInner: 10,textSize:12},parentCss:{'float': 'right',textAlign:'none'}},
                    {maxWidth: 800,width:400,height:200,options:{marginInner: 5,textSize:10},parentCss:{'float': 'none',textAlign:'center'}}
                ]
            }
        
        // The grow() animation effect is used and works just like a regular Bar chart. Some
        // responsive capability is also added.
        }).grow();
    });
</script>