Chart Redraw Control

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Aaron Peronto
Newbie
Newbie
Posts: 38
Joined: Thu Feb 01, 2007 12:00 am

Chart Redraw Control

Post by Aaron Peronto » Wed Dec 05, 2007 8:17 pm

I have a question about controling when the TeeChart control gets redrawn.

We have developed a data plotting package using TeeChart .NET.
Our application is a Windows MDI application. There is one TeeChart control placed on each MDIChild form.

Since our graphs tend to be pretty large (2 million+ points is not uncommon at all), we do NOT want the graph to constantly redraw itself when you resize or move the MDIChild windows and therefore resize and move the TeeChart control.

What we have done to prevent this is we make the TeeChart control invisible and give the user a way to tell the chart to refresh which causes the TeeChart control to execute its DrawToBitmap method and the resulting image is placed into a PictureBox. So what the user actually sees (and interacts with) on the MDIChild is a PictureBox control and NOT the TeeChart control.

This works well in that it allows us to control when redraws are done.
However, it does not allow us to interact directly with the graph itself and makes using some tools (like axis arrows that can be clicked to scroll just an individual axis) something that we cannot use.

Is there any way to tell the TeeChart control to only redraw and resize the graph when explicitly instructed to do so?

I have heard people mention "double-buffering" implemented in the newer versions of TeeChart .NET v3.2 but have not seen any descriptions about what that really gains us.

Can anyone give details about the double-buffering implementation and how to control it OR can someone let me know if there is a way that we can turn off this constant redraw of the graph?

Thanks for any help that you can give us on this issue.

Aaron

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Dec 07, 2007 8:40 am

Hi Aaron,

I suggest you to try using AutoRepaint property as I did in the examples at the bottom of this thread.

Regarding double-buffering, here you can find information on this feature.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Aaron Peronto
Newbie
Newbie
Posts: 29
Joined: Wed Jun 20, 2007 12:00 am

Post by Aaron Peronto » Tue Aug 26, 2008 7:22 pm

The AutoRepaint property on the control indicates (through its tooltip) that is enables/disables the redraw of the graph when points are added.

Is there any way to enable/disable the redraw of the graph when its size is changed?

I want to be able to completely control when the graph redraws.
That means when points are added, series are removed, when the dimensions of the graph changed, etc.
Is there any way (or can we please get a way) to disable the redraw that occurs when the size of the graph is changed?

The AutoRepaint property does help me to some extent. It allows us to control when the graph is redrawn when the user is adding new data to the chart. THe last piece we would really like to see is a single flag that controls AutoRepaint's redrawing but with respect to everything. Series added, removed, resizing of the chart control itself, etc.

Thanks

Marc
Site Admin
Site Admin
Posts: 1260
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Wed Sep 03, 2008 8:49 am

Hello,

Re. Is there any way to enable/disable the redraw of the graph when its size is changed?
No. The resize will change the respective positions of all Chart elements so a repaint is necessary. If you were to render an image as you have been doing then resize the image that would be an alternative approach though the Chart contents would probably lose sharpness.

If you set AutoRepaint false then the Chart will not be repainted as you add or remove points but will repaint on resize (for the above explained reason).

Regards,
Marc Meumann
Steema Support

Post Reply