Exception when an axis is logarithmic
Posted: 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.
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.