Exception when an axis is logarithmic

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Mike Jones
Advanced
Posts: 192
Joined: Thu Feb 01, 2007 12:00 am
Contact:

Exception when an axis is logarithmic

Post by Mike Jones » Tue Oct 14, 2008 2:51 pm

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.

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

Post by Narcís » Tue Oct 14, 2008 3:02 pm

Hi Mike,

I could reproduce the issue here and added it (TF02013456) to the defect list to be fixed for next releases.
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

Mike Jones
Advanced
Posts: 192
Joined: Thu Feb 01, 2007 12:00 am
Contact:

Impressive

Post by Mike Jones » Tue Oct 14, 2008 3:26 pm

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.

brotsten
Newbie
Newbie
Posts: 4
Joined: Thu Feb 02, 2012 12:00 am

Re: Exception when an axis is logarithmic

Post by brotsten » Thu Jan 24, 2013 7:13 pm

This still seems to be a problem.

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Exception when an axis is logarithmic

Post by Sandra » Fri Jan 25, 2013 9:23 am

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,
Best Regards,
Sandra Pazos / 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

brotsten
Newbie
Newbie
Posts: 4
Joined: Thu Feb 02, 2012 12:00 am

Re: Exception when an axis is logarithmic

Post by brotsten » Fri Jan 25, 2013 4:56 pm

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Exception when an axis is logarithmic

Post by Sandra » Mon Jan 28, 2013 12:18 pm

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,
Best Regards,
Sandra Pazos / 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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Exception when an axis is logarithmic

Post by Sandra » Mon Feb 18, 2013 4:48 pm

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,
Best Regards,
Sandra Pazos / 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