Hello,
often when a range that needs to be zoomed in is close to an axis its not easy to achieve because the zoom rectangle can
only be started inside the chart axes area. Is there a simple option to enable the zoom rectangle to start outside the TChart axes ?
best regards,
X-ray
Zooming from Outside Chart axes
Re: Zooming from Outside Chart axes
Hello,
You can Activate the Zoom and Panning at the OnClickBackground event as follows:
You can Activate the Zoom and Panning at the OnClickBackground event as follows:
Code: Select all
procedure TForm1.Chart1ClickBackground(Sender: TCustomChart;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
with Chart1 do
begin
if Zoom.Allow and (Button=Zoom.MouseButton) and
(Zoom.KeyShift<=Shift) then
Begin
if Zoom.Direction=tzdVertical then x:=ChartRect.Left;
if Zoom.Direction=tzdHorizontal then y:=ChartRect.Top;
Zoom.Activate({$IFDEF FMX}Round{$ENDIF}(x),{$IFDEF FMX}Round{$ENDIF}(y));
if Zoom.Direction=tzdVertical then
Zoom.X1:={$IFDEF FMX}Round{$ENDIF}(ChartRect.Right);
if Zoom.Direction=tzdHorizontal then
Zoom.Y1:={$IFDEF FMX}Round{$ENDIF}(ChartRect.Bottom);
end;
if (AllowPanning<>pmNone) and (Button=ScrollMouseButton) and
(TeeScrollKeyShift<=Shift ) then
Begin
Panning.Activate({$IFDEF FMX}Round{$ENDIF}(x),
{$IFDEF FMX}Round{$ENDIF}(y));
end;
CancelMouse:=false;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Zooming from Outside Chart axes
Hello Yeray,
very useful, thank You !
In fact it would be nice if this was just another flag/option of TChart.
best regards,
X-Ray
very useful, thank You !
In fact it would be nice if this was just another flag/option of TChart.
best regards,
X-Ray
Re: Zooming from Outside Chart axes
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |