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 »

A Line chart using the CSV reader

A simple Line chart that's using the CSV reader to get the data that's shown on the chart.
[No canvas support]

A Line chart that's serving as a basic example of using the csv Reader in conjunction with the csv reader.

The data that's being fetched is done with this line-of-code:

var data = csv.column(2);

And what that does is fetch the whole of the third column (counting starts at zero). This column of data is then given to the chart as its data. The x-axis labels for the chart are simply hardcoded but they could quite easily be fetched from the first column of the csv like this:

var labels = csv.column(0);

The responsive function reduces the size of the canvas tag, reduces the size of the text and rotates the x-axis labels to an angle of 45 degrees. It also adds a bottom css margin and removes the css float.


This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.csv.js"></script>
<script src="RGraph.line.js"></script>
Put this where you want the chart to show up:
<div style="float:right">
    <canvas id="cvs" width="500" 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>
    // Create a new CSV connector object passing it the URL of the CSV file and a
    // function that creates the chart. Due to AJAX restrictions the URL must be
    // relative to the current website/domain.
    new RGraph.CSV('/sample.csv', function (csv)
    {
        // Fetch the third column from the CSV file (the numbering is zero-indexed)
        var data = csv.column(2);

        // Create the Line chart and give it the data that we just got from the
        // CSV file along with some hardcoded X-axis labels.
        var line = new RGraph.Line({
            id: 'cvs',
            data: data,
            options: {
                xaxisLabels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
                responsive:[
                    {maxWidth: null, width:500,height:250, options: {xaxisLabelsAngle: 0,textSize: 12,marginLeft: 35},parentCss: {marginBottom: 0,cssFloat: 'right',textAlign:'none'}},
                    {maxWidth: 900,width: 400,height: 150,options: {xaxisLabelsAngle: 20,textSize: 10,marginLeft: 45},parentCss: {marginBottom: '35px',cssFloat: 'none',textAlign:'center'}}
                ]
            }
        }).draw();
    });
</script>