Page 1 of 1

THorizBarSeries - scroll bar bug

Posted: Fri Feb 06, 2009 2:09 pm
by 10049140
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!

Posted: Fri Feb 06, 2009 3:31 pm
by yeray
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.

Posted: Mon Feb 09, 2009 12:15 pm
by 10049140
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!

Posted: Mon Feb 09, 2009 12:36 pm
by yeray
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;

Posted: Mon Feb 09, 2009 3:15 pm
by 10049140
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!

Posted: Tue Feb 10, 2009 8:58 am
by yeray
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.

Posted: Tue Feb 10, 2009 2:03 pm
by 10049140
Thanks for your help!

Posted: Wed Feb 25, 2009 9:29 am
by 10049140
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!

Posted: Wed Feb 25, 2009 10:58 am
by yeray
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.

Posted: Wed Feb 25, 2009 1:58 pm
by 10049140
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!