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

January 2020 (v5.27)
-
The
responsive()
function has been rewritten to use the standardwindow.matchMedia
API instead of thewindow.onresize
event. You can read more about this on the RGraph blog . This is a significant change to theresponsive()
function but the usage of the function has only changed marginally. Now you should list the screen size clauses from largest to smallest like this:
Otherwise the usage of the function is no different..responsive([ {maxWidth: null,width:600,height:250,options:{marginInner: 10,textSize:12}}, {maxWidth: 800,width:400,height:200,options:{marginInner: 5,textSize:10}} ]);
-
In both the canvas and SVG libraries the
String.format()
function has been extended. Previously you could do this with the function:
And this:str = '{1} works as a {2}'; name = 'Richard'; occupation = 'web developer'; str.format(name, occupation);
Now though, as well as that, you can do this too:str = '%1 works as a %2.'; name = 'Richard'; occupation = 'web developer'; str = str.format(name, occupation)
occupation = 'web developer'; name = 'Richard'; str = '{name} works as a {occupation}'.format();
-
All of the libraries now accommodate having the data given to them as strings as well as real
JavaScript arrays. So RGraph now accommodates this type of thing:
You should of course give RGraph real JavaScript data structures (arrays containing numbers for example) - this is simply there for ease of use purposes.new RGraph.Bar({ id: 'cvs', data: '4,8,6,5,3,2,5', // Result: [4,8,6,5,3,2,5] // ['5','3','7','2','4'], // Result: [5,3,7,2,4] // ['4,8,6','4,5,2','4,8,6'], // Result: [[4,8,6],[4,5,2],[4,8,6]] options: { } }).draw();
-
The Horizontal Bar chart now has a
tooltipsHotspotYonly
option so you can still get at tooltips when the value of a bar is zero. - The 3D Bar chart hotspots for tooltips are now drawn more accurately which makes clicking on the bars easier.
-
The CSV reader has had some aliases added to the
getCol()
andgetRow()
API functions. These are:csv.row(); csv.col(); csv.column(); csv.getColumn();
-
The
label
labelUnitsPre
labelUnitsPost
labelPoint
labelThousand
andlabelDecimals
properties were added to theHorseShoe Meter
. -
The
RGraph.redraw()
API function can now accept a canvas as the argument (as well as a color) to limit the clearing to a specific canvas tag. For example:RGraph.redraw(); // Pre-existing usage RGraph.redraw('red'); // Pre-existing usage RGraph.redraw(myCanvas); // New addition RGraph.redraw(myCanvas, 'red'); // New addition
- Fixed a bug with the Bar chart grow effect when supplying data to it. It wouldn't respect a maximum Y scale value that you had set.
-
The properties
tooltipsFormattedListType
andtooltipsFormattedListItems
have been added to both the canvas and SVG chart types (those that support tooltips). These two properties give you the ability to easily show HTML lists (either ordered or unordered) in your tooltips by using the%{list}
macro. There are demos available of charts that use lists in tooltips in the download archive.
Backwards compatibility notes
There are notifications and advisories regarding backwards compatibility that you can read here: https://www.rgraph.net/canvas/compatibility.html
Past release notes
Older release notes though are not available.