Chart does not disappear

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 Kai on 13th February 2013
Hello everybody,
I`m quite impressed about RGraph, but I have the following problem:

I combine a bar-graph and a line-graph in one canvas, this works great :-)

But somehow in my application a graph, that I never created appears and I can`t delete ist. I deleted all the cache, I restarted browser and computer (it appears in all browsers I tested).

I know that page: I put in my application

<canvas id='cvs' width='600' height='250'>[No canvas support]</canvas>
bar = new RGraph.Bar('cvs', [$jan_bar,$feb_bar,$maerz_bar,$april_bar,$mai_bar,$juni_bar,$juli_bar,$aug_bar,$sep_bar,$okt_bar,$nov_bar,$dez_bar]);
*********************** create the graph I want. That one is well created but there is that weird graph as well!????

Firebug shows me the code of the "undeletable" chart:
<canvas id="cvs" height="250" width="600" style="visibility: visible; cursor: default;">[No canvas support]</canvas>
bar = new RGraph.Bar('cvs', [,,,,,,,,,,,]); bar.Set('ymax', -353.16); bar.Set('ylabels.count', 5); bar.Set('lab..........
.....I have no idea where it comes from and how I can delete it....
Can anybody give me a hint please?

Thank you very much, Kai
Posted by RGraph support on 13th February 2013



Should be after your canvas tag (unless you're using the window.onload event etc). Plus you should pass the canvas DOM object to the Reset function:

canvas = document.getElementById('cvs');

So put the Reset call after the canvas and use the canvas object instead of a string.

Richard, RGraph Support

1 Year Premium Support now reduced to £299:
Posted by Kai on 13th February 2013
Hi Richard,

thank you very much; I found out it works also with that function:

        function chartUnload() {
      var el = new Array();
      var elemsCanvas = document.getElementsByTagName("canvas");
      for (var i=0; i<elemsCanvas.length; i++) {
          if (typeof(elemsCanvas[i]) != 'undefined' && elemsCanvas[i].id.indexOf("__rgraph") == 0) {
      var elemsDiv = document.getElementsByTagName("div");
      for (var i=0; i<elemsDiv.length; i++) {
          if (typeof(elemsDiv[i]) != 'undefined' && elemsDiv[i].id.indexOf("__rgraph") == 0) {

      for (var i = 0; i < el.length; i++) {
          var elNode = document.getElementById(el[i]);
          if (elNode.parentNode) {
          else {

      var firstDiv = document.getElementsByTagName("div")[0];
      if (firstDiv.innerHTML == 'M') {

      scatterChart = null;
      data = [];
      labels = [];


Add a reply

« Back to message list