bar series width settings

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Cyionics
Newbie
Newbie
Posts: 17
Joined: Thu Mar 11, 2004 5:00 am
Location: UK
Contact:

bar series width settings

Post by Cyionics » Mon Dec 27, 2004 6:33 pm

Hi

Is it possible to set the width of a bar series automatically so that they don't overlap, if not how can the %BarWidth be calculated based on the zoom level or other parameter?
Nominally I normally set this to 70% but in some cases bars are too wide when zoomed out and overlap.

Rgds

Peter

[/img]

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

Post by Pep » Mon Dec 27, 2004 11:00 pm

Hi Peter,

in which cases ? Setting the BarWidthPercent to any value should keep the spaces between the bars. How can I reproduce the result you're getting ?

Cyionics
Newbie
Newbie
Posts: 17
Joined: Thu Mar 11, 2004 5:00 am
Location: UK
Contact:

sample overlapping file

Post by Cyionics » Tue Dec 28, 2004 9:46 am

Hi

I've exported a .tee file to

http://www.cyionics.com/cyionics.tee

Rgds

Peter

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

Post by Pep » Tue Dec 28, 2004 10:14 am

Hi Peter,

ok, but which code you're using to get this result ?

Cyionics
Newbie
Newbie
Posts: 17
Joined: Thu Mar 11, 2004 5:00 am
Location: UK
Contact:

bar width code

Post by Cyionics » Tue Dec 28, 2004 10:24 am

Hi This is the code used to create the chart

procedure TStudy.Plot(Chart: TChart);
var i : integer; Series: TBarSeries;
begin
Chart.SeriesList.Clear;
Chart.ApplyZOrder := true;
for i := count-1 downto 0 do
begin
Series := TBarSeries.Create (Chart);
if count=1
then Series.Title := self.Title
else Series.Title := Items.Title;
Chart.AddSeries (Series);
Series.MultiBar := mbNone;
Series.Marks.Visible := false;
Items.Plot (Series);
end;
end;

Cyionics
Newbie
Newbie
Posts: 17
Joined: Thu Mar 11, 2004 5:00 am
Location: UK
Contact:

fix

Post by Cyionics » Thu Dec 30, 2004 9:31 am

Hi

I found the problem was cured by setting the autobarwidth to true

Series.AutoBarSize := True;

Rgds

Peter :D

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

Post by Pep » Thu Dec 30, 2004 9:33 am

Hi Peter,

great ! Thanks for the advise. :wink:

Post Reply