Page 1 of 1

How to implement a progress bar while chart is loading

Posted: Tue May 15, 2007 12:21 am
by 8739068
I have many points at time to plot on a chart. While TeeChart is processing these points I have an animated progress bar providing user feedback that application is not locked up but is still processing.

I have this animator working while we compute the point in an asssembly. The progress bar animation updates just fine. I want the animation to continue while we add the series to the TeeChart and it is working on displaying those series.

Unfortunately the timer that is updating the progress bar never gets a chance to call its "tick" event because TeeChart is using all the CPU cycles.

My timer's interval = 100
I am adding 2 point series's, and a line series totalling > 1,000,000.

Is there any sample code or techniques you can point me to implement a progress bar that will update using a timer while TeeChart loads large series' of data?

Thanks.

Posted: Tue May 15, 2007 9:04 am
by narcis
Hi Mike,

I can't think of such example right now. Maybe you could start the timer or progress bar on BeforeDraw chart event and stop it in the AfterDraw event.

At this thread you'll find an example on how those events are used for calculating the time it takes to draw a chart.

Request from users

Posted: Fri Jul 27, 2007 7:55 pm
by 8739068
I see that this thread has been viewed over 200 times. Obviously this is of some interest to the user community. I still haven't solved this issue. I believe it is worthy of some attention.

If anyone in the user community has succesfully loaded the TChart control with a large number of points in a separate thread to prevent the dialog it is sitting in from freezing up I would sure like to know how they did it.

I am currently using V3 of the TChart control in a Winforms form.

I see that there is a method called Invoke that can be used on UI components that support UI threading. I have not figured out how to use it. If anyone has any experience in this area I would love to chat with you.

Posted: Wed Aug 08, 2007 8:18 am
by narcis
Hi Mike,

In that case, what we suggested here may be helpful for you.