Telerik bug: divided by zero

2 posts, 0 answers
  1. Jacek Ciereszko
    Jacek  Ciereszko avatar
    2 posts
    Member since:
    Jan 2009

    Posted 04 May 2009 Link to this post

    Hi,
    I found a bug in your chart control, mainly when I set DataSeries with only 1 element and another with many, I get errors:

       w System.TimeSpan.Interval(Double value, Int32 scale) 
       w System.TimeSpan.FromSeconds(Double value) 
       w Telerik.Windows.Controls.Charting.DelayConverter.CalculateItemDelayBasedOnTotalDuration() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Animations\DelayConverter.cs:wiersz 87 

    It looks like you divide by zero and then try to use it in TimeSpan.FromSeconds method.


    Complete stacktrace:
       w System.TimeSpan.Interval(Double value, Int32 scale) 
       w System.TimeSpan.FromSeconds(Double value) 
       w Telerik.Windows.Controls.Charting.DelayConverter.CalculateItemDelayBasedOnTotalDuration() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Animations\DelayConverter.cs:wiersz 87 
       w Telerik.Windows.Controls.Charting.DelayConverter.CalculateValue(Double[] delayCoefficients) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Animations\DelayConverter.cs:wiersz 47 
       w Telerik.Windows.Controls.Charting.BaseAnimationConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Animations\BaseAnimationConverter.cs:wiersz 88 
       w Telerik.Windows.Controls.Charting.StaticConverter`2.Convert(Object value, Object parameter, CultureInfo culture) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Converters\StaticConverter.cs:wiersz 12 
       w Telerik.Windows.Controls.Charting.StaticConverter`2.Convert(Object value, Object parameter) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Converters\StaticConverter.cs:wiersz 22 
       w Telerik.Windows.Controls.Charting.BaseChartItem.ConfigureAnimationSettings() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Base\BaseChartItem.cs:wiersz 440 
       w Telerik.Windows.Controls.Charting.BaseChartItem.SetAnimationSettings() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Base\BaseChartItem.cs:wiersz 775 
       w Telerik.Windows.Controls.Charting.BaseChartItem.OnApplyTemplate() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Base\BaseChartItem.cs:wiersz 377 
       w Telerik.Windows.Controls.Charting.BaseLabelChartItem.OnApplyTemplate() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Base\BaseLabelChartItem.cs:wiersz 164 
       w Telerik.Windows.Controls.Charting.BasePointMarkChartItem.OnApplyTemplate() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Base\BasePointMarkChartItem.cs:wiersz 359 
       w System.Windows.FrameworkElement.ApplyTemplate() 
       w System.Windows.FrameworkElement.MeasureCore(Size availableSize) 
       w System.Windows.UIElement.Measure(Size availableSize) 
       w Telerik.Windows.Controls.Charting.LinearSeriesPanel.MeasureOverride(Size availableSize) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\ChartArea\Series\LinearSeriesPanel.cs:wiersz 139 
       w System.Windows.FrameworkElement.MeasureCore(Size availableSize) 
       w System.Windows.UIElement.Measure(Size availableSize) 
       w MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) 
       w System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint) 
       w System.Windows.FrameworkElement.MeasureCore(Size availableSize) 
       w System.Windows.UIElement.Measure(Size availableSize) 
       w System.Windows.Controls.Control.MeasureOverride(Size constraint) 
       w System.Windows.FrameworkElement.MeasureCore(Size availableSize) 
       w System.Windows.UIElement.Measure(Size availableSize) 
       w Telerik.Windows.Controls.Charting.ChartPanel.MeasureOverride(Size availableSize) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\ChartArea\ChartPanel.cs:wiersz 39 
       w System.Windows.FrameworkElement.MeasureCore(Size availableSize) 
       w System.Windows.UIElement.Measure(Size availableSize) 
       w MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) 
       w System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint) 
       w System.Windows.FrameworkElement.MeasureCore(Size availableSize) 
       w System.Windows.UIElement.Measure(Size availableSize) 
       w Telerik.Windows.Controls.Charting.ClipPanel.MeasureOverride(Size availableSize) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\ChartArea\ClipPanel.cs:wiersz 30 
       w System.Windows.FrameworkElement.MeasureCore(Size availableSize) 
       w System.Windows.UIElement.Measure(Size availableSize) 
       w Telerik.Windows.Controls.Charting.PlotAreaPanel.MeasureOverride(Size availableSize) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\ChartArea\PlotAreaPanel.cs:wiersz 63 
       w System.Windows.FrameworkElement.MeasureCore(Size availableSize) 
       w System.Windows.UIElement.Measure(Size availableSize) 
       w System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) 
       w System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) 
       w System.Windows.Controls.Grid.MeasureOverride(Size constraint) 
       w System.Windows.FrameworkElement.MeasureCore(Size availableSize) 
       w System.Windows.UIElement.Measure(Size availableSize) 
       w System.Windows.ContextLayoutManager.UpdateLayout() 
       w System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) 
       w System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() 
       w System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() 
       w System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) 
       w System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) 
       w System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 
       w System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
       w System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
       w System.Windows.Threading.DispatcherOperation.InvokeImpl() 
       w System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) 
       w System.Threading.ExecutionContext.runTryCode(Object userData) 
       w System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) 
       w System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) 
       w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
       w System.Windows.Threading.DispatcherOperation.Invoke() 
       w System.Windows.Threading.Dispatcher.ProcessQueue() 
       w System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
       w MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
       w MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
       w System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 
       w System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
       w System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
       w System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) 
       w System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) 
       w MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
       w MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) 
       w System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) 
       w System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) 
       w System.Windows.Threading.Dispatcher.Run() 
       w System.Windows.Application.RunDispatcher(Object ignore) 
       w System.Windows.Application.RunInternal(Window window) 
       w System.Windows.Application.Run(Window window) 
       w System.Windows.Application.Run() 
       w RHEAClient.App.Main() w F:\RHEAClient\obj\Release\App.g.cs:wiersz 0 
       w System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) 
       w System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 
       w Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
       w System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
       w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
       w System.Threading.ThreadHelper.ThreadStart() 

    Regards,
    Jacek Ciereszko



  2. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 05 May 2009 Link to this post

    Hello Jacek,

    Thanks for reporting this. The fix will be available in the next version of the control. The issue seems to be reproducible with TotalSeriesAnimationDuration set to a non-zero timespan. For the time being, please use ItemAnimationDuration or disable the animations. Your Telerik points have been updated.

    Best regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top