Gantt chart not redrawing chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
dave
Newbie
Newbie
Posts: 35
Joined: Fri Feb 24, 2006 12:00 am

Gantt chart not redrawing chart

Post by dave » Mon May 07, 2007 7:17 am

Hi,

I've a Gantt chart that needs to be refreshed and the chart needs to be updated. I've tried:

Code: Select all

 tChartGantt[0].Clear();
and

Code: Select all

 tChartGantt.Invalidate(); 
but in both of them, the original chart remains and the newer chart is overlapped over it in a different colour.

Please advise. Thanks.

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

Post by Narcís » Mon May 07, 2007 10:39 am

Hi dave,

Instead of calling Invalidate have you tried this?

Code: Select all

Bitmap bmp = tChartGantt.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

dave
Newbie
Newbie
Posts: 35
Joined: Fri Feb 24, 2006 12:00 am

Post by dave » Tue May 08, 2007 12:20 am

Hi Narcis,

I tried the bitmap function but still couldn't work. I bind my chart to a dataset on the windows form, and the code below basically populated the chart when the user clicks on a button:

Code: Select all

tChartGantt[0].Clear();
gantt1.DataSource = dt2; //dt2 is the DataTable which contains the data
gantt1.CheckDataSource();
//tChartConstraintsGantt.Invalidate();
Currently, each time the above code is run, it'll overlap the earlier chart. I'm not sure how I could clear the first chart before redrawing it again.

Thanks.

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

Post by Narcís » Tue May 08, 2007 8:05 am

Hi dave,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
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

dave
Newbie
Newbie
Posts: 35
Joined: Fri Feb 24, 2006 12:00 am

Post by dave » Thu May 10, 2007 11:37 pm

Hi Narcis,

I managed to solve it. Silly error really, I forgot to clear my datatable upon refresh.

Thanks anyway.

Cheers!

Post Reply