Deriving from PieSeries breaks pie chart

3 posts, 0 answers
  1. Mitchell
    Mitchell avatar
    45 posts
    Member since:
    Mar 2013

    Posted 15 Jul 2014 Link to this post

    I've got a problem where I've got a menu that appears over part of a pie chart. When a menu item is clicked such that the mouse pointer is over a pie slice, an exception gets thrown (Exception info at the end) when the menu closes. I thought I'd just override PieSeries and catch that exception in the derived class. So, that's what I did. I created a simple derived class and overrode OnMouseLeave. That's the only thing in the derived class. Unfortunately, when using that new pie series class, none of the pie slices get drawn. Snoop tells me that the datapoints are all created and in the chart, the RadLegend is showing all the correct info. Just no slices. Do you have any suggestions?  Are there more requirements to deriving from PieSeries?

    Thanks - Mitch

    ​Message:
    Object reference not set to an instance of an object.

    Operating System:
    Microsoft Windows NT 6.2.9200.0

    Type:
    System.NullReferenceException

    Data:

    Key:
    System.Object
    Value:


    HResult:
    -2147467261

    Message:
    Object reference not set to an instance of an object.

    Source:
    Telerik.Windows.Controls.Chart

    StackTrace:
    at Telerik.Windows.Controls.ChartView.PieSeries.OnMouseLeave(MouseEventArgs e) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\PieChart\PieSeries.Legend.cs:line 165
    at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
    at System.Windows.MouseOverProperty.FireNotifications(UIElement uie, ContentElement ce, UIElement3D uie3D, Boolean oldValue)
    at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
    at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
    at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
    at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, IList`1 otherOrigins, DeferredElementTreeState& oldTreeState, Action`2 originChangedAction)
    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.MouseDevice.Synchronize()
    at System.Windows.Input.MouseDevice.PostProcessInput(Object sender, ProcessInputEventArgs e)
    at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
    at System.Windows.Input.InputManager.ProcessStagingArea()
    at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
    at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
    at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    at MS.Internal.Threading.Exc
  2. Mitchell
    Mitchell avatar
    45 posts
    Member since:
    Mar 2013

    Posted 15 Jul 2014 Link to this post

    The mysterious disappearing pie slices was completely user error (I forgot I was using an implicit style whose target type was still PieSeries, the slices were back after changing the target type to the derived type.)  However, I'd still like to know if the original exception that led me down this path is something important or something that can be safely ignored like I am doing.  Thanks - Mitch
  3. UI for WPF is Visual Studio 2017 Ready
  4. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 16 Jul 2014 Link to this post

    Hi Mitchell,

    I was unable to reproduce the exception you mention. I have attached the project I tested with. Can you modify this project and send it back to us for investigation? Thank you for understanding.

    Regards,
    Petar Marchev
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top