BarWidth

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
PICASSO
Newbie
Newbie
Posts: 3
Joined: Mon Mar 15, 2010 12:00 am

BarWidth

Post by PICASSO » Tue Mar 23, 2010 9:05 am

I just by TeeChart, Version 8.06. I had the old 7.11 version

I have a big problem with BarWidth ( it's running OK in old version)

If I fixed left axis ( minimum = -100, maximum = +100) and if I have only a 'Bar' serie, the barwidth function is Ok.

If I had a new serie on the same chart ( lineseries), the barwidth function does not work !! I'll only have a small line on each bar ( with < 100) or a full bar ( barwith = 100).

I have this curious work with program and VCL editing.

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

Re: BarWidth

Post by Yeray » Wed Mar 24, 2010 3:06 pm

Hi Picasso,

Could you please send us a simple example project we can run as-is to reproduce the problem here? It seems to work fine here with a bar series with two values and a line series with two values too.

Code: Select all

uses series;

procedure TForm1.FormCreate(Sender: TObject);
var bar1: TBarSeries;
    line1: TLineSeries;
begin
  bar1:=Chart1.AddSeries(TBarSeries.Create(self)) as TBarSeries;
  bar1.Add(80);
  bar1.Add(-70);

  line1:=Chart1.AddSeries(TLineSeries.Create(self)) as TLineSeries;
  line1.Add(-40);
  line1.Add(35);

  Chart1.Axes.Left.SetMinMax(-100,100);

  bar1.BarWidthPercent:=40;
end;
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

PICASSO
Newbie
Newbie
Posts: 3
Joined: Mon Mar 15, 2010 12:00 am

Re: BarWidth

Post by PICASSO » Wed Mar 24, 2010 3:32 pm

Hello,

Thanks for your answer. I had try your small program and it's running OK.

The problem appears when you add, by teechart designer, a bar series. If you put BarWith to 100, strange picture on my screen. ( I do not add point on my create series)

If I do that, I'll find the same problem. :?

I will modify my program to add 'barseries' by program, why not, but it's less easy. I prefer use TeeChart Designer to modify the series parameters.

Regards

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

Re: BarWidth

Post by Yeray » Thu Mar 25, 2010 4:51 pm

Hi PICASSO,

I've seen that having a Bar Series and a Line Series with different number of values, the last bar is shown thinner that the others if you set BarWidthPercent to 100. So I've added it to the defect list to be fixed in future releases (TV52014752).

Code: Select all

uses series;

var bar1: TBarSeries;
    line1: TLineSeries;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;

  bar1:=Chart1.AddSeries(TBarSeries.Create(self)) as TBarSeries;
  line1:=Chart1.AddSeries(TLineSeries.Create(self)) as TLineSeries;
  bar1.FillSampleValues();  //6 points
  line1.FillSampleValues(); //25 points
  line1.Pointer.Visible:=true;
  bar1.BarWidthPercent:=100;
end;
test.png
test.png (12.93 KiB) Viewed 4942 times
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

Schnaddel
Newbie
Newbie
Posts: 1
Joined: Fri Mar 05, 2010 12:00 am

Re: BarWidth

Post by Schnaddel » Fri Apr 23, 2010 11:23 am

Hello

I also suffer from the bar width bug. I have a chart with two series: a line series and a bar series.

In TCustomBarSeries.DoBeforeDrawChart you determine a wrong value for IMaxBarPoints:
- the first series is the line series: it has 2000 values. Thus IMaxBarPoints is set to 2000
- the second series is a bar series. For this series the value remains unchanged even if it only has 10 values

Later then the bar width is calculated by the available space (IAxisSize div IMaxBarPoints). The result is a very small bar with width of 1...

If I remove the line series, it looks not even better because there is another bug in this method: the IMaxBarPoints value is determined from Series[t].Count. This is not correct in any case. Consider a ChartValueList with entries for 31 days (Minimum is 2010-03-01, maximum is 2010-03-31), whereas only 10 days have a value. Then count is 10, but the axis width provides space for 31 bars. You divide the space by count and as a result the bars are too wide (the bars for successive days are overlapping each other).

Unfortunately it is absolutely impossible to fix this by a descendant class as there are some private fields unavailable.

Would you mind to provide me with a sulution / workaround / bugfix?

BR
Michael

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

Re: BarWidth

Post by Yeray » Fri Apr 23, 2010 3:54 pm

Hi Michael,

Thank you for your comments. We'll consider them when we'll revise the bug ticket (TV52014752).
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

PICASSO
Newbie
Newbie
Posts: 3
Joined: Mon Mar 15, 2010 12:00 am

Re: BarWidth

Post by PICASSO » Mon Jun 07, 2010 2:22 pm

Hello

Is this problem corrected ? It's became urgent to have a solution.

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

Re: BarWidth

Post by Yeray » Mon Jun 07, 2010 3:14 pm

Hi PICASSO,

I'm afraid it hasn't been fixed yet. I've incremented it's priority.
I recommend you to be aware at this forum or subscribe to our RSS news feed for new release announcements and what's implemented on them.
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

Post Reply