series.custombarwidth to chart1.series[0].???

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kai
Newbie
Newbie
Posts: 21
Joined: Mon May 10, 2004 4:00 am

series.custombarwidth to chart1.series[0].???

Post by kai » Sat Apr 09, 2005 4:42 am

Hi,
I am converting my "series1" to chart1.series[0] so I can change the series from bars to lines or whatever and still make it SaveChartToFile(..) and LoadChartFromFile(..).
Everything was compiling ok until I tried to change this line:

series1.custombarwidth := 5; // old line
chart1.series[0].CustomBarWidth := 5; // new line

The error message I get when I try to compile it is "Undeclared Identifier: 'CustomBarWidth'.

What is the equivalent of 'custombarwidth' when you reference a series using the "chart1.series[0]" notation?

Thank you.
pl

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 Apr 11, 2005 7:19 am

Hi pl,

That's because this notations refers to the generic series type and you need to cast them as BarSeries. You can do:

Code: Select all

(Chart1.Series[0] as TBarSeries).CustomBarWidth:=5;
or

Code: Select all

(Chart1[0] as TBarSeries).CustomBarWidth:=5;
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

kai
Newbie
Newbie
Posts: 21
Joined: Mon May 10, 2004 4:00 am

Thanks

Post by kai » Fri Apr 15, 2005 10:13 pm

Hi,
That works great!.
Thanks. I appreciate your help.
pl

Post Reply