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 (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.
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.
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.
RGraph has some simplified ajax helper functions that
make it much easier to initiate ajax calls without having to be
concerned about what the format that the response is in
(string, number, object etc).
Previously, because the response to an ajax request is a string, you had
to convert it into a usable form (such as a number or an array).
With these functions though they automatically do the
data format conversion for you. The AJAX functions that
are available to you are:
Name: string RGraph.AJAX(string url, function callback)
Description:
Fetches the URL and returns the response to you as a string. No processing is performed on the response.
Name: number RGraph.AJAX.getNumber(string url, function callback)
Description:
Fetches the URL and returns the response to you as a number. This assumes that the output of the AJAX request is a single number.
Name: string RGraph.AJAX.getString(string url, function callback)
Description:
Fetches the URL and returns the response to you as a string.
Name: array RGraph.AJAX.getCSV(string url, function callback[, string separator = ","])
Description:
Fetches the URL and returns the response to you as an array. The response is split on the optional separator, which defaults to a comma. It doesn't support multi-line files - it only fetches a single line of CSV data. If you want multi-line support, you'll need to use the CSV import utility.
Name: object RGraph.AJAX.getJSON(string url, function callback)
Description:
Fetches the URL and returns the response to you as an object. This is the most versatile of all of the AJAX methods, allowing you to retrieve multiple pieces of data in one call. It uses the JavaScript eval() function to convert the reponse to an object.
Name: string RGraph.AJAX.post(string url, object data, function callback)
Description:
This function allows you to make HTTP POST requests and send data back to the server. The data argument should be a JavaScript object of key/value pairs that will be sent to the server. The data is encoded for you.
There are straight-forward examples of the ajax functions in the
basic examples in the download archive