how to limit the scrolling of axes

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

how to limit the scrolling of axes

Post by Neelam » Wed Nov 12, 2008 1:55 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Nov 12, 2008 2:15 pm

Hi shikha,

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();
                  }
            }
Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply