chart autorepaint or series autorepaint

TeeChart for ActiveX, COM and ASP
Post Reply
David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

chart autorepaint or series autorepaint

Post by David » Mon Dec 28, 2009 5:09 am

As suggested by many posts, it is better to set autorepaint false to speed up plotting great number of data, but when I search the help file, both chart and series have autorepaint property. So which one should I set or should I set both.

And how to disable locking for single thread using C++?

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: chart autorepaint or series autorepaint

Post by Yeray » Mon Dec 28, 2009 11:24 am

Hi David,

FastLineSeries' autorepaint property prevents the whole chart to be repainted every time the series is updated or a vale is added to it.
Chart's autorepaint property prevents the chart to be repainted at all.

Regarding the threading, here is an explanation about TeeChart limitations.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Re: chart autorepaint or series autorepaint

Post by David » Mon Dec 28, 2009 1:26 pm

My question was not answered yet. I know there is autorepaint property for both fastline and chart. My question is which one I should use or should I set both? As in the following code, are the two for loops able to make the plotting even faster? With the chart autorepaint disabled, does it matter to disable/enable series autorepaint?

Code: Select all

m_chart1.SetAutoRepaint(FALSE);
for(int i=0;i<3;i++)
     m_chart1.Series(i).GetAsFastLine().SetAutoRepaint(FALSE);

//code to update series(0) to series(3)

for(int i=0;i<3;i++)
     m_chart1.Series(i).GetAsFastLine().SetAutoRepaint(TRUE);

m_chart1.SetAutoRepaint(TRUE);
m_chart1.Repaint();
As for disable locking, in the real-time chart article, it is Basic code as

Code: Select all

  // When using only a single thread, disable locking:
  Chart1.Canvas.ReferenceCanvas.Pen.OwnerCriticalSection := nil;
  Series1.LinePen.OwnerCriticalSection := nil;
So my another question is how to realize it in C++?

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: chart autorepaint or series autorepaint

Post by Yeray » Wed Dec 30, 2009 10:34 am

Hi David,

I recommend you to use series' autorepaint instead of chart's autorepaint. Then, if you need even more optimization, you could try chart's autorepaint instead of series' autorepaint but series drawing is the process that takes more time (incremented with the number of points to show). But, as you suspected, setting chart's autorepaint to false, series' autorepaint to false will be redundant.

Regarding the real-time article, I'm afraid it's not possible to lock TeeChart's pen in ActiveX.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Re: chart autorepaint or series autorepaint

Post by David » Wed Dec 30, 2009 11:10 am

I am a little bit confused. If series drawing is the process that takes more time, it seems logic to use series' autopaint, but then you said to get more optimization, I should use chart's autopaint. So exactly which way is faster, using series' autopaint or using chart's autopaint?

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: chart autorepaint or series autorepaint

Post by Yeray » Wed Dec 30, 2009 12:15 pm

Hi David,

Series autorepaint to false forces the series to not be redrawn.
Chart autorepaint to false forces the series to not be redrawn but also axes, titles,...
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Re: chart autorepaint or series autorepaint

Post by David » Thu Dec 31, 2009 12:57 am

OK, got it. Thank goodness it is solved before 2010. :D Happy new year to you!

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: chart autorepaint or series autorepaint

Post by Yeray » Thu Dec 31, 2009 8:25 am

Hi David,

The same to you! :D
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply