Mouse Right To Left Zoom Action

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

SteMurphy131
Posts: 1
Joined: Fri Feb 09, 2018 9:15 am

Mouse Right To Left Zoom Action

Post by SteMurphy131 » Fri Feb 09, 2018 9:22 am

I'm wondering is there a way to hook into the event raised when this code is called:

_chart.ViewXY.ZoomPanOptions.RightToLeftZoomAction = RightToLeftZoomActionXY.ZoomToFit;

I want to call my own Zoom To Fit method to give an extra bit of space on the Y axis.

Thanks

ArctionKestutis
Posts: 383
Joined: Mon Mar 14, 2016 9:22 am

Re: Mouse Right To Left Zoom Action

Post by ArctionKestutis » Wed Feb 14, 2018 2:44 pm

Sorry for the delayed answer.
Actually ZoomToFit() method modifies Axis ranges saliently (checks chart size, estimates range based on AspectRatio and changes range for X/Y axis if found it necessary).
Probably the only way is to set RightToLeftZoomAction = OFF and build your own custom MouseEvent handling. See for the idea on viewtopic.php?f=16&t=1003&p=3613
There is one quick and dirty way: enable ViewXY.ZoomPanOptions.AutoYFit, modify AutoYFit.UpdateInterval and AutoYFit.MarginPercents.

All the best.

User avatar
ArctionPasi
Posts: 1365
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Mouse Right To Left Zoom Action

Post by ArctionPasi » Thu Feb 15, 2018 10:19 am

Also ViewXY.Zoomed and BeforeZooming events are available.

And RangeChanged event of axes.
LightningChart Support Team, PT