Page 1 of 1

When switching datasets ...

Posted: Sun Jan 08, 2006 8:19 pm
by 9235705
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

Posted: Mon Jan 09, 2006 10:02 am
by narcis
Hi Barry,

You could try using:

Code: Select all

form1.DBChart1.Series[i].Clear;