RGraph.reset(canvas) affects other canvas tags

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Jan Dirk on 28th April 2016
Hello support,

I noticed something, which I think is a bug.
Take the following HTML:

<!DOCTYPE html>
<meta http-equiv="content-type" content="text/html; charset=UTF8">
<meta charset="utf-8">
<script src="/ries/js/RGraph/4.54/libraries/RGraph.common.core.js"></script>
<script src="/ries/js/RGraph/4.54/libraries/RGraph.bar.js"></script>
   <canvas id="cvs1" width="300" height="300">No canvas support</canvas>
   <canvas id="cvs2" width="300" height="300">No canvas support</canvas>
     var canvas1 = document.getElementById("cvs1");
     var canvas2 = document.getElementById("cvs2");
     new RGraph.Bar({
     id: "cvs1",
     data: [1,2,3,4],
     options: {
       labels: ["a", "b", "c", "d"],
       textAccessible: true

     new RGraph.Bar({
       id: "cvs2",
       data: [4,3,2,1],
       options: {
         labels: ["e", "f", "g", "h"],
         textAccessible: true

The labels of the first graph are not visible.
While debugging it, I did find out that the labels are drawn, but are removed due to the "RGraph.reset(canvas2);".
I would expect that this call would not effect my graph in canvas1, because I pass in canvas2.
I haven't found yet, what within the reset function makes this happen or how to fix it.


Jan Dirk
Posted by Richard on 28th April 2016
Hi there,

OK, I've fixed this issue and setup a demo here:


And if you want it, the updated RGraph.common.core.js file is here:


I think that should be a drop in replacement for the 4.54 version that you're using currently.

Posted by Jan Dirk on 28th April 2016
Thank you very much.


Jan Dirk
Posted by on 21st July 2016
Posted by Richard on 21st July 2016

Most likely (!). I can't imagine that I wouldn't have. Try the latest - version 4.56 - it will be a part of that if I have.


Add a reply

« Back to message list