THorizBarSeries - scroll bar bug

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

THorizBarSeries - scroll bar bug

Post by marder » Fri Feb 06, 2009 2:09 pm

Hi.

I encounter a problem in TeeChart V8.04.

I have a Tchart with a TScrolbar on the right siede to scroll in my THorizBarSeries:
Image

I there are many entries in my bar chart and I sroll the chart down, the chart is shown very strange:

Image

I was not abel to reproduce this with V7.
I am using the Anti-Alias tool now, but deactivating did not fix this priblem.

Is this a know issue and are there any workarounds?

Thanks!

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

Post by Yeray » Fri Feb 06, 2009 3:31 pm

Hi marder,

I've tested it and it seems to work fine for me here. Please, could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Post by marder » Mon Feb 09, 2009 12:15 pm

Hi Yeray.

I build a simple example project that shows the problem:
http://mail.jam-software.de/misc/BarCha ... roblem.zip

This project does not have the scrollbar included, but when using the mouse wheel for scrolling has the same effect.

I guess the problem is related to the property
Chart.MaxPointsPerPage

Thanks for your help!

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

Post by Yeray » Mon Feb 09, 2009 12:36 pm

Hi marder,

Yes, as you see your problem is the chart property MaxPointsPerPage. This property is used for the chart's paging feature but you are not using it. You are using a scrollbar so you need a variable or a constant to control the number of points to show. Here there is your code with a few modifications and it works fine for me here.

Code: Select all

const  PointsShown = 10;

procedure TForm1.FormShow(Sender: TObject);
begin
  Chart.SetFocus;
  DrawChart;
end;

procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
  Chart.Axes.Left.SetMinMax(ScrollBar1.Position - 0.5, ScrollBar1.Position + PointsShown - 0.5);
end;

procedure TForm1.DrawChart();
var
  I: Integer;
begin
  BarSeries.XValues.Order := loNone;

  // Fill bar series with new values
  BarSeries.Clear;
  for I := 0 to 100 do
    BarSeries.Add(i, IntToStr(i));

  ScrollBar1.Max := BarSeries.Count-PointsShown;
  ScrollBar1.Min := 0;
  ScrollBar1.Position := 0;

  Chart.Axes.Left.SetMinMax(0 - 0.5, PointsShown - 0.5);
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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Post by marder » Mon Feb 09, 2009 3:15 pm

Hi Yeray.

Thanks for this workaround.
This fixed the problem.

Anyway, since TeeChart V7 I try to use a TChartScrollBar to do my scrolling, but this seems not to work automatically by assigning the Chart property.

Is this a known issue or do I have to do any additional coding to get the TChartScrollBar to work?

Thanks and best regrads!

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

Post by Yeray » Tue Feb 10, 2009 8:58 am

Hi marder,

Yes, this is a known issue from TChartScrollBar that we'll investigate and that's why in the meanwhile we recommend using the standard ScrollBar.
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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Post by marder » Tue Feb 10, 2009 2:03 pm

Thanks for your help!

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Post by marder » Wed Feb 25, 2009 9:29 am

Hi.

I have an issue when using the down button of the standard scroll bar to.
With the down button I can scroll lower than the last bar of my chart:
Image

I am using the following procedure as the OnScroll event of my scroll bar:

Code: Select all

procedure TMainForm.ChartScrollBarScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer);
begin
  Chart1.Axes.Left.SetMinMax(ScrollPos - 0.5, ScrollPos + fChartMaxPointsPerPage - 0.5);
  //fChartMaxPointsPerPage is a member holding the maximum shown bars in the chart
end;

Can you please tell me if there is a workaround to avoid this behavior?
Will this behavior be fixed when using the TChartScrollbar (in case this component works correctly)?

Thanks!

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

Post by Yeray » Wed Feb 25, 2009 10:58 am

Hi marder,

Could you please verify that your TScrollBar has a is getting position values (ScrollPos) in your series' range? I mean, the scrollbar.min has the same value of your series Y min and the scrollbar.max has your series' max Y value (-PointsShown).

If everything seems ok, could you try to make a simple but complete example we can reproduce here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Post by marder » Wed Feb 25, 2009 1:58 pm

Hi.

I just realized that this is a problem of the TScrollBar (When customizing the property PageSize).

Anyway, I would really appreciate if the TChartScrollbar will finally work correctly in one of the next releases of TeeChart!

Thanks for your help!

Post Reply