Hi Team,
I am using Winforms.
I am zooming my line graph with both right mouse button - rectangle zoom and mouse wheel. But i want to limit the zooming.
1) Not zoom below 0 (origin - time axis) on x-Axis.
2) Not zoom out beyond the graph data. (if you zoom out more, then the graph becomes smaller and eventually a thin straight line.)
Can you please tell me which property I have to set?
Zooming with limits
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Zooming with limits
Hi,
ViewXY has BeforeZooming and AfterZooming events available for making special zooming behavior, such as limiting the zooming.
Or if your limiting min and max, use e.XRanges[0].Axis.SetRange method.
There is also BeforePanning event available.
See also
https://forum.arction.com/viewtopic.php ... 286&p=4314
ViewXY has BeforeZooming and AfterZooming events available for making special zooming behavior, such as limiting the zooming.
Code: Select all
_chart.ViewXY.BeforeZooming += ViewXY_BeforeZooming;
private void ViewXY_BeforeZooming(object sender, BeforeZoomingXYEventArgs e)
{
if (e.XRanges[0].NewMin < 0)
{
e.XRanges[0].Axis.Minimum = 0;
}
}
There is also BeforePanning event available.
See also
https://forum.arction.com/viewtopic.php ... 286&p=4314
LightningChart Support Team, PT
Re: Zooming with limits
This would be a great addition to the user manual. I was searching for "Clamp zoom, clamp limits etc" but couldn't find anything.