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.01 released
Version 7.01 (released in October 2025) is the
latest version of RGraph and now includes a new tree
structure object. The accompanying Treemenu object can then turn
the object into a fully dynamic tree menu.
You can read the API documentation for the tree on
the main API documentation page
and see an example of the Treemenu
feature by following this link...
New 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.01, 8th October 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.HOWTO: Use CSS 3D transformations
Example
Here's an example of the code below that shows a 3D Line chart
Introduction
WebKit (which is used by Chrome, Safari, Edge, Opera and possibly others) and Firefox all support CSS 3D transformations. If you're tasked with supporting these browsers then by using 3D transformations you can add 3D effects to your charts. The effect is specified by adding a CSS property which is shown below. Because the effect changes the position of the canvas coordinates in relation to the page you must also tell RGraph to position the tooltips at the pageX/pageY coordinates which you do with the tooltipsCoordsPage option - as shown below.
<canvas id="cvs" width="600" height="250" style="-webkit-transform: rotate3d(0, 1, 0, 45deg) rotate3d(0, 0, 1, 5deg) rotate3d(1, 0, 0, -15deg); -moz-transform: rotate3d(0, 1, 0, 45deg) rotate3d(0, 0, 1, 5deg) rotate3d(1, 0, 0, -15deg); -o-transform: rotate3d(0, 1, 0, 45deg) rotate3d(0, 0, 1, 5deg) rotate3d(1, 0, 0, -15deg); -ms-transform: rotate3d(0, 1, 0, 45deg) rotate3d(0, 0, 1, 5deg) rotate3d(1, 0, 0, -15deg); transform: rotate3d(0, 1, 0, 45deg) rotate3d(0, 0, 1, 5deg) rotate3d(1, 0, 0, -15deg); box-shadow: 3px 3px 5px gray">[No canvas support]</canvas>
<script> new RGraph.Line({ id: 'cvs', data: [4,6,8,4,1,3,4,2,8], options: { xaxisLabels: ['John', 'Lou','Kevin','Barry','John','Alex','Nick','Fred','June'], tooltips: '%{property:xaxisLabels[%{index}]}', tooltipsCss: { fontSize: '20pt' }, tooltipsPositionStatic: false, tooltipsCoordsPage: true, marginInner: 10, tickmarksStyle: 'filledarrow', tickmarksSize: 15, backgroundGridVlines: false, backgroundGridBorder: false, xaxis: false, yaxis: false, textSize: 16, spline: true } }).draw(); </script>
Known bugs
- Mozilla Firefox does not work correctly with tooltips.
- Apple Safari sometimes has trouble with showing tooltips.
- Google Chrome sometimes has trouble with showing tooltips.
See also
- 3D transformations on the Surfin' Safari Blog
- Another example of 3D transformations with video (or a Bar chart depending on your browser) bar-html5-3d-transformations.html This demo is available in the download archive