Page 1 of 1

Gantt chart not redrawing chart

Posted: Mon May 07, 2007 7:17 am
by 9640436
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.

Posted: Mon May 07, 2007 10:39 am
by narcis
Hi dave,

Instead of calling Invalidate have you tried this?

Code: Select all

Bitmap bmp = tChartGantt.Bitmap;

Posted: Tue May 08, 2007 12:20 am
by 9640436
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.

Posted: Tue May 08, 2007 8:05 am
by narcis
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.

Posted: Thu May 10, 2007 11:37 pm
by 9640436
Hi Narcis,

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

Thanks anyway.

Cheers!