Page 1 of 1

Need to customize panning

Posted: Mon Aug 14, 2006 7:01 am
by 9346574
Hi,

I am having two graphs on two different axis(i.e. Left and Custom Axis having same x-Axis).
I need to stop vertical panning of second graph which having custom axis, so that only one graph can be moved and other will be static at all time.

Regards,
Krishna.

Posted: Mon Aug 14, 2006 8:42 am
by Pep
Hi Krishna,

you can use the OnAllowScroll event :

Code: Select all

procedure TForm1.Chart1AllowScroll(Sender: TChartAxis; var AMin,
  AMax: Double; var AllowScroll: Boolean);
begin
if Sender = Chart1.CustomAxes.Items[0] then
  AllowScroll:=False;
end;

customize panning in VCL

Posted: Thu Aug 17, 2006 10:10 am
by 9346574
Hi,
The following is the source code given by you can be used for applications, but, I need to develop VCL so, which property/ event I should override.

I found the AllowScroll is property of type TChartScrollEvent. How should i Implement the below logic code for override of AllowScroll in VCL

procedure TForm1.Chart1AllowScroll(Sender: TChartAxis; var AMin,
AMax: Double; var AllowScroll: Boolean);
begin
if Sender = Chart1.CustomAxes.Items[0] then
AllowScroll:=False;
end;