Zooming chart with mousewheel

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Metman
Advanced
Posts: 113
Joined: Fri Dec 21, 2007 12:00 am

Zooming chart with mousewheel

Post by Metman » Sun Feb 04, 2018 1:16 pm

Hi

I want to zoom the chart in and out by means of the mouse wheel.
This is what I do:

Code: Select all

Chart.Zoom.Allow := true; 
Chart.Zoom.MouseWheel := pmwNormal; 
Chart.ZoomWheel := pmwNormal; 
I expect the chart to zoom in and out but it doesn't - instead it just scrolls the chart vertically.
This should be simple enough - what am I doing wrong?

I have searched the entire forum and the last time someone raised this problem there was no answer that worked.

Bruce.

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

Re: Zooming chart with mousewheel

Post by Yeray » Tue Feb 06, 2018 9:16 am

Hello Bruce,

You have to disable the scroll/panning by mousewheel:

Code: Select all

  Chart1.Panning.MouseWheel:=pmwNone;
  Chart1.Zoom.MouseWheel := pmwNormal;
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

Aaron Wilcox
Newbie
Newbie
Posts: 2
Joined: Fri Jul 13, 2018 12:00 am

Re: Zooming chart with mousewheel

Post by Aaron Wilcox » Wed Sep 26, 2018 10:00 pm

We've got the same issue here, and the suggested solution doesn't work. As soon as you set Zoom.Enable=True, the zoom behaviour binds itself to whatever mouse button is specified by Zoom.MouseButton, and ignores the mouse wheel. Is there some property somewhere else that tells the chart to ignore Zoom.MouseButton in this particular situation?

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

Re: Zooming chart with mousewheel

Post by Yeray » Thu Sep 27, 2018 10:32 am

Hello Aaron,
Aaron Wilcox wrote:
Wed Sep 26, 2018 10:00 pm
We've got the same issue here, and the suggested solution doesn't work. As soon as you set Zoom.Enable=True, the zoom behaviour binds itself to whatever mouse button is specified by Zoom.MouseButton, and ignores the mouse wheel. Is there some property somewhere else that tells the chart to ignore Zoom.MouseButton in this particular situation?
I can't find Zoom.Enable property. What TeeChart version are you using?
Could you please arrange a simple example project we can run as-is to reproduce the problem here?

Thanks in advance.
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

Aaron Wilcox
Newbie
Newbie
Posts: 2
Joined: Fri Jul 13, 2018 12:00 am

Re: Zooming chart with mousewheel

Post by Aaron Wilcox » Thu Sep 27, 2018 2:42 pm

We're using the ActiveX TeeChart control (v2018.0.3.16) in VB6. According to the online library references, TChart.Zoom.Enable from the ActiveX control appears to perform the same function as TChart.Zoom.Allow from the VCL/FMX control. TChart.Zoom.Enable = False completely disables the zoom feature, even if TChart.Zoom.MouseWheel = pmwNormal

ActiveX:
The Zoom Enable boolean property toggles the runtime Zoom. Setting it to True will allow runtime Zoom by dragging the mouse.
VCL/FMX:
Enable disable mousedrag zoom.
I'll try to get a clean-sheet example set up when I've got a chance.

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

Re: Zooming chart with mousewheel

Post by Yeray » Thu Oct 04, 2018 7:41 am

Hello,

As you probably know, TeeChart ActiveX is a wrapper from the VCL version.
The Zoom.Enable property in TeeChart ActiveX sets the AllowZoom property of the VCL Chart, which sets the Zoom.Allow property. So, yes, Zoom.Enable in TeeChart ActiveX is exactly the same than Zoom.Allow in TeeChart VCL.
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