RGraph.reset(canvas) affects other canvas tags

Share RGraph:   Share or Like RGraph on Facebook!

« 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>
<html>
<head>
<title>ResetIssue</title>
<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>
</head>
<body>
   <canvas id="cvs1" width="300" height="300">No canvas support</canvas>
   <canvas id="cvs2" width="300" height="300">No canvas support</canvas>
   <script>
     var canvas1 = document.getElementById("cvs1");
     var canvas2 = document.getElementById("cvs2");
    
     RGraph.reset(canvas1);
     new RGraph.Bar({
     id: "cvs1",
     data: [1,2,3,4],
     options: {
       labels: ["a", "b", "c", "d"],
       textAccessible: true
     }
   }).draw();

     RGraph.reset(canvas2);
     new RGraph.Bar({
       id: "cvs2",
       data: [4,3,2,1],
       options: {
         labels: ["e", "f", "g", "h"],
         textAccessible: true
       }
     }).draw();
   </script>
</body>
</html>

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.

Regards,

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

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

www.rgraph.net/tests/bug.html

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

www.rgraph.net/tests/RGraph.common.core.js

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




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

Regards,

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

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.





Richard

Add a reply




« Back to message list