About
RGraph is a JavaScript charts library based on
HTML5 SVG and canvas. RGraph is mature (over 17 years
old) and has a wealth of features making it an ideal
choice to use for showing charts on your website.
Version 7 released
Version 7 (released in August 2025) is the latest version of RGraph and
brings with it a big improvement in the quality
of the text that's rendered on canvas charts.
This new improvement in text rendering is
the major focus in this release. Read more
about the new scaling feature at the link below.
New HTML datagrid
In the April 2025 release a new datagrid object
was added.
This makes it easy to add static or dynamic data
tables to your pages. It can be used whether you use the
canvas or SVG libraries or entirely standalone.
Download
Get the latest version of RGraph (version 7.00, 12th August 2025) 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.
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', backgroundGridVlinesCount: 20, backgroundGridLinewidth: 2, colors: ['black'], tickmarksStyle: 'filledcircle', xaxis: false, yaxis: false, 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>