Diagram Render completed event?

Hi,

I have a diagram that takes a few seconds to render,  I want to show a progress bar while this is happening.

Is there an event (callback I can register) in order to know when the diagram rendering has completed?

If not, could you please suggest a workaround.

Many thanks.

Regards,

Simon O'Brien


1 Reply

GG Gowtham Gunashekar Syncfusion Team July 12, 2021 11:32 AM UTC

Hi Simon, 

On the further analysis on the shared details, we understood that you want a event that will trigger after diagram is rendered. We have two suggestions, based on you requirement you can opt for any one of the following.

Created event:
        It triggered when the diagram is rendered completely and you can use the created event if the diagram doesn’t contact any layout.
 

code snippet:
 
<ejs-diagram #diagram id="diagram" width="100%" height="590px" (created)=" created ($event)">  
</ejs-diagram> 
 
 

 DataLoaded event:
        It triggered after the diagram is are populated from the external data source. you can use the DataLoaded  event if the diagram has any layout.
        
 
code snippet: 
<ejs-diagram #diagram id="diagram" width="100%" height="590px" (dataLoaded)="dataLoaded($event)">  
</ejs-diagram> 
 
Please refer to the following sample for how to render a progress bar until the diagram is created. In the sample we rendered a circular scroller at ngOnInit and hide it when diagram is created using dataLoaded event. 
 

Regards,
Gowtham.
 


Loader.
Up arrow icon