Page 1 of 1

Exception when an axis is logarithmic

Posted: Tue Oct 14, 2008 2:51 pm
by 8739068
Exception details:
Steema.TeeChart.TeeChartException: Logarithmic Axis Min and Max values should be >= 0
at Steema.TeeChart.Axis.set_Logarithmic(Boolean value)
at Steema.TeeChart.Samples.Log_CustomIncrement.checkBox1_CheckedChanged(Object sender, EventArgs e)
at System.Windows.Forms.CheckBox.OnCheckedChanged(EventArgs e)
at System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
at System.Windows.Forms.CheckBox.OnClick(EventArgs e)
at System.Windows.Forms.CheckBox.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



I ran across this issue in my application. It can be easily duplicated in the sample project, TeeChart for .NET Examples, you provide.

1. Go to Welcome !\Axes\Labels\Custom logarithmic axis
2. Use the right mouse button to pan the chart to the right so the bottom axis minimum shows -20
3. Uncheck the "Logarithmic verticle axis" checkbox
4. Check the "Logarithmic verticle axis" checkbox and you get the exception.

In my application this was causing the application to crash, I had to catch the exception and handle it.

One place that it is not handled and it probably should be is in the Chart Editor. If you launch the ChartEditor when an axis scale is logarithmic and the axis minimum is negative. You can easily get the ChartEditor to crash which causes the entire application to crash. This is in the TeeChart.dll with is difficult to catch in my application. It may be argued that the programmer should prevent this from happening, but it is not very easy to do when the user is allowed to pan and can pan into the negative territory.

Posted: Tue Oct 14, 2008 3:02 pm
by narcis
Hi Mike,

I could reproduce the issue here and added it (TF02013456) to the defect list to be fixed for next releases.

Impressive

Posted: Tue Oct 14, 2008 3:26 pm
by 8739068
I am impressed! I think that is the fastest response I have ever experienced in a support site that was not using chat software.

Thanks for the quick response.

Re: Exception when an axis is logarithmic

Posted: Thu Jan 24, 2013 7:13 pm
by 15661467
This still seems to be a problem.

Brian
Capture.JPG
Capture.JPG (180.16 KiB) Viewed 34892 times

Re: Exception when an axis is logarithmic

Posted: Fri Jan 25, 2013 9:23 am
by 10050769
Hello Brotsten,

This problem is fixed since version 3 build number 3.5.3225.32185 and I can not reproduce it using last version 2012 build number 4.1.2012.09283. Could you please tell us if you use last version 2012? If you use last version 4, please can explain how do we do to reproduce the problem?

Thanks,

Re: Exception when an axis is logarithmic

Posted: Fri Jan 25, 2013 4:56 pm
by 15661467
Hi,

I am using version 4.1.2012.09280. I'm running the pre-built .net Features Demo.

1. Bring up the Custom logarithmic axis demo.
2. Uncheck Logarithmic vertical axis.
3. Slide the chart up to reveal negative numbers in the vertical axes.
4. Check Logarithmic vertical axis.

Brian

Re: Exception when an axis is logarithmic

Posted: Mon Jan 28, 2013 12:18 pm
by 10050769
Hello Brian,

Ok, seems the problem the number bug [TF02013456] is fixed for the chart Editor, but we didn't treat the problem when is done scroll. We have added it in the bug list report with new number with [TF02016494]. We will try to fix it to upcoming versions of TeeChartFor.Net.

Thanks,

Re: Exception when an axis is logarithmic

Posted: Mon Feb 18, 2013 4:48 pm
by 10050769
Hello Brian,

I inform you that the bug number TF02016494 isn't a bug and the exception is being thrown by TeeChart code as you can see in next lines of TeeChart Source code of Axis.cs:

Code: Select all

public bool Logarithmic
    {
      get { return logarithmic;}
      set
      {
        if (chart != null)
        { //CDI for custom axes at designtime this value is

          //sometimes null.

          if ((value) && (IsDateTime))

            throw new TeeChartException(Texts.AxisLogDateTime);
          if (value)
          {
            AdjustMaxMin();
            if ((iMinimum < 0) || (iMaximum < 0))
              throw new TeeChartException(Texts.AxisLogNotPositive); <--- HERE!!
          }
        }
        SetBooleanProperty(ref logarithmic, value);
        SetCalcPosValue();

      }

    }
Thanks,