Page 1 of 1

bar series width settings

Posted: Mon Dec 27, 2004 6:33 pm
by 9336311
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]

Posted: Mon Dec 27, 2004 11:00 pm
by Pep
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 ?

sample overlapping file

Posted: Tue Dec 28, 2004 9:46 am
by 9336311
Hi

I've exported a .tee file to

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

Rgds

Peter

Posted: Tue Dec 28, 2004 10:14 am
by Pep
Hi Peter,

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

bar width code

Posted: Tue Dec 28, 2004 10:24 am
by 9336311
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;

fix

Posted: Thu Dec 30, 2004 9:31 am
by 9336311
Hi

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

Series.AutoBarSize := True;

Rgds

Peter :D

Posted: Thu Dec 30, 2004 9:33 am
by Pep
Hi Peter,

great ! Thanks for the advise. :wink: