Restricting Axis Scroll

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Krishna
Newbie
Newbie
Posts: 16
Joined: Mon Jun 12, 2006 12:00 am
Contact:

Restricting Axis Scroll

Post by Krishna » Fri Sep 01, 2006 4:20 am

Hi,

I have disabled default panning of the chart and used two "axis scroll tool" to move the graph.(i.e one axis scroll is used for left and another for bottom).
I have restricted the axis scroll if it exceeds the graph points(minimum and maximum). The user should not go beyond the total graph points either left or bottom axis.

sample values are given to stop the panning as follows:(0,25)

if Self.Chart1.BottomAxis.Minimum < 0 then
Self.Chart1.BottomAxis.Minimum := 0;

if Self.Chart1.BottomAxis.Maximum > 25 then
Self.Chart1.BottomAxis.Maximum := 25;

The above code I have written in mousemove to restrict.
As I have expected the scrolling is stopped at the specified point and not going beyond, but the chart is expanding and not able to control.

even if the zoom out is done, the graph not coming to its original position

I need the scroll to be stopped and the chart should not expand and graph should remain same.

could you please help me in this problem.

Thanks,
Krishna.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Sep 01, 2006 11:58 am

Hi Krishna,

how about just doing :

Code: Select all

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
chart1.Axes.Bottom.SetMinMax(0,25);
end;
?

Post Reply