Page 1 of 1

Disabling axes draw while scrolling/zooming ?

Posted: Fri Jul 14, 2006 10:24 am
by 9639271
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.

Posted: Fri Jul 14, 2006 10:42 am
by narcis
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();
    }

Posted: Fri Jul 14, 2006 11:01 am
by narcis
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;
    }

Posted: Fri Jul 14, 2006 11:49 am
by 9639271
Great !

Thanks Narcis.