Hi !
I am working in the field of multivariate statistics. This means I like to handle a large amount of variables. Creating series for these variables at designtime is not an option, I like to create them at runtime. I am using this code in Delphi-7 and TeeChart VCL 7.04:
for i:= 1 to 31 do Chart.AddSeries(TBarSeries.Create(Self));
Adding data values for the bar charts and some basic formatting is not a problem using:
for i:= 1 to 31 do
for j:= 1 to 6 do
begin
Chart.Series.AddXY(j,SomeYvalue,'',MyColorList);
Chart.Series.Marks.Visible:=False;
Chart.Series.Color:=MyColorList;
Chart.Series.Title:=’TextInLegend’;
end;
No problem so far, but now I want to change the BarWidthPercent for the bar charts from the default 70% to 95%. And maybe I want to set other specific TBarSeries properties, that can not be reached by Chart.Series. Is there a way to accomplish this ?
Thanks for your attention and kind regards from Gerben
Changing TBarSeries properties at runtime
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Gerben,
Yes, this is possible but to reach those properties you will need to type cast your series as Chart.Series[0] is of TChartSeries type:
or
Yes, this is possible but to reach those properties you will need to type cast your series as Chart.Series[0] is of TChartSeries type:
Code: Select all
(Chart1.Series[i] as TBarSeries).BarWidthPercent:=95;
Code: Select all
(Chart1[i] as TBarSeries).BarWidthPercent:=95;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |