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.11
Version 7.11 (released in March 2026) is the
latest version of RGraph and contains just a few
updates to the code which you can see on
the changelog page. There's
a new dumbbell variation for the Bar and Horizontal bar
charts (both SVG and canvas) and the
front page layout of the
website has been tweaked.
HTML datagrid
In the April 2025 (v6.21) 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.11, 21st March 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.
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.New dual-color Line chart added to the download archive
Written by Richard Heyes, RGraph author, on 20th March 2022
Line chart - one
color for positive values and another color for
negative values. The demo code is shown below and it
should function correctly with version 6.06 of RGraph
(the current version). It will be included in the next
available download archive (version 6.07) whenever that
is available.
The chart uses the beforedraw and
draw events in order to install and remove
clipping - which facilitates using two separate colors
for positive and negative values.
Note also that the second chart uses the es6
spread operator so if you're using a
particularly old browser then this demo may not
function correctly.
// The first line chart is clipped to the top half of the // canvas so you only see the top half of the chart. The // clipping is installed by the clip: property. As a // result of it you only see the top half of the chart // (which is red) line1 = new RGraph.Line({ id: 'cvs', data: data = [ 4,8,6,3,2,4,-5,-4,5,6,-1,-9,1,2,-3,-5,-7,-4,-2,-2,6,2,3,4, 4,8,6,2,3,5,1,4,9,5,6,4,3,8,7,5,6,4,5,1,2,3,4,6 ], options: opt = { textSize: 15, xaxisPosition: 'center', yaxis: false, backgroundGridHlinesCount: 10, backgroundGridVlines: false, backgroundGridBorder: false, shadow: false, linewidth: 0.5, colors: ['red'], filled: true, filledColors:['rgba(255,128,128,0.25)'], marginInner: 15, spline: true, xaxisLabels: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'], xaxisTickmarksCount: 12, clip: 'tophalf' } }).draw(); // This is the chart object that shows the bottom half of the // chart. Again, clipping is used to accomplish this and is again // installed by the clip: property. // This chart uses blue colors instead instead of red. line2 = new RGraph.Line({ id: 'cvs', data: data, options: { ...opt, // Use the ES6 spread operator to combine // the options from above colors: ['blue'], filledColors: ['rgba(128,128,255,0.25)'], yaxisLabels: false, xaxisLabels: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'], clip: 'bottomhalf' } }).draw();