Chart refresh when

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Andy
Newbie
Newbie
Posts: 32
Joined: Wed Apr 18, 2007 12:00 am
Location: Germany Oldenburg
Contact:

Chart refresh when

Post by Andy » Wed Jun 25, 2008 8:19 am

Hello !

I want to know how property change triggers
series/chart refresh.
Because it is more easy to program, I set all properties
at once, even they have not changed.

Concrete is this code faster:

if(CS->Pen->Width != aWidth)
CS->Pen->Width=aWidth;
else
do nothing

than always set property
CS->Pen->Width=aWidth;

Can I avoid so unnecessary redraws.

Best regards
Andreas

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

Post by Narcís » Wed Jun 25, 2008 9:37 am

Hi Andreas,

Easiest way to avoid redundant drawing is setting chart's AutoRepaint property to false, setting it back to true latter and repaint the chart.

You'll find more information about using AutoRepaint at the Real-time Charting article here.
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

Andy
Newbie
Newbie
Posts: 32
Joined: Wed Apr 18, 2007 12:00 am
Location: Germany Oldenburg
Contact:

Chart refresh when

Post by Andy » Wed Jun 25, 2008 10:49 am

Thank you for the tips, I will check it out.

But my main question was an other.

The code Property = x;
it not a value assign but a SetProperty(x) function call
of course.

Checks this function if the value of the property has
changed or not.
Is there code like this:

SetProperty( newProperty)
{
if(CurrentProperty == newProperty
return; // object must not repainted

CurrentProperty=newProperty;
ObjectMustRepainted=true;
}

Costs it time to set permant
the Property to the same value,
or only if it changes.

























narcis wrote:Hi Andreas,

Easiest way to avoid redundant drawing is setting chart's AutoRepaint property to false, setting it back to true latter and repaint the chart.

You'll find more information about using AutoRepaint at the Real-time Charting article here.

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jun 30, 2008 9:46 am

Hi Andy,

the Chart is only repainted when a property value has been changed. Assign the same property value the Chart should not be repainted.
In case you notice setting the same property value makes to repaint the entire or part of the Chart let us know and we'll check the source to know why this is happening.

Post Reply