Does the RGraph.Clear() function have a bug?

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 Jarkko Iso-Heiko on 19th September 2012
Hi

I think I might have encountered a bug in RGraph. You can verify it yourself at url:
www.planetwot.com/comparePlayers.php?p1=jts&p2=talh&c=battles

When you change the dropdown-value from Battles to something else, it runs the RGraph.clear() before it draws another graph. However, if you click the graph (or anything else), the cleared content becomes visible again outside the actual graph area. The labels become all messy.

Works atleast for my Firefox and Chrome (latest version AFAIK).

Another unwanted feature could be that when you resize the canvas with jQuery for example, the RGraph doesnt recognize the new dimensions. However I found out the way to go around the problem, by using document.getElementById("canvas") -syntax.

However, thank you for the great library/tool. Keep up the good work.
Posted by on 19th September 2012
Hi,

> I think I might have encountered a bug in RGraph. You can verify it yourself
> at url:
> www.planetwot.com/comparePlayers.php?p1=jts&;p2=talh&c=battles
>
> When you change the dropdown-value from Battles to something else, it runs
> the RGraph.clear() before it draws another graph. However, if you click the
> graph (or anything else), the cleared content becomes visible again outside
> the actual graph area. The labels become all messy.
>
> Works atleast for my Firefox and Chrome (latest version AFAIK).

When you call the RGraph.Clear() method it doesn't remove the objects
from the ObjectRegistry. This is so that they can be redrawn. There's
more on the problem here:

www.rgraph.net/docs/misc.html#clear.canvas

> Another unwanted feature could be that when you resize the canvas with
> jQuery for example, the RGraph doesnt recognize the new dimensions. However
> I found out the way to go around the problem, by using
> document.getElementById("canvas") -syntax.

If you want to resize the canvas you need to use the HTML attributes -
not CSS. This has the side-effect of clearing the canvas and so will
require a redraw.

> However, thank you for the great library/tool. Keep up the good work.


Thank you.

Add a reply




« Back to message list