Zoom gets activated when clicking on a series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Lenfors
Newbie
Newbie
Posts: 11
Joined: Mon Oct 07, 2013 12:00 am

Zoom gets activated when clicking on a series

Post by Lenfors » Mon Jan 27, 2014 1:40 pm

Hello!

I have a TChart with a TPointSeries on it.
I activated zoom on the TChart.
On the PointSeries I have a SeriesClickPointer event. So when I click on a node on the PointSeries it triggers a popup of a presentation form with info about the "ValueIndex" node clicked.
This all works fine, but when I close the presentation form my TChart is in zoom mode, that means my next klick on another node on the PointSeries does not trigger the SeriesClickPointer event, instead it zooms my chart.

Please help with this. I dont understand why the click event on a node on the series still activates the zoom function...

Best regards, Mikael

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Zoom gets activated when clicking on a series

Post by Yeray » Wed Jan 29, 2014 12:31 pm

Hi Mikael,

You could try disabling the zoom at the OnMouseDown event, if a pointer is clicked, and re enable it at OnMouseUp event:

Code: Select all

procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if Chart1[0].Clicked(X,Y)>-1 then
    Chart1.AllowZoom:=false;
end;

procedure TForm1.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  Chart1.AllowZoom:=true;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply