Page 1 of 1

ChartRect not updated ?

Posted: Thu Jan 12, 2006 10:57 am
by 8576839
Hi,

I am using Tchart in my application (version of my TeeChart.dll is 1.1.1769.19457).
I have some unit tests written with NUnitForms that perform tests on my application.
From my tests, I have a problem with the chartRect of a chart not updated. When I get this chartRect from my code, I always get (0,0,0,0); but sometimes, just by looking at the chartRect value in the Visual Studio debugger, my chartRect value is updated and then my test pass.

I don't understand why looking at the chartRect property in the debugger updates its value... And how can I have directly the right value in chartRect ?

Here is my code:

ChartTester chartTester = new ChartTester("RawData1DChromatogramOffLine0"); //NUnitForms tester for TChart

Steema.TeeChart.TChart theChart = chartTester.Properties;
Rectangle rect = theChart.Chart.ChartRect; //wrong value in rect, but can be updated when addingTheChart.Chart in the visual studio debbugger "watch" window.


Thanks,
Verane.

Posted: Thu Jan 12, 2006 11:25 am
by narcis
Hi Verane,

The ChartRect is not calculated until the whole chart is drawn as many things need to be drawn first (i.e.: axes). To force the chart being drawn you can make a call to tChart1.Bitmap.