Chart is zoomed when user moves chart with pan

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
SiA
Newbie
Newbie
Posts: 43
Joined: Wed Mar 10, 2004 5:00 am

Chart is zoomed when user moves chart with pan

Post by SiA » Fri Apr 20, 2007 2:23 pm

Dear Steema,

We encounter a defect with TChartPro 7.07 for Delphi:
:arrow: [Defect 5741] When user moves chart with the pan function (horizontal, vertical or full panning), the chart is a little bit zoomed. So, we cannot retrieve the original zoom factor when we moves chart to its original position and we have to perform a reset.

I post an example where you can experiment this defect to forum steema.public.teechart7.delphi

:?: How can we perform a pan without this zoom effect?

Best Regards
Gerald

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Apr 24, 2007 10:50 am

Dear Gerald,

Thanks for the example project. We have been able to reproduce the issue here.

This is because when scrolling the chart it automatically changes axes minimum and maximum values.

To solve this you can add implement the OnScroll event doing something like this:

Code: Select all

procedure TForm1.Chart1Scroll(Sender: TObject);
begin
  Chart1.Axes.Bottom.MinimumOffset:=90;
  Chart1.Axes.Bottom.MaximumOffset:=90;
  Chart1.Axes.Left.MaximumOffset:=35;
end;
and then the reset chart button like this:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  Chart1.Axes.Bottom.MinimumOffset:=0;
  Chart1.Axes.Bottom.MaximumOffset:=0;
  Chart1.Axes.Left.MaximumOffset:=0;
  Chart1.UndoZoom;
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

SiA
Newbie
Newbie
Posts: 43
Joined: Wed Mar 10, 2004 5:00 am

Post by SiA » Tue Apr 24, 2007 1:07 pm

:) Thanks for your support

We will apply your proposal

Best Regards
Gerald

Post Reply