Page 1 of 1

Crash when resizing donut chart

Posted: Wed Nov 02, 2011 9:28 am
by 16060157
Resize a donut chart to size so small that the donut disapperars, causes the control to crash

Crash log...
System.ArgumentException: Width must be non-negative.

at System.Windows.Rect.set_Width(Double value)

at Steema.TeeChart.WPF.Styles.Circular.AdjustCircleMarks()

at Steema.TeeChart.WPF.Styles.Circular.ReCalcCircleRect()

at Steema.TeeChart.WPF.Styles.Circular.DoBeforeDrawValues()

at Steema.TeeChart.WPF.Styles.Pie.DoBeforeDrawValues()

at Steema.TeeChart.WPF.Styles.Series.DrawSeries()

at Steema.TeeChart.WPF.Chart.DrawAllSeries(Graphics3D g)

at Steema.TeeChart.WPF.Chart.InternalDraw(DrawingContext g, Boolean noTools)

at Steema.TeeChart.WPF.Chart.InternalDraw(DrawingContext g)

at Steema.TeeChart.WPF.TChart.Draw(DrawingContext g)

at Steema.TeeChart.WPF.TChart.OnRender(DrawingContext drawingContext)

at System.Windows.UIElement.Arrange(Rect finalRect)

at System.Windows.ContextLayoutManager.UpdateLayout()

at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)

at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()

at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()

at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)

at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

Re: Crash when resizing donut chart

Posted: Wed Nov 02, 2011 4:29 pm
by 10050769
Hello BeijerElectronics,

Ok. Using last version of TeeChart.Net and next lines of code, I can not reproduce your exception:

Code: Select all

    private void  InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            Steema.TeeChart.Styles.Donut donut1 = new Donut(tChart1.Chart);
            donut1.FillSampleValues();
            tChart1.Dock = DockStyle.Fill;

}
Can you please,tell us if using previous lines of code your problem appears? On the other hand, can you tell us which version of TeeChart.Net are you using now?

Thanks,

Re: Crash when resizing donut chart

Posted: Thu Nov 03, 2011 11:08 am
by 16060157
We can reproduce the crash in the latest version with the following slightly different call stack:

System.ArgumentException, {"Width must be non-negative."}

at System.Windows.Rect.set_Width(Double value)
at Steema.TeeChart.WPF.Styles.Circular.AdjustCircleMarks()
at Steema.TeeChart.WPF.Styles.Circular.ReCalcCircleRect()
at Steema.TeeChart.WPF.Styles.Circular.DoBeforeDrawValues()
at Steema.TeeChart.WPF.Styles.Pie.DoBeforeDrawValues()
at Steema.TeeChart.WPF.Styles.Series.DrawSeries()
at Steema.TeeChart.WPF.Chart.DrawAllSeries(Graphics3D g)
at Steema.TeeChart.WPF.Chart.InternalDraw(DrawingContext g, Boolean noTools)
at Steema.TeeChart.WPF.Chart.InternalDraw(DrawingContext g)
at Steema.TeeChart.WPF.TChart.Draw(DrawingContext g)
at Steema.TeeChart.WPF.TChart.OnRender(DrawingContext drawingContext)
at System.Windows.UIElement.Arrange(Rect finalRect)
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)

Re: Crash when resizing donut chart

Posted: Fri Nov 04, 2011 3:29 pm
by 10050769
Hello BeijerElectronics,

You are right! Finally I can reproduce your problem and I have added your request in bug list report with number [TW16015817]. We will try to fix it in next maintenance releases of TeeChartWPF.

Thanks,