Bar Chart - incomplete bar

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Metman
Advanced
Posts: 113
Joined: Fri Dec 21, 2007 12:00 am

Bar Chart - incomplete bar

Post by Metman » Thu Sep 25, 2014 5:07 pm

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.

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Bar Chart - incomplete bar

Post by Yeray » Fri Sep 26, 2014 10:49 am

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 6694 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 6700 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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Metman
Advanced
Posts: 113
Joined: Fri Dec 21, 2007 12:00 am

Re: Bar Chart - incomplete bar

Post by Metman » Fri Sep 26, 2014 11:23 am

Hi Yeray

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

Thanks a lot.

Bruce.

Post Reply