how to limit the scrolling of axes
how to limit the scrolling of axes
is there a way to limit the scrolling of axes. Currently if user right click on x axis and drag mose he can keep on scrolling the axis whether there is data or not. I want to restrict that. Only if data is there then user should be able to scroll.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi shikha,
Yes, you can do something like in the code snippet below but using Scroll event and for min. and max. values.
Hope this helps!
Yes, you can do something like in the code snippet below but using Scroll event and for min. and max. values.
Code: Select all
void tChart1_UndoneZoom(object sender, EventArgs e)
{
tChart1.Axes.Bottom.Automatic = true;
}
void tChart1_Zoomed(object sender, EventArgs e)
{
if (tChart1.Axes.Bottom.Minimum < 0)
{
tChart1.Axes.Bottom.AutomaticMinimum = false;
tChart1.Axes.Bottom.Minimum = 0;
tChart1.Axes.Bottom.AutomaticMaximum = false;
tChart1.Axes.Bottom.Maximum = line1.MaxXValue();
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |