Canvas elements sets to display:none after second redraw


« 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 prakash on 14th August 2016
I have multiple charts on my screen, i am using angular 2 with bootstrap and i am generating different charts on different screens. on First screen the charts are proper, but when i click on any other screen then the charts are generated but it gets invisible on click on that page anywhere else in the screen.

Also I have attached on-draw event on the second screen but that reacts to canvas element on other screen as well.

what could be the issue?
Posted by Richard on 14th August 2016
Hi there,

I've never used Angular or bootstrap so I honestly couldn't tell you I'm afraid.


Richard

Posted by prakash on 14th August 2016
I went through the error log and studied the code and found that, RGraph tries to redraw all canvas.
Hence when the screen changes and the previous screen canvas tags are removed from the DOM, it starts giving error and all further logic goes for toss.

I found a usefull method to handle this, RGraph.OR.Clear(); this can be called on screen destory/change so that the old canvas are removed and hence removing the error.
Posted by Richard on 14th August 2016
Hi,

The RGraph.redraw() function will indeed redraw all of the RGraph canvas tags; there's also a

RGraph.redrawCanvas(canvas)

function you might find useful that just redraws the canvas (ie the charts that are related to that canvas tag) that you pass it.

But if clearing the ObjectRegistry works - then stick with that.



Richard

Posted by prakash on 14th August 2016
No I am not explicitly calling any redraw method, it's getting triggered by onmouseup event listener if we have interactive keys enabled, and hence i have to use clear for object registry

Add a reply

 




« Back to message list
RGraph on social media