Page 1 of 1

Zooming chart with mousewheel

Posted: Sun Feb 04, 2018 1:16 pm
by 10047857
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.

Re: Zooming chart with mousewheel

Posted: Tue Feb 06, 2018 9:16 am
by yeray
Hello Bruce,

You have to disable the scroll/panning by mousewheel:

Code: Select all

  Chart1.Panning.MouseWheel:=pmwNone;
  Chart1.Zoom.MouseWheel := pmwNormal;

Re: Zooming chart with mousewheel

Posted: Wed Sep 26, 2018 10:00 pm
by 16683996
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?

Re: Zooming chart with mousewheel

Posted: Thu Sep 27, 2018 10:32 am
by yeray
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.

Re: Zooming chart with mousewheel

Posted: Thu Sep 27, 2018 2:42 pm
by 16683996
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.

Re: Zooming chart with mousewheel

Posted: Thu Oct 04, 2018 7:41 am
by yeray
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.