This is a migrated thread and some comments may be shown as answers.

NullReferenceException in get_ItemToolTipTimer

3 Answers 62 Views
Chart
This is a migrated thread and some comments may be shown as answers.
GPJ
Top achievements
Rank 1
GPJ asked on 01 May 2009, 08:31 PM
I've got an application that updates the display every 5 mins or so and today I received this exception after it had been running for a couple hours.  I'm not using the tool tip at all so I just thought I'd make you aware of it.  The charts being shown are all 2D (1 pie, 1 bar and 2 line charts) and don't implement any user interactive behaviour.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.Charting.BaseChartItem.get_ItemToolTipTimer()
   at Telerik.Windows.Controls.Charting.BaseChartItem.HideToolTip()
   at Telerik.Windows.Controls.Charting.BaseChartItem.BaseChartItemMouseLeave(Object sender, MouseEventArgs e)
   at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.MouseOverProperty.FireNotifications(UIElement uie, ContentElement ce, UIElement3D uie3D, Boolean oldValue)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
   at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, DeferredElementTreeState& oldTreeState)
   at System.Windows.Input.MouseDevice.ChangeMouseOver(IInputElement mouseOver, Int32 timestamp)
   at System.Windows.Input.MouseDevice.PreNotifyInput(Object sender, NotifyInputEventArgs e)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.MouseDevice.Synchronize()
   at System.Windows.Input.MouseDevice.OnHitTestInvalidatedAsync(Object sender, EventArgs e)
   at System.Windows.Input.InputManager.HitTestInvalidatedAsyncCallback(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
 



3 Answers, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 04 May 2009, 01:59 PM
Hi Greg Peter Joyal,

Thank you very much for contacting us. From the stack trace it appears that the exception occured a little after a mouse leave event was triggered. Can you confirm if the excepttion occured immediately after the mouse was moved over the chart control?

Also, can you please share the update code for the chart control? 

Thanks a lot in advance!

Best wishes,
Vladimir Milev
0
GPJ
Top achievements
Rank 1
answered on 04 May 2009, 03:23 PM
Hi Vladimir.

That's the funny thing about the exception...  The application that crashed is a "dashboard" application to show status and nobody was moving the mouse at the time.  The dashboard has 1 carousel, 1 pie chart, 1 bar chart, and 3 line charts on it (as well as some traditional stuff like listboxes). The only thing I can think of is that the mouse cursor was over a chart when we refreshed it (at a 5 minute interval).

Here is the code that is called when one of the charts is initially displayed & refreshed.  They all update in similar ways (obviously with different Series Definitions depending on the style).

        /// <summary>  
        /// Refreshes the data.  
        /// </summary>  
        void RefreshData()  
        {  
            // clear out the old series  
            MyChart.SeriesMappings.Clear();  
 
            // Fill with the new data  
            GetChartData();  
        }  
 
        /// <summary>  
        /// Gets the chart data.  
        /// </summary>  
        private void GetChartData()  
        {  
            MyChart.Visibility = Visibility.Visible;  
            MyChart.DefaultView.ChartArea.DataSeries.Clear();  
 
            var areaSeries = new DataSeries{Definition = new LineSeriesDefinition()};  
            MyChart.DefaultView.ChartArea.DataSeries.Add(areaSeries);  
            foreach (IMyData dataDetail in _dataList)  
                areaSeries.Add(new DataPoint(dataDetail .Period, dataDetail .Value));  
 
            MyChart.DefaultView.ChartArea.AxisY.AutoRange = true;  
            MyChart.DefaultView.ChartArea.AxisY.MinValue = 0;  
            MyChart.DefaultView.ChartArea.AxisY.Visibility = Visibility.Visible;  
            MyChart.DefaultView.ChartArea.AxisX.Visibility = Visibility.Collapsed;  
 
            MyChart.DefaultView.ChartLegend.Visibility = Visibility.Collapsed;  
            MyChart.DefaultSeriesDefinition = new LineSeriesDefinition();  
        }  
    } 

Thanks,
Greg
0
Accepted
Vladimir Milev
Telerik team
answered on 07 May 2009, 10:47 AM
Hello Greg Peter Joyal,

Thanks for the info. We will investigate this issue. In the meantime I can recommend that you set "ShowItemsTooltips" on the series definitions you have to false if you are not using them. I also have your email and will contact you about the other problems you guys encountered if we need additional info.

Regards,
Vladimir Milev
Tags
Chart
Asked by
GPJ
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
GPJ
Top achievements
Rank 1
Share this question
or