Page 1 of 1

Series references -need explanation

Posted: Wed Nov 30, 2005 6:51 pm
by 9235705
Hi,

I hope someone will explain something very basic to me.

I've been using two ways to refer to series properties and methods.
1) Form1.Series1.xxx
2) Form1.DBChart1.Series[ 0 ].xxx

However with Delphi 2005 code completion, some properties, like 'Pointer' are available with the first approach but not with the second. I'd like to understand what the difference is.

Thanks,

Barry

Posted: Thu Dec 01, 2005 11:17 am
by Pep
Hi Barry,

this is a normal behaviour, as for the first approach you are using "Series1" referencing directly to the Series style object you can access to all its properties and methods, but in the second approach you're just referencing to the first Series object of the Chart (without knowing which Series style is), so only the properties and methods shared to all the Series styles will be available.
If you want to refer to any Series using the second approach, you'll have to identificate which series style is, using for example :
(DBChart1.Series[0] as TPointSeries).Pointer....

Also, it exists another way to refer to the Series :
DbChart1[SeriesIndex]

Series references -need explanation

Posted: Thu Dec 01, 2005 3:06 pm
by 9235705
Great, Thanks!!