When switching datasets ...

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bcmiller
Newbie
Newbie
Posts: 30
Joined: Mon Jan 24, 2005 5:00 am

When switching datasets ...

Post by bcmiller » Sun Jan 08, 2006 8:19 pm

Hi,

Frequently my charts draw from clientdatasets whose contents I switch around for other datasets with different fieldDefs. I've learned to clear the data related chart properties to avoid error messages like:

'Project Alpha.exe raised exception class EdatabaseError with message'cds: Field 'fld1' not found'.

I've been clearing the chart properties with this:

form1.DBChart1.Series.DataSource := nil;
form1.DBChart1.Series.YValues.ValueSource := '';
form1.DBChart1.Series.XLabelsSource := '';
form1.DBChart1.Series.XValues.ValueSource := '';

Is there a simpler or better method for doing this?

Thanks,

Barry

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 Jan 09, 2006 10:02 am

Hi Barry,

You could try using:

Code: Select all

form1.DBChart1.Series[i].Clear; 
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