Page 1 of 1

Exception when re-sizing to minimum...

Posted: Tue May 20, 2014 11:07 am
by 15668832
Attached the exception window when,

I try to re-size the window to absolute minimum and bringing the size back to normal and then pressing left button mouse down to zoom it back an exception is thrown.

Chart contains a line with IsoHorizAxes =true and

tChart1.BeforeDrawSeries += tChart1_BeforeDrawSeries;

void tChart1_BeforeDrawSeries(object sender, Graphics3D g)
{
tChart1.Axes.Bottom.AdjustMaxMin();
}

Re: Exception when re-sizing to minimum...

Posted: Wed May 21, 2014 9:47 am
by Christopher
Hello Raavi,
Raavi wrote:I try to re-size the window to absolute minimum and bringing the size back to normal and then pressing left button mouse down to zoom it back an exception is thrown.
Try:

Code: Select all

      tChart1.Resize += tChart1_Resize;

      tChart1.BeforeDrawSeries += tChart1_BeforeDrawSeries;
    }

    void tChart1_Resize(object sender, EventArgs e)
    {
      Rectangle rect = tChart1.Chart.ChartRect;

      if (rect.Height <= 5 || rect.Width <= 5)
      {
        tChart1[0].IsoHorizAxes = false;
      }
      else if (rect.Height >= 5 && rect.Width >= 5)
      {
        tChart1[0].IsoHorizAxes = true;
      }
    }