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 »

An SVG Line chart

An SVG Line chart using the trace effect, It's a simple blue Line chart that has circular tickmarks.

A dark-themed filled Line chart that also has the spline option enabled. Circular tickmarks are enabled. The svg tag has a black background and the line is colored dark blue. It uses the trace effect and has a semi-opaque fill color - so you can see the background through it.

Note that this choice of colors may not be best suited for someone who has sight difficulties as the difference in colors (the black and the dark blue) may be too slight for them to distinguish.

Also, a chart that shows the achievements of individual figures, like this one does, may be more suited to a Bar (horizontal or vertical) as the data is not a continuing series, but more a set of individual numbers that apply (in this case) to a group of people.

In terms of responsiveness when the screen is smaller the labels change to use dual lines and the tickmarks disappear.

This goes in the documents header:
<script src="RGraph.svg.common.core.js"></script>
<script src="RGraph.svg.line.js"></script>
Put this where you want the chart to show up:
<div style="float: right">
    <div style="width: 750px; height: 300px; background-color: black" id="chart-container"></div>
</div>
This is the code that generates the chart - it should be placed AFTER the div tag:
<script>
    new RGraph.SVG.Line({
        id: 'chart-container',
        data: [5,8,6,3,4,1,9,8,2,3,5,6,7,8,9,4,5,6,3,2,5,4,8,6,4,5,3,1,6,4,5],
        options: {
            backgroundGridColor: '#555',
            marginInner: 0,
            textColor: 'white',
            textFont: 'Verdana',
            filled: true,
            filledColors: ['rgba(25,51,74,0.75)'],
            colors: ['#5AF'],
            yaxisScaleUnitsPost: 'm',
            yaxisScaleUnitsPre: '$',
            linewidth: 4,
            spline: true,
            marginLeft: 65,
            tickmarksStyle: 'dot',
            tickmarksFill: 'black',
            responsive: [
                {maxWidth: null,width:750,height:300,options: {xaxisLabels: ['Kev','John','Fred','July','Fred','Olga','Ben','Boris','Lenny','Pete','Lewis'],textSize: 14,tickmarksStyle: 'circle',tickmarksSize: 5,linewidth: 3}, parentCss:{'float':'right',textAlign:'none'}},
                {maxWidth: 1000, width:400,height:200,options: {xaxisLabels: ['Kev','\nJohn','Fred','\nJuly','Fred','\nOlga','Ben','\nBoris','Lenny','\nPete','Lewis'],textSize: 10,tickmarksStyle: '',tickmarksSize: 3,linewidth: 2}, parentCss:{'float':'none',textAlign:'center'}}
            ]
        }
    }).trace();
</script>