The RGraph changelog
Summary: This is the page to check for details on what has changed. The changes may or may not be relevant to you.

December 2019 (v5.2)
This release has many changes to the internals of RGraph - particularly the shape
objects that each chart types getShape()
function returns. So if you upgrade and you
use this function you should definitely test your charts before you commit to the new version.
-
The Bar chart
axes
property should no longer be used. Use thexaxis
andyaxis
properties instead. This will apply to other charts that use axes from the next release and also the Y axis. -
The tag that's used for the X axis labels has changed from
labels
toxaxis.labels
If you use this you'll need to update your code. -
The
RGraph.path()
function can now be called using each objectspath()
function. This results in less typing and a clearer syntax for those reading the code. For example:// Create the Bar chart as normal bar = new RGraph.Bar({ id: 'cvs', data: [4,8,6,5,3,5,8], options: { } }).draw(); // The original usage of the RGraph.path() function RGraph.path({ object: bar, path: 'b r % % % % f %', args: [0,0,1000,1000,'gray'] }); // Less verbose syntax bar.path({ path: 'b r % % % % f %', args: [10,10,100,100,'red'] }); // Even less verbose syntax bar.path('b r % % % % f %', 120, 10, 100, 100, 'green');
-
The Pie chart and the Rose chart
shape
object index names have been changed:angle.start
is nowangleStart
,angle.end
is nowangleEnd
,radius.start
is nowradiusStart
andradius.end
is nowradiusEnd
. You'll need to adjust your code accordingly if you use these properties. They were changed so that they worked better as object property names. -
The
RGraph.linearGradient()
function has had its arguments list changed. It should now only be called using the object notation like this:RGraph.linearGradient({ object: obj, // The chart object x1: x1, // The start X coordinate x2: x2, // The end X coordinate y1: y1, // The start Y coordinate y2: y2, // The end Y coordinate colors: colors // An array of colors to use in the gradient });
-
The
RGraph.radialGradient()
function has had its arguments list changed. It should now only be called using the object notation like this:RGraph.radialGradient({ object: obj, // The chart object x1: x1, // The start X coordinate x2: x2, // The end X coordinate y1: y1, // The start Y coordinate y2: y2, // The end Y coordinate r1: r1, // The start radius r2: r2, // The end radius colors: colors // An array of colors to use in the gradient });
-
The
RGraph.filledCurvyRect()
andRGraph.strokedCurvyRect()
functions have been renamed toRGraph.roundedRect()
. To use this function you need to do thefill()
and/orstroke()
yourself like this:context.beginPath(); context.strokeStyle = 'red'; context.fillStyle = 'black'; RGraph.roundedRect({ context: context, x: 50, y: 50, width: 100, height: 100, radius: 25 }); context.stroke(); context.fill();
The API documentation for this function is here. -
Function names that were all lower-case in the core libraries have been changed to be
camel-case. For example
RGraph.contextmenu()
has been changed toRGraph.contextMenu()
(all common libraries have been updated). -
The object returned by the Bar chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
sequentialIndex
-
The object returned by the Bipolar chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
sequentialIndex
-
The object returned by the Funnel chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
(this is always zero)sequentialIndex
-
The object returned by the Gantt chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
sequentialIndex
subindex
property has been removed - the equivalent now is theindex
property, whilst thedataset
property refers to the row whether it has one or multiple bars on it. -
The object returned by the Horizontal Bar chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
sequentialIndex
-
The object returned by the Horizontal Progress bar
getShape()
function has been adjusted. The index returned in the object are now:index
dataset (this is always zero)
sequentialIndex
-
The object returned by the Line chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
sequentialIndex
-
The object returned by the Pie chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
sequentialIndex
-
The object returned by the Radar chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
sequentialIndex
-
The object returned by the Rose chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
(same as thegroup
)group
(same as thedataset
)sequentialIndex
-
The object returned by the RScatter chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
sequentialIndex
-
The object returned by the Scatter chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
sequentialIndex
-
The object returned by the Semi-circular Progress chart
getShape()
function has been adjusted. The indexes returned in the object are now (they're all zero):index
dataset
sequentialIndex
-
The object returned by the Thermometer chart
getShape()
function has been adjusted. The indexes returned in the shape object are now (they're all zero):index
dataset
sequentialIndex
-
The object returned by the Vertical Progress chart
getShape()
function has been adjusted. The indexes returned are now :index
dataset
sequentialIndex
-
The object returned by the Waterfall chart
getShape()
function has been adjusted. The indexes returned in the object are now:index
dataset
sequentialIndex
-
The objects returned by the Drawing API objects
getShape()
functions (all of them) have been adjusted. The indexes returned in the objects are now:index
dataset
sequentialIndex
-
The
RGraph.ActivityMeter
chart has been added and resides in theRGraph.pie.js
library. This type of chart was previously possible, but involved a lot of custom code. You can see a demo of it here. -
The indexes on tooltips (and therefore their
id
attributes) have changed to be the relevantsequentialIndex
instead of theindex
. -
Notice In a later release I'll be changing all of the
__*__
properties to have a different format for their names. The new format will bergraph_*
(egrgraph_index
rgraph_dataset
rgraph_sequentialIndex
) -
The shape objects that are returned by each objects
getShape()
function do not now return any numeric indexes - so the only indexes that are returned are textual ones. This should make your code much easier to read and understand. For example the Bar chart returns:shape = obj.getShape(e); // If a bar/segment is matched the shape object will contain these indexes: // // shape.object // The RGraph Bar chart object // shape.x // The X coordinate for the rectangle // shape.y // The Y coordinate for the rectangle // shape.width // The width of the rectangle // shape.height // The height of the rectangle // shape.dataset // In a regular Bar chart the dataset is the same as the sequentialIndex // In a grouped or stacked Bar chart it pertains to the group of values. // shape.index // In a regular Bar chart the index is always zero whilst in a grouped // or stacked chart it pertains to the Bar in the relevant group // shape.sequentialIndex // This is the sequential index of the bar/segment. // shape.tooltip // The corresponding tooltip for the Bar or segment.
Other charts will return different indexes and you can see what they are by inspecting the shape object in your browsers JavaScript console ieconsole.log(shape);
. - There is now a dedicated RGraph.SegmentedMeter chart that is based on the Pie chart. This was previously possible - though a lot more code was required to create it. Now the code has been significantly reduced so creating such a chart is much easier.
-
The
RGraph.random.array()
function is now calledRGraph.arrayRandom()
. If you use this function you'll need to change your code.
Past release notes
Older release notes though are not available.
Backwards compatibility notes
There are notifications and advisories regarding backwards compatibility that you can read here: https://www.rgraph.net/canvas/docs/backwards-compatibility.html