Page 1 of 1

Bar Chart - incomplete bar

Posted: Thu Sep 25, 2014 5:07 pm
by 10047857
Hi

This sounds really an easy problem to fix, and I'm more than a little embarrassed to ask for a solution but...

When I plot any type of bar series I almost invariably end up with the final bar on the right hand side incomplete - its usually a slither of a bar thats no more than half the width it should be. How can I ensure that the final bar is the full width?

Bruce.

Re: Bar Chart - incomplete bar

Posted: Fri Sep 26, 2014 10:49 am
by yeray
Hi Bruce,

If I just create a TBarSeries,

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TBarSeries).FillSampleValues();
end;
it looks fine to me:
2014-09-26_1239.png
2014-09-26_1239.png (17.8 KiB) Viewed 7109 times
So I guess you have set some property in the bottom axis that is cutting it.
Ie, if I set a maximum in the bottom axis:

Code: Select all

  Chart1.Axes.Bottom.AutomaticMaximum:=False;
  Chart1.Axes.Bottom.Maximum:=5;
If we force the axis maximum as above, then the chart isn't adding any extra margin to fit the bar width:
2014-09-26_1247.png
2014-09-26_1247.png (18.38 KiB) Viewed 7115 times
In that case, you can use MaximumOffset property to manually set an extra margin and avoid that:

Code: Select all

  Chart1.Axes.Bottom.MaximumOffset:=35;
If this isn't helping you, please arrange a simple example project we can run as-is to reproduce the problem here.

Re: Bar Chart - incomplete bar

Posted: Fri Sep 26, 2014 11:23 am
by 10047857
Hi Yeray

That's the property I was looking for and forgot!

Thanks a lot.

Bruce.