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.
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
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.
Latest forum posts
These are the latest support forum posts that have been
posted or updated.
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?
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.A black and gray SVG Line chart
A straightforward Line chart that's showing UFO sightings over the past century. As you can see - people's creativity is clearly on the increase - particularly since the 1990s!
The background grid is customised with white and an increased number of vertical lines.
The x-axis labels are just years, the axes have been turned off and the tickmarks for the line are filled circles.
On the whole, it's a pretty regular Line chart. The responsive configuration just shrinks the size of the chart and reduces the size of the linewidth and the tickmarksSize options.
This goes in the documents header:
<script src="../libraries/RGraph.svg.common.core.js" ></script> <script src="../libraries/RGraph.svg.line.js" ></script>Put this where you want the chart to show up:
<div style="float: right">
<div style="width: 600px; height: 250px" id="chart-container"></div>
</div>
This is the code that generates the chart - it should be placed AFTER the div tag:
<script>
// A Line chart that shows the increase over the years
// of UFO sightings. The background color and the grid
// have been color inverted with the grid being
// white and the background color being gray. The axes
// have been disabled and the text is slightly smaller
// than the default.
new RGraph.SVG.Line({
id: 'chart-container',
data: [0,2,3,2,3,6,5,6,10,42,46],
options: {
backgroundColor: '#eee',
backgroundGridColor: 'white',
backgroundGridLinewidth: 2,
colors: ['black'],
tickmarksStyle: 'filledcircle',
yaxisScaleUnitsPost: 'k',
textSize: 10,
xaxisLabels: ['1910','1920','1930','1940','1950','1960','1970','1980','1990','2000','2010'],
// Add some responsive capability
responsive: [
{maxWidth: null,width:600,height:250,parentCss: {'float':'right',textAlign:'none'},options:{xaxisLabelsAngle: 0,linewidth:2,tickmarksSize:6}},
{maxWidth: 850, width:400,height:200,parentCss: {'float':'none',textAlign:'center'}, options:{xaxisLabelsAngle: 45,linewidth:2,tickmarksSize:5}}
]
}
// Use the trace() animation to show the chart
}).trace();
</script>