Redraw of stacked bar chart


« 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 Antonio Vianello on 25th March 2014
Hi there!

I want to describe a strange behaviour never seen before.
I have a stacked bar chart with a key box above it. When I draw it for the first time I get it work correctly, but when I draw it for the second time with different parameters like, for example, a different time range, and then I click onto the canvas the graph seems to redraw the old X-Y labels and the key labels, so overlapping them with the new ones!
I use an AJAX call to redraw the graph.

How can is it possible?

Thanks in advance
Posted by Richard on 25th March 2014
Hi there,

RGraph remembers charts that you create so that they can be redrawn when required. I'm guessing that you're creating a new chart in the AJAX callback. And whilst you can do this - instead of the clear function you'll need to use the reset function so that past objects are cleared from the ObjectRegistry:

RGraph.Reset(myBar.canvas);



Richard
www.rgraph.net
If RGraph has helped you - please share the website - thanks!
Posted by Antonio Vianello on 25th March 2014
Hi there!

Great, now it works!
Previously I used Rgraph.Clear(theCanvas) and in fact it did't have no effect.

Thanks a lot

Add a reply

 




« Back to message list
RGraph on social media