Page 1 of 1

How to prevent UI flashing and other mass update distraction

Posted: Fri Feb 13, 2009 5:28 pm
by 8739068
I have multi-threaded application that interacts with TeeChart. Because of how we need to process the data that is generated, I add an remove many series's from the chart control. Some are visible others are not, some show in the legend, others do not. There is also some sizing of the chart that occurs because of some other controls I put around the chart. It is a very dynamic situation.

While this processing is going on and the data being charted is changing, I would like to chart to be flashing and changing making it distracting to the user. There are a couple of processing threads. 1 is generating the data and loops about 4 - 5 times. Each time coming up with a new set of data to chart. The other thread is consuming that data and mapping it to TeeChart series's and calculating Axes increments and labels and things of that sort.

I would like each iteration to have the chart draw the data ( add series, set axes labels, size the chart etc) without the user seeing the chart jump, flash, jerk, and other distracting behaviors.

I have tried calling SuspendLayout / ResumeLayout at various places but this does not seem to help. I have tried to do this on the chart and on the dialog that is the parent of the chart. Neither case helps.

Any thoughts on how to minimize or eliminate the UI distractions? Ideally it would be nice to freeze the drawing area until all data is in place in the chart and then have it completely redraw the chart one time. I did verify that the Graphics3D.UseBuffer = true;

Posted: Mon Feb 16, 2009 11:12 am
by narcis
Hi Mike,

You could try setting TChart's AutoRepaint to false, do all your modifications, set it back to true when you want the chart being updated and call TChart's refresh method too.

seems to help

Posted: Mon Feb 16, 2009 9:15 pm
by 8739068
Setting the AutoRepaint = false seems to help but it does not completely solve my problem.

Posted: Tue Feb 17, 2009 11:19 am
by narcis
Hi Mike,

Thanks for the information. In that case you may be interested in reading this thread about using TeeChart for .NET with multi-threaded applications.

If this doesn't help, can you please send us a very simple example project we can run "as-is" to reproduce the problem here so that we can have a look at the issue?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroupo or at our upload page.

Thanks in advance.