Page 1 of 1

Chart is zoomed when user moves chart with pan

Posted: Fri Apr 20, 2007 2:23 pm
by 9336299
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

Posted: Tue Apr 24, 2007 10:50 am
by narcis
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;

Posted: Tue Apr 24, 2007 1:07 pm
by 9336299
:) Thanks for your support

We will apply your proposal

Best Regards
Gerald