Page 1 of 1

Chart refresh when

Posted: Wed Jun 25, 2008 8:19 am
by 9244864
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

Posted: Wed Jun 25, 2008 9:37 am
by narcis
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.

Chart refresh when

Posted: Wed Jun 25, 2008 10:49 am
by 9244864
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.

Posted: Mon Jun 30, 2008 9:46 am
by Pep
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.