Disabling axes draw while scrolling/zooming ?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
cybertof
Newbie
Newbie
Posts: 9
Joined: Mon Nov 21, 2005 12:00 am

Disabling axes draw while scrolling/zooming ?

Post by cybertof » Fri Jul 14, 2006 10:24 am

Hello,

The drawing process is quite slow when displaying a chart with axes, and quite faster when disabling axis drawing.

Is there a way to automatically disable axis display/draw while Zomming/Scrolling ?

Thanks.

Cybertof.

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

Post by Narcís » Fri Jul 14, 2006 10:42 am

Hi Cybertof,

Yes, you can do something like this:

Code: Select all

    private void HideAxes()
    {
      for (int i = 0; i < tChart1.Series.Count; i++)
      {
        tChart1[i].GetVertAxis.Visible = false;
        tChart1[i].GetHorizAxis.Visible = false;
      }
    }

    private void ShowAxes()
    {
      for (int i = 0; i < tChart1.Series.Count; i++)
      {
        tChart1[i].GetVertAxis.Visible = true;
        tChart1[i].GetHorizAxis.Visible = true;
      }
    }

    private void tChart1_Zoomed(object sender, EventArgs e)
    {
      HideAxes();
    }

    private void tChart1_UndoneZoom(object sender, EventArgs e)
    {
      ShowAxes();
    }

    private void tChart1_Scroll(object sender, EventArgs e)
    {
      HideAxes();
    }
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

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

Post by Narcís » Fri Jul 14, 2006 11:01 am

Hi Cybertof,

A more simple solution is:

Code: Select all

    private void tChart1_Zoomed(object sender, EventArgs e)
    {
      tChart1.Axes.Visible = false;
    }

    private void tChart1_UndoneZoom(object sender, EventArgs e)
    {
      tChart1.Axes.Visible = true;
    }

    private void tChart1_Scroll(object sender, EventArgs e)
    {
      tChart1.Axes.Visible = false;
    }
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

cybertof
Newbie
Newbie
Posts: 9
Joined: Mon Nov 21, 2005 12:00 am

Post by cybertof » Fri Jul 14, 2006 11:49 am

Great !

Thanks Narcis.

Post Reply