ChartRect not updated ?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Verane
Newbie
Newbie
Posts: 23
Joined: Thu Jan 09, 2003 5:00 am

ChartRect not updated ?

Post by Verane » Thu Jan 12, 2006 10:57 am

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.

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

Post by Narcís » Thu Jan 12, 2006 11:25 am

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.
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

Post Reply