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.Version 6.13 of RGraph is now available
Written by Richard Heyes, RGraph author, on 17th July 2023
The latest version of RGraph - version 6.13 - is now available to download from the
download page. What's new in this release?
- The
svgScatter chartnow has a trace effect just like theLine chart. This may look strange when you're using theScatter chartto produce a vertical Line as it always animates from left to right. However, when you're producing aVertical Line chartthen you may want to instead look at using theHorizontal Bar chart. You can read the relevant properties on thesvgHorizontalBar chartapidocumentation page and there's a blog article (with an example) about producing aVertical Line charthere. - Fixed a missing background grid line in the
canvasHorizontalBar chartwhich became apparent when theX-axiswas turned off. - A significant change to the way that you specify the
responsive clauses on your chart (though this change doesn't at all mean that you have to alter all of your charts). The change is how you specify the responsiveclauses when you define your chart - you can now put them in the main configuration of the chart instead of calling theresponsivefunction after you call thedrawfunction. The code shown below highlights the new way that you can put theresponsiveclauses.<script> new RGraph.Bar({ id: 'cvs', data: [12,18,10,9,6,20,18], options: { yaxisScaleUnitsPost: 'k', colors: ['red'], title: 'A basic responsive Bar chart', titleBold: true, xaxis: false, yaxis: false, marginLeft: 50, marginBottom: 50, // // The new way of specifying your responsive clauses // responsive: [ {maxWidth: 900, width: 400, height: 150, options: {textSize:10, xaxisLabels: ['Mon\n(yuck!)','Tue','Wed','Thu','Fri\n(woo!)','Sat','Sun'], marginInner: 10}}, {maxWidth: null, width: 750, height: 250, options: {textSize:14, xaxisLabels: ['Monday\n(yuck!)','Tuesday','Wednesday','Thursday','Friday\n(woo!)','Saturday','Sunday'], marginInner: 20}} ] } }).draw(); </script>This change isn't at all mandatory - you can still use the existing method if you prefer - it's your choice!- The
svgGauge chartnow has a simple background grid effect (just some lines that emanate from the center out to the edge.) You can disable it if you want to and also stipulate the color.- The canvas
Line charttrendline now animates as well as the line if you use the trace animation effect.- The
responsivefunction had a small bug in it that prevented the setting of new colors in an updated configuration. This has been fixed.- The
Bar chartlabelsAboveproperty, for some time now, has not been showing decimals correctly. This has now been remedied so that what you specify with the propertylabelsAboveDecimalswill be what you see. The positioning of the labels has also been slightly adjusted - so you might need to reduce or remove entirely anylabelsAboveOffsetythat you may have set.- A new color macro has been added to formatted tooltips:
- %{color:red}
- %{color:%{property:myColor}}
- %{color:%{property:colors[%{dataset}]}}
- %{color:%{property:colors [%{index}]}}
- The Horizontal
Bar charthas been able to have rounded ends for some time - however, the feature only worked when you had a regular chart with theY-axison the left-hand-side. Now, however, you can have rounded ends to your bars regardless of where theY-axisis or whether you have a regular, stacked or grouped chart.- You can currently have rounded corners on your
Bar chartby setting thecornersproperty to round - you can now control whether the left and right corners are rounded individually with thecornersRoundLeftandcornersRoundRightproperties. You can also set the radius of the corners individually as well with thecornersRoundLeftRadiusandcornersRoundRightRadiusproperties.- A new feature has come to the
canvasScatter chart- thelassooptions. These options, when enabled, allow you to draw rectangles around some (or all) of the points on your chart. Acallbackfunction is then called which is passed a list of the selected dataset and index numbers which you can use to integrate into your own code. The feature is mentioned in the documentation page here and the API documentation for the Lasso feature is here. It can also make use of thewindow.localStoragevariable to enable easy persistence across page refreshes.- Added the
highlightDatasetEventproperty to the canvasLine chartwhich defaults toclick. You can set this tomousemoveto change the event that highlights the relevant dataset.- Added the missing annotating properties to the
canvasGauge chartdocumentation- Added the Semi-circular Progress property
ThebackgroundBackdropRGraph.common.core.jslibrary now contains a new function:RGraph.arrayRemoveNullThis function does what the name suggests and when you pass it anarraythenullvalues in thearraywill be removed. By default, objects aren't touched however if you give an object as the second argument which has the keyobjects(for exampleRGraph.arrayRemoveNull(myArray, {objects: true}))thennullvalues will be removed fromobjectstoo. If you give avalueparameter to the optionsarray,nullvalues will NOT be removed, but substituted with that value instead. You can see theapidocs for theRGraph.arrayRemoveNullfunction here. - The
- The
canvasPie chartnow has a new set oflabelsInsideproperties for use when you're showing aDonut chart. These properties allow you to show labels inside the Donut ring - instead of traditional labels which are placed around the outside of the Donut.