Page 1 of 1

how can I tell when a Repaint has finished?

Posted: Thu Jun 28, 2007 8:21 am
by 8575642
I have a chart which I'm populating like this:

Code: Select all

Chart->AutoRepaint = false;
for (many thousands of values)
{
    lineseries->AddXY(x,y,"",clRed);
}
Chart->AutoRepaint = true;
Chart->Repaint();
The problem is that the Repaint does not happen immediately. If I call Repaint(), and then immediatelly check the XValues or YValues lists for my series, they are empty. I need to know when the data is actually visible on the screen (and the X/Y lists have been populated), which doesn't happen until ? milliseconds after the Repaint is called. Is there some sort of property I can check, or method I can call to see if a Chart is still repainting? Any suggestions as to how I can tell that all data is now shown on the screen?

Cheers,

Andrew

Posted: Thu Jun 28, 2007 8:44 am
by narcis
Hi Andrew,

You could use TChart's OnAfterDraw event for that purpose. An alternative could be using Series' OnAfterDrawValues.