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 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...
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.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.
I have an error with my SVG chart: attribute d - expected number
Posted by Todd Shafer at 14:15 on Friday 18th March 2022[link]
Hello again, sorry to bug you. I updated to your newest code and I have one graph I can't get to work on, which works in the old code. Can you tell me what this error means?
// Create the clipPath element that sits inside the <def> tag
clip = RGraph.SVG.create({
svg: line.svg,
type: 'clipPath', // This is case sensitive!
parent: line.svg.defs,
attr: {
id: 'myClip'
}
});
// Create the shape element for the clip area
RGraph.SVG.create({
svg: line.svg,
parent: clip,
type: 'rect',
attr: { // These coordinates create a rect that is the same size as the top half of the SVG tag
x: 0,
y: 0,
width: 900,
height: 306
}
});
// Now set the clip-path attribute on the first Line charts all-elements group
line.svg.all.setAttribute(
'clip-path',
'url(#myClip)'
);
// Create the clipPath element that sits inside the <def> tag *** for the bottom half of the chart ***
clip2 = RGraph.SVG.create({
svg: line2.svg,
type: 'clipPath', // This is case sensitive!
parent: line2.svg.defs,
attr: {
id: 'myClip2'
}
});
// Create the shape element for the clip area
RGraph.SVG.create({
svg: line2.svg,
parent: clip2,
type: 'rect',
attr: { // These coordinates create a rect that is the same size as the bottom half of the SVG tag
x: 0,
y: 305,
width: 900,
height: 300
}
});
// Now set the clip-path attribute on the second Line charts all-elements group
line2.svg.all.setAttribute(
'clip-path',
'url(#myClip2)'
);
Posted by Richard at 20:45 on Friday 18th March 2022[link]
Can you give me some idea of what the chart s supposed to look like?
Posted by Todd Shafer at 20:53 on Friday 18th March 2022[link]