Waiting indicator while Chart is being rendered

Hello,

Depending on the user choices I can draw a chart with a lot of information, so I want to show a “Wait while rendering” indicator. An animated gif will suffice, I don’t need progress indicators for this.
My approach is to show a dtmlx window onXLS and hide on onXLE, but I am getting weird results (window showing/hidding out of sinch, for example):

	barChart.attachEvent("onXLS", function (){
		var dhxWins= new dhtmlXWindows();
		dhxWins.setSkin("dhx_skyblue");
		win = dhxWins.createWindow("Window", 20, 20, 200, 100);
		win.setModal(true);
		win.setText("Loading");
		win.button("close").hide();
		win.button("minmax1").hide();
		win.button("minmax2").hide();
		win.button("park").hide();
		win.denyResize();
		win.centerOnScreen();
		win.progressOn();			
		win.show();
	});
	barChart.attachEvent("onXLE", function (){
				win.hide();

	});	   

Is this the right approach to do this?
What is the better way to accomplish this task?

Thanks in advance

Javier

Hello,

your approach is possible. However, it would be better to create a window only once:

var dhxWins= new dhtmlXWindows(); dhxWins.setSkin("dhx_skyblue"); var win; barChart.attachEvent("onXLS", function (){ if(!win){ win = dhxWins.createWindow("Window", 20, 20, 200, 100); win.setModal(true); win.setText("Loading"); win.button("close").hide(); win.button("minmax1").hide(); win.button("minmax2").hide(); win.button("park").hide(); win.denyResize(); win.centerOnScreen(); win.progressOn(); } else win.show(); }); barChart.attachEvent("onXLE", function (){ win.hide(); });

Thank you for your response, in this way is more efficient, but it doesn’t solve the problem I’m getting.

I don’t know exactly why but the loading screen doesn’t appear at all.
If i put an “alert” on the events, I am able to see the window between two alerts, but without them the window doesn’t show at all…

Any suggestion welcome I am on the verge of giving up and make the user wait without any loading indicator.

Best regads.

Javier

Possibly the data are loaded rather fast and therefore, the window disappears swift. Please send the demo if the window disappears before data loaded

Please, see attached the demo.

I have included two “alerts” on the “onXLS” and “onXLE” events in order to freeze the window and being able to see it.

My results are (IE8):
click on “render graphic” button → alert shows.
click on alert → the alert window gets disabled and after a long waiting time the second alert shows and below it you can see the loading window.

Thanks in advance.

Javier
DEMO.rar (522 KB)

You are using parse command which is works in the sync mode ( it means browser will not alter current view, until rendering end - as result the window not painted until render-end moment )

You can alter a logic of progress showing to be used with parse - please check the updated sample.
Index_alt.zip (3.53 KB)

Works perfect.
Thanks a lot.

Javier