Series references -need explanation

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

Series references -need explanation

Post by bcmiller » Wed Nov 30, 2005 6:51 pm

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

Pep
Site Admin
Site Admin
Posts: 3298
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Dec 01, 2005 11:17 am

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]

bcmiller
Newbie
Newbie
Posts: 30
Joined: Mon Jan 24, 2005 5:00 am

Series references -need explanation

Post by bcmiller » Thu Dec 01, 2005 3:06 pm

Great, Thanks!!

Post Reply