TBarseries wrong barwidth on not automatic axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Andy
Newbie
Newbie
Posts: 32
Joined: Wed Apr 18, 2007 12:00 am
Location: Germany Oldenburg
Contact:

TBarseries wrong barwidth on not automatic axis

Post by Andy » Tue Nov 10, 2009 2:53 pm

Hello !

I use TChart 7.12 VCL. You can produce the error with the TChart-Editor:

Insert a TBarseries fill it with 3 samples. The x-Points are:
0. Bar -0.5 .. 0.5
1.Bar 0.5 .. 1.5
3. Bar 1.5 .. 2.5
Thats ok, but when you widen the x-Axis range maybe to -3 .. 10
the bar have different width and position.
I could not figure out whats the rule for this.
0. Bar -1.8 .. 0.8
1. Bar 0.8 .. 0.5
2. Bar 0.5 .. 3.8 !!!!!!!
So the last bar is always very large.

The %BarWith is 100.

For SideMargins off you get -2 to -1 to 0 to 4

I expected the bars should be centered at 0, 1, 2, 3 etc. with width 1.

Is this a bug or must I configure something ???

Bye
Andreas Weichert

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

Re: TBarseries wrong barwidth on not automatic axis

Post by Yeray » Wed Nov 11, 2009 4:56 pm

Hi Andreas,

Several changes have been made to Bar series since v7.12 and this has been improved.
For example the following code gives the following result in v8.06:

Code: Select all

uses series;

procedure TForm1.FormCreate(Sender: TObject);
var bar1: TBarSeries;
begin
  Chart1.View3D:=false;
  bar1:=TBarSeries.Create(self);
  Chart1.AddSeries(bar1);
  bar1.FillSampleValues(3);
  bar1.BarWidthPercent:=100;
  bar1.SideMargins:=false;
  Chart1.Axes.Bottom.SetMinMax(-3,10);
end;
Image

The result is still not perfect but I think is better than in v7. If you want to test it further note that you can download the fully functional evaluation version for free.
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

Andy
Newbie
Newbie
Posts: 32
Joined: Wed Apr 18, 2007 12:00 am
Location: Germany Oldenburg
Contact:

Re: TBarseries wrong barwidth on not automatic axis

Post by Andy » Thu Nov 12, 2009 9:11 am

Thank you for the answer.
The result looks perfect for me - that is what I expected.
Ok I will update.

Post Reply